code: def test_creation_and_hydration():
      name = random_str()
      t1, t2 = 100, 150
      source = "path/to/source"
      run_id = uuid.uuid4().hex
      run_link = "http://localhost:5000/path/to/run"
      tags = [
          ModelVersionTag("key", "value"),
          ModelVersionTag("randomKey", "not a random value"),
      ]
      aliases = ["test_alias"]
      mvd = ModelVersion(
          name,
          "5",
          t1,
          t2,
          "version five",
          "user 1",
          "Production",
          source,
          run_id,
          "READY",
          "Model version #5 is ready to use.",
          tags,
          run_link,
          aliases,
      )
      _check(
          mvd,
          name,
          "5",
          t1,
          t2,
          "version five",
          "user 1",
          "Production",
          source,
          run_id,
          "READY",
          "Model version #5 is ready to use.",
          {tag.key: tag.value for tag in (tags or [])},
          ["test_alias"],
      )
  
      expected_dict = {
          "name": name,
          "version": "5",
          "creation_timestamp": t1,
          "last_updated_timestamp": t2,
          "description": "version five",
          "user_id": "user 1",
          "current_stage": "Production",
          "source": source,
          "run_id": run_id,
          "run_link": run_link,
          "status": "READY",
          "status_message": "Model version #5 is ready to use.",
          "tags": {tag.key: tag.value for tag in (tags or [])},
          "aliases": ["test_alias"],
      }
      model_version_as_dict = dict(mvd)
      assert model_version_as_dict == expected_dict
  
      proto = mvd.to_proto()
      assert proto.name == name
      assert proto.version == "5"
      assert proto.status == ModelVersionStatus.from_string("READY")
      assert proto.status_message == "Model version #5 is ready to use."
      assert {tag.key for tag in proto.tags} == {"key", "randomKey"}
      assert {tag.value for tag in proto.tags} == {
          "value",
          "not a random value",
      }
      assert proto.aliases == ["test_alias"]
      mvd_2 = ModelVersion.from_proto(proto)
      _check(
          mvd_2,
          name,
          "5",
          t1,
          t2,
          "version five",
          "user 1",
          "Production",
          source,
          run_id,
          "READY",
          "Model version #5 is ready to use.",
          {tag.key: tag.value for tag in (tags or [])},
          ["test_alias"],
      )
  
      expected_dict.update({"registered_model": RegisteredModel(name)})
      expected_dict["tags"] = tags
      mvd_3 = ModelVersion.from_dictionary(expected_dict)
      _check(
          mvd_3,
          name,
          "5",
          t1,
          t2,
          "version five",
          "user 1",
          "Production",
          source,
          run_id,
          "READY",
          "Model version #5 is ready to use.",
          {tag.key: tag.value for tag in (tags or [])},
          ["test_alias"],
      )
  
file_path: mlflow/tests/entities/model_registry/test_model_version.py
imports: import uuid
  from mlflow.entities.model_registry.model_version import ModelVersion
  from mlflow.entities.model_registry.model_version_status import ModelVersionStatus
  from mlflow.entities.model_registry.model_version_tag import ModelVersionTag
  from mlflow.entities.model_registry.registered_model import RegisteredModel
  from tests.helper_functions import random_str
label_desc: Use image node_id 2 for calling a global function with example usage: test_creation_and_hydration() without return types