(self, exception_edges=True)
return g
Get a local transition graph with a custom configuration. A local transition graph is a transition graph that
        only contains nodes that belong to the current function. 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 local transition graph with a custom configuration. A local transition graph is a transition graph that
        only contains nodes that belong to the current function. 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 local transition graph with a custom configuration . A local transition graph is a transition graph that only contains nodes that belong to the current function . 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 graph_ex(self, exception_edges=True):
        """
        Get a local transition graph with a custom configuration. A local transition graph is a transition graph that
        only contains nodes that belong to the current function. 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_ex() should not impact any already cached graph
        old_cached_graph = self._local_transition_graph
        graph = self.graph
        self._local_transition_graph = old_cached_graph  # restore the cached 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)

            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 graph_ex ( self , exception_edges = True ) : # graph_ex() should not impact any already cached graph old_cached_graph = self . _local_transition_graph graph = self . graph self . _local_transition_graph = old_cached_graph # restore the cached 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 ) 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