def sort(self):
        """
        Return an iterable of nodes, toplogically sorted to correctly import
        dependencies before leaf nodes.
        """
        while self.nodes:
            iterated = False
            for node in self.leaf_nodes():
                iterated = True
                self.prune_node(node)
                yield node
            if not iterated:
                raise CyclicGraphError("Sorting has found a cyclic graph.")
def sort ( self ) : while self . nodes : iterated = False for node in self . leaf_nodes ( ) : iterated = True self . prune_node ( node ) yield node if not iterated : raise CyclicGraphError ( "Sorting has found a cyclic graph." )
Return an iterable of nodes, toplogically sorted to correctly import
        dependencies before leaf nodes.