code: def test_search_registered_models(
      mock_get_request_message, mock_model_registry_store
  ):
      rmds = [
          RegisteredModel(
              name="model_1",
              creation_timestamp=111,
              last_updated_timestamp=222,
              description="Test model",
              latest_versions=[],
          ),
          RegisteredModel(
              name="model_2",
              creation_timestamp=111,
              last_updated_timestamp=333,
              description="Another model",
              latest_versions=[],
          ),
      ]
      mock_get_request_message.return_value = SearchRegisteredModels()
      mock_model_registry_store.search_registered_models.return_value = PagedList(
          rmds, None
      )
      resp = _search_registered_models()
      (
          _,
          args,
      ) = mock_model_registry_store.search_registered_models.call_args
      assert args == {
          "filter_string": "",
          "max_results": SEARCH_REGISTERED_MODEL_MAX_RESULTS_DEFAULT,
          "order_by": [],
          "page_token": "",
      }
      assert json.loads(resp.get_data()) == {
          "registered_models": jsonify(rmds)
      }
  
      mock_get_request_message.return_value = SearchRegisteredModels(
          filter="hello"
      )
      mock_model_registry_store.search_registered_models.return_value = PagedList(
          rmds[:1], "tok"
      )
      resp = _search_registered_models()
      (
          _,
          args,
      ) = mock_model_registry_store.search_registered_models.call_args
      assert args == {
          "filter_string": "hello",
          "max_results": SEARCH_REGISTERED_MODEL_MAX_RESULTS_DEFAULT,
          "order_by": [],
          "page_token": "",
      }
      assert json.loads(resp.get_data()) == {
          "registered_models": jsonify(rmds[:1]),
          "next_page_token": "tok",
      }
  
      mock_get_request_message.return_value = SearchRegisteredModels(
          filter="hi", max_results=5
      )
      mock_model_registry_store.search_registered_models.return_value = PagedList(
          [rmds[0]], "tik"
      )
      resp = _search_registered_models()
      (
          _,
          args,
      ) = mock_model_registry_store.search_registered_models.call_args
      assert args == {
          "filter_string": "hi",
          "max_results": 5,
          "order_by": [],
          "page_token": "",
      }
      assert json.loads(resp.get_data()) == {
          "registered_models": jsonify([rmds[0]]),
          "next_page_token": "tik",
      }
  
      mock_get_request_message.return_value = SearchRegisteredModels(
          filter="hey",
          max_results=500,
          order_by=["a", "B desc"],
          page_token="prev",
      )
      mock_model_registry_store.search_registered_models.return_value = PagedList(
          rmds, "DONE"
      )
      resp = _search_registered_models()
      (
          _,
          args,
      ) = mock_model_registry_store.search_registered_models.call_args
      assert args == {
          "filter_string": "hey",
          "max_results": 500,
          "order_by": ["a", "B desc"],
          "page_token": "prev",
      }
      assert json.loads(resp.get_data()) == {
          "registered_models": jsonify(rmds),
          "next_page_token": "DONE",
      }
  
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 27 for calling a global function with example usage: test_search_registered_models(mock_get_request_message, mock_model_registry_store) without return types