def _call_timeout_handlers(self):
sources_handled = <NUM_LIT:0><EOL>now = time.time()<EOL>schedule = None<EOL>while self._timeout_handlers:<EOL><INDENT>schedule, handler = self._timeout_handlers[<NUM_LIT:0>]<EOL>if schedule <= now:<EOL><INDENT>logger.debug("<STR_LIT>"<EOL>.format(handler))<EOL>self._timeout_handlers = self._timeout_handlers[<NUM_LIT:1>:]<EOL>result = handler()<EOL>logger.debug("<STR_LIT>".format(result))<EOL>rec = handler._pyxmpp_recurring<EOL>if rec:<EOL><INDENT>logger.debug("<STR_LIT>"<EOL>.format(handler._pyxmpp_timeout))<EOL>self._timeout_handlers.append(<EOL>(now + handler._pyxmpp_timeout, handler))<EOL>self._timeout_handlers.sort(key = lambda x: x[<NUM_LIT:0>])<EOL><DEDENT>elif rec is None and result is not None:<EOL><INDENT>logger.debug("<STR_LIT>"<EOL>.format(result))<EOL>self._timeout_handlers.append((now + result, handler))<EOL>self._timeout_handlers.sort(key = lambda x: x[<NUM_LIT:0>])<EOL><DEDENT>sources_handled += <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>break<EOL><DEDENT>if self.check_events():<EOL><INDENT>return <NUM_LIT:0>, sources_handled<EOL><DEDENT><DEDENT>if self._timeout_handlers and schedule:<EOL><INDENT>timeout = schedule - now<EOL><DEDENT>else:<EOL><INDENT>timeout = None<EOL><DEDENT>return timeout, sources_handled<EOL>
Call the timeout handlers due.

        :Return: (next_event_timeout, sources_handled) tuple.
            next_event_timeout is number of seconds until the next timeout
            event, sources_handled is number of handlers called.