code: def assert_no_leak():
      gc.collect()
      core_worker = ray._private.worker.global_worker.core_worker
      ref_counts = core_worker.get_all_reference_counts()
      print(ref_counts)
      for rc in ref_counts.values():
          assert rc["local"] == 0
          assert rc["submitted"] == 0
      assert core_worker.get_memory_store_size() == 0
  
file_path: ray/python/ray/tests/test_streaming_generator_4.py
imports: import pytest
  import numpy
  import sys
  import time
  import gc
  import random
  import asyncio
  from typing import Optional
  from pydantic import BaseModel
  import ray
label_desc: Use image node_id 1 for calling a global function with example usage: assert_no_leak() without return types