@contextmanager
def capture_output():
    import sys
    old_out, old_err = sys.stdout, sys.stderr
    try:
        out = [StringIO(), StringIO()]
        sys.stdout, sys.stderr = out
        yield out
    finally:
        sys.stdout, sys.stderr = old_out, old_err
        out[0] = out[0].getvalue()
        out[1] = out[1].getvalue()


# This used to be a custom function, but as of Python 3.2 we can use
# the built-in lru_cache for simplicity
Call schema updates functions and properly
dataset/ETHPy150Open calliope-project/calliope/calliope/utils.py/capture_output--crossover with--dataset/ETHPy150Open pycassa/pycassa/pycassa/system_manager.py/SystemManager._schema_update