code: def test_set_registered_model_tag(store):
      name1 = "SetRegisteredModelTag_TestMod"
      name2 = "SetRegisteredModelTag_TestMod 2"
      initial_tags = [
          RegisteredModelTag("key", "value"),
          RegisteredModelTag("anotherKey", "some other value"),
      ]
      store.create_registered_model(name1, initial_tags)
      store.create_registered_model(name2, initial_tags)
      new_tag = RegisteredModelTag("randomTag", "not a random value")
      store.set_registered_model_tag(name1, new_tag)
      rm1 = store.get_registered_model(name=name1)
      all_tags = [*initial_tags, new_tag]
      assert rm1.tags == {tag.key: tag.value for tag in all_tags}
  
      # test overriding a tag with the same key
      overriding_tag = RegisteredModelTag("key", "overriding")
      store.set_registered_model_tag(name1, overriding_tag)
      all_tags = [tag for tag in all_tags if tag.key != "key"] + [
          overriding_tag
      ]
      rm1 = store.get_registered_model(name=name1)
      assert rm1.tags == {tag.key: tag.value for tag in all_tags}
      # does not affect other models with the same key
      rm2 = store.get_registered_model(name=name2)
      assert rm2.tags == {tag.key: tag.value for tag in initial_tags}
  
      # can not set tag on deleted (non-existed) registered model
      store.delete_registered_model(name1)
      with pytest.raises(
          MlflowException,
          match=f"Registered Model with name={name1} not found",
      ) as exception_context:
          store.set_registered_model_tag(name1, overriding_tag)
      assert exception_context.value.error_code == ErrorCode.Name(
          RESOURCE_DOES_NOT_EXIST
      )
      # test cannot set tags that are too long
      long_tag = RegisteredModelTag("longTagKey", "a" * 5001)
      with pytest.raises(
          MlflowException,
          match=(
              r"Registered model value '.+' had length \d+, which exceeded length limit of 5000"
          ),
      ) as exception_context:
          store.set_registered_model_tag(name2, long_tag)
      assert exception_context.value.error_code == ErrorCode.Name(
          INVALID_PARAMETER_VALUE
      )
      # test can set tags that are somewhat long
      long_tag = RegisteredModelTag("longTagKey", "a" * 4999)
      store.set_registered_model_tag(name2, long_tag)
      # can not set invalid tag
      with pytest.raises(
          MlflowException, match=r"Tag name cannot be None"
      ) as exception_context:
          store.set_registered_model_tag(
              name2, RegisteredModelTag(key=None, value="")
          )
      assert exception_context.value.error_code == ErrorCode.Name(
          INVALID_PARAMETER_VALUE
      )
      # can not use invalid model name
      with pytest.raises(
          MlflowException,
          match=r"Registered model name cannot be empty",
      ) as exception_context:
          store.set_registered_model_tag(
              None, RegisteredModelTag(key="key", value="value")
          )
      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 18 for calling a global function with example usage: test_set_registered_model_tag(store) without return types