code: def test_model_info():
      with TempDir(chdr=True) as tmp:
          sig = ModelSignature(
              inputs=Schema(
                  [ColSpec("integer", "x"), ColSpec("integer", "y")]
              ),
              outputs=Schema([ColSpec(name=None, type="double")]),
          )
          input_example = {"x": 1, "y": 2}
  
          experiment_id = mlflow.create_experiment("test")
          with mlflow.start_run(experiment_id=experiment_id) as run:
              model_info = Model.log(
                  "some/path",
                  TestFlavor,
                  signature=sig,
                  input_example=input_example,
              )
          model_uri = f"runs:/{run.info.run_id}/some/path"
  
          model_info_fetched = mlflow.models.get_model_info(model_uri)
          with pytest.warns(
              FutureWarning,
              match="Field signature_dict is deprecated since v1.28.1. Use signature instead",
          ):
              assert model_info_fetched.signature_dict == sig.to_dict()
  
          local_path = _download_artifact_from_uri(
              model_uri, output_path=tmp.path("")
          )
  
          assert model_info.run_id == run.info.run_id
          assert model_info_fetched.run_id == run.info.run_id
          assert model_info.artifact_path == "some/path"
          assert model_info_fetched.artifact_path == "some/path"
          assert model_info.model_uri == model_uri
          assert model_info_fetched.model_uri == model_uri
  
          loaded_model = Model.load(os.path.join(local_path, "MLmodel"))
          assert (
              model_info.utc_time_created
              == loaded_model.utc_time_created
          )
          assert (
              model_info_fetched.utc_time_created
              == loaded_model.utc_time_created
          )
          assert model_info.model_uuid == loaded_model.model_uuid
          assert (
              model_info_fetched.model_uuid == loaded_model.model_uuid
          )
  
          assert model_info.flavors == {
              "flavor1": {"a": 1, "b": 2},
              "flavor2": {"x": 1, "y": 2},
          }
  
          path = os.path.join(
              local_path,
              model_info.saved_input_example_info["artifact_path"],
          )
          x = dataframe_from_raw_json(path)
          assert x.to_dict(orient="records")[0] == input_example
  
          model_signature = model_info_fetched.signature
          assert model_info.signature_dict == sig.to_dict()
          assert model_signature.to_dict() == sig.to_dict()
  
          assert (
              model_info.mlflow_version == loaded_model.mlflow_version
          )
          assert (
              model_info_fetched.mlflow_version
              == loaded_model.mlflow_version
          )
  
imports: import os
  import pathlib
  import uuid
  from datetime import date
  from unittest import mock
  import numpy
  import pandas
  import pytest
  import sklearn.datasets
  import sklearn.neighbors
  from packaging.version import Version
  from scipy.sparse import csc_matrix
  import mlflow
  from mlflow.models import Model, ModelSignature, infer_signature, validate_schema
  from mlflow.models.utils import _save_example
  from mlflow.store.artifact.s3_artifact_repo import S3ArtifactRepository
  from mlflow.tracking.artifact_utils import _download_artifact_from_uri
  from mlflow.types.schema import ColSpec, DataType, ParamSchema, ParamSpec, Schema, TensorSpec
  from mlflow.utils.file_utils import TempDir
  from mlflow.utils.model_utils import _validate_and_prepare_target_save_path
  from mlflow.utils.proto_json_utils import dataframe_from_raw_json
label_desc: Use image node_id 7 for calling a global function with example usage: test_model_info() without return types