code: def test_wait_makes_object_local(ray_start_cluster_enabled):
      cluster = ray_start_cluster_enabled
      cluster.add_node(num_cpus=0)
      cluster.add_node(num_cpus=2)
      ray.init(address=cluster.address)
  
      @ray.remote
      class Foo:
          def method(self):
              return np.zeros(1024 * 1024)
  
      a = Foo.remote()
  
      # Test get makes the object local.
      x_id = a.method.remote()
      assert not ray._private.worker.global_worker.core_worker.object_exists(
          x_id
      )
      ray.get(x_id)
      assert (
          ray._private.worker.global_worker.core_worker.object_exists(
              x_id
          )
      )
  
      # Test wait makes the object local.
      x_id = a.method.remote()
      assert not ray._private.worker.global_worker.core_worker.object_exists(
          x_id
      )
      ok, _ = ray.wait([x_id])
      assert len(ok) == 1
      assert (
          ray._private.worker.global_worker.core_worker.object_exists(
              x_id
          )
      )
  
file_path: ray/python/ray/tests/test_advanced_7.py
imports: import logging
  import random
  import sys
  import threading
  import time
  from concurrent.futures import ThreadPoolExecutor
  import numpy
  import pytest
  import ray.cluster_utils
  from ray._private.test_utils import client_test_enabled
label_desc: Use image node_id 2 for calling a global function with example usage: test_wait_makes_object_local(ray_start_cluster_enabled) and returns: np