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:
          _rm_maker(store, name)
  
      # search with no filter should return all registered models
      rms, _ = _search_registered_models(store, None)
      assert rms == names
  
      # equality search using name should return exactly the 1 name
      rms, _ = _search_registered_models(store, f"name='{names[0]}'")
      assert rms == [names[0]]
  
      # equality search using name that is not valid should return nothing
      rms, _ = _search_registered_models(
          store, "name='{}'".format(names[0] + "cats")
      )
      assert rms == []
  
      # case-sensitive prefix search using LIKE should return all the RMs
      rms, _ = _search_registered_models(
          store, f"name LIKE '{prefix}%'"
      )
      assert rms == names
  
      # case-sensitive prefix search using LIKE with surrounding % should return all the RMs
      rms, _ = _search_registered_models(store, "name LIKE '%RM%'")
      assert rms == names
  
      # case-sensitive prefix search using LIKE with surrounding % should return all the RMs
      # _e% matches test_for_search_ , so all RMs should match
      rms, _ = _search_registered_models(store, "name LIKE '_e%'")
      assert rms == names
  
      # case-sensitive prefix search using LIKE should return just rm4
      rms, _ = _search_registered_models(
          store, "name LIKE '{}%'".format(prefix + "RM4A")
      )
      assert rms == [names[4]]
  
      # case-sensitive prefix search using LIKE should return no models if no match
      rms, _ = _search_registered_models(
          store, "name LIKE '{}%'".format(prefix + "cats")
      )
      assert rms == []
  
      # confirm that LIKE is not case-sensitive
      rms, _ = _search_registered_models(store, "name lIkE '%blah%'")
      assert rms == []
  
      rms, _ = _search_registered_models(
          store, "name like '{}%'".format(prefix + "RM4A")
      )
      assert rms == [names[4]]
  
      # case-insensitive prefix search using ILIKE should return both rm5 and rm6
      rms, _ = _search_registered_models(
          store, "name ILIKE '{}%'".format(prefix + "RM4A")
      )
      assert rms == names[4:]
  
      # case-insensitive postfix search with ILIKE
      rms, _ = _search_registered_models(store, "name ILIKE '%RM4a%'")
      assert rms == names[4:]
  
      # case-insensitive prefix search using ILIKE should return both rm5 and rm6
      rms, _ = _search_registered_models(
          store, "name ILIKE '{}%'".format(prefix + "cats")
      )
      assert rms == []
  
      # confirm that ILIKE is not case-sensitive
      rms, _ = _search_registered_models(store, "name iLike '%blah%'")
      assert rms == []
  
      # confirm that ILIKE works for empty query
      rms, _ = _search_registered_models(store, "name iLike '%%'")
      assert rms == names
  
      rms, _ = _search_registered_models(store, "name ilike '%RM4a%'")
      assert rms == 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.",
      ) 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.",
      ) 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])
      assert _search_registered_models(
          store, None, max_results=1000
      ) == (names[:-1], 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
      assert _search_registered_models(
          store, f"name LIKE '{prefix}%'"
      ) == (
          names[0:5],
          None,
      )
  
      # case-insensitive prefix search using ILIKE should return both rm5 and rm6
      assert _search_registered_models(
          store, "name ILIKE '{}%'".format(prefix + "RM4A")
      ) == (
          [names[4]],
          None,
      )
  
imports: import time
  import uuid
  from unittest import mock
  import pytest
  from mlflow.entities.model_registry import ModelVersion, ModelVersionTag, RegisteredModelTag
  from mlflow.environment_variables import MLFLOW_TRACKING_URI
  from mlflow.exceptions import MlflowException
  from mlflow.protos.databricks_pb2 import INVALID_PARAMETER_VALUE, RESOURCE_ALREADY_EXISTS, RESOURCE_DOES_NOT_EXIST, ErrorCode
  from mlflow.store.model_registry.dbmodels.models import SqlModelVersion, SqlModelVersionTag, SqlRegisteredModel, SqlRegisteredModelTag
  from mlflow.store.model_registry.sqlalchemy_store import SqlAlchemyStore
  from tests.helper_functions import random_str
label_desc: Use image node_id 26 for calling a global function with example usage: test_search_registered_models(store) without return types