code: def _convert_config(cfg: "OmegaConf"):
      """Recursive function convertint the configuration from old hydra format to the new one."""
      if not _HAS_HYDRA:
          logging.error(
              "This function requires Hydra/Omegaconf and it was not installed."
          )
          exit(1)
  
      # Get rid of cls -> _target_.
      if "cls" in cfg and "_target_" not in cfg:
          cfg._target_ = cfg.pop("cls")
  
      # Get rid of params.
      if "params" in cfg:
          params = cfg.pop("params")
          for param_key, param_val in params.items():
              cfg[param_key] = param_val
  
      # Recursion.
      try:
          for _, sub_cfg in cfg.items():
              if isinstance(sub_cfg, DictConfig):
                  _convert_config(sub_cfg)
      except omegaconf_errors.OmegaConfBaseException as e:
          logging.warning(
              f"Skipped conversion for config/subconfig:\n{cfg}\n Reason: {e}."
          )
  
imports: import copy
  import importlib
  import os
  from dataclasses import dataclass, is_dataclass
  from enum import Enum
  from functools import lru_cache
  from pathlib import Path
  from typing import List, Optional, Tuple, Union
  import wrapt
  from nemo.utils import AppState, logging
  from nemo.utils.data_utils import resolve_cache_dir
  from nemo.utils.data_utils import is_datastore_path
label_desc: Use image node_id 8 for calling a global function with example usage: _convert_config(cfg) without return types