human
I wrote the below code

    future = convert_yielded(future)
    result = Future()
    chain_future(future, result)
    if (io_loop is None):
        io_loop = IOLoop.current()
    def error_callback(future):
        try:
            future.result()
        except Exception as e:
            if (not isinstance(e, quiet_exceptions)):
                app_log.error('Exception    in    Future    %r    after    timeout', future, exc_info=True)
    def timeout_callback():
        result.set_exception(TimeoutError('Timeout'))
        future.add_done_callback(error_callback)
    timeout_handle = io_loop.add_timeout(timeout, timeout_callback)
    if isinstance(future, Future):
        future.add_done_callback((lambda future: io_loop.remove_timeout(timeout_handle)))
    else:
        io_loop.add_future(future, (lambda future: io_loop.remove_timeout(timeout_handle)))
    return result

What's a good function header?
 ... Here's a good function header?
assistant
#Here's a good function header.

def with_timeout(timeout, future, io_loop=None, quiet_exceptions=()):