human
I wrote the below code

    from theano.tensor import arange
    assert isinstance(expression, Variable), 'tensor.jacobian    expects    a    Variable    as    `expression`'
    assert (expression.ndim < 2), 'tensor.jacobian    expects    a    1    dimensional    variable    as    `expression`.    If    not    use    flatten    to    make    it    a    vector'
    using_list = isinstance(wrt, list)
    using_tuple = isinstance(wrt, tuple)
    if isinstance(wrt, (list, tuple)):
        wrt = list(wrt)
    else:
        wrt = [wrt]
    if (expression.ndim == 0):
        return format_as(using_list, using_tuple, grad(expression, wrt, consider_constant=consider_constant, disconnected_inputs=disconnected_inputs))
    def inner_function(*args):
        idx = args[0]
        expr = args[1]
        rvals = []
        for inp in args[2:]:
            rval = grad(expr[idx], inp, consider_constant=consider_constant, disconnected_inputs=disconnected_inputs)
            rvals.append(rval)
        return rvals
    (jacobs, updates) = theano.scan(inner_function, sequences=arange(expression.shape[0]), non_sequences=([expression] + wrt))
    assert (not updates), 'Scan    has    returned    a    list    of    updates.    This    should    not    happen!    Report    this    to    theano-users    (also    include    the    script    that    generated    the    error)'
    return format_as(using_list, using_tuple, jacobs)

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

def jacobian(expression, wrt, consider_constant=None, disconnected_inputs='raise'):