code: def future_add_done_callback(  # noqa: F811
      future: "Union[futures.Future[_T], Future[_T]]",
      callback: Callable[..., None],
  ) -> None:
      """Arrange to call ``callback`` when ``future`` is complete.
  
      ``callback`` is invoked with one argument, the ``future``.
  
      If ``future`` is already done, ``callback`` is invoked immediately.
      This may differ from the behavior of ``Future.add_done_callback``,
      which makes no such guarantee.
  
      .. versionadded:: 5.0
      """
      if future.done():
          callback(future)
      else:
          future.add_done_callback(callback)
  
imports: import asyncio
  from concurrent import futures
  import functools
  import sys
  import types
  from tornado.log import app_log
  import typing
  from typing import Any, Callable, Optional, Tuple, Union
label_desc: Use image node_id 9 for calling a global function with example usage: future_add_done_callback(future, callback) without return types