@open_file(1, mode='w')
def write_yaml(G, path, encoding='UTF-8', **kwds):
 try:
  import yaml
 except ImportError:
  raise ImportError('write_yaml() requires PyYAML: http://pyyaml.org/')
 yaml.dump(G, path, **kwds)

@ open_file ( 1 , mode = 'w' ) def write_yaml ( G , path , encoding = 'UTF-8' , ** kwds ) : try : import yaml except ImportError : raise ImportError ( 'write_yaml() requires PyYAML: http://pyyaml.org/' ) yaml . dump ( G , path , ** kwds )
write graph g in yaml format to path .