code: def test_detached_actor_ref(call_ray_start):
      address = call_ray_start
  
      driver_script = """
  import ray
  import time
  
  
  @ray.remote
  def foo(x):
      return ray.put(42)
  
  
  @ray.remote
  class Actor:
      def __init__(self):
          self.ref = None
  
      def invoke(self):
          self.ref = foo.remote(0)
          # Wait for the task to finish before exiting the driver.
          ray.get(self.ref)
  
      def get(self):
          print("get", self.ref)
          return self.ref
  
  
  if __name__ == "__main__":
      ray.init(address="{}", namespace="default")
      a = Actor.options(name="holder", lifetime="detached").remote()
      # Wait for the task to finish before exiting the driver.
      ray.get(a.invoke.remote())
      print("success")
  """.format(
          address
      )
  
      out = run_string_as_driver(driver_script)
      assert "success" in out
  
      import time
  
      time.sleep(5)
  
      # connect to the cluster
      ray.init(address=address, namespace="default")
      actor = ray.get_actor("holder")
      x = actor.get.remote()
      while isinstance(x, ray.ObjectRef):
          x = ray.get(x)
      assert x == 42
  
imports: import subprocess
  import sys
  import time
  import grpc
  import numpy
  import psutil
  import pytest
  from grpc._channel import _InactiveRpcError
  from ray.util.state import list_tasks
  from ray._private.state_api_test_utils import verify_failed_task
  import ray
  import ray._private.ray_constants
  import ray.experimental.internal_kv
  from ray import NodeID
  from ray._private.test_utils import SignalActor, get_error_message, init_error_pubsub, run_string_as_driver, wait_for_condition, kill_raylet
  from ray.cluster_utils import Cluster, cluster_not_supported
  from ray.core.generated import gcs_service_pb2, gcs_service_pb2_grpc, node_manager_pb2, node_manager_pb2_grpc
  from ray.exceptions import LocalRayletDiedError
label_desc: Use image node_id 6 for calling a global function with example usage: test_detached_actor_ref(call_ray_start) without return types