code: def validate_schema(
      data: PyFuncInput, expected_schema: Schema
  ) -> None:
      """
      Validate that the input data has the expected schema.
  
      :param data: Input data to be validated. Supported types are:
  
                   - pandas.DataFrame
                   - pandas.Series
                   - numpy.ndarray
                   - scipy.sparse.csc_matrix
                   - scipy.sparse.csr_matrix
                   - List[Any]
                   - Dict[str, Any]
                   - str
      :param expected_schema: Expected :py:class:`Schema <mlflow.types.Schema>` of the input data.
      :raises: A :py:class:`mlflow.exceptions.MlflowException`. when the input data does
               not match the schema.
  
      .. code-block:: python
          :caption: Example usage of validate_schema
  
          import mlflow.models
  
          # Suppose you've already got a model_uri
          model_info = mlflow.models.get_model_info(model_uri)
          # Get model signature directly
          model_signature = model_info.signature
          # validate schema
          mlflow.models.validate_schema(input_data, model_signature.inputs)
      """
      _enforce_schema(data, expected_schema)
  
imports: import datetime
  import decimal
  import json
  import logging
  import os
  from copy import deepcopy
  from typing import Any, Dict, List, Optional, Union
  import numpy
  import pandas
  from mlflow.exceptions import INVALID_PARAMETER_VALUE, MlflowException
  from mlflow.models import Model
  from mlflow.store.artifact.utils.models import get_model_name_and_version
  from mlflow.types import DataType, ParamSchema, ParamSpec, Schema, TensorSpec
  from mlflow.types.schema import Array, Object, Property
  from mlflow.types.utils import TensorsNotSupportedException, _infer_param_schema, clean_tensor_type
  from mlflow.utils.annotations import experimental
  from mlflow.utils.proto_json_utils import NumpyEncoder, dataframe_from_parsed_json, parse_tf_serving_input
  from mlflow.utils.uri import get_databricks_profile_uri_from_artifact_uri
label_desc: Use image node_id 20 for calling a global function with example usage: validate_schema(data, expected_schema) without return types