def pop_all(self):
        new_stack = type(self)()
        new_stack._exit_callbacks = self._exit_callbacks
        self._exit_callbacks = deque()
        return new_stack
Preserve the context stack by transferring it to a new instance
dataset/ETHPy150Open amrdraz/kodr/app/brython/www/src/Lib/contextlib.py/ExitStack.pop_all