#NEWLINE# def write_dot( G , path ) : #NEWLINE# #INDENT# 'Write NetworkX graph G to Graphviz dot format on path.\n\n    Parameters\n    ----------\n    G : graph\n       A networkx graph\n    path : filename\n       Filename or file handle to write\n    ' #NEWLINE# try : #NEWLINE# #INDENT# import pygraphviz #NEWLINE# #UNINDENT# except ImportError : #NEWLINE# #INDENT# raise ImportError ( 'requires pygraphviz ' , 'http://networkx.lanl.gov/pygraphviz ' , '(not available for Python3)' ) #NEWLINE# #UNINDENT# A = to_agraph ( A ) #NEWLINE# A . write ( path ) #NEWLINE# A . clear ( ) #NEWLINE# return