class_docstr: A key/object registry class.
  This class is used in CVNets to do Dependency Injection in configs,
  so when you write "resnet" in a config, it knows which module to load.
  You can potentially provide a `base_class` to ensures that all items
  in the registry are of type `base_class`.
  
  Registry also allows for passing arguments to a registered item:
  For example: "top1" -> "top1(pred=logits)"
  
  Usage:
  >>> my_registry = Registry("registry_name")
  >>> @my_registry.register("awesome_class_or_func")
  ... def my_awesome_class_or_func():
  ...    pass
  >>> assert "awesome_class_or_func" in my_registry
  
  It allows for vanilla key/object definition as well as functional argument injection:
  >>> reg = Registry("registry_name")
  >>> reg.register("awesome_dict")(dict)
  >>> reg["awesome_dict(name=hello, type=fifo)]()
  {'name': 'hello', 'type': 'fifo'}
code: def register(self, name: str, type: str = "") -> Callable:
      if type:
          name = "{}{}{}".format(type, self.separator, name)
  
      if self.arguments_accessed:
          # TODO: do we really want an error here?
          logger.error(
              f"Found item `{name}` being registered after all_item_arguments"
              f" was called for `{self.registry_name}` registry."
          )
  
      def register_with_name(item: RegistryItem) -> RegistryItem:
          if name in self.registry:
              raise ValueError(
                  "Cannot register duplicate {} ({})".format(
                      self.registry_name, name
                  )
              )
          if self.base_class and not issubclass(item, self.base_class):
              raise ValueError(
                  "{} class ({}: {}) must extend {}".format(
                      self.registry_name,
                      name,
                      item.__name__,
                      self.base_class,
                  )
              )
  
          self.registry[name] = item
          return item
  
      return register_with_name
  
file_path: ml-cvnets/utils/registry.py
imports: import argparse
  from functools import partial
  from typing import Callable, Dict, Iterable, List, Optional, Sequence, Tuple, TypeVar, Union
  from utils import logger
  from utils.import_utils import import_modules_from_folder
label_desc: Use image node_id 8 for calling the Registry obj's underlying member method code with example usage: obj.register(name, type) and returns: register_with_name, item