def _run_pending_tasks():
  now = time.time()
  old_pending = list(_pending_delayed_tasks)
  del _pending_delayed_tasks[:]
  for t in old_pending:
    if not _main_loop_running:
      return
    if now >= t.run_at_or_after:
      try:
        t.cb()
      except __HOLE__:
        raise
      except:
        _on_exception()
    else:
      _pending_delayed_tasks.append(t)
  _pending_delayed_tasks.sort(lambda x, y: cmp(x, y))
dataset/ETHPy150Open natduca/quickopen/src/message_loop_curses.py/_run_pending_tasks