code: def apply_omegaconf_overrides(
      conf: DictConfig,
      overrides: Union[List, Tuple, str, Dict, DictConfig],
      check_key_exist=True,
  ):
      """
      Apply omegaconf overrides.
  
      Parameters
      ----------
      conf
          The base configuration.
      overrides
          The overrides can be a string or a list.
      check_key_exist
          Whether to check if all keys in the overrides must exist in the conf.
  
      Returns
      -------
      new_conf
          The updated configuration.
      """
      overrides = parse_dotlist_conf(overrides)
  
      def _check_exist_dotlist(C, key_in_dotlist):
          if not isinstance(key_in_dotlist, list):
              key_in_dotlist = key_in_dotlist.split(".")
          if key_in_dotlist[0] in C:
              if len(key_in_dotlist) > 1:
                  return _check_exist_dotlist(
                      C[key_in_dotlist[0]], key_in_dotlist[1:]
                  )
              else:
                  return True
          else:
              return False
  
      if check_key_exist:
          for ele in overrides.items():
              if not _check_exist_dotlist(conf, ele[0]):
                  raise KeyError(
                      f'"{ele[0]}" is not found in the config. You may need to check the overrides. '
                      f"overrides={overrides}"
                  )
      override_conf = OmegaConf.from_dotlist(
          [f"{ele[0]}={ele[1]}" for ele in overrides.items()]
      )
      conf = OmegaConf.merge(conf, override_conf)
      return conf
  
imports: import copy
  import logging
  import os
  import re
  import warnings
  from typing import Callable, Dict, List, Optional, Tuple, Union
  from omegaconf import DictConfig, OmegaConf
  from packaging import version
  from torch import nn
  from ..constants import AUTOMM, DATA, FT_TRANSFORMER, FUSION_TRANSFORMER, HF_MODELS, MODEL, REGRESSION, VALID_CONFIG_KEYS
  from ..presets import get_automm_presets, get_basic_automm_config
  from .data import get_detected_data_types
label_desc: Use image node_id 11 for calling a global function with example usage: apply_omegaconf_overrides(conf, overrides, check_key_exist) and returns: conf, False, _check_exist_dotlist, True