Recursively get all sons of this node

        :param root: node to get sons
        :type root:
        :return: sons
        :rtype: list
328075
def dfs_get_all_childs(self, root):
        
        self.nodes[root]['dfs_loop_status'] = 'DFS_CHECKED'

        ret = set()
        # Me
        ret.add(root)
        # And my sons
        ret.update(self.nodes[root]['sons'])

        for child in self.nodes[root]['sons']:
            # I just don't care about already checked children
            if self.nodes[child]['dfs_loop_status'] == 'DFS_UNCHECKED':
                ret.update(self.dfs_get_all_childs(child))

        return list(ret)
942360
def root_sections(h):
    
    roots = []
    for section in h.allsec():
        sref = h.SectionRef(sec=section)
        # has_parent returns a float... cast to bool
        if sref.has_parent() < 0.9:
            roots.append(section)
    return roots
766647
def descendants(self):
        
        return self.members + \
            [submember for member in self.members for submember in member.descendants]
1211165
def root(self):
        ''''''
        with self._mutex:
            if self._parent:
                return self._parent.root
            else:
                return self
629774
def iter(self, root=None):
        
        if root is None:
            return iter(self._controls)
        return ((os.path.join(root, outdir), control)
                for outdir, control in self._controls)
852936
def get_descendants(self, strategy="levelorder", is_leaf_fn=None):
        
        return [n for n in self.iter_descendants(
            strategy=strategy, is_leaf_fn=is_leaf_fn)]
580987
public static <T extends HierarchyEntity<T, ?>> List<T> getRoots(final List<T> nodes) {
    List<T> roots = CollectUtils.newArrayList();
    for (T m : nodes)
      if (null == m.getParent() || !nodes.contains(m.getParent())) roots.add(m);
    return roots;
  }
1097491
def list_roots():
    '''
    
    '''
    ret = {}
    for saltenv in __opts__['pillar_roots']:
        ret[saltenv] = []
        ret[saltenv].append(list_env(saltenv))
    return ret
81373
def nodes(self, node=None):
        ''''''
        if node is None:
            for root in self.stack:
                yield from self.nodes(root)
        else:
            yield node
            if node.is_container():
                for child in node.children:
                    yield from self.nodes(child)
90457
def _get_ancestors(self, current=None):
        
        if not current:
            current = []
        current.insert(0, self)
        if self.is_root:
            if current:
                return current
        else:
            return self.parent._get_ancestors(current)
540261
def get_by_name_from(self, root: Account, name: str) -> List[Account]:
        
        result = []

        if root.name == name:
            result.append(root)

        for child in root.children:
            child_results = self.get_by_name_from(child, name)
            result += child_results

        return result
599627
def root_indices(sec_list):
    
    roots = []
    for i,section in enumerate(sec_list):
        sref = h.SectionRef(sec=section)
        # has_parent returns a float... cast to bool
        if sref.has_parent() < 0.9:
            roots.append(i)
    return roots
873200
def get_siblings(self):
        
        qset = get_result_class(self.__class__).objects.filter(
            depth=self.depth
        ).order_by(
            'path'
        )
        if self.depth > 1:
            # making sure the non-root nodes share a parent
            parentpath = self._get_basepath(self.path, self.depth - 1)
            qset = qset.filter(
                path__range=self._get_children_path_interval(parentpath))
        return qset
471285
def root(self):
            
            str_treeRoot                = '/'
            self.l_cwd                  = [str_treeRoot]
            self.snode_current          = self.snode_root
            self.sbranch_current        = self.sbranch_root
26737
def bin_tree_to_list(root):
    
    if not root:
        return root
    root = bin_tree_to_list_util(root)
    while root.left:
        root = root.left
    return root
803853
def traverse(self):
        
        builder = self.child_builder
        for child in self._children:
            with pushd(str(child)):
                yield child, builder(child)
925541
def get_tree_root(self):
        
        root = self
        while root.up is not None:
            root = root.up
        return root