code: def _check_refcounts(expected):
      actual = (
          ray._private.worker.global_worker.core_worker.get_all_reference_counts()
      )
      assert len(expected) == len(actual)
      for object_ref, (local, submitted) in expected.items():
          hex_id = object_ref.hex().encode("ascii")
          assert hex_id in actual
          assert local == actual[hex_id]["local"]
          assert submitted == actual[hex_id]["submitted"]
  
imports: import copy
  import logging
  import os
  import sys
  import time
  import numpy
  import pytest
  import ray
  import ray._private.gcs_utils
  import ray.cluster_utils
  from ray._private.test_utils import SignalActor, convert_actor_state, kill_actor_and_wait_for_failure, put_object, wait_for_condition, skip_flaky_core_test_premerge
label_desc: Use image node_id 3 for calling a global function with example usage: _check_refcounts(expected) without return types