#NEWLINE# def add_timeout( self , deadline , callback ) : #NEWLINE# #INDENT# "Calls the given callback at the time deadline from the I/O loop.\n\n        Returns a handle that may be passed to remove_timeout to cancel.\n\n        ``deadline`` may be a number denoting a unix timestamp (as returned\n        by ``time.time()`` or a ``datetime.timedelta`` object for a deadline\n        relative to the current time.\n\n        Note that it is not safe to call `add_timeout` from other threads.\n        Instead, you must use `add_callback` to transfer control to the\n        IOLoop's thread, and then call `add_timeout` from there.\n        " #NEWLINE# timeout = _Timeout ( deadline , stack_context . wrap ( callback ) ) #NEWLINE# heapq . heappush ( self . _timeouts , deadline ) #NEWLINE# return timeout