human
I wrote the below code

    if (dy is None):
        dy = 1
    (t, y, dy) = np.broadcast_arrays(t, y, dy)
    frequency = np.asarray(frequency)
    if (t.ndim != 1):
        raise ValueError('t,    y,    dy    should    be    one    dimensional')
    if (frequency.ndim != 1):
        raise ValueError('frequency    should    be    one-dimensional')
    w = (dy ** (-2.0))
    w /= w.sum()
    if (center_data or fit_mean):
        yw = ((y - np.dot(w, y)) / dy)
    else:
        yw = (y / dy)
    chi2_ref = np.dot(yw, yw)
    def compute_power(f):
        X = design_matrix(t, f, dy=dy, bias=fit_mean, nterms=nterms)
        XTX = np.dot(X.T, X)
        XTy = np.dot(X.T, yw)
        return np.dot(XTy.T, np.linalg.solve(XTX, XTy))
    p = np.array([compute_power(f) for f in frequency])
    if (normalization == 'psd'):
        p *= 0.5
    elif (normalization == 'model'):
        p /= (chi2_ref - p)
    elif (normalization == 'log'):
        p = (- np.log((1 - (p / chi2_ref))))
    elif (normalization == 'standard'):
        p /= chi2_ref
    else:
        raise ValueError("normalization='{0}'    not    recognized".format(normalization))
    return p

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

def lombscargle_chi2(t, y, dy, frequency, normalization='standard', fit_mean=True, center_data=True, nterms=1):