code: def artifacts_server():
      with tempfile.TemporaryDirectory() as tmpdir:
          port = get_safe_port()
          backend_store_uri = (
              f'sqlite:///{os.path.join(tmpdir, "mlruns.db")}'
          )
          artifacts_destination = os.path.join(tmpdir, "mlartifacts")
          url = f"http://{LOCALHOST}:{port}"
          default_artifact_root = (
              f"{url}/api/2.0/mlflow-artifacts/artifacts"
          )
          process = _launch_server(
              LOCALHOST,
              port,
              backend_store_uri,
              default_artifact_root,
              (
                  "file:///" + artifacts_destination
                  if is_windows()
                  else artifacts_destination
              ),
          )
          yield ArtifactsServer(
              backend_store_uri,
              default_artifact_root,
              artifacts_destination,
              url,
              process,
          )
          process.kill()
  
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 3 for calling a global function with example usage: artifacts_server() without return types