code: def categorical_node_match(attr, default):
      if isinstance(attr, str):
  
          def match(data1, data2):
              return data1.get(attr, default) == data2.get(
                  attr, default
              )
  
      else:
          attrs = list(zip(attr, default))  # Python 3
  
          def match(data1, data2):
              return all(
                  data1.get(attr, d) == data2.get(attr, d)
                  for attr, d in attrs
              )
  
      return match
  
file_path: networkx/networkx/algorithms/isomorphism/matchhelpers.py
imports: import math
  import types
  from itertools import permutations
label_desc: Use image node_id 3 for calling a global function with example usage: categorical_node_match(attr, default) and returns: match, unknown, all