human
I wrote the below code

    if ('resource' in get_argnames(action)):
        shim = action
    else:
        def shim(req, resp, resource, kwargs):
            action(req, resp, kwargs)
    @wraps(responder)
    def do_before(self, req, resp, **kwargs):
        shim(req, resp, self, kwargs)
        responder(self, req, resp, **kwargs)
    return do_before

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

def _wrap_with_before(action, responder):