forward navigator through the sons of Union nodes.
10796
private static <A> ForwardNavigator<RegExp<A>> unionNav() {
	return new ForwardNavigator<RegExp<A>>() {
	    private Visitor<A,List<RegExp<A>>> unionVis = new Visitor<A,List<RegExp<A>>>() {
		public List<RegExp<A>> visit(Union<A> ure) {
		    return Arrays.<RegExp<A>>asList(ure.left, ure.right);
		}
		public List<RegExp<A>> visit(RegExp<A> re) {
		    return Collections.<RegExp<A>>emptyList();
		}
	    };
	    public List<RegExp<A>> next(RegExp<A> re) {
		return re.accept(unionVis);
	    }
	};
    }
648427
private void generateMapRecursive(final List<NavigationEntryInterface> pnavigationEntries) {
    for (final NavigationEntryInterface entryToAdd : pnavigationEntries) {
      String token = entryToAdd.getToken();
      if (entryToAdd.getMenuValue() != null && token != null) {
        if (token.endsWith("/" + StringUtils.removeStart(loginToken, "/"))) {
          token = loginToken;
        }
        if (!placeMap.containsKey(token)) {
          placeMap.put(token, entryToAdd);
        }
      }
      if (entryToAdd instanceof NavigationEntryFolder) {
        generateMapRecursive(((NavigationEntryFolder) entryToAdd).getSubEntries());
      }
    }
  }
493204
def walkSignalPorts(rootPort: LPort):
    
    if rootPort.children:
        for ch in rootPort.children:
            yield from walkSignalPorts(ch)
    else:
        yield rootPort
355768
private void postTraversalProcessing() {
		int nc1 = treeSize;
		info[KR] = new int[leafCount];
		info[RKR] = new int[leafCount];

		int lc = leafCount;
		int i = 0;

		// compute left-most leaf descendants
		// go along the left-most path, remember each node and assign to it the path's
		// leaf
		// compute right-most leaf descendants (in reversed postorder)
		for (i = 0; i < treeSize; i++) {
			if (paths[LEFT][i] == -1) {
				info[POST2_LLD][i] = i;
			} else {
				info[POST2_LLD][i] = info[POST2_LLD][paths[LEFT][i]];
			}
			if (paths[RIGHT][i] == -1) {
				info[RPOST2_RLD][treeSize - 1 - info[POST2_PRE][i]] =
						(treeSize - 1 - info[POST2_PRE][i]);
			} else {
				info[RPOST2_RLD][treeSize - 1 - info[POST2_PRE][i]] =
						info[RPOST2_RLD][treeSize - 1
								- info[POST2_PRE][paths[RIGHT][i]]];
			}
		}

		// compute key root nodes
		// compute reversed key root nodes (in revrsed postorder)
		boolean[] visited = new boolean[nc1];
		boolean[] visitedR = new boolean[nc1];
		Arrays.fill(visited, false);
		int k = lc - 1;
		int kR = lc - 1;
		for (i = nc1 - 1; i >= 0; i--) {
			if (!visited[info[POST2_LLD][i]]) {
				info[KR][k] = i;
				visited[info[POST2_LLD][i]] = true;
				k--;
			}
			if (!visitedR[info[RPOST2_RLD][i]]) {
				info[RKR][kR] = i;
				visitedR[info[RPOST2_RLD][i]] = true;
				kR--;
			}
		}

		// compute minimal key roots for every subtree
		// compute minimal reversed key roots for every subtree (in reversed postorder)
		int parent = -1;
		int parentR = -1;
		for (i = 0; i < leafCount; i++) {
			parent = info[KR][i];
			while (parent > -1 && info[POST2_MIN_KR][parent] == -1) {
				info[POST2_MIN_KR][parent] = i;
				parent = info[POST2_PARENT][parent];
			}
			parentR = info[RKR][i];
			while (parentR > -1 && info[RPOST2_MIN_RKR][parentR] == -1) {
				info[RPOST2_MIN_RKR][parentR] = i;
				parentR =
						info[POST2_PARENT][info[RPOST2_POST][parentR]]; // get parent's postorder
				if (parentR > -1) {
					parentR = treeSize - 1 - info[POST2_PRE][parentR]; // if parent exists get its
					// rev. postorder
				}
			}
		}
	}
858408
def goForward(self):
        
        if not self.canGoForward():
            return ''
        
        self._blockStack = True
        self._index += 1
        self.emitCurrentChanged()
        self._blockStack = False
        return self.currentUrl()
160268
private void forward(int[] o, double[][] alpha, double[] scaling) {
        for (int k = 0; k < numStates; k++) {
            alpha[0][k] = pi[k] * b[k][o[0]];
        }
        scale(scaling, alpha, 0);

        for (int t = 1; t < o.length; t++) {
            for (int k = 0; k < numStates; k++) {
                double sum = 0.0;

                for (int i = 0; i < numStates; i++) {
                    sum += alpha[t - 1][i] * a[i][k];
                }

                alpha[t][k] = sum * b[k][o[t]];
            }
            scale(scaling, alpha, t);
        }
    }
1291453
def tab_navigation_mru(self, forward=True):
        
        self.tabs_switcher = TabSwitcherWidget(self, self.stack_history,
                                               self.tabs)
        self.tabs_switcher.show()
        self.tabs_switcher.select_row(1 if forward else -1)
        self.tabs_switcher.setFocus()
