code: def test_artifact_logging(databricks_artifact_repo, tmp_path):
      """
      Verifies that `log_artifact()` and `log_artifacts()` initiate all expected asynchronous
      artifact uploads and await their completion before returning results to the caller
      """
      src_dir = tmp_path.joinpath("src")
      src_dir.mkdir()
      src_file1_path = src_dir.joinpath("file_1.txt")
      src_file1_path.write_text("file1")
      src_file2_path = src_dir.joinpath("file_2.txt")
      src_file2_path.write_text("file2")
  
      dst_dir = tmp_path.joinpath("dst")
      dst_dir.mkdir()
  
      def mock_upload_to_cloud(
          cloud_credential_info,  # pylint: disable=unused-argument
          src_file_path,
          artifact_file_path,
      ):
          # Sleep in order to simulate a longer-running asynchronous upload
          time.sleep(2)
          dst_run_relative_artifact_path = dst_dir.joinpath(
              artifact_file_path
          )
          dst_run_relative_artifact_path.parent.mkdir(
              parents=True, exist_ok=True
          )
          shutil.copy2(
              src=src_file_path, dst=dst_run_relative_artifact_path
          )
  
      with mock.patch(
          f"{DATABRICKS_ARTIFACT_REPOSITORY}._get_write_credential_infos",
          return_value=[
              ArtifactCredentialInfo(
                  signed_uri=MOCK_AZURE_SIGNED_URI,
                  type=ArtifactCredentialType.AZURE_SAS_URI,
              ),
              ArtifactCredentialInfo(
                  signed_uri=MOCK_AZURE_SIGNED_URI,
                  type=ArtifactCredentialType.AZURE_SAS_URI,
              ),
          ],
      ), mock.patch(
          f"{DATABRICKS_ARTIFACT_REPOSITORY}._upload_to_cloud",
          side_effect=mock_upload_to_cloud,
      ):
          databricks_artifact_repo.log_artifacts(
              src_dir, "dir_artifact"
          )
  
          expected_dst_dir_file1_path = os.path.join(
              dst_dir, "dir_artifact", "file_1.txt"
          )
          expected_dst_dir_file2_path = os.path.join(
              dst_dir, "dir_artifact", "file_2.txt"
          )
          assert os.path.exists(expected_dst_dir_file1_path)
          assert os.path.exists(expected_dst_dir_file2_path)
          with open(expected_dst_dir_file1_path) as f:
              assert f.read() == "file1"
          with open(expected_dst_dir_file2_path) as f:
              assert f.read() == "file2"
  
          databricks_artifact_repo.log_artifact(src_file1_path)
  
          expected_dst_file_path = os.path.join(dst_dir, "file_1.txt")
          assert os.path.exists(expected_dst_file_path)
          with open(expected_dst_file_path) as f:
              assert f.read() == "file1"
  
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 33 for calling a global function with example usage: test_artifact_logging(databricks_artifact_repo, tmp_path) without return types