code: def _auth_return_future(f):
      """Similar to tornado.concurrent.return_future, but uses the auth
      module's legacy callback interface.
  
      Note that when using this decorator the ``callback`` parameter
      inside the function will actually be a future.
      """
      replacer = ArgReplacer(f, "callback")
  
      @functools.wraps(f)
      def wrapper(*args, **kwargs):
          future = TracebackFuture()
          callback, args, kwargs = replacer.replace(
              future, args, kwargs
          )
          if callback is not None:
              future.add_done_callback(
                  functools.partial(_auth_future_to_callback, callback)
              )
  
          def handle_exception(typ, value, tb):
              if future.done():
                  return False
              else:
                  future.set_exc_info((typ, value, tb))
                  return True
  
          with ExceptionStackContext(handle_exception):
              f(*args, **kwargs)
          return future
  
      return wrapper
  
imports: from __future__ import absolute_import, division, print_function
  import base64
  import binascii
  import functools
  import hashlib
  import hmac
  import time
  import uuid
  from tornado.concurrent import TracebackFuture, return_future, chain_future
  from tornado import gen
  from tornado import httpclient
  from tornado import escape
  from tornado.httputil import url_concat
  from tornado.log import gen_log
  from tornado.stack_context import ExceptionStackContext
  from tornado.util import unicode_type, ArgReplacer, PY3
label_desc: Use image node_id 2 for calling a global function with example usage: _auth_return_future(f) and returns: wrapper, future, False, True