parameters: (registry_store, base_metaclass=None)
return_statement: return Registry
docstring: Return a new Registry metaclass.
docstring_summary: Return a new Registry metaclass.
docstring_tokens: Return a new Registry metaclass .
function: def make_registry_metaclass(registry_store, base_metaclass=None):
      """Return a new Registry metaclass."""
  
      if not isinstance(registry_store, dict):
          raise TypeError("'registry_store' argument must be a dict")
  
      base_metaclass = default_if_none(base_metaclass, type)
  
      class Registry(base_metaclass):
          """A metaclass that stores a reference to all registered classes."""
  
          def __new__(mcs, class_name, base_classes, class_dict):  # pylint: disable=bad-mcs-classmethod-argument,bad-classmethod-argument
              """Create and returns a new instance of Registry.
  
              The registry is a class named 'class_name' derived from 'base_classes'
              that defines 'class_dict' as additional attributes.
  
              The returned class is added to 'registry_store' using
              class_dict["REGISTERED_NAME"] as the name, or 'class_name'
              if the "REGISTERED_NAME" attribute isn't defined. If the
              sentinel value 'LEAVE_UNREGISTERED' is specified as the
              name, then the returned class isn't added to
              'registry_store'.
  
              The returned class will have the "REGISTERED_NAME" attribute
              defined either as its associated key in 'registry_store' or
              the 'LEAVE_UNREGISTERED' sentinel value.
              """
  
              registered_name = class_dict.setdefault("REGISTERED_NAME", class_name)
              cls = base_metaclass.__new__(mcs, class_name, base_classes, class_dict)
  
              if registered_name is not LEAVE_UNREGISTERED:
                  name_to_register = f"{registered_name}{GLOBAL_SUFFIX}"
                  if name_to_register in registry_store:
                      raise ValueError(
                          "The name %s is already registered; a different value for the"
                          " 'REGISTERED_NAME' attribute must be chosen" % (registered_name))
                  registry_store[name_to_register] = cls
  
              return cls
  
      return Registry
function_tokens: def make_registry_metaclass ( registry_store , base_metaclass = None ) : if not isinstance ( registry_store , dict ) : raise TypeError ( "'registry_store' argument must be a dict" ) base_metaclass = default_if_none ( base_metaclass , type ) class Registry ( base_metaclass ) : """A metaclass that stores a reference to all registered classes.""" def __new__ ( mcs , class_name , base_classes , class_dict ) : # pylint: disable=bad-mcs-classmethod-argument,bad-classmethod-argument """Create and returns a new instance of Registry.
  
              The registry is a class named 'class_name' derived from 'base_classes'
              that defines 'class_dict' as additional attributes.
  
              The returned class is added to 'registry_store' using
              class_dict["REGISTERED_NAME"] as the name, or 'class_name'
              if the "REGISTERED_NAME" attribute isn't defined. If the
              sentinel value 'LEAVE_UNREGISTERED' is specified as the
              name, then the returned class isn't added to
              'registry_store'.
  
              The returned class will have the "REGISTERED_NAME" attribute
              defined either as its associated key in 'registry_store' or
              the 'LEAVE_UNREGISTERED' sentinel value.
              """ registered_name = class_dict . setdefault ( "REGISTERED_NAME" , class_name ) cls = base_metaclass . __new__ ( mcs , class_name , base_classes , class_dict ) if registered_name is not LEAVE_UNREGISTERED : name_to_register = f"{registered_name}{GLOBAL_SUFFIX}" if name_to_register in registry_store : raise ValueError ( "The name %s is already registered; a different value for the" " 'REGISTERED_NAME' attribute must be chosen" % ( registered_name ) ) registry_store [ name_to_register ] = cls return cls return Registry