code: def test_iris_data_model_can_be_loaded_and_evaluated_as_pyfunc(
      tmp_path, model_path, monkeypatch
  ):
      mlflow.set_tracking_uri(tmp_path.joinpath("mlruns").as_uri())
      monkeypatch.chdir(tmp_path)
      model_data_info = save_or_log_tf_model_by_mlflow128(
          tmp_path, "iris", "save_model", model_path
      )
  
      pyfunc_wrapper = pyfunc.load_model(model_path)
  
      # can call predict with a df
      results_df = pyfunc_wrapper.predict(model_data_info.inference_df)
      assert isinstance(results_df, pd.DataFrame)
      pd.testing.assert_frame_equal(
          results_df.sort_index(axis=1),
          model_data_info.raw_df.sort_index(axis=1),
          rtol=1e-6,
      )
  
      # can also call predict with a dict
      inp_dict = {}
      for df_col_name in list(model_data_info.inference_df):
          inp_dict[df_col_name] = model_data_info.inference_df[
              df_col_name
          ].values
      results = pyfunc_wrapper.predict(inp_dict)
      assert isinstance(results, dict)
      pd.testing.assert_frame_equal(
          pd.DataFrame(results).sort_index(axis=1),
          model_data_info.raw_df.sort_index(axis=1),
          rtol=1e-6,
      )
  
      # can not call predict with a list
      inp_list = []
      for df_col_name in list(model_data_info.inference_df):
          inp_list.append(
              model_data_info.inference_df[df_col_name].values
          )
      with pytest.raises(
          TypeError,
          match="Only dict and DataFrame input types are supported",
      ):
          results = pyfunc_wrapper.predict(inp_list)
  
imports: import collections
  import json
  import os
  import iris_data_utils
  import numpy
  import pandas
  import pandas.testing
  import pytest
  import tensorflow
  import mlflow
  import mlflow.pyfunc.scoring_server
  from mlflow import pyfunc
  from mlflow.store.artifact.s3_artifact_repo import S3ArtifactRepository
  from mlflow.tensorflow import _TF2Wrapper
  from mlflow.utils.conda import get_or_create_conda_env
  from mlflow.utils.environment import _mlflow_conda_env
  from tests.helper_functions import assert_array_almost_equal, pyfunc_serve_and_score_model
label_desc: Use image node_id 7 for calling a global function with example usage: test_iris_data_model_can_be_loaded_and_evaluated_as_pyfunc(tmp_path, model_path, monkeypatch) without return types