code: def test_jumpstart_cache_makes_correct_s3_calls(
      mock_boto3_client, mock_emit_logs_based_on_model_specs
  ):
      # test get_header
      mock_manifest_json = json.dumps(
          [
              {
                  "model_id": "pytorch-ic-imagenet-inception-v3-classification-4",
                  "version": "2.0.0",
                  "min_version": "2.49.0",
                  "spec_key": "community_models_specs/pytorch-ic-"
                  "imagenet-inception-v3-classification-4/specs_v2.0.0.json",
              }
          ]
      )
      mock_boto3_client.return_value.get_object.return_value = {
          "Body": botocore.response.StreamingBody(
              io.BytesIO(bytes(mock_manifest_json, "utf-8")),
              content_length=len(mock_manifest_json),
          ),
          "ETag": "etag",
      }
  
      mock_boto3_client.return_value.head_object.return_value = {
          "ETag": "some-hash"
      }
  
      bucket_name = get_jumpstart_content_bucket("us-west-2")
      client_config = botocore.config.Config(
          signature_version="my_signature_version"
      )
      cache = JumpStartModelsCache(
          s3_bucket_name=bucket_name,
          s3_client_config=client_config,
          region="us-west-2",
      )
      cache.get_header(
          model_id="pytorch-ic-imagenet-inception-v3-classification-4",
          semantic_version_str="*",
      )
  
      mock_boto3_client.return_value.get_object.assert_called_with(
          Bucket=bucket_name, Key=JUMPSTART_DEFAULT_MANIFEST_FILE_S3_KEY
      )
      mock_boto3_client.return_value.head_object.assert_not_called()
  
      mock_boto3_client.assert_called_with(
          "s3", region_name="us-west-2", config=client_config
      )
  
      # test get_specs. manifest already in cache, so only s3 call will be to get specs.
      mock_json = json.dumps(BASE_SPEC)
  
      mock_boto3_client.return_value.reset_mock()
  
      mock_boto3_client.return_value.get_object.return_value = {
          "Body": botocore.response.StreamingBody(
              io.BytesIO(bytes(mock_json, "utf-8")),
              content_length=len(mock_json),
          ),
          "ETag": "etag",
      }
  
      with patch("logging.Logger.warning") as mocked_warning_log:
          cache.get_specs(
              model_id="pytorch-ic-imagenet-inception-v3-classification-4",
              semantic_version_str="*",
          )
          mocked_warning_log.assert_called_once_with(
              "Using model 'pytorch-ic-imagenet-inception-v3-classification-4' with wildcard "
              "version identifier '*'. You can pin to version '2.0.0' for more "
              "stable results. Note that models may have different input/output "
              "signatures after a major version upgrade."
          )
          mocked_warning_log.reset_mock()
          cache.get_specs(
              model_id="pytorch-ic-imagenet-inception-v3-classification-4",
              semantic_version_str="*",
          )
          mocked_warning_log.assert_not_called()
  
      mock_boto3_client.return_value.get_object.assert_called_with(
          Bucket=bucket_name,
          Key="community_models_specs/pytorch-ic-imagenet-"
          "inception-v3-classification-4/specs_v2.0.0.json",
      )
      mock_boto3_client.return_value.head_object.assert_not_called()
  
imports: from __future__ import absolute_import
  import copy
  import datetime
  import io
  import json
  from unittest.mock import Mock, call, mock_open
  from botocore.stub import Stubber
  import botocore
  from mock.mock import MagicMock
  import pytest
  from mock import patch
  from sagemaker.jumpstart.cache import JUMPSTART_DEFAULT_MANIFEST_FILE_S3_KEY, JumpStartModelsCache
  from sagemaker.jumpstart.constants import ENV_VARIABLE_JUMPSTART_MANIFEST_LOCAL_ROOT_DIR_OVERRIDE, ENV_VARIABLE_JUMPSTART_SPECS_LOCAL_ROOT_DIR_OVERRIDE
  from sagemaker.jumpstart.types import JumpStartModelHeader, JumpStartModelSpecs, JumpStartVersionedModelId
  from tests.unit.sagemaker.jumpstart.utils import get_spec_from_base_spec, patched_retrieval_function
  from tests.unit.sagemaker.jumpstart.constants import BASE_MANIFEST, BASE_SPEC
  from sagemaker.jumpstart.utils import get_jumpstart_content_bucket
label_desc: Use image node_id 7 for calling a global function with example usage: test_jumpstart_cache_makes_correct_s3_calls(mock_boto3_client, mock_emit_logs_based_on_model_specs) without return types