@not_implemented_for('directed')
def generate_edgelist(G, delimiter=' ', data=True):
 try:
  part0 = [n for (n, d) in G.node.items() if (d['bipartite'] == 0)]
 except:
  raise AttributeError('Missing node attribute `bipartite`')
 if ((data is True) or (data is False)):
  for n in part0:
   for e in G.edges(n, data=data):
    (yield delimiter.join(map(make_str, e)))
 else:
  for n in part0:
   for (u, v, d) in G.edges(n, data=True):
    e = [u, v]
    try:
     e.extend((d[k] for k in data))
    except KeyError:
     pass
    (yield delimiter.join(map(make_str, e)))

@ not_implemented_for ( 'directed' ) def generate_edgelist ( G , delimiter = ' ' , data = True ) : try : part0 = [ n for ( n , d ) in G . node . items ( ) if ( d [ 'bipartite' ] == 0 ) ] except : raise AttributeError ( 'Missing node attribute `bipartite`' ) if ( ( data is True ) or ( data is False ) ) : for n in part0 : for e in G . edges ( n , data = data ) : ( yield delimiter . join ( map ( make_str , e ) ) ) else : for n in part0 : for ( u , v , d ) in G . edges ( n , data = True ) : e = [ u , v ] try : e . extend ( ( d [ k ] for k in data ) ) except KeyError : pass ( yield delimiter . join ( map ( make_str , e ) ) )
generate a single line of the graph g in edge list format .