<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_output_data( self, original_res, serialized_res, formatted_res, request):
 """ Validate the response data. :param response: ``HttpResponse`` :param data: payload data. This implementation assumes dict or list of dicts. :raises: `HttpStatusCodeError` if data is not valid """


        validator = self.representation

        # when not to validate...
        if not validator:
            return

        try:
            if isinstance(serialized_res, (list, tuple)):
                map(validator.validate, serialized_res)
            else:
                validator.validate(serialized_res)
        except ValidationError, exc:
            self._output_validation_failed(exc, serialized_res, request)