code: def test_download_artifacts_handles_empty_dir(
      base_uri, download_arg, list_return_val
  ):
      def list_artifacts(path):
          if path.endswith(_MODEL_DIR):
              return [
                  FileInfo(
                      item, item.endswith(_EMPTY_DIR), _DUMMY_FILE_SIZE
                  )
                  for item in list_return_val
              ]
          elif path.endswith(_PARENT_DIR) or path.endswith(
              _PARENT_DIR + "/"
          ):
              return [
                  FileInfo(_PARENT_MODEL_DIR, True, _EMPTY_FILE_SIZE)
              ]
          else:
              return []
  
      with mock.patch.object(
          ArtifactRepositoryImpl, "list_artifacts"
      ) as list_artifacts_mock:
          list_artifacts_mock.side_effect = list_artifacts
          repo = ArtifactRepositoryImpl(base_uri)
          with TempDir() as tmp:
              repo.download_artifacts(download_arg, dst_path=tmp.path())
  
imports: import posixpath
  import time
  from unittest import mock
  import pytest
  from mlflow.entities import FileInfo
  from mlflow.exceptions import MlflowException
  from mlflow.store.artifact.artifact_repo import ArtifactRepository
  from mlflow.utils.file_utils import TempDir
label_desc: Use image node_id 5 for calling a global function with example usage: test_download_artifacts_handles_empty_dir(base_uri, download_arg, list_return_val) and returns: unknown, list, list