code: def infer_dtypes_by_model_names(model_config: DictConfig):
      """
      Get data types according to model types.
  
      Parameters
      ----------
      model_config
          Model config from `config.model`.
  
      Returns
      -------
      The data types allowed by models and the default fallback data type.
      """
      allowable_dtypes = []
      fallback_dtype = None
      for per_model in model_config.names:
          per_model_dtypes = OmegaConf.select(
              model_config, f"{per_model}.data_types"
          )
          if per_model_dtypes:
              allowable_dtypes.extend(per_model_dtypes)
  
      allowable_dtypes = set(allowable_dtypes)
      if allowable_dtypes == {IMAGE, TEXT}:
          fallback_dtype = TEXT
      elif len(allowable_dtypes) == 1:
          fallback_dtype = list(allowable_dtypes)[0]
  
      return allowable_dtypes, fallback_dtype
  
imports: import copy
  import logging
  import os
  import warnings
  from typing import Dict, List, Optional, Tuple, Union
  import pandas
  from omegaconf import DictConfig, OmegaConf
  from torch import nn
  from autogluon.core.utils import default_holdout_frac, generate_train_test_split_combined
  from autogluon.core.utils.loaders import load_pd
  from ..constants import BINARY, CATEGORICAL, DEFAULT_SHOT, DOCUMENT, FEW_SHOT, IMAGE, IMAGE_PATH, LABEL, MMLAB_MODELS, MULTICLASS, NER, NER_ANNOTATION, NER_TEXT, NUMERICAL, OVD, REGRESSION, ROIS, SAM, SEMANTIC_SEGMENTATION_IMG, TEXT, TEXT_NER
  from ..data import CategoricalProcessor, DocumentProcessor, ImageProcessor, LabelProcessor, MixupModule, MMDetProcessor, MMOcrProcessor, MultiModalFeaturePreprocessor, NerLabelEncoder, NerProcessor, NumericalProcessor, OVDProcessor, SemanticSegImageProcessor, TextProcessor
  from ..data.infer_types import is_image_column
label_desc: Use image node_id 9 for calling a global function with example usage: infer_dtypes_by_model_names(model_config) and returns: allowable_dtypes,  fallback_dtype