code: def to_asyncio_future(
      future: torch.futures.Future,
  ) -> asyncio.futures.Future:
      r"""Convert a :class:`torch.futures.Future` to a :obj:`asyncio` future."""
      loop = asyncio.get_event_loop()
      asyncio_future = loop.create_future()
  
      def on_done(*_):
          try:
              result = future.wait()
          except Exception as e:
              loop.call_soon_threadsafe(asyncio_future.set_exception, e)
          else:
              loop.call_soon_threadsafe(
                  asyncio_future.set_result, result
              )
  
      future.add_done_callback(on_done)
  
      return asyncio_future
  
file_path: pytorch_geometric/torch_geometric/distributed/event_loop.py
imports: import asyncio
  import atexit
  import logging
  from threading import BoundedSemaphore, Thread
  from typing import Callable, Optional
  import torch
label_desc: Use image node_id 1 for calling a global function with example usage: to_asyncio_future(future) and returns: asyncio_future