def METHOD_NAME(self):
    task = asyncio.ensure_future(self.network.stop_all_nodes())
    while not task.done():
        self.loop.run_until_complete(asyncio.sleep(0.1))
    try:
        self.loop.run_until_complete(self.loop.shutdown_asyncgens())
        self.loop.close()
    except RuntimeError:
        pass