class_docstr: This class is a Registry that stores information about the Accelerators.
  
  The Accelerators are mapped to strings. These strings are names that identify
  an accelerator, e.g., "gpu". It also returns Optional description and
  parameters to initialize the Accelerator, which were defined during the
  registration.
  
  The motivation for having a AcceleratorRegistry is to make it convenient
  for the Users to try different accelerators by passing mapped aliases
  to the accelerator flag to the Trainer.
  
  Example::
  
      @AcceleratorRegistry.register("sota", description="Custom sota accelerator", a=1, b=True)
      class SOTAAccelerator(Accelerator):
          def __init__(self, a, b):
              ...
  
      or
  
      AcceleratorRegistry.register("sota", SOTAAccelerator, description="Custom sota accelerator", a=1, b=True)
docstr: Registers a accelerator mapped to a name and with required metadata.
  
  Args:
      name : the name that identifies a accelerator, e.g. "gpu"
      accelerator : accelerator class
      description : accelerator description
      override : overrides the registered accelerator, if True
      init_params: parameters to initialize the accelerator
code: def register(
      self,
      name: str,
      accelerator: Optional[Callable] = None,
      description: str = "",
      override: bool = False,
      **init_params: Any,
  ) -> Callable:
      """Registers a accelerator mapped to a name and with required metadata.
  
      Args:
          name : the name that identifies a accelerator, e.g. "gpu"
          accelerator : accelerator class
          description : accelerator description
          override : overrides the registered accelerator, if True
          init_params: parameters to initialize the accelerator
  
      """
      if not (name is None or isinstance(name, str)):
          raise TypeError(f"`name` must be a str, found {name}")
  
      if name in self and not override:
          raise MisconfigurationException(
              f"'{name}' is already present in the registry. HINT: Use `override=True`."
          )
  
      data: Dict[str, Any] = {}
  
      data["description"] = description
      data["init_params"] = init_params
  
      def do_register(name: str, accelerator: Callable) -> Callable:
          data["accelerator"] = accelerator
          data["accelerator_name"] = name
          self[name] = data
          return accelerator
  
      if accelerator is not None:
          return do_register(name, accelerator)
  
      return do_register
  
file_path: pytorch-lightning/src/lightning/fabric/accelerators/registry.py
imports: from typing import Any, Callable, Dict, List, Optional
  from typing_extensions import override
  from lightning.fabric.utilities.exceptions import MisconfigurationException
  from lightning.fabric.utilities.registry import _register_classes
label_desc: Use image node_id 1 for calling the _AcceleratorRegistry obj's underlying member method code with example usage: obj.register(name, accelerator, description, override) and returns: do_register, accelerator, do_register