#NEWLINE# def display_pygraphviz( graph , path , format = None , prog = None , args = '' ) : #NEWLINE# #INDENT# 'Internal function to display a graph in OS dependent manner.\n\n    Parameters\n    ----------\n    graph : PyGraphviz graph\n        A PyGraphviz AGraph instance.\n    path :  file object\n        An already opened file object that will be closed.\n    format : str, None\n        An attempt is made to guess the output format based on the extension\n        of the filename. If that fails, the value of `format` is used.\n    prog : string\n        Name of Graphviz layout program.\n    args : str\n        Additional arguments to pass to the Graphviz layout program.\n\n    Notes\n    -----\n    If this function is called in succession too quickly, sometimes the\n    image is not displayed. So you might consider time.sleep(.5) between\n    calls if you experience problems.\n\n    ' #NEWLINE# if ( format is None ) : #NEWLINE# #INDENT# filename = path . name #NEWLINE# format = os . path . splitext ( filename ) [ 1 ] . lower ( ) [ 1 : ] #NEWLINE# #UNINDENT# if ( not format ) : #NEWLINE# #INDENT# format = None #NEWLINE# #UNINDENT# graph . draw ( path , format , prog , args ) #NEWLINE# path . close ( ) #NEWLINE# nx . utils . default_opener ( filename )