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: Perform semantic version search on available versions.
  
  Args:
      semantic_version_str (str): the semantic version for which to filter
          available versions.
      available_versions (List[Version]): list of available versions.
docstr_tok: ["Perform","semantic","version","search","on","available","versions",".","Args",":","semantic_version_str","(","str",")",":","the","semantic","version","for","which","to","filter","available","versions",".","available_versions","(","List","[","Version","]",")",":","list","of","available","versions","."]
code: def _select_version(
      self,
      semantic_version_str: str,
      available_versions: List[Version],
  ) -> Optional[str]:
      """Perform semantic version search on available versions.
  
      Args:
          semantic_version_str (str): the semantic version for which to filter
              available versions.
          available_versions (List[Version]): list of available versions.
      """
      if semantic_version_str == "*":
          if len(available_versions) == 0:
              return None
          return str(max(available_versions))
  
      try:
          spec = SpecifierSet(f"=={semantic_version_str}")
      except InvalidSpecifier:
          raise KeyError(
              f"Bad semantic version: {semantic_version_str}"
          )
      available_versions_filtered = list(
          spec.filter(available_versions)
      )
      return (
          str(max(available_versions_filtered))
          if available_versions_filtered != []
          else None
      )
  
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 17 for calling the JumpStartModelsCache obj's underlying member method code with example usage: obj._select_version(semantic_version_str, available_versions) and returns: unknown, str, None