code: def test_asyncio_actor(ray_start_regular_shared):
      @ray.remote
      class AsyncBatcher:
          def __init__(self):
              self.batch = []
              self.event = asyncio.Event()
  
          async def add(self, x):
              self.batch.append(x)
              if len(self.batch) >= 3:
                  self.event.set()
              else:
                  await self.event.wait()
              return sorted(self.batch)
  
      a = AsyncBatcher.remote()
      x1 = a.add.remote(1)
      x2 = a.add.remote(2)
      x3 = a.add.remote(3)
      r1 = ray.get(x1)
      r2 = ray.get(x2)
      r3 = ray.get(x3)
      assert r1 == [1, 2, 3]
      assert r1 == r2 == r3
  
imports: import asyncio
  import os
  import sys
  import threading
  import time
  import pytest
  import ray
  from ray._private.client_mode_hook import client_mode_should_convert
  from ray._private.test_utils import SignalActor, kill_actor_and_wait_for_failure, wait_for_condition, wait_for_pid_to_exit
label_desc: Use image node_id 1 for calling a global function with example usage: test_asyncio_actor(ray_start_regular_shared) and returns: sorted