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

    if (mtrace.nchains < 2):
        raise ValueError('Calculation    of    effective    sample    size    requires    multiple    chains    of    the    same    length.')
    def get_vhat(x):
        num_samples = x.shape[(-2)]
        B = (num_samples * np.var(np.mean(x, axis=(-2)), axis=(-1), ddof=1))
        W = np.mean(np.var(x, axis=(-2), ddof=1), axis=(-1))
        Vhat = (((W * (num_samples - 1)) / num_samples) + (B / num_samples))
        return Vhat
    def get_neff(x, Vhat):
        num_chains = x.shape[(-1)]
        num_samples = x.shape[(-2)]
        negative_autocorr = False
        t = 1
        rho = np.ones(num_samples)
        while ((not negative_autocorr) and (t < num_samples)):
            variogram = np.mean(((x[t:, :] - x[:(- t), :]) ** 2))
            rho[t] = (1.0 - (variogram / (2.0 * Vhat)))
            negative_autocorr = (sum(rho[(t - 1):(t + 1)]) < 0)
            t += 1
        if (t % 2):
            t -= 1
        return min((num_chains * num_samples), int(((num_chains * num_samples) / (1.0 + (2 * rho[1:(t - 1)].sum())))))
    n_eff = {}
    for var in mtrace.varnames:
        x = np.array(mtrace.get_values(var, combine=False))
        if (len(x.shape) == 2):
            is_scalar = True
            x = np.atleast_3d(mtrace.get_values(var, combine=False))
        else:
            is_scalar = False
        x = x.transpose()
        Vhat = get_vhat(x)
        _n_eff = np.zeros(x.shape[:(-2)])
        for tup in np.ndindex(*list(x.shape[:(-2)])):
            _n_eff[tup] = get_neff(x[tup], Vhat[tup])
        if is_scalar:
            n_eff[var] = _n_eff[0]
        else:
            n_eff[var] = np.transpose(_n_eff)
    return n_eff

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

def effective_n(mtrace):