def graph_from_edges(edge_list, node_prefix='<STR_LIT>', directed=False):
if directed:<EOL><INDENT>graph = Dot(graph_type='<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>graph = Dot(graph_type='<STR_LIT>')<EOL><DEDENT>for edge in edge_list:<EOL><INDENT>if isinstance(edge[<NUM_LIT:0>], str):<EOL><INDENT>src = node_prefix + edge[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>src = node_prefix + str(edge[<NUM_LIT:0>])<EOL><DEDENT>if isinstance(edge[<NUM_LIT:1>], str):<EOL><INDENT>dst = node_prefix + edge[<NUM_LIT:1>]<EOL><DEDENT>else:<EOL><INDENT>dst = node_prefix + str(edge[<NUM_LIT:1>])<EOL><DEDENT>e = Edge( src, dst )<EOL>graph.add_edge(e)<EOL><DEDENT>return graph<EOL>
Creates a basic graph out of an edge list.

    The edge list has to be a list of tuples representing
    the nodes connected by the edge.
    The values can be anything: bool, int, float, str.

    If the graph is undirected by default, it is only
    calculated from one of the symmetric halves of the matrix.