def asyncio_run(main: Awaitable[_T], *, debug: bool=False) -> _T:
    'Minimal re-implementation of asyncio.run (since 3.7).'
    loop = asyncio.new_event_loop()
    asyncio.set_event_loop(loop)
    loop.set_debug(debug)
    try:
        return loop.run_until_complete(main)
    finally:
        print('loop final')
        asyncio.set_event_loop(None)
        loop.close()
Minimal re-implementation of asyncio.run (since 3.7).
def asyncio_run(main: Awaitable[_T], *, debug: bool=False) -> _T:
    
    loop = asyncio.new_event_loop()
    asyncio.set_event_loop(loop)
    loop.set_debug(debug)
    try:
        return loop.run_until_complete(main)
    finally:
        print('loop final')
        asyncio.set_event_loop(None)
        loop.close()