code: def test_search_model_versions(
      mock_get_request_message, mock_model_registry_store
  ):
      mvds = [
          ModelVersion(
              name="model_1",
              version="5",
              creation_timestamp=100,
              last_updated_timestamp=3200,
              description="v 5",
              user_id="u1",
              current_stage="Production",
              source="A/B/CD",
              run_id=uuid.uuid4().hex,
              status="READY",
              status_message=None,
          ),
          ModelVersion(
              name="model_1",
              version="12",
              creation_timestamp=110,
              last_updated_timestamp=2000,
              description="v 12",
              user_id="u2",
              current_stage="Production",
              source="A/B/CD",
              run_id=uuid.uuid4().hex,
              status="READY",
              status_message=None,
          ),
          ModelVersion(
              name="ads_model",
              version="8",
              creation_timestamp=200,
              last_updated_timestamp=1000,
              description="v 8",
              user_id="u1",
              current_stage="Staging",
              source="A/B/CD",
              run_id=uuid.uuid4().hex,
              status="READY",
              status_message=None,
          ),
          ModelVersion(
              name="fraud_detection_model",
              version="345",
              creation_timestamp=1000,
              last_updated_timestamp=999,
              description="newest version",
              user_id="u12",
              current_stage="None",
              source="A/B/CD",
              run_id=uuid.uuid4().hex,
              status="READY",
              status_message=None,
          ),
      ]
      mock_get_request_message.return_value = SearchModelVersions(
          filter="source_path = 'A/B/CD'"
      )
      mock_model_registry_store.search_model_versions.return_value = (
          PagedList(mvds, None)
      )
      resp = _search_model_versions()
      mock_model_registry_store.search_model_versions.assert_called_with(
          filter_string="source_path = 'A/B/CD'",
          max_results=SEARCH_MODEL_VERSION_MAX_RESULTS_THRESHOLD,
          order_by=[],
          page_token="",
      )
      assert json.loads(resp.get_data()) == {
          "model_versions": jsonify(mvds)
      }
  
      mock_get_request_message.return_value = SearchModelVersions(
          filter="name='model_1'"
      )
      mock_model_registry_store.search_model_versions.return_value = (
          PagedList(mvds[:1], "tok")
      )
      resp = _search_model_versions()
      mock_model_registry_store.search_model_versions.assert_called_with(
          filter_string="name='model_1'",
          max_results=SEARCH_MODEL_VERSION_MAX_RESULTS_THRESHOLD,
          order_by=[],
          page_token="",
      )
      assert json.loads(resp.get_data()) == {
          "model_versions": jsonify(mvds[:1]),
          "next_page_token": "tok",
      }
  
      mock_get_request_message.return_value = SearchModelVersions(
          filter="version<=12", max_results=2
      )
      mock_model_registry_store.search_model_versions.return_value = (
          PagedList([mvds[0], mvds[2]], "next")
      )
      resp = _search_model_versions()
      mock_model_registry_store.search_model_versions.assert_called_with(
          filter_string="version<=12",
          max_results=2,
          order_by=[],
          page_token="",
      )
      assert json.loads(resp.get_data()) == {
          "model_versions": jsonify([mvds[0], mvds[2]]),
          "next_page_token": "next",
      }
  
      mock_get_request_message.return_value = SearchModelVersions(
          filter="version<=12",
          max_results=2,
          order_by=["version DESC"],
          page_token="prev",
      )
      mock_model_registry_store.search_model_versions.return_value = (
          PagedList(mvds[1:3], "next")
      )
      resp = _search_model_versions()
      mock_model_registry_store.search_model_versions.assert_called_with(
          filter_string="version<=12",
          max_results=2,
          order_by=["version DESC"],
          page_token="prev",
      )
      assert json.loads(resp.get_data()) == {
          "model_versions": jsonify(mvds[1:3]),
          "next_page_token": "next",
      }
  
imports: import json
  import uuid
  from unittest import mock
  import pytest
  import mlflow
  from mlflow.entities import ViewType
  from mlflow.entities.model_registry import ModelVersion, ModelVersionTag, RegisteredModel, RegisteredModelTag
  from mlflow.exceptions import MlflowException
  from mlflow.protos.databricks_pb2 import INTERNAL_ERROR, INVALID_PARAMETER_VALUE, ErrorCode
  from mlflow.protos.model_registry_pb2 import CreateModelVersion, CreateRegisteredModel, DeleteModelVersion, DeleteModelVersionTag, DeleteRegisteredModel, DeleteRegisteredModelAlias, DeleteRegisteredModelTag, GetLatestVersions, GetModelVersion, GetModelVersionByAlias, GetModelVersionDownloadUri, GetRegisteredModel, RenameRegisteredModel, SearchModelVersions, SearchRegisteredModels, SetModelVersionTag, SetRegisteredModelAlias, SetRegisteredModelTag, TransitionModelVersionStage, UpdateModelVersion, UpdateRegisteredModel
  from mlflow.protos.service_pb2 import CreateExperiment, SearchRuns
  from mlflow.server import BACKEND_STORE_URI_ENV_VAR, SERVE_ARTIFACTS_ENV_VAR, app
  from mlflow.server.handlers import _create_experiment, _create_model_version, _create_registered_model, _delete_artifact_mlflow_artifacts, _delete_model_version, _delete_model_version_tag, _delete_registered_model, _delete_registered_model_alias, _delete_registered_model_tag, _get_latest_versions, _get_model_version, _get_model_version_by_alias, _get_model_version_download_uri, _get_registered_model, _get_request_message, _log_batch, _rename_registered_model, _search_model_versions, _search_registered_models, _search_runs, _set_model_version_tag, _set_registered_model_alias, _set_registered_model_tag, _transition_stage, _update_model_version, _update_registered_model, catch_mlflow_exception, get_endpoints
  from mlflow.store.entities.paged_list import PagedList
  from mlflow.store.model_registry import SEARCH_MODEL_VERSION_MAX_RESULTS_THRESHOLD, SEARCH_REGISTERED_MODEL_MAX_RESULTS_DEFAULT
  from mlflow.utils.proto_json_utils import message_to_json
  from mlflow.utils.validation import MAX_BATCH_LOG_REQUEST_SIZE
label_desc: Use image node_id 37 for calling a global function with example usage: test_search_model_versions(mock_get_request_message, mock_model_registry_store) without return types