human
I wrote the below code

    if (ic == 'WAIC'):
        ic_func = waic
        df_comp = pd.DataFrame(index=np.arange(len(models)), columns=['WAIC', 'pWAIC', 'dWAIC', 'weight', 'SE', 'dSE', 'warning'])
    elif (ic == 'LOO'):
        ic_func = loo
        df_comp = pd.DataFrame(index=np.arange(len(models)), columns=['LOO', 'pLOO', 'dLOO', 'weight', 'SE', 'dSE', 'warning'])
    else:
        raise NotImplementedError('The    information    criterion    {}    is    not    supported.'.format(ic))
    warns = np.zeros(len(models))
    c = 0
    def add_warns(*args):
        warns[c] = 1
    with warnings.catch_warnings():
        warnings.showwarning = add_warns
        warnings.filterwarnings('always')
        ics = []
        for (c, (t, m)) in enumerate(zip(traces, models)):
            ics.append((c, ic_func(t, m, pointwise=True)))
    ics.sort(key=(lambda x: x[1][0]))
    if bootstrap:
        N = len(ics[0][1][3])
        ic_i = np.zeros((len(ics), N))
        for i in range(len(ics)):
            ic_i[i] = (ics[i][1][3] * N)
        b_weighting = dirichlet.rvs(alpha=([alpha] * N), size=b_samples, random_state=seed)
        weights = np.zeros((b_samples, len(ics)))
        z_bs = np.zeros((b_samples, len(ics)))
        for i in range(b_samples):
            z_b = np.dot(ic_i, b_weighting[i])
            u_weights = np.exp(((-0.5) * (z_b - np.min(z_b))))
            z_bs[i] = z_b
            weights[i] = (u_weights / np.sum(u_weights))
        weights_mean = weights.mean(0)
        se = z_bs.std(0)
        for (i, (idx, res)) in enumerate(ics):
            diff = (res[3] - ics[0][1][3])
            d_ic = np.sum(diff)
            d_se = np.sqrt((len(diff) * np.var(diff)))
            df_comp.at[idx] = (res[0], res[2], d_ic, weights_mean[i], se[i], d_se, warns[idx])
    else:
        min_ic = ics[0][1][0]
        Z = np.sum([np.exp(((-0.5) * (x[1][0] - min_ic))) for x in ics])
        for (idx, res) in ics:
            diff = (res[3] - ics[0][1][3])
            d_ic = np.sum(diff)
            d_se = np.sqrt((len(diff) *...

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

def compare(traces, models, ic='WAIC', bootstrap=True, b_samples=1000, alpha=1, seed=None):