class_docstr: This class is a Registry that stores information about the Training Strategies.
  
  The Strategies are mapped to strings. These strings are names that identify
  a strategy, e.g., "deepspeed". It also returns Optional description and
  parameters to initialize the Strategy, which were defined durng the
  registration.
  
  The motivation for having a StrategyRegistry is to make it convenient
  for the Users to try different Strategies by passing just strings
  to the strategy flag to the Trainer.
  
  Example::
  
      @StrategyRegistry.register("lightning", description="Super fast", a=1, b=True)
      class LightningStrategy:
          def __init__(self, a, b):
              ...
  
      or
  
      StrategyRegistry.register("lightning", LightningStrategy, description="Super fast", a=1, b=True)
docstr: Registers a strategy mapped to a name and with required metadata.
  
  Args:
      name : the name that identifies a strategy, e.g. "deepspeed_stage_3"
      strategy : strategy class
      description : strategy description
      override : overrides the registered strategy, if True
      init_params: parameters to initialize the strategy
docstr_tok: ["Registers","a","strategy","mapped","to","a","name","and","with","required","metadata",".","Args",":","name",":","the","name","that","identifies","a","strategy",",","e.g",".","``","deepspeed_stage_3","''","strategy",":","strategy","class","description",":","strategy","description","override",":","overrides","the","registered","strategy",",","if","True","init_params",":","parameters","to","initialize","the","strategy"]
code: def register(
      self,
      name: str,
      strategy: Optional[Callable] = None,
      description: Optional[str] = None,
      override: bool = False,
      **init_params: Any,
  ) -> Callable:
      """Registers a strategy mapped to a name and with required metadata.
  
      Args:
          name : the name that identifies a strategy, e.g. "deepspeed_stage_3"
          strategy : strategy class
          description : strategy description
          override : overrides the registered strategy, if True
          init_params: parameters to initialize the strategy
  
      """
      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 ValueError(
              f"'{name}' is already present in the registry. HINT: Use `override=True`."
          )
  
      data: Dict[str, Any] = {}
      data["description"] = (
          description if description is not None else ""
      )
  
      data["init_params"] = init_params
  
      def do_register(strategy: Callable) -> Callable:
          data["strategy"] = strategy
          data["strategy_name"] = name
          self[name] = data
          return strategy
  
      if strategy is not None:
          return do_register(strategy)
  
      return do_register
  
file_path: pytorch-lightning/src/lightning/fabric/strategies/registry.py
imports: from typing import Any, Callable, Dict, List, Optional
  from typing_extensions import override
label_desc: Use image node_id 1 for calling the _StrategyRegistry obj's underlying member method code with example usage: obj.register(name, strategy, description, override) and returns: do_register, strategy, do_register