code: def _check_spilled(num_objects_spilled=0):
      def ok():
          s = ray._private.internal_api.memory_summary(stats_only=True)
          if num_objects_spilled == 0:
              return "Spilled " not in s
  
          m = re.search(r"Spilled (\d+) MiB, (\d+) objects", s)
          if m is not None:
              actual_num_objects = int(m.group(2))
              return actual_num_objects >= num_objects_spilled
  
          return False
  
      wait_for_condition(ok, timeout=90, retry_interval_ms=5000)
  
imports: import json
  import platform
  import random
  import re
  import shutil
  import sys
  import time
  import zlib
  from collections import defaultdict
  import numpy
  import pytest
  import ray
  from ray._private.test_utils import wait_for_condition
  from ray.cluster_utils import Cluster, cluster_not_supported
  from ray.tests.test_object_spilling import assert_no_thrashing, is_dir_empty
label_desc: Use image node_id 2 for calling a global function with example usage: _check_spilled(num_objects_spilled) and returns: False, unknown, unknown