Return a list of lists of nodes.
        The outer list is indexed by the level.
        Each inner list contains the nodes at that level,
        in DFS order.

        :rtype: list of lists of :class:`~aeneas.tree.Tree`
171843
def levels(self):
        
        ret = [[] for i in range(self.height)]
        for node in self.subtree:
            ret[node.level - self.level].append(node)
        return ret
1115588
def leaf_nodes(self):
        
        # Now contains all nodes that contain dependencies.
        deps = {item for sublist in self.edges.values() for item in sublist}
        # contains all nodes *without* any dependencies (leaf nodes)
        return self.nodes - deps
226386
def indexlist( self ):
        
        output = [(child.text(0), child.url())
                   for child in self.children(recursive=True)]
        
        output.sort()
        return output
53103
def references(self):
        
        return [
            (tail, head)
            for tail in self.vertices
            for head in self.children(tail)
        ]
169549
def get_level(self, level, relations=None, **args):
        
        g = self.get_filtered_graph(relations)
        nodes = self.get_roots(relations=relations, **args)
        for i in range(level):
            logger.info(" ITERATING TO LEVEL: {} NODES: {}".format(i, nodes))
            nodes = [c for n in nodes
                     for c in g.successors(n)]
        logger.info(" FINAL: {}".format(nodes))
        return nodes
53831
@Override
    public Collection<N> getNodes() {
        List<N> nodes = new ArrayList<>();
        Iterables.addAll(nodes, GraphTraversal.breadthFirstOrder(this, Collections.singleton(root)));
        return nodes;
    }
603446
def members(self):
        
        res = [self]
        for c in list(self.children.values()):
            res.extend(c.members)
        return res
594458
def children(self):
        
        new_refs = set()
        output = []
        for ref in self._children:
            item = ref()
            if item is not None:
                output.append(item)
                new_refs.add(ref)
        
        self._children = new_refs
        return output
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
749742
def children(self):
        
        impl_nodelist = self.adapter.get_node_children(self.impl_node)
        return self._convert_nodelist(impl_nodelist)
196960
def get_trees_as_list(self):
        
        mytrees = []
        if self.constituency_layer is not None:
            for tree in self.constituency_layer.get_trees():
                mytrees.append(tree)
                return mytrees
1135527
def to_list(self):
        
        ret = []
        for instance in self.instances:
            ret.append(instance.to_dict())
        return ret
764882
def getAllNodeUids(self):
        '''
            
        '''
        ret = set()

        for child in self:
            ret.update(child.getAllNodeUids())

        return ret
905272
def get_node_list(self) -> list:
        
        # Initialising empty list
        nodes = []

        # Raise an exception if we are not a manager
        if not self._manager:
            raise RuntimeError('Only the Swarm manager node '
                               'can retrieve all the nodes.')

        node_list = self._client.nodes.list()
        for n_list in node_list:
            nodes.append(n_list.id)
        return nodes
1099600
def data_children(self) -> List["DataNode"]:
        """"""
        res = []
        for child in self.children:
            if isinstance(child, DataNode):
                res.append(child)
            elif not isinstance(child, SchemaTreeNode):
                res.extend(child.data_children())
        return res
848423
def get_siblings(self):
        
        if self.parent:
            return get_result_class(self.__class__).objects.filter(
                parent=self.parent)
        return self.__class__.get_root_nodes()
889507
def get_instances(self):
        
        return [c.get('instance') for c in self.runtime._nodes.values()
                if c.get('instance')]