code: def update_model_cfg(original_cfg, new_cfg):
      with open_dict(original_cfg), open_dict(new_cfg):
          # force inject some keys into the config
          whitelist_keys = ["num_workers", "pin_memory"]
          for wkey in whitelist_keys:
              if wkey in new_cfg:
                  original_cfg[wkey] = new_cfg[wkey]
                  print(
                      f"Injecting white listed key `{wkey}` into config"
                  )
  
          # drop keys which don't exist in old config and are not whitelisted
          new_keys = list(new_cfg.keys())
          for key in new_keys:
              if key not in original_cfg:
                  new_cfg.pop(key)
                  print("Removing unavailable key from config :", key)
  
          new_cfg = OmegaConf.merge(original_cfg, new_cfg)
      return new_cfg
  
file_path: NeMo/examples/asr/asr_adapters/train_asr_adapter.py
imports: import os
  from dataclasses import is_dataclass
  import pytorch_lightning
  from omegaconf import DictConfig, OmegaConf, open_dict
  from nemo.collections.asr.models import ASRModel
  from nemo.core import adapter_mixins
  from nemo.core.config import hydra_runner
  from nemo.utils import logging
  from nemo.utils.exp_manager import clean_exp_ckpt, exp_manager
label_desc: Use image node_id 2 for calling a global function with example usage: update_model_cfg(original_cfg, new_cfg) and returns: new_cfg