code: def test_model_versions(client: _client.Determined) -> None:
      with open(
          conf.fixtures_path("no_op/single-one-short-step.yaml")
      ) as f:
          config = util.yaml_safe_load(f)
      exp = client.create_experiment(
          config, conf.fixtures_path("no_op")
      )
      assert exp.wait() == _client.ExperimentState.COMPLETED
      ckpt = exp.top_checkpoint()
  
      suffix = [
          random.sample("abcdefghijklmnopqrstuvwxyz", 1)
          for _ in range(10)
      ]
      model_name = f"test-model-{suffix}"
      model = client.create_model(model_name)
      try:
          ver = model.register_version(ckpt.uuid)
  
          assert ver.model_version in (
              v.model_version for v in model.get_versions()
          )
  
          ver.set_name("vername")
          ver.set_notes("vernotes")
  
          # Check the cache.
          assert ver.name == "vername", ver.name
          assert ver.notes == "vernotes", ver.notes
  
          # Break the cache.
          ver2 = model.get_version(ver.model_version)
          assert ver2 is not None
          assert ver2.name == "vername", ver2.name
          assert ver2.notes == "vernotes", ver2.notes
  
          # Test get_version without an arg, while a version exists.
          ver3 = model.get_version()
          assert ver3
          assert ver3.model_version == ver.model_version
  
          ver2.delete()
  
          with pytest.raises(errors.APIException):
              model.get_version(ver.model_version)
  
          # Test get_version without an arg, when no version exists.
          assert model.get_version() is None
  
      finally:
          model.delete()
  
file_path: determined/e2e_tests/tests/test_sdk.py
imports: import os
  import random
  import shutil
  import tempfile
  import time
  import pytest
  from determined.common import util
  from determined.common.api import bindings, errors
  from determined.common.experimental import resource_pool
  from determined.common.experimental.metrics import TrialMetrics
  from determined.experimental import client
  from tests import config
label_desc: Use image node_id 7 for calling a global function with example usage: test_model_versions(client) without return types