parameters: (coro_or_future, *, loop=None)
docstring: Wrap a coroutine or an awaitable in a future.
  
      If the argument is a Future, it is returned directly.
docstring_summary: Wrap a coroutine or an awaitable in a future.
docstring_tokens: Wrap a coroutine or an awaitable in a future .
function: def ensure_future(coro_or_future, *, loop=None):
      """Wrap a coroutine or an awaitable in a future.
  
      If the argument is a Future, it is returned directly.
      """
      if coroutines.iscoroutine(coro_or_future):
          if loop is None:
              loop = events.get_event_loop()
          task = loop.create_task(coro_or_future)
          if task._source_traceback:
              del task._source_traceback[-1]
          return task
      elif futures.isfuture(coro_or_future):
          if loop is not None and loop is not futures._get_loop(coro_or_future):
              raise ValueError('loop argument must agree with Future')
          return coro_or_future
      elif inspect.isawaitable(coro_or_future):
          return ensure_future(_wrap_awaitable(coro_or_future), loop=loop)
      else:
          raise TypeError('An asyncio.Future, a coroutine or an awaitable is '
                          'required')
function_tokens: def ensure_future ( coro_or_future , * , loop = None ) : if coroutines . iscoroutine ( coro_or_future ) : if loop is None : loop = events . get_event_loop ( ) task = loop . create_task ( coro_or_future ) if task . _source_traceback : del task . _source_traceback [ - 1 ] return task elif futures . isfuture ( coro_or_future ) : if loop is not None and loop is not futures . _get_loop ( coro_or_future ) : raise ValueError ( 'loop argument must agree with Future' ) return coro_or_future elif inspect . isawaitable ( coro_or_future ) : return ensure_future ( _wrap_awaitable ( coro_or_future ) , loop = loop ) else : raise TypeError ( 'An asyncio.Future, a coroutine or an awaitable is ' 'required' )