code: def customize_model_names(
      config: DictConfig,
      customized_names: Union[str, List[str]],
      advanced_hyperparameters: Optional[Dict] = None,
  ):
      """
      Customize attribute names of `config` with the provided names.
      A valid customized name string should start with one available name
      string in `config`. Customizing the model names in advanced_hyperparameters
      is only used for matcher query and response models currently.
  
      Parameters
      ----------
      config
          Config should have a attribute `names`, which contains a list of
          attribute names, e.g., ["timm_image", "hf_text"]. And each string in
          `config.names` should also be a attribute of `config`, e.g, `config.timm_image`.
      customized_names
          The provided names to replace the existing ones in `config.names` as well as
          the corresponding attribute names. For example, if `customized_names` is
          ["timm_image_123", "hf_text_abc"], then `config.timm_image` and `config.hf_text`
          are changed to `config.timm_image_123` and `config.hf_text_abc`.
      advanced_hyperparameters
          The hyperparameters whose values are complex objects, which can't be stored in config.
  
      Returns
      -------
          A new config with its first-level attributes customized by the provided names.
      """
      if not customized_names:
          return config, advanced_hyperparameters
  
      if isinstance(customized_names, str):
          customized_names = OmegaConf.from_dotlist(
              [f"names={customized_names}"]
          ).names
  
      if advanced_hyperparameters:
          new_advanced_hyperparameters = copy.deepcopy(
              advanced_hyperparameters
          )
      else:
          new_advanced_hyperparameters = dict()
  
      new_config = OmegaConf.create()
      new_config.names = []
      available_prefixes = list(config.keys())
      available_prefixes.remove("names")
      for per_name in customized_names:
          per_prefix = get_name_prefix(
              name=per_name,
              prefixes=available_prefixes,
          )
          if per_prefix:
              per_config = getattr(config, per_prefix)
              setattr(new_config, per_name, copy.deepcopy(per_config))
              new_config.names.append(per_name)
  
              if advanced_hyperparameters:
                  for k, v in advanced_hyperparameters.items():
                      if k.startswith(f"{MODEL}.{per_prefix}"):
                          new_k = k.replace(
                              f"{MODEL}.{per_prefix}",
                              f"{MODEL}.{per_name}",
                          )
                          new_advanced_hyperparameters.pop(k)
                          new_advanced_hyperparameters[new_k] = v
          else:
              logger.debug(
                  f"Removing {per_name}, which doesn't start with any of these prefixes: {available_prefixes}."
              )
  
      if len(new_config.names) == 0:
          raise ValueError(
              f"No customized name in `{customized_names}` starts with name prefixes in `{available_prefixes}`."
          )
  
      return new_config, new_advanced_hyperparameters
  
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 6 for calling a global function with example usage: customize_model_names(config, customized_names, advanced_hyperparameters) and returns: new_config,  new_advanced_hyperparameters, config,  advanced_hyperparameters