code: def test_client_object_ref_basics(ray_start_regular):
      with ray_start_client_server_pair() as pair:
          ray, server = pair
          ref = ray.put("Hello World")
          # Make sure ClientObjectRef is a subclass of ObjectRef
          assert isinstance(ref, ClientObjectRef)
          assert isinstance(ref, ObjectRef)
  
          # Invalid ref format.
          with pytest.raises(Exception):
              ClientObjectRef(b"\0")
  
          obj_id = b"\0" * 28
          fut = Future()
          fut.set_result(obj_id)
          server_ref = ObjectRef(obj_id)
          for client_ref in [
              ClientObjectRef(obj_id),
              ClientObjectRef(fut),
          ]:
              client_members = set(client_ref.__dir__())
              server_members = set(server_ref.__dir__())
              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 == ClientObjectRef(obj_id)
              assert client_ref != ref
              assert client_ref != server_ref
  
              # Test other methods
              assert (
                  client_ref.__repr__()
                  == f"ClientObjectRef({obj_id.hex()})"
              )
              assert client_ref.binary() == obj_id
              assert client_ref.hex() == obj_id.hex()
              assert not client_ref.is_nil()
              assert client_ref.task_id() == server_ref.task_id()
              assert client_ref.job_id() == server_ref.job_id()
  
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 1 for calling a global function with example usage: test_client_object_ref_basics(ray_start_regular) without return types