human
I wrote the below code

    if (dist not in ['norm', 'expon', 'gumbel', 'gumbel_l', 'gumbel_r', 'extreme1', 'logistic']):
        raise ValueError("Invalid    distribution.
   dist    must    be    'norm',    'expon',    'gumbel',    'extreme1'    or    'logistic'.")
    y = sort(x)
    xbar = np.mean(x, axis=0)
    N = len(y)
    if (dist == 'norm'):
        s = np.std(x, ddof=1, axis=0)
        w = ((y - xbar) / s)
        logcdf = distributions.norm.logcdf(w)
        logsf = distributions.norm.logsf(w)
        sig = array([15, 10, 5, 2.5, 1])
        critical = around((_Avals_norm / ((1.0 + (4.0 / N)) - ((25.0 / N) / N))), 3)
    elif (dist == 'expon'):
        w = (y / xbar)
        logcdf = distributions.expon.logcdf(w)
        logsf = distributions.expon.logsf(w)
        sig = array([15, 10, 5, 2.5, 1])
        critical = around((_Avals_expon / (1.0 + (0.6 / N))), 3)
    elif (dist == 'logistic'):
        def rootfunc(ab, xj, N):
            (a, b) = ab
            tmp = ((xj - a) / b)
            tmp2 = exp(tmp)
            val = [(np.sum((1.0 / (1 + tmp2)), axis=0) - (0.5 * N)), (np.sum(((tmp * (1.0 - tmp2)) / (1 + tmp2)), axis=0) + N)]
            return array(val)
        sol0 = array([xbar, np.std(x, ddof=1, axis=0)])
        sol = optimize.fsolve(rootfunc, sol0, args=(x, N), xtol=1e-05)
        w = ((y - sol[0]) / sol[1])
        logcdf = distributions.logistic.logcdf(w)
        logsf = distributions.logistic.logsf(w)
        sig = array([25, 10, 5, 2.5, 1, 0.5])
        critical = around((_Avals_logistic / (1.0 + (0.25 / N))), 3)
    elif (dist == 'gumbel_r'):
        (xbar, s) = distributions.gumbel_r.fit(x)
        w = ((y - xbar) / s)
        logcdf = distributions.gumbel_r.logcdf(w)
        logsf = distributions.gumbel_r.logsf(w)
        sig = array([25, 10, 5, 2.5, 1])
        critical = around((_Avals_gumbel / (1.0 + (0.2 / sqrt(N)))), 3)
    else:
        (xbar, s) = distributions.gumbel_l.fit(x)
        w = ((y - xbar) / s)
        logcdf = distributions.gumbel_l.logcdf(w)
        logsf =...

What's a good function header?

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

def anderson(x, dist='norm'):