code: def group_by_levels(levels):
      L = {}
      for n, lev in levels.items():
          if lev not in L:
              L[lev] = []
          L[lev].append(n)
  
      return L
  
file_path: networkx/networkx/algorithms/isomorphism/tree_isomorphism.py
imports: import networkx
  from networkx.utils.decorators import not_implemented_for
label_desc: Use image node_id 3 for calling a global function with example usage: group_by_levels(levels) and returns: L