<s> """<STR_LIT>""" <EOL> import logging <EOL> error_level = <NUM_LIT> <EOL> logger = logging . getLogger ( '<STR_LIT>' ) <EOL> logger . addHandler ( logging . StreamHandler ( ) ) <EOL> class ErrorLevel ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , level ) : <EOL> self . level = level <EOL> def __enter__ ( self ) : <EOL> global error_level <EOL> self . _original_level = error_level <EOL> error_level = self . level <EOL> def __exit__ ( self , exc , value , tb ) : <EOL> global error_level <EOL> error_level = self . _original_level <EOL> return False <EOL> class LoggingOutputSuppressor ( object ) : <EOL> """<STR_LIT>""" <EOL> def __enter__ ( self ) : <EOL> self . orig_handlers = logger . handlers <EOL> for handler in self . orig_handlers : <EOL> logger . removeHandler ( handler ) <EOL> def __exit__ ( self , exc , value , tb ) : <EOL> for handler in self . orig_handlers : <EOL> logger . addHandler ( handler ) </s>
