def edgelist_for_workflow_steps(steps):
 edges = []
 steps_to_index = dict(((step, i) for (i, step) in enumerate(steps)))
 for step in steps:
  edges.append((steps_to_index[step], steps_to_index[step]))
  for conn in step.input_connections:
   edges.append((steps_to_index[conn.output_step], steps_to_index[conn.input_step]))
 return edges

def edgelist_for_workflow_steps ( steps ) : edges = [ ] steps_to_index = dict ( ( ( step , i ) for ( i , step ) in enumerate ( steps ) ) ) for step in steps : edges . append ( ( steps_to_index [ step ] , steps_to_index [ step ] ) ) for conn in step . input_connections : edges . append ( ( steps_to_index [ conn . output_step ] , steps_to_index [ conn . input_step ] ) ) return edges
create a list of tuples representing edges between workflowsteps based on associated workflowstepconnections .