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'}
docstr: Parses `key` which can contain arguments in the form of:
  <key_name>(arg1=value1, arg2=value2, ...)
  
  Returns:
      Tuple: (base_name: str, parameters: dict)
docstr_tok: ["Parses","`","key","`","which","can","contain","arguments","in","the","form","of",":","<","key_name",">","(","arg1=value1",",","arg2=value2",",","...",")","Returns",":","Tuple",":","(","base_name",":","str",",","parameters",":","dict",")"]
code: def parse_key(self, key: str) -> Tuple[str, Dict[str, str]]:
      """
      Parses `key` which can contain arguments in the form of:
      <key_name>(arg1=value1, arg2=value2, ...)
  
      Returns:
          Tuple: (base_name: str, parameters: dict)
      """
      name = key.split("(")[0]
  
      params = {}
      if "(" in key:
          params_str = key.split("(")[1].split(")")[0]
  
          try:
              params = dict(
                  [
                      [x.strip() for x in arg.split("=")]
                      for arg in params_str.split(",")
                  ]
              )
          except Exception as e:
              logger.error(
                  "Could not correctly parse key parameters `{}` for registry {}."
                  " Please make sure to key parameters have the format:"
                  " <key_name>(arg1=value1, arg2=value2, ...)".format(
                      key, self.registry_name
                  )
              )
              raise e
  
      return name, params
  
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 10 for calling the Registry obj's underlying member method code with example usage: obj.parse_key(key) and returns: name,  params