code: def upload_and_download(file_size, num_files):
      with tempfile.TemporaryDirectory() as tmpdir:
          tmpdir = pathlib.Path(tmpdir)
  
          # Prepare files
          src_dir = tmpdir / "src"
          src_dir.mkdir()
          files = {}
          with ThreadPoolExecutor() as pool:
              futures = []
              for i in range(num_files):
                  f = src_dir / str(i)
                  futures.append(
                      pool.submit(generate_random_file, f, file_size)
                  )
                  files[f.name] = f
  
              for fut in tqdm(
                  as_completed(futures),
                  total=len(futures),
                  desc="Generating files",
                  colour="#FFA500",
              ):
                  fut.result()
  
          # Upload
          with mlflow.start_run() as run:
              with Timer() as t_upload:
                  mlflow.log_artifacts(str(src_dir))
  
          # Download
          dst_dir = tmpdir / "dst"
          dst_dir.mkdir()
          with Timer() as t_download:
              mlflow.artifacts.download_artifacts(
                  artifact_uri=f"{run.info.artifact_uri}/",
                  dst_path=dst_dir,
              )
  
          # Verify checksums
          with ThreadPoolExecutor() as pool:
              futures = []
              for f in dst_dir.rglob("*"):
                  if f.is_dir():
                      continue
                  futures.append(
                      pool.submit(
                          assert_checksum_equal, f, files[f.name]
                      )
                  )
  
              for fut in tqdm(
                  as_completed(futures),
                  total=len(futures),
                  desc="Verifying checksums",
                  colour="#FFA500",
              ):
                  fut.result()
  
          return t_upload.elapsed, t_download.elapsed
  
file_path: mlflow/examples/databricks/multipart.py
imports: import hashlib
  import json
  import os
  import pathlib
  import tempfile
  from concurrent.futures import ThreadPoolExecutor, as_completed
  import pandas
  import psutil
  from tqdm.auto import tqdm
  import mlflow
  from mlflow.environment_variables import MLFLOW_ENABLE_MULTIPART_DOWNLOAD, MLFLOW_ENABLE_MULTIPART_UPLOAD
  from mlflow.utils.time import Timer
label_desc: Use image node_id 6 for calling a global function with example usage: upload_and_download(file_size, num_files) and returns: t_upload,  t_download