code: def test_wait(ray_start_combination):
      (
          num_nodes,
          num_workers_per_scheduler,
          cluster,
      ) = ray_start_combination
      num_workers = num_nodes * num_workers_per_scheduler
  
      @ray.remote
      def f(x):
          return x
  
      x_ids = [f.remote(i) for i in range(100)]
      for i in range(len(x_ids)):
          ray.wait([x_ids[i]])
      for i in range(len(x_ids) - 1):
          ray.wait(x_ids[i:])
  
      @ray.remote
      def g(x):
          time.sleep(x)
  
      for i in range(1, 5):
          x_ids = [
              g.remote(np.random.uniform(0, i))
              for _ in range(2 * num_workers)
          ]
          ray.wait(x_ids, num_returns=len(x_ids))
  
      assert cluster.remaining_processes_alive()
  
file_path: ray/python/ray/tests/test_stress.py
imports: import numpy
  import pytest
  import time
  import ray
  from ray.cluster_utils import Cluster, cluster_not_supported
label_desc: Use image node_id 4 for calling a global function with example usage: test_wait(ray_start_combination) and returns: x