235523
def find_forward(data, offset = 0, length = data.length)
      node = nil
      lastvaluenode = nil
      i = offset
      while (i<offset+length)
        c = data[i]
        if (node == nil)
          node = self.find_horizontal(c)
        elsif (node.down != nil)
          node = node.down.find_horizontal(c)
        else
          return lastvaluenode
        end
        return lastvaluenode  if (node == nil)
        lastvaluenode = node if (node.value != nil)
        i += 1
      end
      lastvaluenode
    end
905629
private LinkedList<T> computeRecursiveTraversal(T node, NodePath<T> nodePath) {
    try {


      LinkedList<T> imports = new LinkedList<>();
      Set<T> alreadyIncludedImports = new HashSet<>();

      for (T neighbor : this.traversalFunction.apply(node)) {
        nodePath.appendNode(neighbor);
        addSubtraversal(neighbor, imports, alreadyIncludedImports, nodePath);
        nodePath.popTail();
      }

      return imports;
    } catch (ExecutionException ee) {
      throw new RuntimeException(ee);
    }
  }
25776
function visit(node) {
    if(node.flag) {
      var v = node.value.value
      var adj = v.adjacent
      for(var ptr=elist.level(adj, level); ptr<adj.length && adj[ptr].level === level; ++ptr) {
        var e = adj[ptr]
        var es = e.s
        var et = e.t
        if(es.euler[level].path(et.euler[level])) {
          raiseLevel(e)
          ptr -= 1
        } else {
          //Found the edge, relink components
          link(e)
          return true
        }
      }
    }
    if(node.left && node.left.flagAggregate) {
      if(visit(node.left)) {
        return true
      }
    }
    if(node.right && node.right.flagAggregate) {
      if(visit(node.right)) {
        return true
      }
    }
    return false
  }
596456
function traverseChildren(tw, type) {
  var child, node, parent, result, sibling;
  node = tw._currentNode[mapChild[type]];
  while (node !== null) {
    result = tw._internalFilter(node);
    if (result === NodeFilter.FILTER_ACCEPT) {
      tw._currentNode = node;
      return node;
    }
    if (result === NodeFilter.FILTER_SKIP) {
      child = node[mapChild[type]];
      if (child !== null) {
        node = child;
        continue;
      }
    }
    while (node !== null) {
      sibling = node[mapSibling[type]];
      if (sibling !== null) {
        node = sibling;
        break;
      }
      parent = node.parentNode;
      if (parent === null || parent === tw.root || parent === tw._currentNode) {
        return null;
      } else {
        node = parent;
      }
    }
  }
  return null;
}
955690
def reachable_nodes(self, p_id, p_recursive=True, p_reverse=False):
        
        stack = [p_id]
        visited = set()
        result = set()

        while len(stack):
            current = stack.pop()

            if current in visited or current not in self._edges:
                continue

            visited.add(current)

            if p_reverse:
                parents = [node for node, neighbors in self._edges.items()
                           if current in neighbors]

                stack = stack + parents
                result = result.union(parents)
            else:
                stack = stack + list(self._edges[current])
                result = result.union(self._edges[current])

            if not p_recursive:
                break

        return result
386242
def move_forward(self):
        """"""
        self.at(ardrone.at.pcmd, True, 0, -self.speed, 0, 0)
1208399
def compute_dominance_frontier(nodes):
    '''
        
    '''
    for node in nodes:
        if len(node.fathers) >= 2:
            for father in node.fathers:
                runner = father
                # Corner case: if there is a if without else
                # we need to add update the conditional node 
                if runner == node.immediate_dominator and runner.type == NodeType.IF and node.type == NodeType.ENDIF:
                    runner.dominance_frontier = runner.dominance_frontier.union({node})
                while runner != node.immediate_dominator:
                    runner.dominance_frontier = runner.dominance_frontier.union({node})
                    runner = runner.immediate_dominator
475739
function walkBFS (obj, iter) {
  var q = _.map(_.keys(obj), k => {
    return { key: k, path: '["' + k + '"]' }
  })

  var current
  var currentNode
  var retval
  var push = (v, k) => {
    q.push({ key: k, path: current.path + '["' + k + '"]' })
  }
  while (q.length) {
    current = q.shift()
    currentNode = _.get(obj, current.path)
    retval = iter(currentNode, current.key, current.path)
    if (retval) {
      return retval
    }

    if (_.isPlainObject(currentNode) || _.isArray(currentNode)) {
      _.each(currentNode, push)
    }
  }
}
1267867
private void buildForward(List<List<Vertex>> adjacencyList,
                              LinkedList<X509Certificate> certPathList,
                              boolean searchAllCertStores)
        throws GeneralSecurityException, IOException
    {
        if (debug != null) {
            debug.println("SunCertPathBuilder.buildForward()...");
        }

        /* Initialize current state */
        ForwardState currentState = new ForwardState();
        currentState.initState(buildParams.certPathCheckers());

        /* Initialize adjacency list */
        adjacencyList.clear();
        adjacencyList.add(new LinkedList<Vertex>());

        currentState.untrustedChecker = new UntrustedChecker();

        depthFirstSearchForward(buildParams.targetSubject(), currentState,
                                new ForwardBuilder(buildParams,
                                                   searchAllCertStores),
                                adjacencyList, certPathList);
    }
1130095
def _forward_iterator(self):
        ""
        path = [(self, 0, Bits())]
        while path:
            node, idx, prefix = path.pop()
            if idx==0 and node.value is not None and not node.prune_value:
                yield (self._unpickle_key(prefix), self._unpickle_value(node.value))
            if idx<len(node.children):
                path.append((node, idx+1, prefix))
                link = node.children[idx]
                if not link.pruned:
                    path.append((link.node, 0, prefix + link.prefix))