code: 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
  
imports: import concurrent.futures
  import contextvars
  import logging
  import sys
  from types import GenericAlias
  from .None import base_futures
  from .None import events
  from .None import exceptions
  from .None import format_helpers
label_desc: Use image node_id 7 for calling a global function with example usage: wrap_future(future) and returns: new_future, future