human
I wrote the below code

    if (phi0 is None):
        phi0 = phi(zero)
    else:
        phi0 = phi0
    if ((derphi0 is None) and (derphi is not None)):
        derphi0 = derphi(zero)
    else:
        derphi0 = derphi0
    alpha0 = zero
    alpha0.name = 'alpha0'
    if (old_phi0 is not None):
        alpha1 = TT.minimum(one, (((numpy.asarray(1.01, dtype=theano.config.floatX) * numpy.asarray(2, dtype=theano.config.floatX)) * (phi0 - old_phi0)) / derphi0))
    else:
        old_phi0 = nan
        alpha1 = one
    alpha1 = TT.switch((alpha1 < zero), one, alpha1)
    alpha1.name = 'alpha1'
    phi0 = TT.switch(TT.eq(alpha1, zero), old_phi0, phi0)
    phi_a1 = ifelse(TT.eq(alpha1, zero), phi0, phi(alpha1), name='phi_a1')
    phi_a1.name = 'phi_a1'
    phi_a0 = phi0
    phi_a0.name = 'phi_a0'
    derphi_a0 = derphi0
    derphi_a0.name = 'derphi_a0'
    c1 = TT.as_tensor_variable(c1)
    c2 = TT.as_tensor_variable(c2)
    maxiter = n_iters
    def while_search(alpha0, alpha1, phi_a0, phi_a1, derphi_a0, i_t, alpha_star, phi_star, derphi_star):
        derphi_a1 = derphi(alpha1)
        cond1 = TT.bitwise_or((phi_a1 > (phi0 + ((c1 * alpha1) * derphi0))), TT.bitwise_and((phi_a1 >= phi_a0), (i_t > zero)))
        cond2 = (abs(derphi_a1) <= ((- c2) * derphi0))
        cond3 = (derphi_a1 >= zero)
        (alpha_star_c1, phi_star_c1, derphi_star_c1) = _zoom(alpha0, alpha1, phi_a0, phi_a1, derphi_a0, phi, derphi, phi0, derphi0, c1, c2, profile=profile)
        (alpha_star_c3, phi_star_c3, derphi_star_c3) = _zoom(alpha1, alpha0, phi_a1, phi_a0, derphi_a1, phi, derphi, phi0, derphi0, c1, c2, profile=profile)
        nw_alpha1 = (alpha1 * numpy.asarray(2, dtype=theano.config.floatX))
        nw_phi = phi(nw_alpha1)
        (alpha_star, phi_star, derphi_star) = ifelse(cond1, (alpha_star_c1, phi_star_c1, derphi_star_c1), ifelse(cond2, (alpha1, phi_a1, derphi_a1), ifelse(cond3, (alpha_star_c3, phi_star_c3, derphi_star_c3), (nw_alpha1, nw_phi, nan), name='alphastar_c3'), name='alphastar_c2'), name='alphastar_c1')
        return ([alpha1, nw_alpha1,...

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

def scalar_search_wolfe2(phi, derphi, phi0=None, old_phi0=None, derphi0=None, n_iters=20, c1=0.0001, c2=0.9, profile=False):