human
I wrote the below code

    def error(body):
        raise ResponseError(result.code, body)
    if (result.code != response_code):
        d = content(result)
        d.addCallback(error)
        return d
    return json_content(result)

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

def check_and_decode_json(result, response_code):