code: def test_mime_type_for_download_artifacts_api(
      artifacts_server, tmp_path, filename, expected_mime_type
  ):
      default_artifact_root = artifacts_server.default_artifact_root
      url = artifacts_server.url
      test_file = tmp_path.joinpath(filename)
      test_file.touch()
      upload_file(test_file, f"{default_artifact_root}/dir/{filename}")
      download_response = download_file(
          f"{default_artifact_root}/dir/{filename}", test_file
      )
  
      _, params = cgi.parse_header(
          download_response.headers["Content-Disposition"]
      )
      assert params["filename"] == filename
      assert (
          download_response.headers["Content-Type"]
          == expected_mime_type
      )
  
      mlflow.set_tracking_uri(url)
      with mlflow.start_run() as run:
          mlflow.log_artifact(test_file)
      artifact_response = requests.get(
          url=f"{url}/get-artifact",
          params={"run_id": run.info.run_id, "path": filename},
      )
      artifact_response.raise_for_status()
      _, params = cgi.parse_header(
          artifact_response.headers["Content-Disposition"]
      )
      assert params["filename"] == filename
      assert (
          artifact_response.headers["Content-Type"]
          == expected_mime_type
      )
      assert (
          artifact_response.headers["X-Content-Type-Options"]
          == "nosniff"
      )
  
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 17 for calling a global function with example usage: test_mime_type_for_download_artifacts_api(artifacts_server, tmp_path, filename, expected_mime_type) without return types