code: def test_actor_spilled(ray_start_regular):
      object_store_memory = 150 * 1024 * 1024
  
      @ray.remote
      class Actor:
          def __init__(self):
              pass
  
          def create_object(self, size):
              return np.random.rand(size)
  
      a = Actor.remote()
      # Submit enough methods on the actor so that they exceed the size of the
      # object store.
      objects = []
      num_objects = 40
      for _ in range(num_objects):
          obj = a.create_object.remote(
              object_store_memory // num_objects
          )
          objects.append(obj)
          # Get each object once to make sure each object gets created.
          ray.get(obj)
  
      # Get each object again. At this point, the earlier objects should have
      # been spilled.
      num_success = 0
      for obj in objects:
          val = ray.get(obj)
          assert isinstance(val, np.ndarray), val
          num_success += 1
      # All of objects should've been spilled, so all of them should succeed.
      assert num_success == len(objects)
  
imports: import atexit
  import asyncio
  import collections
  import numpy
  import os
  import pytest
  import signal
  import sys
  import time
  import ray
  from ray.actor import exit_actor
  import ray.cluster_utils
  from ray._private.test_utils import wait_for_condition, wait_for_pid_to_exit, generate_system_config_map, SignalActor
label_desc: Use image node_id 2 for calling a global function with example usage: test_actor_spilled(ray_start_regular) and returns: np