def _node_func(G):
 if G.is_multigraph():
  def sorted_node(u, v, key):
   return ((u, v, key) if (u <= v) else (v, u, key))
 else:
  def sorted_node(u, v):
   return ((u, v) if (u <= v) else (v, u))
 return sorted_node

def _node_func ( G ) : if G . is_multigraph ( ) : def sorted_node ( u , v , key ) : return ( ( u , v , key ) if ( u <= v ) else ( v , u , key ) ) else : def sorted_node ( u , v ) : return ( ( u , v ) if ( u <= v ) else ( v , u ) ) return sorted_node
returns a function which returns a sorted node for line graphs .