code: def test_infer_type(
      num_distinct_values,
      distinct_values,
      img_values,
      audio_values,
      avg_words,
      missing_vals,
      expected,
  ):
      field = FieldInfo(
          name="foo",
          dtype="object",
          num_distinct_values=num_distinct_values,
          distinct_values=distinct_values,
          image_values=img_values,
          audio_values=audio_values,
          avg_words=avg_words,
      )
      assert infer_type(field, missing_vals, ROW_COUNT) == expected
  
file_path: ludwig/tests/ludwig/utils/automl/test_type_inference.py
imports: import random
  import pytest
  from ludwig.constants import AUDIO, BINARY, CATEGORY, DATE, IMAGE, NUMBER, TEXT
  from ludwig.data.dataset_synthesizer import generate_string
  from ludwig.utils.automl.field_info import FieldInfo
  from ludwig.utils.automl.type_inference import infer_type, should_exclude
label_desc: Use image node_id 1 for calling a global function with example usage: test_infer_type(num_distinct_values, distinct_values, img_values, audio_values, avg_words, missing_vals, expected) without return types