<s> import warnings <EOL> from bento . compat . api import wraps <EOL> from bento . warnings import NoBentoInfoWarning <EOL> def disable_warning ( f ) : <EOL> def decorator_factory ( warning_class = UserWarning ) : <EOL> @ wraps ( f ) <EOL> def decorator ( * a , ** kw ) : <EOL> filters = warnings . filters [ : ] <EOL> warnings . simplefilter ( "<STR_LIT:ignore>" , warning_class ) <EOL> try : <EOL> return f ( * a , ** kw ) <EOL> finally : <EOL> warnings . filters = filters <EOL> return decorator <EOL> return decorator_factory <EOL> disable_missing_bento_warning = lambda f : disable_warning ( f ) ( NoBentoInfoWarning ) </s>
