#NEWLINE# def add_timeout( self , deadline , callback , * args , **kwargs ) : #NEWLINE# #INDENT# "Runs the ``callback`` at the time ``deadline`` from the I/O loop.\n\n        Returns an opaque handle that may be passed to\n        `remove_timeout` to cancel.\n\n        ``deadline`` may be a number denoting a time (on the same\n        scale as `IOLoop.time`, normally `time.time`), or a\n        `datetime.timedelta` object for a deadline relative to the\n        current time.  Since Tornado 4.0, `call_later` is a more\n        convenient alternative for the relative case since it does not\n        require a timedelta object.\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\n        Subclasses of IOLoop must implement either `add_timeout` or\n        `call_at`; the default implementations of each will call\n        the other.  `call_at` is usually easier to implement, but\n        subclasses that wish to maintain compatibility with Tornado\n        versions prior to 4.0 must use `add_timeout` instead.\n\n        .. versionchanged:: 4.0\n           Now passes through ``*args`` and ``**kwargs`` to the callback.\n        " #NEWLINE# if isinstance ( deadline , numbers . Real ) : #NEWLINE# #INDENT# return self . call_at ( deadline , callback , * args , ** kwargs ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( deadline , datetime . timedelta ) : #NEWLINE# #INDENT# return self . call_at ( ( self . time ( ) + timedelta_to_seconds ( deadline ) ) , callback , * args , ** kwargs ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise TypeError ( ( 'Unsupported deadline %r' % callback ) )