human
I wrote the below code

    def wrap(*a, **kw):
        v = func(*a, **kw)
        if (not np.isfinite(v)):
            return np.nan
        return v
    return wrap

What's a good function header?
assistant
#Here's a good function header.

def inf_to_nan(func):