def make_subgraph(graph, vertices, edges):
<EOL>local_graph = copy.deepcopy(graph)<EOL>edges_to_delete = [x for x in local_graph.get_all_edge_ids() if x not in edges]<EOL>for e in edges_to_delete:<EOL><INDENT>local_graph.delete_edge_by_id(e)<EOL><DEDENT>nodes_to_delete = [x for x in local_graph.get_all_node_ids() if x not in vertices]<EOL>for n in nodes_to_delete:<EOL><INDENT>local_graph.delete_node(n)<EOL><DEDENT>return local_graph<EOL>
Converts a subgraph given by a list of vertices and edges into a graph object.