code: def test_wait_for_multiple_events(workflow_start_regular_shared):
      """If a workflow has multiple event arguments, it should wait for them at the
      same time.
      """
  
      class EventListener1(workflow.EventListener):
          async def poll_for_event(self):
              utils.set_global_mark("listener1")
              while not utils.check_global_mark("trigger_event"):
                  await asyncio.sleep(0.1)
              return "event1"
  
      class EventListener2(workflow.EventListener):
          async def poll_for_event(self):
              utils.set_global_mark("listener2")
              while not utils.check_global_mark("trigger_event"):
                  await asyncio.sleep(0.1)
              return "event2"
  
      @ray.remote
      def trivial_task(arg1, arg2):
          return f"{arg1} {arg2}"
  
      event1_promise = workflow.wait_for_event(EventListener1)
      event2_promise = workflow.wait_for_event(EventListener2)
  
      promise = workflow.run_async(
          trivial_task.bind(event1_promise, event2_promise)
      )
  
      while not (
          utils.check_global_mark("listener1")
          and utils.check_global_mark("listener2")
      ):
          time.sleep(0.1)
  
      utils.set_global_mark("trigger_event")
      assert ray.get(promise) == "event1 event2"
  
file_path: ray/python/ray/workflow/tests/test_events.py
imports: import asyncio
  import time
  import pytest
  import ray
  from ray import workflow
  from ray.tests.conftest import *
  from ray.workflow.tests import utils
label_desc: Use image node_id 3 for calling a global function with example usage: test_wait_for_multiple_events(workflow_start_regular_shared) and returns: arg1, str, arg2, str, str