code: def register_optimizer_params(
      name: str, optimizer_params: OptimizerParams
  ):
      """
      Checks if the optimizer param name exists in the registry, and if it doesnt, adds it.
  
      This allows custom optimizer params to be added and called by name during instantiation.
  
      Args:
          name: Name of the optimizer. Will be used as key to retrieve the optimizer.
          optimizer_params: Optimizer class
      """
      if name in AVAILABLE_OPTIMIZER_PARAMS:
          raise ValueError(
              f"Cannot override pre-existing optimizers. Conflicting optimizer name = {name}"
          )
  
      AVAILABLE_OPTIMIZER_PARAMS[name] = optimizer_params
  
imports: from dataclasses import dataclass
  from functools import partial
  from typing import Any, Dict, Optional, Tuple
  from omegaconf import MISSING, OmegaConf
label_desc: Use image node_id 1 for calling a global function with example usage: register_optimizer_params(name, optimizer_params) without return types