code: def test_download_file_in_parallel_when_necessary(
      s3_artifact_root, file_size, is_parallel_download
  ):
      repo = OptimizedS3ArtifactRepository(
          posixpath.join(s3_artifact_root, "some/path")
      )
      remote_file_path = "file_1.txt"
      list_artifacts_result = (
          [
              FileInfo(
                  path=remote_file_path,
                  is_dir=False,
                  file_size=file_size,
              )
          ]
          if file_size
          else []
      )
      with mock.patch(
          f"{S3_ARTIFACT_REPOSITORY}.list_artifacts",
          return_value=list_artifacts_result,
      ), mock.patch(
          f"{S3_ARTIFACT_REPOSITORY}._download_from_cloud",
          return_value=None,
      ) as download_mock, mock.patch(
          f"{S3_ARTIFACT_REPOSITORY}._parallelized_download_from_cloud",
          return_value=None,
      ) as parallel_download_mock:
          repo.download_artifacts("")
          if is_parallel_download:
              parallel_download_mock.assert_called_with(
                  file_size, remote_file_path, ANY
              )
          else:
              download_mock.assert_called()
  
file_path: mlflow/tests/store/artifact/test_optimized_s3_artifact_repo.py
imports: import os
  import posixpath
  from datetime import datetime
  from unittest import mock
  from unittest.mock import ANY
  import pytest
  from mlflow.protos.service_pb2 import FileInfo
  from mlflow.store.artifact.optimized_s3_artifact_repo import OptimizedS3ArtifactRepository
  from mlflow.store.artifact.s3_artifact_repo import _MAX_CACHE_SECONDS, _cached_get_s3_client
  from tests.helper_functions import set_boto_credentials
label_desc: Use image node_id 9 for calling a global function with example usage: test_download_file_in_parallel_when_necessary(s3_artifact_root, file_size, is_parallel_download) without return types