<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _handle(self, event_handler, event_name, user_args, event_timeout, cond, cond_timeout):
 """Pop an event of specified type and calls its handler on it. If condition is not None, block until condition is met or timeout. """

        if cond:
            cond.wait(cond_timeout)
        event = self.pop_event(event_name, event_timeout)
        return event_handler(event, *user_args)