parameters: (future, *, loop=None)
return_statement: return new_future
docstring: Wrap concurrent.futures.Future object.
docstring_summary: Wrap concurrent.futures.Future object.
docstring_tokens: Wrap concurrent . futures . Future object .
function: def wrap_future(future, *, loop=None):
      """Wrap concurrent.futures.Future object."""
      if isfuture(future):
          return future
      assert isinstance(future, concurrent.futures.Future), \
          f'concurrent.futures.Future is expected, got {future!r}'
      if loop is None:
          loop = events.get_event_loop()
      new_future = loop.create_future()
      _chain_future(future, new_future)
      return new_future
function_tokens: def wrap_future ( future , * , loop = None ) : if isfuture ( future ) : return future assert isinstance ( future , concurrent . futures . Future ) , f'concurrent.futures.Future is expected, got {future!r}' if loop is None : loop = events . get_event_loop ( ) new_future = loop . create_future ( ) _chain_future ( future , new_future ) return new_future