def dot_graph(dsk, filename='mydask', format=None, **kwargs):
 g = to_graphviz(dsk, **kwargs)
 fmts = ['.png', '.pdf', '.dot', '.svg', '.jpeg', '.jpg']
 if ((format is None) and any((filename.lower().endswith(fmt) for fmt in fmts))):
  (filename, format) = os.path.splitext(filename)
  format = format[1:].lower()
 if (format is None):
  format = 'png'
 data = g.pipe(format=format)
 if (not data):
  raise RuntimeError('Graphviz failed to properly produce an image. This probably means your installation of graphviz is missing png support. See: https://github.com/ContinuumIO/anaconda-issues/issues/485 for more information.')
 display_cls = _get_display_cls(format)
 if (not filename):
  return display_cls(data=data)
 full_filename = '.'.join([filename, format])
 with open(full_filename, 'wb') as f:
  f.write(data)
 return display_cls(filename=full_filename)

def dot_graph ( dsk , filename = 'mydask' , format = None , ** kwargs ) : g = to_graphviz ( dsk , ** kwargs ) fmts = [ '.png' , '.pdf' , '.dot' , '.svg' , '.jpeg' , '.jpg' ] if ( ( format is None ) and any ( ( filename . lower ( ) . endswith ( fmt ) for fmt in fmts ) ) ) : ( filename , format ) = os . path . splitext ( filename ) format = format [ 1 : ] . lower ( ) if ( format is None ) : format = 'png' data = g . pipe ( format = format ) if ( not data ) : raise RuntimeError ( 'Graphviz failed to properly produce an image. This probably means your installation of graphviz is missing png support. See: https://github.com/ContinuumIO/anaconda-issues/issues/485 for more information.' ) display_cls = _get_display_cls ( format ) if ( not filename ) : return display_cls ( data = data ) full_filename = '.' . join ( [ filename , format ] ) with open ( full_filename , 'wb' ) as f : f . write ( data ) return display_cls ( filename = full_filename )
render a task graph using dot .