human
Here's a good function header given the following:
I wrote the below code

    def _hd_1D(data, prob, var):
        'Computes    the    HD    quantiles    for    a    1D    array.    Returns    nan    for    invalid    data.'
        xsorted = np.squeeze(np.sort(data.compressed().view(ndarray)))
        n = xsorted.size
        hd = np.empty((2, len(prob)), float_)
        if (n < 2):
            hd.flat = np.nan
            if var:
                return hd
            return hd[0]
        v = (np.arange((n + 1)) / float(n))
        betacdf = beta.cdf
        for (i, p) in enumerate(prob):
            _w = betacdf(v, ((n + 1) * p), ((n + 1) * (1 - p)))
            w = (_w[1:] - _w[:(-1)])
            hd_mean = np.dot(w, xsorted)
            hd[(0, i)] = hd_mean
            hd[(1, i)] = np.dot(w, ((xsorted - hd_mean) ** 2))
        hd[(0, (prob == 0))] = xsorted[0]
        hd[(0, (prob == 1))] = xsorted[(-1)]
        if var:
            hd[(1, (prob == 0))] = hd[(1, (prob == 1))] = np.nan
            return hd
        return hd[0]
    data = ma.array(data, copy=False, dtype=float_)
    p = np.array(prob, copy=False, ndmin=1)
    if ((axis is None) or (data.ndim == 1)):
        result = _hd_1D(data, p, var)
    else:
        if (data.ndim > 2):
            raise ValueError(("Array    'data'    must    be    at    most    two    dimensional,    but    got    data.ndim    =    %d" % data.ndim))
        result = ma.apply_along_axis(_hd_1D, axis, data, p, var)
    return ma.fix_invalid(result, copy=False)

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

def hdquantiles(data, prob=list([0.25, 0.5, 0.75]), axis=None, var=False):