<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def response(request, status, obj):
 """ Generate a response. :param IRequest request: The request being responsed to. :param int status: The response status code to set. :param obj: Something JSON-dumpable to write into the response body. :return bytes: The response body to write out. eg, return this from a *render_* method. """

    request.setResponseCode(status)
    request.responseHeaders.setRawHeaders(
        u"content-type", [u"application/json"],
    )
    body = dumps_bytes(obj)
    return body