code: def _adjacency_to_edges(adjacency):
      
      edges = set()
      for u in adjacency:
          for v in adjacency[u]:
              try:
                  edge = (u, v) if u <= v else (v, u)
              except TypeError:
                  # Py3 does not allow sorting of unlike types
                  if (v, u) in edges:
                      continue
                  edge = (u, v)
  
              edges.add(edge)
      return edges
docs: determine from an adjacency the list of edges
      if (u, v) in edges, then (v, u) should not be