code: def add_metaclass(metaclass):
      """Class decorator for creating a class with a metaclass."""
  
      def wrapper(cls):
          orig_vars = cls.__dict__.copy()
          slots = orig_vars.get("__slots__")
          if slots is not None:
              if isinstance(slots, str):
                  slots = [slots]
              for slots_var in slots:
                  orig_vars.pop(slots_var)
          orig_vars.pop("__dict__", None)
          orig_vars.pop("__weakref__", None)
          if hasattr(cls, "__qualname__"):
              orig_vars["__qualname__"] = cls.__qualname__
          return metaclass(cls.__name__, cls.__bases__, orig_vars)
  
      return wrapper
  
imports: from __future__ import absolute_import
  import functools
  import itertools
  import operator
  import sys
  import types
label_desc: Use image node_id 10 for calling a global function with example usage: add_metaclass(metaclass) and returns: wrapper, metaclass