(self, exception_edges=True)
return g
Get a transition graph with a custom configuration. This method allows user to exclude certain types of edges
        together with the nodes that are only reachable through such edges, such as exception edges.

        The generated graph is not cached.

        :param bool exception_edges:    Should exception edges and the nodes that are only reachable through exception
                                        edges be kept.
        :return:                        A local transition graph with a special configuration.
        :rtype:                         networkx.DiGraph
Get a transition graph with a custom configuration. This method allows user to exclude certain types of edges
        together with the nodes that are only reachable through such edges, such as exception edges.
Get a transition graph with a custom configuration . This method allows user to exclude certain types of edges together with the nodes that are only reachable through such edges such as exception edges .
def transition_graph_ex(self, exception_edges=True):
        """
        Get a transition graph with a custom configuration. This method allows user to exclude certain types of edges
        together with the nodes that are only reachable through such edges, such as exception edges.

        The generated graph is not cached.

        :param bool exception_edges:    Should exception edges and the nodes that are only reachable through exception
                                        edges be kept.
        :return:                        A local transition graph with a special configuration.
        :rtype:                         networkx.DiGraph
        """

        graph = self.transition_graph

        # fast path
        if exception_edges:
            return graph

        # BFS on local graph but ignoring certain types of graphs
        g = networkx.DiGraph()
        queue = [ n for n in graph if n is self.startpoint or graph.in_degree[n] == 0 ]
        traversed = set(queue)

        while queue:
            node = queue.pop(0)
            traversed.add(node)

            g.add_node(node)
            for _, dst, edge_data in graph.out_edges(node, data=True):
                edge_type = edge_data.get('type', None)
                if not exception_edges and edge_type == 'exception':
                    # ignore this edge
                    continue
                g.add_edge(node, dst, **edge_data)

                if dst not in traversed:
                    traversed.add(dst)
                    queue.append(dst)

        return g
def transition_graph_ex ( self , exception_edges = True ) : graph = self . transition_graph # fast path if exception_edges : return graph # BFS on local graph but ignoring certain types of graphs g = networkx . DiGraph ( ) queue = [ n for n in graph if n is self . startpoint or graph . in_degree [ n ] == 0 ] traversed = set ( queue ) while queue : node = queue . pop ( 0 ) traversed . add ( node ) g . add_node ( node ) for _ , dst , edge_data in graph . out_edges ( node , data = True ) : edge_type = edge_data . get ( 'type' , None ) if not exception_edges and edge_type == 'exception' : # ignore this edge continue g . add_edge ( node , dst , * * edge_data ) if dst not in traversed : traversed . add ( dst ) queue . append ( dst ) return g