import functools
import warnings


def nowarnings(func):
    """Create a function wrapped in a context that ignores warnings.
    """
    @functools.wraps(func)
    def new_func(*args, **kwargs):
        with warnings.catch_warnings():
            warnings.simplefilter('ignore')
            return func(*args, **kwargs)
    return new_func