def silence_errors(f):
@wraps(f)<EOL>def wrapper(*args, **kwds):<EOL><INDENT>status = np.seterr(all='<STR_LIT:ignore>')<EOL>result = f(*args, **kwds)<EOL>np.seterr(**status)<EOL>return result<EOL><DEDENT>return wrapper<EOL>
This wraps a function and it silences numpy errors that
happen during the execution. After the function has exited, it restores
the previous state of the warnings.