DO.py WaitEventEnd function