(graph, node, frontier, include_frontier=False)
return subgraph
Generate a slice of the graph from the head node to the given frontier.

        :param networkx.DiGraph graph: The graph to work on.
        :param node: The starting node in the graph.
        :param frontier: A list of frontier nodes.
        :param bool include_frontier: Whether the frontier nodes are included in the slice or not.
        :return: A subgraph.
        :rtype: networkx.DiGraph
Generate a slice of the graph from the head node to the given frontier.
Generate a slice of the graph from the head node to the given frontier .
def slice_graph(graph, node, frontier, include_frontier=False):
        """
        Generate a slice of the graph from the head node to the given frontier.

        :param networkx.DiGraph graph: The graph to work on.
        :param node: The starting node in the graph.
        :param frontier: A list of frontier nodes.
        :param bool include_frontier: Whether the frontier nodes are included in the slice or not.
        :return: A subgraph.
        :rtype: networkx.DiGraph
        """

        subgraph = subgraph_between_nodes(graph, node, frontier, include_frontier=include_frontier)
        if not list(subgraph.nodes):
            # HACK: FIXME: for infinite loop nodes, this would return an empty set, so we include the loop body itself
            # Make sure this makes sense (EDG thinks it does)
            if (node, node) in graph.edges:
                subgraph.add_edge(node, node)
        return subgraph
def slice_graph ( graph , node , frontier , include_frontier = False ) : subgraph = subgraph_between_nodes ( graph , node , frontier , include_frontier = include_frontier ) if not list ( subgraph . nodes ) : # HACK: FIXME: for infinite loop nodes, this would return an empty set, so we include the loop body itself # Make sure this makes sense (EDG thinks it does) if ( node , node ) in graph . edges : subgraph . add_edge ( node , node ) return subgraph