code: def get_default_config(
      config: Optional[Union[Dict, DictConfig]] = None,
      extra: Optional[List[str]] = None,
  ):
      """
      Get the default config.
  
      Parameters
      ----------
      config
          A dictionary including four keys: "model", "data", "optimization", and "environment".
          If any key is not given, we will fill in with the default value.
      extra
          A list of extra config keys.
  
      Returns
      -------
      The default config.
      """
      if isinstance(config, DictConfig):
          return config
  
      if config is None:
          config = {}
  
      basic_config = get_basic_automm_config(extra=extra)
      for k, default_value in basic_config.items():
          if k not in config:
              config[k] = default_value
  
      all_configs = []
      for k, v in config.items():
          if isinstance(v, dict):
              per_config = OmegaConf.create(v)
          elif isinstance(v, DictConfig):
              per_config = v
          elif isinstance(v, str):
              if v.lower().endswith((".yaml", ".yml")):
                  per_config = OmegaConf.load(os.path.expanduser(v))
              else:
                  cur_path = os.path.dirname(
                      os.path.dirname(os.path.abspath(__file__))
                  )
                  config_path = os.path.join(
                      cur_path, "configs", k, f"{v}.yaml"
                  )
                  per_config = OmegaConf.load(config_path)
          else:
              raise ValueError(f"Unknown configuration type: {type(v)}")
  
          all_configs.append(per_config)
  
      config = OmegaConf.merge(*all_configs)
  
      return config
  
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 2 for calling a global function with example usage: get_default_config(config, extra) and returns: config, config