def topological_traversal( self, filter_func=None, yield_descendants_of_unyielded=False, start_node=None, ): """ Performs a topological sort of the block structure and yields the usage_key of each block as it is encountered. Arguments: See the description in openedx.core.lib.graph_traversals.traverse_topologically. Returns: generator - A generator object created from the traverse_topologically method. """ return traverse_topologically( start_node=start_node or self.root_block_usage_key, get_parents=self.get_parents, get_children=self.get_children, filter_func=filter_func, yield_descendants_of_unyielded=yield_descendants_of_unyielded, )
def topological_traversal( self, filter_func=None, yield_descendants_of_unyielded=False, start_node=None, ): """ Performs a topological sort of the block structure and yields the usage_key of each block as it is encountered. Arguments: See the description in openedx.core.lib.graph_traversals.traverse_topologically. Returns: generator - A generator object created from the traverse_topologically method. """ return traverse_topologically( start_node=start_node or self.root_block_usage_key, get_parents=self.get_parents, get_children=self.get_children, filter_func=filter_func, yield_descendants_of_unyielded=yield_descendants_of_unyielded, )