code: def set_optim(
      self,
      cfg: config.OptimizerParams,
      sched_cfg: Optional[config.SchedulerParams] = None,
  ):
      @dataclass
      class WrappedOptimConfig(OptimConfig, cfg.__class__):
          pass
  
      # Setup optim
      optim_name = cfg.__class__.__name__.replace("Params", "").lower()
      wrapped_cfg = WrappedOptimConfig(
          name=optim_name, sched=None, **vars(cfg)
      )
  
      if sched_cfg is not None:
  
          @dataclass
          class WrappedSchedConfig(SchedConfig, sched_cfg.__class__):
              pass
  
          # Setup scheduler
          sched_name = sched_cfg.__class__.__name__.replace(
              "Params", ""
          )
          wrapped_sched_cfg = WrappedSchedConfig(
              name=sched_name, **vars(sched_cfg)
          )
  
          wrapped_cfg.sched = wrapped_sched_cfg
  
      self.model_cfg.optim = wrapped_cfg
  
file_path: NeMo/nemo/core/config/modelPT.py
imports: from dataclasses import dataclass, field
  from typing import Any, Dict, Optional
  from omegaconf import MISSING
  from nemo.core import config
  from nemo.core.classes.dataset import DatasetConfig
  from nemo.utils import exp_manager
label_desc: Use image node_id 5 for calling the ModelConfigBuilder obj's underlying member method code with example usage: obj.set_optim(cfg, sched_cfg) without return types