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: Lower-level function to return header.
  
  Allows a single retry if the cache is old.
  
  Args:
      model_id (str): model ID for which to get a header.
      semantic_version_str (str): The semantic version for which to get a
          header.
      attempt (int): attempt number at retrieving a header.
docstr_tok: ["Lower-level","function","to","return","header",".","Allows","a","single","retry","if","the","cache","is","old",".","Args",":","model_id","(","str",")",":","model","ID","for","which","to","get","a","header",".","semantic_version_str","(","str",")",":","The","semantic","version","for","which","to","get","a","header",".","attempt","(","int",")",":","attempt","number","at","retrieving","a","header","."]
code: def _get_header_impl(
      self,
      model_id: str,
      semantic_version_str: str,
      attempt: int = 0,
  ) -> JumpStartModelHeader:
      """Lower-level function to return header.
  
      Allows a single retry if the cache is old.
  
      Args:
          model_id (str): model ID for which to get a header.
          semantic_version_str (str): The semantic version for which to get a
              header.
          attempt (int): attempt number at retrieving a header.
      """
  
      versioned_model_id = (
          self._model_id_semantic_version_manifest_key_cache.get(
              JumpStartVersionedModelId(model_id, semantic_version_str)
          )[0]
      )
  
      manifest = self._s3_cache.get(
          JumpStartCachedS3ContentKey(
              JumpStartS3FileType.MANIFEST, self._manifest_file_s3_key
          )
      )[0].formatted_content
      try:
          header = manifest[versioned_model_id]  # type: ignore
          return header
      except KeyError:
          if attempt > 0:
              raise
          self.clear()
          return self._get_header_impl(
              model_id, semantic_version_str, attempt + 1
          )
  
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 18 for calling the JumpStartModelsCache obj's underlying member method code with example usage: obj._get_header_impl(model_id, semantic_version_str, attempt) and returns: header, self