human
Give me a the Python code you requested given the following:
Complete the below
def assert_error(response, status_code, headers=None, **kwargs):

    ''''Assert error response has the expected status_code and kwargs.
    Asserts that the response body is a JSON object containing an error message
    and all provided kwargs.
    If error is not passed as a kwarg, only the presence of an error message
    will be asserted, not its content.'
    '''
assistant
#Here is the Python code you requested.
    headers = (headers or {})
    def error_cmp(response_body, body):
        return (isinstance(response_body, dict) and (set(response_body.keys()) == set((list(body.keys()) + ['error']))) and all(((response_body.get(k) == v) for (k, v) in body.items())))
    assert_json_response(response, status_code, kwargs, headers, error_cmp)