code: def _wait(coro):
      # Synchronized version of "await".
      future = asyncio.run_coroutine_threadsafe(coro, _event_loop)
      return future.result()
  
file_path: nni/nni/runtime/command_channel/websocket/connection.py
imports: from __future__ import annotations
  import asyncio
  import logging
  from threading import Lock, Thread
  from typing import Any, Type
  import websockets
  import nni
  from ..base import Command
label_desc: Use image node_id 1 for calling a global function with example usage: _wait(coro) and returns: future