<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def validate_response(response, request_method, schema):
 """ Response validation involves the following steps. 4. validate that the response status_code is in the allowed responses for the request method. 5. validate that the response content validates against any provided schemas for the responses. """

    with ErrorDict() as errors:
        # 1
        # TODO: tests
        try:
            api_path = validate_path_to_api_path(
                path=response.path,
                context=schema,
                **schema
            )
        except ValidationError as err:
            errors['path'].extend(list(err.messages))
            return  # this causes an exception to be raised since errors is no longer falsy.

        path_definition = schema['paths'][api_path] or {}

        # TODO: tests
        try:
            operation_definition = validate_request_method_to_operation(
                request_method=request_method,
                path_definition=path_definition,
            )
        except ValidationError as err:
            errors['method'].add_error(err.detail)
            return

        # 4
        try:
            response_definition = validate_status_code_to_response_definition(
                response=response,
                operation_definition=operation_definition,
            )
        except ValidationError as err:
            errors['status_code'].add_error(err.detail)
        else:
            # 5
            response_validator = generate_response_validator(
                api_path,
                operation_definition=operation_definition,
                path_definition=path_definition,
                response_definition=response_definition,
                context=schema,
            )
            try:
                response_validator(response, context=schema)
            except ValidationError as err:
                errors['body'].add_error(err.detail)