def _dependencies_graph(filename, dep_info):
done = {}<EOL>printer = DotBackend(filename[:-<NUM_LIT:4>], rankdir="<STR_LIT>")<EOL>printer.emit('<STR_LIT>')<EOL>for modname, dependencies in sorted(dep_info.items()):<EOL><INDENT>done[modname] = <NUM_LIT:1><EOL>printer.emit_node(modname)<EOL>for depmodname in dependencies:<EOL><INDENT>if depmodname not in done:<EOL><INDENT>done[depmodname] = <NUM_LIT:1><EOL>printer.emit_node(depmodname)<EOL><DEDENT><DEDENT><DEDENT>for depmodname, dependencies in sorted(dep_info.items()):<EOL><INDENT>for modname in dependencies:<EOL><INDENT>printer.emit_edge(modname, depmodname)<EOL><DEDENT><DEDENT>printer.generate(filename)<EOL>
write dependencies as a dot (graphviz) file