code: def test_add_jumpstart_uri_tags_inference():
      tags = None
      inference_model_uri = "dfsdfsd"
      inference_script_uri = "dfsdfs"
      assert (
          utils.add_jumpstart_uri_tags(
              tags=tags,
              inference_model_uri=inference_model_uri,
              inference_script_uri=inference_script_uri,
          )
          is None
      )
  
      tags = []
      inference_model_uri = "dfsdfsd"
      inference_script_uri = "dfsdfs"
      assert (
          utils.add_jumpstart_uri_tags(
              tags=tags,
              inference_model_uri=inference_model_uri,
              inference_script_uri=inference_script_uri,
          )
          == []
      )
  
      tags = [{"Key": "some", "Value": "tag"}]
      inference_model_uri = "dfsdfsd"
      inference_script_uri = "dfsdfs"
      assert utils.add_jumpstart_uri_tags(
          tags=tags,
          inference_model_uri=inference_model_uri,
          inference_script_uri=inference_script_uri,
      ) == [{"Key": "some", "Value": "tag"}]
  
      tags = None
      inference_model_uri = random_jumpstart_s3_uri("random_key")
      inference_script_uri = "dfsdfs"
      assert utils.add_jumpstart_uri_tags(
          tags=tags,
          inference_model_uri=inference_model_uri,
          inference_script_uri=inference_script_uri,
      ) == [
          {
              "Key": JumpStartTag.INFERENCE_MODEL_URI.value,
              "Value": inference_model_uri,
          }
      ]
  
      tags = []
      inference_model_uri = random_jumpstart_s3_uri("random_key")
      inference_script_uri = "dfsdfs"
      assert utils.add_jumpstart_uri_tags(
          tags=tags,
          inference_model_uri=inference_model_uri,
          inference_script_uri=inference_script_uri,
      ) == [
          {
              "Key": JumpStartTag.INFERENCE_MODEL_URI.value,
              "Value": inference_model_uri,
          }
      ]
  
      tags = []
      inference_model_uri = {
          "S3DataSource": {
              "S3Uri": random_jumpstart_s3_uri("random_key")
          }
      }
      inference_script_uri = "dfsdfs"
      assert utils.add_jumpstart_uri_tags(
          tags=tags,
          inference_model_uri=inference_model_uri,
          inference_script_uri=inference_script_uri,
      ) == [
          {
              "Key": JumpStartTag.INFERENCE_MODEL_URI.value,
              "Value": inference_model_uri["S3DataSource"]["S3Uri"],
          }
      ]
  
      tags = []
      inference_model_uri = {
          "S3DataSource": {
              "S3Uri": random_jumpstart_s3_uri("random_key/prefix/")
          }
      }
      inference_script_uri = "dfsdfs"
      assert utils.add_jumpstart_uri_tags(
          tags=tags,
          inference_model_uri=inference_model_uri,
          inference_script_uri=inference_script_uri,
      ) == [
          {
              "Key": JumpStartTag.INFERENCE_MODEL_URI.value,
              "Value": inference_model_uri["S3DataSource"]["S3Uri"],
          }
      ]
  
      tags = [{"Key": "some", "Value": "tag"}]
      inference_model_uri = random_jumpstart_s3_uri("random_key")
      inference_script_uri = "dfsdfs"
      assert utils.add_jumpstart_uri_tags(
          tags=tags,
          inference_model_uri=inference_model_uri,
          inference_script_uri=inference_script_uri,
      ) == [
          {"Key": "some", "Value": "tag"},
          {
              "Key": JumpStartTag.INFERENCE_MODEL_URI.value,
              "Value": inference_model_uri,
          },
      ]
  
      tags = None
      inference_script_uri = random_jumpstart_s3_uri("random_key")
      inference_model_uri = "dfsdfs"
      assert utils.add_jumpstart_uri_tags(
          tags=tags,
          inference_model_uri=inference_model_uri,
          inference_script_uri=inference_script_uri,
      ) == [
          {
              "Key": JumpStartTag.INFERENCE_SCRIPT_URI.value,
              "Value": inference_script_uri,
          }
      ]
  
      tags = []
      inference_script_uri = random_jumpstart_s3_uri("random_key")
      inference_model_uri = "dfsdfs"
      assert utils.add_jumpstart_uri_tags(
          tags=tags,
          inference_model_uri=inference_model_uri,
          inference_script_uri=inference_script_uri,
      ) == [
          {
              "Key": JumpStartTag.INFERENCE_SCRIPT_URI.value,
              "Value": inference_script_uri,
          }
      ]
  
      tags = [{"Key": "some", "Value": "tag"}]
      inference_script_uri = random_jumpstart_s3_uri("random_key")
      inference_model_uri = "dfsdfs"
      assert utils.add_jumpstart_uri_tags(
          tags=tags,
          inference_model_uri=inference_model_uri,
          inference_script_uri=inference_script_uri,
      ) == [
          {"Key": "some", "Value": "tag"},
          {
              "Key": JumpStartTag.INFERENCE_SCRIPT_URI.value,
              "Value": inference_script_uri,
          },
      ]
  
      tags = None
      inference_script_uri = random_jumpstart_s3_uri("random_key")
      inference_model_uri = random_jumpstart_s3_uri("random_key")
      assert utils.add_jumpstart_uri_tags(
          tags=tags,
          inference_model_uri=inference_model_uri,
          inference_script_uri=inference_script_uri,
      ) == [
          {
              "Key": JumpStartTag.INFERENCE_MODEL_URI.value,
              "Value": inference_model_uri,
          },
          {
              "Key": JumpStartTag.INFERENCE_SCRIPT_URI.value,
              "Value": inference_script_uri,
          },
      ]
  
      tags = []
      inference_script_uri = random_jumpstart_s3_uri("random_key")
      inference_model_uri = random_jumpstart_s3_uri("random_key")
      assert utils.add_jumpstart_uri_tags(
          tags=tags,
          inference_model_uri=inference_model_uri,
          inference_script_uri=inference_script_uri,
      ) == [
          {
              "Key": JumpStartTag.INFERENCE_MODEL_URI.value,
              "Value": inference_model_uri,
          },
          {
              "Key": JumpStartTag.INFERENCE_SCRIPT_URI.value,
              "Value": inference_script_uri,
          },
      ]
  
      tags = [{"Key": "some", "Value": "tag"}]
      inference_script_uri = random_jumpstart_s3_uri("random_key")
      inference_model_uri = random_jumpstart_s3_uri("random_key")
      assert utils.add_jumpstart_uri_tags(
          tags=tags,
          inference_model_uri=inference_model_uri,
          inference_script_uri=inference_script_uri,
      ) == [
          {"Key": "some", "Value": "tag"},
          {
              "Key": JumpStartTag.INFERENCE_MODEL_URI.value,
              "Value": inference_model_uri,
          },
          {
              "Key": JumpStartTag.INFERENCE_SCRIPT_URI.value,
              "Value": inference_script_uri,
          },
      ]
  
      tags = [
          {
              "Key": JumpStartTag.INFERENCE_MODEL_URI.value,
              "Value": "garbage-value",
          }
      ]
      inference_script_uri = random_jumpstart_s3_uri("random_key")
      inference_model_uri = random_jumpstart_s3_uri("random_key")
      assert utils.add_jumpstart_uri_tags(
          tags=tags,
          inference_model_uri=inference_model_uri,
          inference_script_uri=inference_script_uri,
      ) == [
          {
              "Key": JumpStartTag.INFERENCE_MODEL_URI.value,
              "Value": "garbage-value",
          },
          {
              "Key": JumpStartTag.INFERENCE_SCRIPT_URI.value,
              "Value": inference_script_uri,
          },
      ]
  
      tags = [
          {
              "Key": JumpStartTag.INFERENCE_SCRIPT_URI.value,
              "Value": "garbage-value",
          }
      ]
      inference_script_uri = random_jumpstart_s3_uri("random_key")
      inference_model_uri = random_jumpstart_s3_uri("random_key")
      assert utils.add_jumpstart_uri_tags(
          tags=tags,
          inference_model_uri=inference_model_uri,
          inference_script_uri=inference_script_uri,
      ) == [
          {
              "Key": JumpStartTag.INFERENCE_SCRIPT_URI.value,
              "Value": "garbage-value",
          },
          {
              "Key": JumpStartTag.INFERENCE_MODEL_URI.value,
              "Value": inference_model_uri,
          },
      ]
  
      tags = [
          {
              "Key": JumpStartTag.INFERENCE_SCRIPT_URI.value,
              "Value": "garbage-value",
          },
          {
              "Key": JumpStartTag.INFERENCE_MODEL_URI.value,
              "Value": "garbage-value-2",
          },
      ]
      inference_script_uri = random_jumpstart_s3_uri("random_key")
      inference_model_uri = random_jumpstart_s3_uri("random_key")
      assert utils.add_jumpstart_uri_tags(
          tags=tags,
          inference_model_uri=inference_model_uri,
          inference_script_uri=inference_script_uri,
      ) == [
          {
              "Key": JumpStartTag.INFERENCE_SCRIPT_URI.value,
              "Value": "garbage-value",
          },
          {
              "Key": JumpStartTag.INFERENCE_MODEL_URI.value,
              "Value": "garbage-value-2",
          },
      ]
  
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 14 for calling a global function with example usage: test_add_jumpstart_uri_tags_inference() without return types