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

    def double_val_fun(*args, **kwargs):
        val = fun(*args, **kwargs)
        return make_tuple(val, unbox_if_possible(val))
    gradval_and_val = grad_and_aux(double_val_fun, argnum)
    flip = (lambda x, y: make_tuple(y, x))
    return (lambda *args, **kwargs: flip(*gradval_and_val(*args, **kwargs)))

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

def value_and_grad(fun, argnum=0):