def get_connected_components_as_subgraphs(graph):
components = get_connected_components(graph)<EOL>list_of_graphs = []<EOL>for c in components:<EOL><INDENT>edge_ids = set()<EOL>nodes = [graph.get_node(node) for node in c]<EOL>for n in nodes:<EOL><INDENT>for e in n['<STR_LIT>']:<EOL><INDENT>edge = graph.get_edge(e)<EOL>a, b = edge['<STR_LIT>']<EOL>if a in c and b in c:<EOL><INDENT>edge_ids.add(e)<EOL><DEDENT><DEDENT><DEDENT>list_of_edges = list(edge_ids)<EOL>subgraph = make_subgraph(graph, c, list_of_edges)<EOL>list_of_graphs.append(subgraph)<EOL><DEDENT>return list_of_graphs<EOL>
Finds all connected components of the graph.
    Returns a list of graph objects, each representing a connected component.
    Returns an empty list for an empty graph.