code: def test_event_after_arg_resolution(workflow_start_regular_shared):
      """Ensure that a workflow resolves all of its non-event arguments while it
      waiting the the event to occur.
      """
  
      class MyEventListener(workflow.EventListener):
          async def poll_for_event(self):
              while not utils.check_global_mark():
                  await asyncio.sleep(0.1)
              # Give the other task time to finish.
              await asyncio.sleep(1)
  
      @ray.remote
      def triggers_event():
          utils.set_global_mark()
  
      @ray.remote
      def gather(*args):
          return args
  
      event_promise = workflow.wait_for_event(MyEventListener)
  
      assert workflow.run(
          gather.bind(event_promise, triggers_event.bind())
      ) == (
          None,
          None,
      )
  
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 4 for calling a global function with example usage: test_event_after_arg_resolution(workflow_start_regular_shared) and returns: args