class_docstr: This is a registry class used to register classes and modules so that a universal
  object builder can be enabled.
  
  Args:
      name (str): The name of the registry .
      third_party_library (list, optional):
          List of third party libraries which are used in the initialization of the register module.
docstr: Retrieves a module with name `module_name` and returns the module if it has
  already been registered before.
  
  Args:
      module_name (str): The name of the module to be retrieved.
  Returns:
      :class:`object`: The retrieved module or None.
  Raises:
      NameError: Raises a NameError if the module to be retrieved has neither been
      registered directly nor as third party modules before.
docstr_tok: ["Retrieves","a","module","with","name","`","module_name","`","and","returns","the","module","if","it","has","already","been","registered","before",".","Args",":","module_name","(","str",")",":","The","name","of","the","module","to","be","retrieved",".","Returns",":",":","class",":","`","object","`",":","The","retrieved","module","or","None",".","Raises",":","NameError",":","Raises","a","NameError","if","the","module","to","be","retrieved","has","neither","been","registered","directly","nor","as","third","party","modules","before","."]
code: def get_module(self, module_name: str):
      """Retrieves a module with name `module_name` and returns the module if it has
      already been registered before.
  
      Args:
          module_name (str): The name of the module to be retrieved.
      Returns:
          :class:`object`: The retrieved module or None.
      Raises:
          NameError: Raises a NameError if the module to be retrieved has neither been
          registered directly nor as third party modules before.
      """
      if module_name in self._registry:
          return self._registry[module_name]
      elif self._third_party_lib is not None:
          for lib in self._third_party_lib:
              if hasattr(lib, module_name):
                  return getattr(lib, module_name)
          raise NameError(
              f"Module {module_name} not found in the registry {self.name}"
          )
  
file_path: colossalai/colossalai/legacy/registry/registry.py
imports: from types import ModuleType
  from typing import List
label_desc: Use image node_id 4 for calling the Registry obj's underlying member method code with example usage: obj.get_module(module_name) and returns: self, getattr