code: def __new__(metacls, typename, bases, namespace):
      if "Config" not in namespace:
          # We need to dynamically create a new Config class per
          # instance rather than inheriting a single empty config class
          # because components are registered uniquely by config class.
          # If a parent class specifies a config class, inherit from it.
          parent_config = next(
              (
                  base.Config
                  for base in bases
                  if hasattr(base, "Config")
              ),
              None,
          )
          if parent_config is not None:
  
              class Config(parent_config):
                  pass
  
          else:
  
              class Config(ConfigBase):
                  pass
  
          namespace["Config"] = Config
  
      component_type = next(
          (
              base.__COMPONENT_TYPE__
              for base in bases
              if hasattr(base, "__COMPONENT_TYPE__")
          ),
          namespace.get("__COMPONENT_TYPE__"),
      )
      new_cls = super().__new__(metacls, typename, bases, namespace)
  
      new_cls.Config.__COMPONENT_TYPE__ = component_type
      new_cls.Config.__name__ = f"{typename}.Config"
      new_cls.Config.__COMPONENT__ = new_cls
      new_cls.Config.__EXPANSIBLE__ = namespace.get("__EXPANSIBLE__")
      if component_type:
          Registry.add(component_type, new_cls, new_cls.Config)
      return new_cls
  
imports: import collections
  import enum
  from typing import Any, Dict, List, Tuple, Type, Union
  import torch
  from pytext.utils.usage import log_class_usage
  from .pytext_config import ConfigBase, PyTextConfig
label_desc: Use image node_id 1 for calling the ComponentMeta obj's underlying member method code with example usage: obj.__new__(metacls, typename, bases, namespace) and returns: new_cls