code: def test_pyfunc_serve_and_score(input1, input2, basic_model):
      with mlflow.start_run():
          model_info = mlflow.sentence_transformers.log_model(
              basic_model, "my_model"
          )
      loaded_pyfunc = pyfunc.load_model(model_uri=model_info.model_uri)
      local_predict = loaded_pyfunc.predict(input1)
  
      # Check that the giving the same string to the served model results in the same result
      inference_data = json.dumps({"inputs": input1})
      resp = pyfunc_serve_and_score_model(
          model_info.model_uri,
          data=inference_data,
          content_type=pyfunc_scoring_server.CONTENT_TYPE_JSON,
          extra_args=["--env-manager", "local"],
      )
      serving_result = json.loads(resp.content.decode("utf-8"))[
          "predictions"
      ]
      np.testing.assert_array_equal(local_predict, serving_result)
  
      # Check that the giving a different string to the served model results in a different result
      inference_data = json.dumps({"inputs": input2})
      resp = pyfunc_serve_and_score_model(
          model_info.model_uri,
          data=inference_data,
          content_type=pyfunc_scoring_server.CONTENT_TYPE_JSON,
          extra_args=["--env-manager", "local"],
      )
      serving_result = json.loads(resp.content.decode("utf-8"))[
          "predictions"
      ]
      assert not np.equal(local_predict, serving_result).all()
  
imports: import json
  import os
  from unittest import mock
  import numpy
  import pandas
  import pytest
  import yaml
  from pyspark.sql import SparkSession
  from pyspark.sql.types import ArrayType, DoubleType
  from sentence_transformers import SentenceTransformer
  import mlflow
  import mlflow.pyfunc.scoring_server
  import mlflow.sentence_transformers
  from mlflow import pyfunc
  from mlflow.exceptions import MlflowException
  from mlflow.models import Model, infer_signature
  from mlflow.models.utils import _read_example
  from mlflow.store.artifact.s3_artifact_repo import S3ArtifactRepository
  from mlflow.utils.environment import _mlflow_conda_env
  from tests.helper_functions import _assert_pip_requirements, _compare_logged_code_paths, _mlflow_major_version_string, assert_register_model_called_with_local_model_path, pyfunc_serve_and_score_model
label_desc: Use image node_id 20 for calling a global function with example usage: test_pyfunc_serve_and_score(input1, input2, basic_model) without return types