human
I wrote the below code

    def _broadcast(arr_or_scalar, shape):
        '\n                                Helper    function    to    broadcast    arrays    /    scalars    to    the    desired    shape.\n                                '
        if _np_version_under1p10:
            if lib.isscalar(arr_or_scalar):
                out = np.empty(shape)
                out.fill(arr_or_scalar)
            else:
                out = arr_or_scalar
        else:
            out = np.broadcast_to(arr_or_scalar, shape)
        return out
    b2 = _broadcast(b, arr.shape)
    if (b_mask is not None):
        b2_mask = _broadcast(b_mask, arr.shape)
    else:
        b2_mask = None
    if ((arr_mask is not None) and (b2_mask is not None)):
        not_nan = np.logical_not((arr_mask | b2_mask))
    elif (arr_mask is not None):
        not_nan = np.logical_not(arr_mask)
    elif (b_mask is not None):
        not_nan = np.logical_not(b2_mask)
    else:
        not_nan = np.empty(arr.shape, dtype=bool)
        not_nan.fill(True)
    mask1 = (b2 > 0)
    mask2 = (b2 < 0)
    if (not mask1.any()):
        to_raise = (((np.iinfo(np.int64).min - b2) > arr) & not_nan).any()
    elif (not mask2.any()):
        to_raise = (((np.iinfo(np.int64).max - b2) < arr) & not_nan).any()
    else:
        to_raise = ((((np.iinfo(np.int64).max - b2[mask1]) < arr[mask1]) & not_nan[mask1]).any() or (((np.iinfo(np.int64).min - b2[mask2]) > arr[mask2]) & not_nan[mask2]).any())
    if to_raise:
        raise OverflowError('Overflow    in    int64    addition')
    return (arr + b)

What's a good function header?

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

def checked_add_with_arr(arr, b, arr_mask=None, b_mask=None):