human
I wrote the below code

    if (not isinstance(bs, (tuple, list))):
        bs = [bs]
        return_as_list = False
    else:
        bs = list(bs)
        return_as_list = True
    eps = constantX(1e-23)
    beta1 = sqrt_inner_product(bs)
    r3s = [b for b in bs]
    r2s = [b for b in bs]
    r1s = [b for b in bs]
    if (Ms is not None):
        r3s = [(b / m) for (b, m) in zip(bs, Ms)]
        beta1 = sqrt_inner_product(r3s, bs)
    bnorm = beta1
    n_params = len(bs)
    def loop(niter, beta, betan, phi, Acond, cs, dbarn, eplnn, rnorm, sn, Tnorm, rnorml, xnorm, Dnorm, gamma, pnorm, gammal, Axnorm, relrnorm, relArnorml, Anorm, flag, *args):
        xs = args[(0 * n_params):(1 * n_params)]
        r1s = args[(1 * n_params):(2 * n_params)]
        r2s = args[(2 * n_params):(3 * n_params)]
        r3s = args[(3 * n_params):(4 * n_params)]
        dls = args[(4 * n_params):(5 * n_params)]
        ds = args[(5 * n_params):(6 * n_params)]
        betal = beta
        beta = betan
        vs = [(r3 / beta) for r3 in r3s]
        (r3s, upds) = compute_Av(*vs)
        r3s = [(r3 - (shift * v)) for (r3, v) in zip(r3s, vs)]
        r3s = [TT.switch(TT.ge(niter, constantX(1.0)), (r3 - ((beta / betal) * r1)), r3) for (r3, r1) in zip(r3s, r1s)]
        alpha = inner_product(r3s, vs)
        r3s = [(r3 - ((alpha / beta) * r2)) for (r3, r2) in zip(r3s, r2s)]
        r1s = [r2 for r2 in r2s]
        r2s = [r3 for r3 in r3s]
        if (Ms is not None):
            r3s = [(r3 / M) for (r3, M) in zip(r3s, Ms)]
            betan = sqrt_inner_product(r2s, r3s)
        else:
            betan = sqrt_inner_product(r3s)
        pnorml = pnorm
        pnorm = TT.switch(TT.eq(niter, constantX(0.0)), TT.sqrt((TT.sqr(alpha) + TT.sqr(betan))), TT.sqrt(((TT.sqr(alpha) + TT.sqr(betan)) + TT.sqr(beta))))
        dbar = dbarn
        epln = eplnn
        dlta = ((cs * dbar) + (sn * alpha))
        gbar = ((sn * dbar) - (cs * alpha))
        eplnn = (sn * betan)
        dbarn = ((- cs) * betan)
        gammal2 = gammal
        gammal = gamma
        (cs, sn,...

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

def minres(compute_Av, bs, rtol=constantX(1e-06), maxit=20, Ms=None, shift=constantX(0.0), maxxnorm=constantX(1000000000000000.0), Acondlim=constantX(1e+16), profile=0):