code: def assert_media_obj_referential_equality(obj):
      with wandb.init() as run:
          orig_artifact = wandb.Artifact("orig_artifact", "database")
          orig_artifact.add(obj, "obj")
          run.log_artifact(orig_artifact)
  
      _cleanup()
      with wandb.init() as run:
          orig_artifact_ref = run.use_artifact("orig_artifact:latest")
          orig_dir = orig_artifact_ref._default_root()
          obj1 = orig_artifact_ref.get("obj")
  
      if hasattr(obj, "_eq_debug"):
          obj._eq_debug(obj1, True)
  
      assert obj1 == obj
  
      target_path = os.path.join(
          orig_dir, "obj." + type(obj)._log_type + ".json"
      )
      assert os.path.isfile(target_path)
  
      with wandb.init() as run:
          orig_artifact_ref = run.use_artifact("orig_artifact:latest")
          mid_artifact = wandb.Artifact("mid_artifact", "database")
          mid_obj = orig_artifact_ref.get("obj")
          mid_artifact.add(mid_obj, "obj2")
          run.log_artifact(mid_artifact)
  
      _cleanup()
      with wandb.init() as run:
          mid_artifact_ref = run.use_artifact("mid_artifact:latest")
          mid_dir = mid_artifact_ref._default_root()
          obj2 = mid_artifact_ref.get("obj2")
  
      if hasattr(obj, "_eq_debug"):
          obj._eq_debug(obj2, True)
  
      assert obj2 == obj
      # name = "obj2." + type(obj)._log_type + ".json"
      # start_path = os.path.join(mid_dir, name)
      # mid_artifact_ref.get_entry(name).download()
      # assert os.path.islink(start_path)
      # assert os.path.abspath(os.readlink(start_path)) == os.path.abspath(target_path)
  
      with wandb.init() as run:
          mid_artifact_ref = run.use_artifact("mid_artifact:latest")
          down_artifact = wandb.Artifact("down_artifact", "database")
          down_obj = mid_artifact_ref.get("obj2")
          down_artifact.add(down_obj, "obj3")
          run.log_artifact(down_artifact)
  
      _cleanup()
      with wandb.init() as run:
          down_artifact_ref = run.use_artifact("down_artifact:latest")
          down_dir = down_artifact_ref._default_root()  # noqa: F841
          obj3 = down_artifact_ref.get("obj3")
  
      if hasattr(obj, "_eq_debug"):
          obj._eq_debug(obj3, True)
  
      assert obj3 == obj
      assert not os.path.isdir(os.path.join(mid_dir))
  
imports: import base64
  import binascii
  import os
  import shutil
  import time
  from math import cos, pi, sin
  import boto3
  import botocore
  import google.cloud.storage
  import numpy
  import pytest
  import wandb
  from bokeh.plotting import figure
  from wandb.sdk.artifacts.storage_handlers.gcs_handler import GCSHandler
  from wandb.sdk.artifacts.storage_handlers.s3_handler import S3Handler
label_desc: Use image node_id 17 for calling a global function with example usage: assert_media_obj_referential_equality(obj) without return types