@contextmanager
def disable_logging(logger=None):
    logger = logger or logging.getLogger()
    disabled = logger.disabled
    logger.disabled = True
    yield
    logger.disabled = disabled
Context manager to temporarily suppress all logging for a given logger
dataset/ETHPy150Open c-w/Gutenberg/gutenberg/_util/logging.py/disable_logging