human
I wrote the below code

    def deco(original):
        def success(result, request):
            code = OK
            headers = {}
            if isinstance(result, EndpointResponse):
                code = result.code
                headers = result.headers
                result = result.result
            if _validate_responses:
                outputValidator.validate(result)
            request.responseHeaders.setRawHeaders('content-type', ['application/json'])
            for (key, value) in headers.items():
                request.responseHeaders.setRawHeaders(key, [value])
            request.setResponseCode(code)
            return dumps(result)
        def doit(self, request, **routeArguments):
            result = maybeDeferred(original, self, request, **routeArguments)
            result.addCallback(success, request)
            return result
        return doit
    return deco

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

def _serialize(outputValidator):