code: def test_schema_inference_on_lists(data, data_type):
      assert _infer_schema(data) == Schema([ColSpec(data_type)])
  
      test_data = [{"data": data}]
      assert _infer_schema(test_data) == Schema(
          [ColSpec(Array(data_type), name="data")]
      )
  
      test_data = [{"data": [data]}]
      assert _infer_schema(test_data) == Schema(
          [ColSpec(Array(Array(data_type)), name="data")]
      )
  
      test_data = [
          {"data": {"dict": data}},
          {"data": {"dict": data, "string": "a"}},
      ]
      inferred_schema = _infer_schema(test_data)
      expected_schema = Schema(
          [
              ColSpec(
                  Object(
                      [
                          Property("dict", Array(data_type)),
                          Property(
                              "string", DataType.string, required=False
                          ),
                      ]
                  ),
                  name="data",
              )
          ]
      )
      assert inferred_schema == expected_schema
  
      test_data = [
          {"data": {"dict": data}},
          {"data": {"dict": data}, "string": "a"},
      ]
      inferred_schema = _infer_schema(test_data)
      expected_schema = Schema(
          [
              ColSpec(
                  Object([Property("dict", Array(data_type))]),
                  name="data",
              ),
              ColSpec(DataType.string, name="string", required=False),
          ]
      )
      assert inferred_schema == expected_schema
  
imports: import datetime
  import json
  import math
  import re
  import numpy
  import pandas
  import pyspark
  import pyspark.sql.types
  import pytest
  from scipy.sparse import csc_matrix, csr_matrix
  from mlflow.exceptions import MlflowException
  from mlflow.models.utils import _enforce_tensor_spec
  from mlflow.pyfunc import _parse_spark_datatype
  from mlflow.types import DataType
  from mlflow.types.schema import Array, ColSpec, Object, ParamSchema, ParamSpec, Property, Schema, TensorSpec
  from mlflow.types.utils import _get_tensor_shape, _infer_colspec_type, _infer_param_schema, _infer_schema, _validate_input_dictionary_contains_only_strings_and_lists_of_strings
label_desc: Use image node_id 48 for calling a global function with example usage: test_schema_inference_on_lists(data, data_type) without return types