code: def test_download_artifacts(artifacts_server, tmp_path):
      url = artifacts_server.url
      mlflow.set_tracking_uri(url)
  
      tmp_path_a = tmp_path.joinpath("a.txt")
      tmp_path_a.write_text("0")
      tmp_path_b = tmp_path.joinpath("b.txt")
      tmp_path_b.write_text("1")
      with mlflow.start_run() as run:
          mlflow.log_artifact(tmp_path_a)
          mlflow.log_artifact(tmp_path_b, "dir")
  
      dest_path = download_artifacts(
          run_id=run.info.run_id, artifact_path=""
      )
      assert sorted(os.listdir(dest_path)) == ["a.txt", "dir"]
      assert read_file(os.path.join(dest_path, "a.txt")) == "0"
      dest_path = download_artifacts(
          run_id=run.info.run_id, artifact_path="dir"
      )
      assert os.listdir(dest_path) == ["b.txt"]
      assert read_file(os.path.join(dest_path, "b.txt")) == "1"
  
imports: import cgi
  import os
  import pathlib
  import subprocess
  import tempfile
  from collections import namedtuple
  import pytest
  import requests
  import mlflow
  from mlflow import MlflowClient
  from mlflow.artifacts import download_artifacts
  from tests.helper_functions import LOCALHOST, get_safe_port
  from tests.tracking.integration_test_utils import _await_server_up_or_die
label_desc: Use image node_id 11 for calling a global function with example usage: test_download_artifacts(artifacts_server, tmp_path) without return types