def numpy_invalid_op_as_exception(func):
def func_wrapper(*args, **kwargs):<EOL><INDENT>np.seterr(invalid='<STR_LIT>')<EOL>result = func(*args, **kwargs)<EOL>np.seterr(invalid='<STR_LIT>')<EOL>return result<EOL><DEDENT>return func_wrapper<EOL>
A decorator that allows catching numpy invalid operations
as exceptions (the default behaviour is raising warnings).