code: def test_rename_registered_model(store):
      original_name = "original name"
      new_name = "new name"
      _rm_maker(store, original_name)
      _mv_maker(store, original_name)
      _mv_maker(store, original_name)
      rm = store.get_registered_model(original_name)
      mv1 = store.get_model_version(original_name, 1)
      mv2 = store.get_model_version(original_name, 2)
      assert rm.name == original_name
      assert mv1.name == original_name
      assert mv2.name == original_name
  
      # test renaming registered model also updates its model versions
      store.rename_registered_model(original_name, new_name)
      rm = store.get_registered_model(new_name)
      mv1 = store.get_model_version(new_name, 1)
      mv2 = store.get_model_version(new_name, 2)
      assert rm.name == new_name
      assert mv1.name == new_name
      assert mv2.name == new_name
  
      # test accessing the model with the old name will fail
      with pytest.raises(
          MlflowException,
          match=rf"Registered Model with name={original_name} not found",
      ) as exception_context:
          store.get_registered_model(original_name)
      assert exception_context.value.error_code == ErrorCode.Name(
          RESOURCE_DOES_NOT_EXIST
      )
  
      # test name another model with the replaced name is ok
      _rm_maker(store, original_name)
      # cannot rename model to conflict with an existing model
      with pytest.raises(
          MlflowException,
          match=rf"Registered Model \(name={original_name}\) already exists",
      ) as exception_context:
          store.rename_registered_model(new_name, original_name)
      assert exception_context.value.error_code == ErrorCode.Name(
          RESOURCE_ALREADY_EXISTS
      )
      # invalid model name will fail
      with pytest.raises(
          MlflowException,
          match=r"Registered model name cannot be empty",
      ) as exception_context:
          store.rename_registered_model(original_name, None)
      assert exception_context.value.error_code == ErrorCode.Name(
          INVALID_PARAMETER_VALUE
      )
      with pytest.raises(
          MlflowException,
          match=r"Registered model name cannot be empty",
      ) as exception_context:
          store.rename_registered_model(original_name, "")
      assert exception_context.value.error_code == ErrorCode.Name(
          INVALID_PARAMETER_VALUE
      )
  
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 8 for calling a global function with example usage: test_rename_registered_model(store) without return types