code: def _infer_scalar_datatype(data) -> DataType:
      if DataType.is_boolean(data):
          return DataType.boolean
      # Order of is_long & is_integer matters
      # as both of theirs python_type is int
      if DataType.is_long(data):
          return DataType.long
      if DataType.is_integer(data):
          return DataType.integer
      # Order of is_double & is_float matters
      # as both of theirs python_type is float
      if DataType.is_double(data):
          return DataType.double
      if DataType.is_float(data):
          return DataType.float
      if DataType.is_string(data):
          return DataType.string
      if DataType.is_binary(data):
          return DataType.binary
      if DataType.is_datetime(data):
          return DataType.datetime
      raise MlflowException.invalid_parameter_value(
          "Data is not one of the supported DataType"
      )
  
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 6 for calling a global function with example usage: _infer_scalar_datatype(data) and returns: DataType, DataType, DataType, DataType, DataType, DataType, DataType, DataType