code: def convert_adapter_cfg_to_dict_config(cfg: DictConfig):
      # Convert to DictConfig from dict or Dataclass
      if is_dataclass(cfg):
          cfg = OmegaConf.structured(cfg)
  
      if not isinstance(cfg, DictConfig):
          cfg = DictConfig(cfg)
  
      return cfg
  
imports: from dataclasses import is_dataclass
  import torch
  from omegaconf import DictConfig, OmegaConf
  from nemo.utils import logging
label_desc: Use image node_id 1 for calling a global function with example usage: convert_adapter_cfg_to_dict_config(cfg) and returns: cfg