def METHOD_NAME(*args, **kwargs):
    async_gen = high_level_predict(*args, **kwargs).__aiter__()
    loop = asyncio.new_event_loop()
    def cleanup():
        loop.run_until_complete(loop.shutdown_asyncgens())
        loop.close()
    while True:
        try:
            yield loop.run_until_complete(async_gen.__anext__())
        except StopAsyncIteration:
            cleanup()
            return
        except:
            cleanup()
            raise