human
I wrote the below code

    def _winsorize1D(a, low_limit, up_limit, low_include, up_include):
        n = a.count()
        idx = a.argsort()
        if low_limit:
            if low_include:
                lowidx = int((low_limit * n))
            else:
                lowidx = np.round((low_limit * n))
            a[idx[:lowidx]] = a[idx[lowidx]]
        if (up_limit is not None):
            if up_include:
                upidx = (n - int((n * up_limit)))
            else:
                upidx = (n - np.round((n * up_limit)))
            a[idx[upidx:]] = a[idx[(upidx - 1)]]
        return a
    a = ma.array(a, copy=np.logical_not(inplace))
    if (limits is None):
        return a
    if ((not isinstance(limits, tuple)) and isinstance(limits, float)):
        limits = (limits, limits)
    (lolim, uplim) = limits
    errmsg = 'The    proportion    to    cut    from    the    %s    should    be    between    0.    and    1.'
    if (lolim is not None):
        if ((lolim > 1.0) or (lolim < 0)):
            raise ValueError(((errmsg % 'beginning') + ('(got    %s)' % lolim)))
    if (uplim is not None):
        if ((uplim > 1.0) or (uplim < 0)):
            raise ValueError(((errmsg % 'end') + ('(got    %s)' % uplim)))
    (loinc, upinc) = inclusive
    if (axis is None):
        shp = a.shape
        return _winsorize1D(a.ravel(), lolim, uplim, loinc, upinc).reshape(shp)
    else:
        return ma.apply_along_axis(_winsorize1D, axis, a, lolim, uplim, loinc, upinc)

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

def winsorize(a, limits=None, inclusive=(True, True), inplace=False, axis=None):