code: def check_event_loop():
          
          loop = asyncio.get_event_loop()
          if loop.is_closed():
              asyncio.set_event_loop(asyncio.new_event_loop())
docs: Check if event loop is closed and
          create a new event loop