code: def test_client_actor_ref_basics(ray_start_regular):
      with ray_start_client_server_pair() as pair:
          ray, server = pair
  
          @ray.remote
          class Counter:
              def __init__(self):
                  self.acc = 0
  
              def inc(self):
                  self.acc += 1
  
              def get(self):
                  return self.acc
  
          counter = Counter.remote()
          ref = counter.actor_ref
  
          # Make sure ClientActorRef is a subclass of ActorID
          assert isinstance(ref, ClientActorRef)
          assert isinstance(ref, ActorID)
  
          # Invalid ref format.
          with pytest.raises(Exception):
              ClientActorRef(b"\0")
  
          actor_id = b"\0" * 16
          fut = Future()
          fut.set_result(actor_id)
          server_ref = ActorID(actor_id)
          for client_ref in [
              ClientActorRef(actor_id),
              ClientActorRef(fut),
          ]:
              client_members = {
                  m
                  for m in client_ref.__dir__()
                  if not m.startswith("_")
              }
              server_members = {
                  m
                  for m in server_ref.__dir__()
                  if not m.startswith("_")
              }
              assert client_members.difference(server_members) == {"id"}
              assert server_members.difference(client_members) == set()
  
              # Test __eq__()
              assert client_ref == ClientActorRef(actor_id)
              assert client_ref != ref
              assert client_ref != server_ref
  
              # Test other methods
              assert (
                  client_ref.__repr__()
                  == f"ClientActorRef({actor_id.hex()})"
              )
              assert client_ref.binary() == actor_id
              assert client_ref.hex() == actor_id.hex()
              assert not client_ref.is_nil()
  
file_path: ray/python/ray/tests/test_client_references.py
imports: from concurrent.futures import Future
  import pytest
  import ray
  from ray._private.test_utils import object_memory_usage, wait_for_condition
  from ray._raylet import ActorID, ObjectRef
  from ray.util.client import _ClientContext
  from ray.util.client.common import ClientActorRef, ClientObjectRef
  from ray.util.client.ray_client_helpers import ray_start_client_server, ray_start_client_server_pair, ray_start_cluster_client_server_pair
label_desc: Use image node_id 2 for calling a global function with example usage: test_client_actor_ref_basics(ray_start_regular) and returns: self