code: def _register(celf, clazzes_attrs):
      assert celf != Visitor, "Subclass Visitor instead."
      if "_visitors" not in celf.__dict__:
          celf._visitors = {}
  
      def wrapper(method):
          assert method.__name__ == "visit"
          for clazzes, attrs in clazzes_attrs:
              if type(clazzes) != tuple:
                  clazzes = (clazzes,)
              if type(attrs) == str:
                  attrs = (attrs,)
              for clazz in clazzes:
                  _visitors = celf._visitors.setdefault(clazz, {})
                  for attr in attrs:
                      assert attr not in _visitors, (
                          "Oops, class '%s' has visitor function for '%s' defined already."
                          % (clazz.__name__, attr)
                      )
                      _visitors[attr] = method
          return None
  
      return wrapper
  
file_path: catboost/contrib/python/fonttools/fontTools/misc/visitor.py
imports: import enum
label_desc: Use image node_id 1 for calling the Visitor obj's underlying member method code with example usage: obj._register(celf, clazzes_attrs) and returns: wrapper, None