code: def edges_equal(edges1, edges2):
      """Check if edges are equal.
  
      Equality here means equal as Python objects.
      Edge data must match if included.
      The order of the edges is not relevant.
  
      Parameters
      ----------
      edges1, edges2 : iterables of with u, v nodes as
          edge tuples (u, v), or
          edge tuples with data dicts (u, v, d), or
          edge tuples with keys and data dicts (u, v, k, d)
  
      Returns
      -------
      bool
          True if edges are equal, False otherwise.
      """
      from collections import defaultdict
  
      d1 = defaultdict(dict)
      d2 = defaultdict(dict)
      c1 = 0
      for c1, e in enumerate(edges1):
          u, v = e[0], e[1]
          data = [e[2:]]
          if v in d1[u]:
              data = d1[u][v] + data
          d1[u][v] = data
          d1[v][u] = data
      c2 = 0
      for c2, e in enumerate(edges2):
          u, v = e[0], e[1]
          data = [e[2:]]
          if v in d2[u]:
              data = d2[u][v] + data
          d2[u][v] = data
          d2[v][u] = data
      if c1 != c2:
          return False
      # can check one direction because lengths are the same.
      for n, nbrdict in d1.items():
          for nbr, datalist in nbrdict.items():
              if n not in d2:
                  return False
              if nbr not in d2[n]:
                  return False
              d2datalist = d2[n][nbr]
              for data in datalist:
                  if datalist.count(data) != d2datalist.count(data):
                      return False
      return True
  
imports: import sys
  import uuid
  import warnings
  from collections import defaultdict, deque
  from collections.abc import Iterable, Iterator, Sized
  from itertools import chain, tee
  import networkx
label_desc: Use image node_id 12 for calling a global function with example usage: edges_equal(edges1, edges2) and returns: True, False, False, False, False