code: def _infer_colspec_type(data: Any) -> Union[DataType, Array, Object]:
      """
      Infer an MLflow Colspec type from the dataset.
  
      Args:
          data: data to infer from.
  
      Returns:
          Object
      """
      dtype = _infer_datatype(data)
  
      # Currently only input that gives None is nested list whose items are all empty e.g. [[], []],
      # because flat empty list [] has special handlign logic in _infer_schema
      if dtype is None:
          raise MlflowException(
              "A column of nested array type must include at least one non-empty array."
          )
  
      return dtype
  
imports: import logging
  import warnings
  from collections import defaultdict
  from typing import Any, Dict, List, Optional, Union
  import numpy
  import pandas
  from mlflow.exceptions import MlflowException
  from mlflow.protos.databricks_pb2 import INVALID_PARAMETER_VALUE
  from mlflow.types import DataType
  from mlflow.types.schema import Array, ColSpec, Object, ParamSchema, ParamSpec, Property, Schema, TensorSpec
label_desc: Use image node_id 3 for calling a global function with example usage: _infer_colspec_type(data) and returns: dtype