code: def test_wait_mixup(init):
      loop = get_or_create_event_loop()
  
      @ray.remote
      def f(n):
          time.sleep(n)
          return n, np.zeros(1024 * 1024, dtype=np.uint8)
  
      def g(n):
          async def _g(_n):
              await asyncio.sleep(_n)
              return _n
  
          return asyncio.ensure_future(_g(n))
  
      tasks = [
          f.remote(0.1).as_future(),
          g(7),
          f.remote(5).as_future(),
          g(2),
      ]
      ready, _ = loop.run_until_complete(asyncio.wait(tasks, timeout=4))
      assert set(ready) == {tasks[0], tasks[-1]}
  
imports: import asyncio
  import concurrent.futures
  import sys
  import time
  import numpy
  import pytest
  import ray
  from ray._private.async_compat import is_async_func
  from ray._private.test_utils import wait_for_condition
  from ray._private.utils import get_or_create_event_loop, run_background_task, background_tasks
label_desc: Use image node_id 9 for calling a global function with example usage: test_wait_mixup(init) and returns: n,  np, asyncio, _n