code: def test_predict(input_data, expected_data, content_type):
      class TestModel(mlflow.pyfunc.PythonModel):
          def predict(self, context, model_input):
              if isinstance(model_input, pd.DataFrame):
                  assert model_input.equals(expected_data)
              elif isinstance(model_input, np.ndarray):
                  assert np.array_equal(model_input, expected_data)
              else:
                  assert model_input == expected_data
              return {}
  
      with mlflow.start_run() as run:
          mlflow.pyfunc.log_model(
              artifact_path="model",
              python_model=TestModel(),
          )
          run_id = run.info.run_id
  
      mlflow.models.predict(
          model_uri=f"runs:/{run_id}/model",
          input_data=input_data,
          content_type=content_type,
      )
  
file_path: mlflow/tests/models/test_python_api.py
imports: import datetime
  import sys
  from unittest import mock
  import numpy
  import pandas
  import pytest
  import scipy.sparse
  import mlflow
  from mlflow.exceptions import MlflowException
  from mlflow.models.python_api import _CONTENT_TYPE_CSV, _CONTENT_TYPE_JSON, _serialize_input_data
  from mlflow.utils.env_manager import CONDA, VIRTUALENV
label_desc: Use image node_id 1 for calling a global function with example usage: test_predict(input_data, expected_data, content_type) and returns: dict