code: def test_stats(relay_server, wandb_init):
      with relay_server() as relay:
          before = time.time()
          run = wandb_init(
              settings={
                  "_stats_sample_rate_seconds": 0.6,
                  "_stats_samples_to_average": 2,
              }
          )
          time.sleep(3)
          run.finish()
          after = time.time()
  
      stats = relay.context.get_run_stats(run.id)
  
      assert len(stats) > 1
      # assert any(stats["_timestamp"])
      # assert any(stats["_runtime"])
      assert all(before <= stats["_timestamp"]) and all(
          stats["_timestamp"] <= after
      )
      assert all(0 <= stats["_runtime"]) and all(
          stats["_runtime"] <= after - before
      )
  
imports: import time
  import pytest
label_desc: Use image node_id 2 for calling a global function with example usage: test_stats(relay_server, wandb_init) without return types