code: def test_uploaded_artifacts_are_unstaged(
      wandb_init, tmp_path, monkeypatch
  ):
      # Use a separate staging directory for the duration of this test.
      monkeypatch.setenv("WANDB_DATA_DIR", str(tmp_path))
      staging_dir = Path(get_staging_dir())
  
      def dir_size():
          return sum(
              f.stat().st_size
              for f in staging_dir.rglob("*")
              if f.is_file()
          )
  
      artifact = wandb.Artifact(name="stage-test", type="dataset")
      with open("random.bin", "wb") as f:
          f.write(np.random.bytes(4096))
      artifact.add_file("random.bin")
  
      # The file is staged until it's finalized.
      assert dir_size() == 4096
  
      with wandb_init() as run:
          run.log_artifact(artifact)
  
      # The staging directory should be empty again.
      assert dir_size() == 0
  
imports: import os
  import platform
  import shutil
  import time
  from datetime import datetime, timedelta, timezone
  from pathlib import Path
  from typing import Callable, Optional
  import numpy
  import pytest
  import wandb
  from wandb import Api
  from wandb.sdk.artifacts.artifact import Artifact
  from wandb.sdk.artifacts.exceptions import ArtifactFinalizedError, WaitTimeoutError
  from wandb.sdk.artifacts.staging import get_staging_dir
  from wandb.sdk.wandb_run import Run
label_desc: Use image node_id 11 for calling a global function with example usage: test_uploaded_artifacts_are_unstaged(wandb_init, tmp_path, monkeypatch) and returns: sum