code: def test_get_s3_client_hits_cache(s3_artifact_root, monkeypatch):
      # pylint: disable=no-value-for-parameter
      repo = get_artifact_repository(
          posixpath.join(s3_artifact_root, "some/path")
      )
      repo._get_s3_client()
      cache_info = _cached_get_s3_client.cache_info()
      assert cache_info.hits == 0
      assert cache_info.misses == 1
      assert cache_info.currsize == 1
  
      repo._get_s3_client()
      cache_info = _cached_get_s3_client.cache_info()
      assert cache_info.hits == 1
      assert cache_info.misses == 1
      assert cache_info.currsize == 1
  
      monkeypatch.setenv(
          "MLFLOW_EXPERIMENTAL_S3_SIGNATURE_VERSION", "s3v2"
      )
      repo._get_s3_client()
      cache_info = _cached_get_s3_client.cache_info()
      assert cache_info.hits == 1
      assert cache_info.misses == 2
      assert cache_info.currsize == 2
  
      with mock.patch(
          "mlflow.store.artifact.s3_artifact_repo._get_utcnow_timestamp",
          return_value=datetime.utcnow().timestamp()
          + _MAX_CACHE_SECONDS,
      ):
          repo._get_s3_client()
      cache_info = _cached_get_s3_client.cache_info()
      assert cache_info.hits == 1
      assert cache_info.misses == 3
      assert cache_info.currsize == 3
  
imports: import json
  import os
  import posixpath
  import tarfile
  from datetime import datetime
  from unittest import mock
  from unittest.mock import ANY
  import botocore.exceptions
  import pytest
  import requests
  from mlflow.entities.multipart_upload import MultipartUploadPart
  from mlflow.store.artifact.artifact_repository_registry import get_artifact_repository
  from mlflow.store.artifact.optimized_s3_artifact_repo import OptimizedS3ArtifactRepository
  from mlflow.store.artifact.s3_artifact_repo import _MAX_CACHE_SECONDS, S3ArtifactRepository, _cached_get_s3_client
  from tests.helper_functions import set_boto_credentials
label_desc: Use image node_id 7 for calling a global function with example usage: test_get_s3_client_hits_cache(s3_artifact_root, monkeypatch) without return types