code: def test_search_registered_model_pagination(store):
      rms = [
          store.create_registered_model(f"RM{i:03}").name
          for i in range(50)
      ]
  
      # test flow with fixed max_results
      returned_rms = []
      query = "name LIKE 'RM%'"
      res = _search_registered_models(
          store, query, page_token=None, max_results=5
      )
      returned_rms.extend(res.names)
      while res.token:
          res = _search_registered_models(
              store, query, page_token=res.token, max_results=5
          )
          returned_rms.extend(res.names)
      assert returned_rms == rms
  
      # test that pagination will return all valid results in sorted order
      # by name ascending
      res = _search_registered_models(store, query, max_results=5)
      assert res.token is not None
      assert res.names == rms[0:5]
  
      res = _search_registered_models(
          store, query, page_token=res.token, max_results=10
      )
      assert res.token is not None
      assert res.names == rms[5:15]
  
      res = _search_registered_models(
          store, query, page_token=res.token, max_results=20
      )
      assert res.token is not None
      assert res.names == rms[15:35]
  
      res = _search_registered_models(
          store, query, page_token=res.token, max_results=100
      )
      # assert that page token is None
      assert res.token is None
      assert res.names == rms[35:]
  
      # test that providing a completely invalid page token throws
      with pytest.raises(
          MlflowException,
          match=r"Invalid page token, could not base64-decode",
      ) as exception_context:
          _search_registered_models(
              store, query, page_token="evilhax", max_results=20
          )
      assert exception_context.value.error_code == ErrorCode.Name(
          INVALID_PARAMETER_VALUE
      )
  
      # test that providing too large of a max_results throws
      with pytest.raises(
          MlflowException, match=r"Invalid value for max_results."
      ) as exception_context:
          _search_registered_models(
              store, query, page_token="evilhax", max_results=1e15
          )
      assert exception_context.value.error_code == ErrorCode.Name(
          INVALID_PARAMETER_VALUE
      )
  
imports: import time
  import uuid
  from typing import List, NamedTuple
  from unittest import mock
  import pytest
  from mlflow.entities.model_registry import ModelVersion, ModelVersionTag, RegisteredModelTag
  from mlflow.exceptions import MlflowException
  from mlflow.protos.databricks_pb2 import INVALID_PARAMETER_VALUE, RESOURCE_DOES_NOT_EXIST, ErrorCode
  from mlflow.store.model_registry.file_store import FileStore
  from mlflow.utils.file_utils import path_to_local_file_uri, write_yaml
  from mlflow.utils.time import get_current_time_millis
  from tests.helper_functions import random_int, random_str
label_desc: Use image node_id 34 for calling a global function with example usage: test_search_registered_model_pagination(store) without return types