code: def select_edges(docgraph, conditions, data):
      
      for (src_id, target_id, edge_attribs) in docgraph.edges(data=True):
          # if all conditions are fulfilled
          # we need to add edge_attribs to the namespace eval is working in
          if all((eval(cond, {'edge_attribs': edge_attribs})
                  for cond in conditions)):
              if data:
                  yield (src_id, target_id, edge_attribs)
              else:
                  yield (src_id, target_id)
docs: yields all edges that meet the conditions given as eval strings