code: def get_optimizer_config(
      name: str, **kwargs: Optional[Dict[str, Any]]
  ) -> OptimizerParams:
      """
      Convenience method to obtain a OptimizerParams class and partially instantiate it with optimizer kwargs.
  
      Args:
          name: Name of the OptimizerParams in the registry.
          kwargs: Optional kwargs of the optimizer used during instantiation.
  
      Returns:
          a partially instantiated OptimizerParams
      """
      if name is None:
          return kwargs
  
      if name not in AVAILABLE_OPTIMIZER_PARAMS:
          raise ValueError(
              f"Cannot resolve optimizer parameters '{name}'. Available optimizer parameters are : "
              f"{AVAILABLE_OPTIMIZER_PARAMS.keys()}"
          )
  
      scheduler_params = AVAILABLE_OPTIMIZER_PARAMS[name]
  
      if kwargs is not None and len(kwargs) != 0:
          kwargs = OmegaConf.create(kwargs)
          OmegaConf.merge(scheduler_params(), kwargs)
  
      scheduler_params = partial(scheduler_params, **kwargs)
      return scheduler_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 2 for calling a global function with example usage: get_optimizer_config(name) and returns: scheduler_params, kwargs