code: def add_jumpstart_uri_tags(
      tags: Optional[List[TagsDict]] = None,
      inference_model_uri: Optional[Union[str, dict]] = None,
      inference_script_uri: Optional[str] = None,
      training_model_uri: Optional[str] = None,
      training_script_uri: Optional[str] = None,
  ) -> Optional[List[TagsDict]]:
      """Add custom uri tags to JumpStart models, return the updated tags.
  
      No-op if this is not a JumpStart model related resource.
  
      Args:
          tags (Optional[List[Dict[str,str]]): Current tags for JumpStart inference
              or training job. (Default: None).
          inference_model_uri (Optional[Union[dict, str]]): S3 URI for inference model artifact.
              (Default: None).
          inference_script_uri (Optional[str]): S3 URI for inference script tarball.
              (Default: None).
          training_model_uri (Optional[str]): S3 URI for training model artifact.
              (Default: None).
          training_script_uri (Optional[str]): S3 URI for training script tarball.
              (Default: None).
      """
      warn_msg = (
          "The URI (%s) is a pipeline variable which is only interpreted at execution time. "
          "As a result, the JumpStart resources will not be tagged."
      )
  
      if isinstance(inference_model_uri, dict):
          inference_model_uri = inference_model_uri.get(
              "S3DataSource", {}
          ).get("S3Uri", None)
  
      if inference_model_uri:
          if is_pipeline_variable(inference_model_uri):
              logging.warning(warn_msg, "inference_model_uri")
          else:
              tags = add_single_jumpstart_tag(
                  inference_model_uri,
                  enums.JumpStartTag.INFERENCE_MODEL_URI,
                  tags,
                  is_uri=True,
              )
  
      if inference_script_uri:
          if is_pipeline_variable(inference_script_uri):
              logging.warning(warn_msg, "inference_script_uri")
          else:
              tags = add_single_jumpstart_tag(
                  inference_script_uri,
                  enums.JumpStartTag.INFERENCE_SCRIPT_URI,
                  tags,
                  is_uri=True,
              )
  
      if training_model_uri:
          if is_pipeline_variable(training_model_uri):
              logging.warning(warn_msg, "training_model_uri")
          else:
              tags = add_single_jumpstart_tag(
                  training_model_uri,
                  enums.JumpStartTag.TRAINING_MODEL_URI,
                  tags,
                  is_uri=True,
              )
  
      if training_script_uri:
          if is_pipeline_variable(training_script_uri):
              logging.warning(warn_msg, "training_script_uri")
          else:
              tags = add_single_jumpstart_tag(
                  training_script_uri,
                  enums.JumpStartTag.TRAINING_SCRIPT_URI,
                  tags,
                  is_uri=True,
              )
  
      return tags
  
imports: from __future__ import absolute_import
  import logging
  import os
  from typing import Any, Dict, List, Optional, Union
  from urllib.parse import urlparse
  import boto3
  from packaging.version import Version
  import sagemaker
  from sagemaker.config.config_schema import MODEL_ENABLE_NETWORK_ISOLATION_PATH, MODEL_EXECUTION_ROLE_ARN_PATH, TRAINING_JOB_ENABLE_NETWORK_ISOLATION_PATH, TRAINING_JOB_INTER_CONTAINER_ENCRYPTION_PATH, TRAINING_JOB_ROLE_ARN_PATH
  from sagemaker.jumpstart import constants, enums
  from sagemaker.jumpstart import accessors
  from sagemaker.s3 import parse_s3_url
  from sagemaker.jumpstart.exceptions import DeprecatedJumpStartModelError, VulnerableJumpStartModelError, get_old_model_version_msg
  from sagemaker.jumpstart.types import JumpStartModelHeader, JumpStartModelSpecs, JumpStartVersionedModelId
  from sagemaker.session import Session
  from sagemaker.config import load_sagemaker_config
  from sagemaker.utils import resolve_value_from_config, TagsDict
  from sagemaker.workflow import is_pipeline_variable
label_desc: Use image node_id 14 for calling a global function with example usage: add_jumpstart_uri_tags(tags, inference_model_uri, inference_script_uri, training_model_uri, training_script_uri) and returns: tags