code: def test_databricks_download_file_in_parallel_when_necessary(
      databricks_artifact_repo, file_size, is_parallel_download
  ):
      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"{DATABRICKS_ARTIFACT_REPOSITORY}.list_artifacts",
          return_value=list_artifacts_result,
      ), mock.patch(
          f"{DATABRICKS_ARTIFACT_REPOSITORY}._download_from_cloud",
          return_value=None,
      ) as download_mock, mock.patch(
          f"{DATABRICKS_ARTIFACT_REPOSITORY}._parallelized_download_from_cloud",
          return_value=None,
      ) as parallel_download_mock:
          databricks_artifact_repo.download_artifacts("")
          if is_parallel_download:
              parallel_download_mock.assert_called_with(
                  file_size, remote_file_path, ANY
              )
          else:
              download_mock.assert_called()
  
imports: import json
  import os
  import posixpath
  import re
  import shutil
  import time
  from unittest import mock
  from unittest.mock import ANY
  import pytest
  from requests.models import Response
  from mlflow.entities.file_info import FileInfo
  from mlflow.exceptions import MlflowException
  from mlflow.protos.databricks_artifacts_pb2 import ArtifactCredentialInfo, ArtifactCredentialType, CompleteMultipartUpload, CreateMultipartUpload, GetCredentialsForRead, GetCredentialsForWrite, GetPresignedUploadPartUrl
  from mlflow.protos.service_pb2 import FileInfo, ListArtifacts
  from mlflow.store.artifact.artifact_repository_registry import get_artifact_repository
  from mlflow.store.artifact.databricks_artifact_repo import _MAX_CREDENTIALS_REQUEST_SIZE, DatabricksArtifactRepository
label_desc: Use image node_id 30 for calling a global function with example usage: test_databricks_download_file_in_parallel_when_necessary(databricks_artifact_repo, file_size, is_parallel_download) without return types