code: def should_exclude(
      idx: int,
      field: FieldInfo,
      dtype: str,
      column_count: int,
      row_count: int,
      targets: Set[str],
  ) -> bool:
      if field.key == "PRI":
          logging.info(f"Exclude {field.name} ({dtype}): primary key")
          return True
  
      if field.name in targets:
          return False
  
      if field.num_distinct_values <= 1:
          logging.info(
              f"Exclude {field.name} ({dtype}): less than 2 distinct values"
          )
          return True
  
      distinct_value_percent = (
          float(field.num_distinct_values) / row_count
      )
      if distinct_value_percent == 1.0:
          upper_name = field.name.upper()
          if (
              (idx == 0 and "INDEX" in upper_name and dtype == NUMBER)
              or upper_name.endswith("ID")
              or upper_name.startswith("ID")
          ):
              logging.info(
                  f"Exclude {field.name} ({dtype}): unique ID column"
              )
              return True
  
      # For TEXT fields, we only want to use them if they appear "interesting", otherwise we would rather exclude
      # them and treat the problem as a tabular problem
      if (
          column_count > 3
          and dtype == TEXT
          and (field.avg_words or 0) < TEXT_AVG_WORDS_CUTOFF
      ):
          logging.info(
              f"Exclude {field.name} ({dtype}): too few average words"
          )
          return True
  
      return False
  
file_path: ludwig/ludwig/utils/automl/type_inference.py
imports: import logging
  from typing import Set
  from ludwig.api_annotations import DeveloperAPI
  from ludwig.constants import AUDIO, BINARY, CATEGORY, DATE, IMAGE, NUMBER, TEXT
  from ludwig.utils import strings_utils
  from ludwig.utils.automl.field_info import FieldInfo
label_desc: Use image node_id 2 for calling a global function with example usage: should_exclude(idx, field, dtype, column_count, row_count, targets) and returns: False, True, False, True, True, True