code: def test_shared_actor(shutdown_only):
      ray.init(num_cpus=1)
  
      @ray.remote(name="x", namespace="test", get_if_exists=True)
      class SharedActor:
          def ping(self):
              return "ok"
  
          def pid(self):
              return os.getpid()
  
      a = SharedActor.remote()
      b = SharedActor.remote()
      assert ray.get(a.ping.remote()) == "ok"
      assert ray.get(b.ping.remote()) == "ok"
      assert ray.get(b.pid.remote()) == ray.get(a.pid.remote())
  
file_path: ray/python/ray/tests/test_get_or_create_actor.py
imports: import sys
  import os
  import pytest
  import ray
  from ray._private.test_utils import run_string_as_driver_nonblocking
label_desc: Use image node_id 2 for calling a global function with example usage: test_shared_actor(shutdown_only) and returns: str, os