code: def test_run_coroutine():
      dht = hivemind.DHT(start=True)
      assert dht.run_coroutine(dummy_dht_coro) == "pew"
  
      with pytest.raises(ValueError):
          res = dht.run_coroutine(dummy_dht_coro_error)
  
      bg_task = dht.run_coroutine(
          dummy_dht_coro_long, return_future=True
      )
      assert dht.run_coroutine(dummy_dht_coro_stateful) == 124
      assert dht.run_coroutine(dummy_dht_coro_stateful) == 125
      assert dht.run_coroutine(dummy_dht_coro_stateful) == 126
      assert not hasattr(dht, "_x_dummy")
      assert bg_task.result() == 126**2
  
      future = dht.run_coroutine(
          dummy_dht_coro_for_cancel, return_future=True
      )
      time.sleep(0.25)
      future.cancel()
      assert dht.run_coroutine(dummy_dht_coro_stateful) == -99
  
      dht.shutdown()
  
file_path: hivemind/tests/test_dht.py
imports: import asyncio
  import concurrent.futures
  import random
  import time
  import pytest
  from multiaddr import Multiaddr
  import hivemind
  from test_utils.dht_swarms import launch_dht_instances
  from test_utils.networking import get_free_port
label_desc: Use image node_id 2 for calling a global function with example usage: test_run_coroutine() without return types