code: def sanitize_and_filter_combiner_entities_(config: "ModelConfig"):
      if (
          config.model_type != MODEL_ECD
          or config.combiner.type != "comparator"
      ):
          return
  
      input_feature_names = {
          input_feature.name for input_feature in config.input_features
      }
  
      # Sanitize feature names.
      config.combiner.entity_1 = [
          get_sanitized_feature_name(fname)
          for fname in config.combiner.entity_1
      ]
      config.combiner.entity_2 = [
          get_sanitized_feature_name(fname)
          for fname in config.combiner.entity_2
      ]
  
      entity_1_excluded = {
          fname
          for fname in config.combiner.entity_1
          if fname not in input_feature_names
      }
      if entity_1_excluded:
          logger.warning(
              f"Excluding `entity_1` features {entity_1_excluded} from the comparator combiner because they are not "
              f"present in the `input_features`."
          )
  
      config.combiner.entity_1 = [
          fname
          for fname in config.combiner.entity_1
          if fname not in entity_1_excluded
      ]
  
      entity_2_excluded = {
          fname
          for fname in config.combiner.entity_2
          if fname not in input_feature_names
      }
      if entity_2_excluded:
          logger.warning(
              f"Excluding `entity_2` features {entity_2_excluded} from the comparator combiner because they are not "
              f"present in the `input_features`."
          )
  
      config.combiner.entity_2 = [
          fname
          for fname in config.combiner.entity_2
          if fname not in entity_2_excluded
      ]
  
imports: import copy
  import logging
  import sys
  import warnings
  from typing import Any, Dict, List, Mapping, Set, TYPE_CHECKING
  from marshmallow import ValidationError
  from transformers import AutoConfig
  from ludwig.api_annotations import DeveloperAPI
  from ludwig.constants import CATEGORY, COMBINED, DECODER, DEFAULTS, ENCODER, GRID_SEARCH, INPUT_FEATURES, LOSS, MODEL_ECD, MODEL_LLM, OUTPUT_FEATURES, PARAMETERS, PREPROCESSING, SEQUENCE, SPACE, TEXT, TYPE
  from ludwig.features.feature_utils import compute_feature_hash
  from ludwig.schema.features.utils import output_config_registry
  from ludwig.schema.hyperopt.scheduler import BaseHyperbandSchedulerConfig
  from ludwig.schema.llms.generation import LLMGenerationConfig
  from ludwig.schema.trainer import ECDTrainerConfig
  from ludwig.types import HyperoptConfigDict, ModelConfigDict
  from ludwig.utils.data_utils import get_sanitized_feature_name
  from ludwig.utils.llm_utils import get_context_len
label_desc: Use image node_id 7 for calling a global function with example usage: sanitize_and_filter_combiner_entities_(config) without return types