code: def test_add_jumpstart_model_id_version_tags():
      tags = None
      model_id = "model_id"
      version = "version"
      assert [
          {
              "Key": "sagemaker-sdk:jumpstart-model-id",
              "Value": "model_id",
          },
          {
              "Key": "sagemaker-sdk:jumpstart-model-version",
              "Value": "version",
          },
      ] == utils.add_jumpstart_model_id_version_tags(
          tags=tags, model_id=model_id, model_version=version
      )
  
      tags = [
          {
              "Key": "sagemaker-sdk:jumpstart-model-id",
              "Value": "model_id_2",
          },
          {
              "Key": "sagemaker-sdk:jumpstart-model-version",
              "Value": "version_2",
          },
      ]
      model_id = "model_id"
      version = "version"
      # If tags are already present, don't modify existing tags
      assert [
          {
              "Key": "sagemaker-sdk:jumpstart-model-id",
              "Value": "model_id_2",
          },
          {
              "Key": "sagemaker-sdk:jumpstart-model-version",
              "Value": "version_2",
          },
      ] == utils.add_jumpstart_model_id_version_tags(
          tags=tags, model_id=model_id, model_version=version
      )
  
      tags = [
          {"Key": "random key", "Value": "random_value"},
      ]
      model_id = "model_id"
      version = "version"
      assert [
          {"Key": "random key", "Value": "random_value"},
          {
              "Key": "sagemaker-sdk:jumpstart-model-id",
              "Value": "model_id",
          },
          {
              "Key": "sagemaker-sdk:jumpstart-model-version",
              "Value": "version",
          },
      ] == utils.add_jumpstart_model_id_version_tags(
          tags=tags, model_id=model_id, model_version=version
      )
  
      tags = [
          {
              "Key": "sagemaker-sdk:jumpstart-model-id",
              "Value": "model_id_2",
          },
      ]
      model_id = "model_id"
      version = "version"
      # If tags are already present, don't modify existing tags
      assert [
          {
              "Key": "sagemaker-sdk:jumpstart-model-id",
              "Value": "model_id_2",
          },
          {
              "Key": "sagemaker-sdk:jumpstart-model-version",
              "Value": "version",
          },
      ] == utils.add_jumpstart_model_id_version_tags(
          tags=tags, model_id=model_id, model_version=version
      )
  
      tags = [
          {"Key": "random key", "Value": "random_value"},
      ]
      model_id = None
      version = None
      assert [
          {"Key": "random key", "Value": "random_value"},
      ] == utils.add_jumpstart_model_id_version_tags(
          tags=tags, model_id=model_id, model_version=version
      )
  
imports: from __future__ import absolute_import
  import os
  from unittest import TestCase
  from mock.mock import Mock, patch
  import pytest
  import random
  from sagemaker.jumpstart import utils
  from sagemaker.jumpstart.constants import DEFAULT_JUMPSTART_SAGEMAKER_SESSION, ENV_VARIABLE_DISABLE_JUMPSTART_LOGGING, ENV_VARIABLE_JUMPSTART_CONTENT_BUCKET_OVERRIDE, ENV_VARIABLE_JUMPSTART_GATED_CONTENT_BUCKET_OVERRIDE, JUMPSTART_DEFAULT_REGION_NAME, JUMPSTART_GATED_AND_PUBLIC_BUCKET_NAME_SET, JUMPSTART_LOGGER, JUMPSTART_REGION_NAME_SET, JUMPSTART_RESOURCE_BASE_NAME, JumpStartScriptScope
  from functools import partial
  from sagemaker.jumpstart.enums import JumpStartTag, MIMEType
  from sagemaker.jumpstart.exceptions import DeprecatedJumpStartModelError, VulnerableJumpStartModelError
  from sagemaker.jumpstart.types import JumpStartModelHeader, JumpStartVersionedModelId
  from tests.unit.sagemaker.jumpstart.utils import get_spec_from_base_spec
  from mock import MagicMock
label_desc: Use image node_id 13 for calling a global function with example usage: test_add_jumpstart_model_id_version_tags() without return types