code: def test_namespace_client():
      cluster = Cluster()
      cluster.add_node(num_cpus=4, ray_client_server_port=8080)
      cluster.wait_for_nodes(1)
  
      template = """
  import ray
  ray.util.connect("{address}", namespace="{namespace}")
  
  @ray.remote
  class DetachedActor:
      def ping(self):
          return "pong from other job"
  
  actor = DetachedActor.options(name="Pinger", lifetime="detached").remote()
  ray.get(actor.ping.remote())
  print("Done!!!")
      """
  
      print(
          run_string_as_driver(
              template.format(
                  address="localhost:8080", namespace="test"
              )
          )
      )
  
      ray.util.connect("localhost:8080", namespace="test")
  
      pinger = ray.get_actor("Pinger")
      assert ray.get(pinger.ping.remote()) == "pong from other job"
  
      ray.util.disconnect()
      cluster.shutdown()
      # This piece of cleanup doesn't seem to happen automatically.
      ray._private.client_mode_hook._explicitly_disable_client_mode()
  
file_path: ray/python/ray/tests/test_namespace.py
imports: import sys
  import time
  import pytest
  import ray
  from ray._private import ray_constants
  from ray._private.test_utils import get_error_message, init_error_pubsub, run_string_as_driver
  from ray.cluster_utils import Cluster
label_desc: Use image node_id 6 for calling a global function with example usage: test_namespace_client() without return types