def to_graphviz(graph):
ret = ['<STR_LIT>']<EOL>vertices = []<EOL>node_ids = dict([(name, '<STR_LIT>' + idx) for (idx, name) in enumerate(list(graph))])<EOL>for node in list(graph):<EOL><INDENT>ret.append('<STR_LIT>' % (node_ids[node], node))<EOL>for target in graph[node]:<EOL><INDENT>vertices.append('<STR_LIT>' % (node_ids[node], node_ids[target]))<EOL><DEDENT><DEDENT>ret += vertices<EOL>ret.append('<STR_LIT:}>')<EOL>return '<STR_LIT:\n>'.join(ret)<EOL>
:param graph:
:return: