class_docstr: Class that implements a cache for JumpStart models manifests and specs.
  
  The manifest and specs associated with JumpStart models provide the information necessary
  for launching JumpStart models from the SageMaker SDK.
docstr: Return s3 content given a file type and s3_key in ``JumpStartCachedS3ContentKey``.
  
  If a manifest file is being fetched, we only download the object if the md5 hash in
  ``head_object`` does not match the current md5 hash for the stored value. This prevents
  unnecessarily downloading the full manifest when it hasn't changed.
  
  Args:
      key (JumpStartCachedS3ContentKey): key for which to fetch s3 content.
      value (Optional[JumpStartVersionedModelId]): Current value of old cached
          s3 content. This is used for the manifest file, so that it is only
          downloaded when its content changes.
docstr_tok: ["Return","s3","content","given","a","file","type","and","s3_key","in","``","JumpStartCachedS3ContentKey","``",".","If","a","manifest","file","is","being","fetched",",","we","only","download","the","object","if","the","md5","hash","in","``","head_object","``","does","not","match","the","current","md5","hash","for","the","stored","value",".","This","prevents","unnecessarily","downloading","the","full","manifest","when","it","has","n't","changed",".","Args",":","key","(","JumpStartCachedS3ContentKey",")",":","key","for","which","to","fetch","s3","content",".","value","(","Optional","[","JumpStartVersionedModelId","]",")",":","Current","value","of","old","cached","s3","content",".","This","is","used","for","the","manifest","file",",","so","that","it","is","only","downloaded","when","its","content","changes","."]
code: def _retrieval_function(
      self,
      key: JumpStartCachedS3ContentKey,
      value: Optional[JumpStartCachedS3ContentValue],
  ) -> JumpStartCachedS3ContentValue:
      """Return s3 content given a file type and s3_key in ``JumpStartCachedS3ContentKey``.
  
      If a manifest file is being fetched, we only download the object if the md5 hash in
      ``head_object`` does not match the current md5 hash for the stored value. This prevents
      unnecessarily downloading the full manifest when it hasn't changed.
  
      Args:
          key (JumpStartCachedS3ContentKey): key for which to fetch s3 content.
          value (Optional[JumpStartVersionedModelId]): Current value of old cached
              s3 content. This is used for the manifest file, so that it is only
              downloaded when its content changes.
      """
  
      file_type, s3_key = key.file_type, key.s3_key
  
      if file_type == JumpStartS3FileType.MANIFEST:
          if value is not None and not self._is_local_metadata_mode():
              etag = self._get_json_md5_hash(s3_key)
              if etag == value.md5_hash:
                  return value
          formatted_body, etag = self._get_json_file(s3_key, file_type)
          return JumpStartCachedS3ContentValue(
              formatted_content=utils.get_formatted_manifest(
                  formatted_body
              ),
              md5_hash=etag,
          )
      if file_type == JumpStartS3FileType.SPECS:
          formatted_body, _ = self._get_json_file(s3_key, file_type)
          model_specs = JumpStartModelSpecs(formatted_body)
          utils.emit_logs_based_on_model_specs(
              model_specs, self.get_region(), self._s3_client
          )
          return JumpStartCachedS3ContentValue(
              formatted_content=model_specs
          )
      raise ValueError(
          f"Bad value for key '{key}': must be in {[JumpStartS3FileType.MANIFEST, JumpStartS3FileType.SPECS]}"
      )
  
imports: from __future__ import absolute_import
  import datetime
  from difflib import get_close_matches
  import os
  from typing import List, Optional, Tuple, Union
  import json
  import boto3
  import botocore
  from packaging.version import Version
  from packaging.specifiers import SpecifierSet, InvalidSpecifier
  from sagemaker.jumpstart.constants import ENV_VARIABLE_JUMPSTART_MANIFEST_LOCAL_ROOT_DIR_OVERRIDE, ENV_VARIABLE_JUMPSTART_SPECS_LOCAL_ROOT_DIR_OVERRIDE, JUMPSTART_DEFAULT_MANIFEST_FILE_S3_KEY, JUMPSTART_DEFAULT_REGION_NAME, JUMPSTART_LOGGER, MODEL_ID_LIST_WEB_URL
  from sagemaker.jumpstart.exceptions import get_wildcard_model_version_msg
  from sagemaker.jumpstart.parameters import JUMPSTART_DEFAULT_MAX_S3_CACHE_ITEMS, JUMPSTART_DEFAULT_MAX_SEMANTIC_VERSION_CACHE_ITEMS, JUMPSTART_DEFAULT_S3_CACHE_EXPIRATION_HORIZON, JUMPSTART_DEFAULT_SEMANTIC_VERSION_CACHE_EXPIRATION_HORIZON
  from sagemaker.jumpstart.types import JumpStartCachedS3ContentKey, JumpStartCachedS3ContentValue, JumpStartModelHeader, JumpStartModelSpecs, JumpStartS3FileType, JumpStartVersionedModelId
  from sagemaker.jumpstart import utils
  from sagemaker.utilities.cache import LRUCache
label_desc: Use image node_id 14 for calling the JumpStartModelsCache obj's underlying member method code with example usage: obj._retrieval_function(key, value) and returns: JumpStartCachedS3ContentValue, JumpStartCachedS3ContentValue, value