code: def test_search_registered_models(store):
      # create some registered models
      prefix = "test_for_search_"
      names = [
          prefix + name
          for name in ["RM1", "RM2", "RM3", "RM4", "RM4A", "RM4ab"]
      ]
      for name in names:
          store.create_registered_model(name)
  
      # search with no filter should return all registered models
      res = _search_registered_models(store, None)
      assert res.names == names
  
      # equality search using name should return exactly the 1 name
      res = _search_registered_models(store, f"name='{names[0]}'")
      assert res.names == [names[0]]
  
      # equality search using name that is not valid should return nothing
      res = _search_registered_models(store, f"name='{names[0]}cats'")
      assert res.names == []
  
      # case-sensitive prefix search using LIKE should return all the RMs
      res = _search_registered_models(store, f"name LIKE '{prefix}%'")
      assert res.names == names
  
      # case-sensitive prefix search using LIKE with surrounding % should return all the RMs
      res = _search_registered_models(store, "name LIKE '%RM%'")
      assert res.names == names
  
      # case-sensitive prefix search using LIKE with surrounding % should return all the RMs
      # _e% matches test_for_search_ , so all RMs should match
      res = _search_registered_models(store, "name LIKE '_e%'")
      assert res.names == names
  
      # case-sensitive prefix search using LIKE should return just rm4
      res = _search_registered_models(
          store, f"name LIKE '{prefix}RM4A%'"
      )
      assert res.names == [names[4]]
  
      # case-sensitive prefix search using LIKE should return no models if no match
      res = _search_registered_models(
          store, f"name LIKE '{prefix}cats%'"
      )
      assert res.names == []
  
      # confirm that LIKE is not case-sensitive
      res = _search_registered_models(store, "name lIkE '%blah%'")
      assert res.names == []
  
      res = _search_registered_models(
          store, f"name like '{prefix}RM4A%'"
      )
      assert res.names == [names[4]]
  
      # case-insensitive prefix search using ILIKE should return both rm5 and rm6
      res = _search_registered_models(
          store, f"name ILIKE '{prefix}RM4A%'"
      )
      assert res.names == names[4:]
  
      # case-insensitive postfix search with ILIKE
      res = _search_registered_models(store, "name ILIKE '%RM4a%'")
      assert res.names == names[4:]
  
      # case-insensitive prefix search using ILIKE should return both rm5 and rm6
      res = _search_registered_models(
          store, f"name ILIKE '{prefix}cats%'"
      )
      assert res.names == []
  
      # confirm that ILIKE is not case-sensitive
      res = _search_registered_models(store, "name iLike '%blah%'")
      assert res.names == []
  
      # confirm that ILIKE works for empty query
      res = _search_registered_models(store, "name iLike '%%'")
      assert res.names == names
  
      res = _search_registered_models(store, "name ilike '%RM4a%'")
      assert res.names == names[4:]
  
      # cannot search by invalid comparator types
      with pytest.raises(
          MlflowException,
          match="Parameter value is either not quoted or unidentified quote types used for "
          "string value something",
      ) as exception_context:
          _search_registered_models(store, "name!=something")
      assert exception_context.value.error_code == ErrorCode.Name(
          INVALID_PARAMETER_VALUE
      )
  
      # cannot search by run_id
      with pytest.raises(
          MlflowException,
          match=r"Invalid attribute key 'run_id' specified. Valid keys are '{'name'}'",
      ) as exception_context:
          _search_registered_models(store, "run_id='somerunID'")
      assert exception_context.value.error_code == ErrorCode.Name(
          INVALID_PARAMETER_VALUE
      )
  
      # cannot search by source_path
      with pytest.raises(
          MlflowException,
          match=r"Invalid attribute key 'source_path' specified\. Valid keys are '{'name'}'",
      ) as exception_context:
          _search_registered_models(store, "source_path = 'A/D'")
      assert exception_context.value.error_code == ErrorCode.Name(
          INVALID_PARAMETER_VALUE
      )
  
      # cannot search by other params
      with pytest.raises(
          MlflowException, match=r"Invalid clause\(s\) in filter string"
      ) as exception_context:
          _search_registered_models(store, "evilhax = true")
      assert exception_context.value.error_code == ErrorCode.Name(
          INVALID_PARAMETER_VALUE
      )
  
      # delete last registered model. search should not return the first 5
      store.delete_registered_model(name=names[-1])
      res = _search_registered_models(store, None, max_results=1000)
      assert res.names == names[:-1]
      assert res.token is None
  
      # equality search using name should return no names
      assert _search_registered_models(
          store, f"name='{names[-1]}'"
      ) == ([], None)
  
      # case-sensitive prefix search using LIKE should return all the RMs
      res = _search_registered_models(store, f"name LIKE '{prefix}%'")
      assert res.names == names[0:5]
      assert res.token is None
  
      # case-insensitive prefix search using ILIKE should return both rm5 and rm6
      res = _search_registered_models(
          store, f"name ILIKE '{prefix}RM4A%'"
      )
      assert res.names == [names[4]]
      assert res.token is None
  
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 31 for calling a global function with example usage: test_search_registered_models(store) without return types