code: def switch_to_uvloop() -> asyncio.AbstractEventLoop:
      """stop any running event loops; install uvloop; then create, set and return a new event loop"""
      try:
          asyncio.get_event_loop().stop()  # if we're in jupyter, get rid of its built-in event loop
      except RuntimeError as error_no_event_loop:
          pass  # this allows running DHT from background threads with no event loop
      uvloop.install()
      loop = asyncio.new_event_loop()
      asyncio.set_event_loop(loop)
      return loop
  
file_path: hivemind/hivemind/utils/asyncio.py
imports: import asyncio
  import concurrent.futures
  import multiprocessing
  import os
  from concurrent.futures import ThreadPoolExecutor
  from contextlib import AbstractAsyncContextManager, AbstractContextManager, asynccontextmanager
  from typing import AsyncIterable, AsyncIterator, Awaitable, Callable, Iterable, Optional, Tuple, TypeVar, Union
  import uvloop
  from hivemind.utils.logging import get_logger
label_desc: Use image node_id 1 for calling a global function with example usage: switch_to_uvloop() and returns: loop