from importlib.metadata import version as _get_version
# load nest_asyncio
import nest_asyncio as _nest_asyncio
import asyncio as _asyncio
import threading
import asyncio as _asyncio
import threading
if threading.current_thread() == threading.main_thread():
_nest_asyncio.apply()
else:
_asyncio.set_event_loop(_asyncio.new_event_loop())
_nest_asyncio.apply()
This code needs to work in marvin's init.py