(self, graph: networkx.DiGraph)
return outtop, outall
Return all Loop instances that can be extracted from a graph.

        :param graph:   The graph to analyze.

        :return:        A list of all the Loop instances that were found in the graph.
Return all Loop instances that can be extracted from a graph.
Return all Loop instances that can be extracted from a graph .
def _parse_loops_from_graph(self, graph: networkx.DiGraph):
        """
        Return all Loop instances that can be extracted from a graph.

        :param graph:   The graph to analyze.

        :return:        A list of all the Loop instances that were found in the graph.
        """
        outtop = []
        outall = []
        subg: networkx.DiGraph
        for subg in ( networkx.induced_subgraph(graph, nodes).copy() for nodes in networkx.strongly_connected_components(graph)):
            if len(subg.nodes()) == 1:
                if len(list(subg.successors(list(subg.nodes())[0]))) == 0:
                    continue
            thisloop, allloops = self._parse_loop_graph(subg, graph)
            if thisloop is not None:
                outall += allloops
                outtop.append(thisloop)
        return outtop, outall
def _parse_loops_from_graph ( self , graph : networkx . DiGraph ) : outtop = [ ] outall = [ ] subg : networkx . DiGraph for subg in ( networkx . induced_subgraph ( graph , nodes ) . copy ( ) for nodes in networkx . strongly_connected_components ( graph ) ) : if len ( subg . nodes ( ) ) == 1 : if len ( list ( subg . successors ( list ( subg . nodes ( ) ) [ 0 ] ) ) ) == 0 : continue thisloop , allloops = self . _parse_loop_graph ( subg , graph ) if thisloop is not None : outall += allloops outtop . append ( thisloop ) return outtop , outall