code: def test_file_and_directories_artifacts_are_logged_and_downloaded_successfully_in_batch(
      s3_artifact_repo, tmp_path
  ):
      subdir = tmp_path / "subdir"
      subdir.mkdir()
      subdir_path = str(subdir)
      nested_path = os.path.join(subdir_path, "nested")
      os.makedirs(nested_path)
      with open(os.path.join(subdir_path, "a.txt"), "w") as f:
          f.write("A")
      with open(os.path.join(subdir_path, "b.txt"), "w") as f:
          f.write("B")
      with open(os.path.join(nested_path, "c.txt"), "w") as f:
          f.write("C")
  
      s3_artifact_repo.log_artifacts(subdir_path)
  
      # Download individual files and verify correctness of their contents
      with open(s3_artifact_repo.download_artifacts("a.txt")) as f:
          assert f.read() == "A"
      with open(s3_artifact_repo.download_artifacts("b.txt")) as f:
          assert f.read() == "B"
      with open(
          s3_artifact_repo.download_artifacts("nested/c.txt")
      ) as f:
          assert f.read() == "C"
  
      # Download the nested directory and verify correctness of its contents
      downloaded_dir = s3_artifact_repo.download_artifacts("nested")
      assert os.path.basename(downloaded_dir) == "nested"
      with open(os.path.join(downloaded_dir, "c.txt")) as f:
          assert f.read() == "C"
  
      # Download the root directory and verify correctness of its contents
      downloaded_dir = s3_artifact_repo.download_artifacts("")
      dir_contents = os.listdir(downloaded_dir)
      assert "nested" in dir_contents
      assert os.path.isdir(os.path.join(downloaded_dir, "nested"))
      assert "a.txt" in dir_contents
      assert "b.txt" in dir_contents
  
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 12 for calling a global function with example usage: test_file_and_directories_artifacts_are_logged_and_downloaded_successfully_in_batch(s3_artifact_repo, tmp_path) without return types