def _connect_nodes(graph, srcnode, destnode, connection_info):
 data = graph.get_edge_data(srcnode, destnode, default=None)
 if (not data):
  data = {u'connect': connection_info}
  graph.add_edges_from([(srcnode, destnode, data)])
 else:
  data[u'connect'].extend(connection_info)

def _connect_nodes ( graph , srcnode , destnode , connection_info ) : data = graph . get_edge_data ( srcnode , destnode , default = None ) if ( not data ) : data = { u'connect' : connection_info } graph . add_edges_from ( [ ( srcnode , destnode , data ) ] ) else : data [ u'connect' ] . extend ( connection_info )
add a connection between two nodes .