code: def get_tag_value(
      tag_key: str, tag_array: List[Dict[str, str]]
  ) -> str:
      """Return the value of a tag whose key matches the given ``tag_key``.
  
      Args:
          tag_key (str): AWS tag for which to search.
          tag_array (List[Dict[str, str]]): List of AWS tags, each formatted as dicts.
  
      Raises:
          KeyError: If the number of matches for the ``tag_key`` is not equal to 1.
      """
      tag_values = [
          tag["Value"] for tag in tag_array if tag_key == tag["Key"]
      ]
      if len(tag_values) != 1:
          raise KeyError(
              f"Cannot get value of tag for tag key '{tag_key}' -- found {len(tag_values)} "
              f"number of matches in the tag list."
          )
  
      return tag_values[0]
  
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 10 for calling a global function with example usage: get_tag_value(tag_key, tag_array) and returns: tag_values