Traverse from source GO down children.
779314
def _traverse_relationship_rev_objs(self, rel2dst2srcs, goobj_parent, goids_seen):
        """"""
        parent_id = goobj_parent.id
        goids_seen.add(parent_id)
        ##A self.go2obj[parent_id] = goobj_parent
        # Update goids_seen and go2obj with parent alt_ids
        for goid_altid in goobj_parent.alt_ids:
            goids_seen.add(goid_altid)
            ##A self.go2obj[goid_altid] = goobj_parent
        # Loop through children
        for reltype, recs in goobj_parent.relationship.items():
            if reltype in self.relationships:
                for relrev_obj in recs:
                    relrev_id = relrev_obj.id
                    rel2dst2srcs[relrev_id].add(parent_id)
                    # If child has not been seen, traverse
                    if relrev_id not in goids_seen:
                        ##F self._traverse_relrev_objs(rel2dst2srcs, relrev_obj, go2obj, goids_seen)
                        self._traverse_relationship_rev_objs(rel2dst2srcs, relrev_obj, goids_seen)
1192839
function traverse (root, dirs, collect, next) {
  const rootPath = path.join (root, ...dirs);
  fs.lstat (rootPath, (err0) => {
    if (err0) {
      next (err0);
    } else {
      fs.readdir (rootPath, (_, files) => {
        let pending = files.length;
        for (let file of files) {
          const filePath = path.join (root, ...dirs, file);
          fs.lstat (filePath, (err1, stats) => {
            if (err1) {
              next (err1);
            } else {
              if (stats.isDirectory ()) {
                traverse (root, [...dirs, file], collect, err2 => {
                  if (err2) {
                    next (err2);
                  } else {
                    if (--pending === 0) {
                      next ();
                    }
                  }
                });
              } else {
                if (stats.isFile ()) {
                  collect (dirs, file, files);
                  if (--pending === 0) {
                    next ();
                  }
                }
              }
            }
          });
        }
      });
    }
  });
}
583232
function walk(node, rootNode, prev) {
      var sibling, parent, startName = prev ? 'lastChild' : 'firstChild', siblingName = prev ? 'prev' : 'next';

      // Walk into nodes if it has a start
      if (node[startName]) {
        return node[startName];
      }

      // Return the sibling if it has one
      if (node !== rootNode) {
        sibling = node[siblingName];

        if (sibling) {
          return sibling;
        }

        // Walk up the parents to look for siblings
        for (parent = node.parent; parent && parent !== rootNode; parent = parent.parent) {
          sibling = parent[siblingName];

          if (sibling) {
            return sibling;
          }
        }
      }
    }
550802
def find_all(root, path):
  """"""
  path = parse_path(path)

  if len(path) == 1:
    yield from get_children(root, path[0])
  else:
    for child in get_children(root, path[0]):
      yield from find_all(child, path[1:])
391127
function traverse(object, iterator, parent, parentProperty) {
        var key, child;
        if (iterator(object, parent, parentProperty) === false)
          return;
        for (key in object) {
          if (!object.hasOwnProperty(key))
            continue;
          if (key == 'location' || key == 'type')
            continue;
          child = object[key];
          if (typeof child == 'object' && child !== null)
            traverse(child, iterator, object, key);
        }
      }
104931
def walk(self, leavesonly=True, maxdepth=None, _depth = 0):
        """"""
        if self.children:
            if not maxdepth or (maxdepth and _depth < maxdepth):
                for key, child in self.children.items():
                    if child.leaf():
                        yield child
                    else:
                        for results in child.walk(leavesonly, maxdepth, _depth + 1):
                            yield results
760325
def walk_tree(start, attr):
    
    path = [start]
    for child in path:
        yield child
        idx = path.index(child)
        for grandchild in reversed(getattr(child, attr)):
            path.insert(idx + 1, grandchild)
150615
def children(self):
        """"""
        from warnings import warn
        warn("Deprecated. Use Scraper.descendants.", DeprecationWarning)
        for descendant in self.descendants:
            yield descendant
788615
def walk(self, visitor):
        
        visitor(self)
        for c in self.children:
            c.walk(visitor)
        return self
803853
def traverse(self):
        
        builder = self.child_builder
        for child in self._children:
            with pushd(str(child)):
                yield child, builder(child)
766766
function traverse(tokens, options) {
    const traverser = new Traverser()
    const nodes = Array.isArray(tokens) ? tokens : [tokens]
    for (const node of nodes) {
        traverser.traverse(node, options)
        if (traverser.isBroken()) {
            return
        }
    }
}
1013966
def at_depth(self, depth):
        

        for child in list(self.children):
            if depth == 0:
                yield child
            else:
                for grandchild in child.at_depth(depth - 1):
                    yield grandchild
519042
def traversal(root):
    ''''''
    stack = [root]
    while len(stack) > 0:
        node = stack.pop()
        if hasattr(node,'children'):
            if node.children == set():
                try:
                    stack[-1].children.remove(node)
                except:
                    pass
                yield (node,stack)
            else:
                childnode = node.children.pop()
                stack += [node,childnode]
        else: 
            children = [x for x in ast.iter_child_nodes(node)]
            node.children = set(children)
            stack.append(node)
408762
def traverse(self, node):
    
    self.find_replace(node)

    for c in node.children:
      self.traverse(c)
174683
void setChildrenContexts(Map<String, List<TraverserContext<T>>> children) {
        assertTrue(this.children == null, "children already set");
        this.children = children;
    }
1196722
function traverseDescendants (nodes, handler) {
  nodes.forEach((node) => {
    var progress = true
    handler(node, () => progress = false)
    if (node.childTags && progress) {
      traverseDescendants(node.childTags, handler)
    }
  })
}
587510
private void moveChildren(INode source, INode target) {
        List<INode> children = new ArrayList<INode>(source.getChildrenList());
        while (0 < children.size()) {
            INode child = children.remove(0);
            int idx = target.getChildIndex(child);
            if (-1 == idx) {
                target.addChild(child);
            } else {
                moveChildren(child, target.getChildAt(idx));
            }
        }
    }