'Decorator to catch and hide warnings without visual nesting.'

def __call__(self, fn):

    @wraps(fn)
    def wrapper(*args, **kwargs):
        clean_warning_registry()
        with warnings.catch_warnings():
            warnings.simplefilter('ignore', self.category)
            return fn(*args, **kwargs)
    return wrapper
