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

    if (vars is None):
        vars = {}
    d = ctx.db.cursor()
    if (not processed):
        (q, vars) = reparam(q, vars)
    ctx.db_execute(d, q, vars)
    if d.description:
        names = [x[0] for x in d.description]
        def iterwrapper():
            x = d.fetchone()
            while x:
                (yield Storage(dict(zip(names, x))))
                x = d.fetchone()
        out = iterbetter(iterwrapper())
        out.__len__ = (lambda : int(d.rowcount))
        out.list = (lambda : [Storage(dict(zip(names, x))) for x in d.fetchall()])
    else:
        out = d.rowcount
    if (not ctx.db_transaction):
        ctx.db.commit()
    return out

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

def query(q, vars=None, processed=False):