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: This function allows for lazily loading modules from pre-specified directories.
  The main reason for its existence is to prevent circular imports.
  
  This function should be called before any "pull/get" kind of action from
  Registry to make sure it has loaded all registered models, which is pretty
  much any operation except for "register".
  
  If self._modules_loaded is not True, it will load all modules under
  self._lazy_load_dirs.
docstr_tok: ["This","function","allows","for","lazily","loading","modules","from","pre-specified","directories",".","The","main","reason","for","its","existence","is","to","prevent","circular","imports",".","This","function","should","be","called","before","any","``","pull\/get","''","kind","of","action","from","Registry","to","make","sure","it","has","loaded","all","registered","models",",","which","is","pretty","much","any","operation","except","for","``","register","''",".","If","self._modules_loaded","is","not","True",",","it","will","load","all","modules","under","self._lazy_load_dirs","."]
code: def _load_all(self) -> None:
      """
      This function allows for lazily loading modules from pre-specified directories.
      The main reason for its existence is to prevent circular imports.
  
      This function should be called before any "pull/get" kind of action from
      Registry to make sure it has loaded all registered models, which is pretty
      much any operation except for "register".
  
      If self._modules_loaded is not True, it will load all modules under
      self._lazy_load_dirs.
      """
      if not self._modules_loaded:
          self._modules_loaded = True
          for dir_name in self._lazy_load_dirs:
              import_modules_from_folder(
                  dir_name, extra_roots=self.internal_dirs
              )
  
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 2 for calling the Registry obj's underlying member method code with example usage: obj._load_all() without return types