def generate_graphml(G, encoding='utf-8', prettyprint=True):
 writer = GraphMLWriter(encoding=encoding, prettyprint=prettyprint)
 writer.add_graph_element(G)
 for line in str(writer).splitlines():
  (yield line)

def generate_graphml ( G , encoding = 'utf-8' , prettyprint = True ) : writer = GraphMLWriter ( encoding = encoding , prettyprint = prettyprint ) writer . add_graph_element ( G ) for line in str ( writer ) . splitlines ( ) : ( yield line )
generate graphml lines for g parameters g : graph a networkx graph encoding : string encoding for text data .