def _poll_event(self, event, end_time):
    proceed = False
    while True:
      now = time.time()
      if event.proceed(self.simulation):
        proceed = True
        break
      elif now > end_time:
        break
      self.select_continuation(self.sleep_interval_seconds)
    if proceed:
      event.timed_out = False
      self.stats.event_matched(event)
      self.update_event_time(event)
    else:
      event.timed_out = True
      self.stats.event_timed_out(event)
    event.replay_time = SyncTime.now()
dataset/ETHPy150Open ucb-sts/sts/sts/control_flow/event_scheduler.py/EventScheduler._poll_event/original