human
I wrote the below code

    def grad_and_aux_fun(*args, **kwargs):
        saved = (lambda : None)
        def return_val_save_aux(*args, **kwargs):
            (val, saved.aux) = fun(*args, **kwargs)
            return val
        gradval = grad(return_val_save_aux, argnum)(*args, **kwargs)
        return (gradval, saved.aux)
    return grad_and_aux_fun

What's a good function header?

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

def grad_and_aux(fun, argnum=0):