Check that a registration response contains the registration we were
        expecting.
779979
def _check_regr(self, regr, new_reg):
        
        body = getattr(new_reg, 'body', new_reg)
        for k, v in body.items():
            if k == 'resource' or not v:
                continue
            if regr.body[k] != v:
                raise errors.UnexpectedUpdate(regr)
        if regr.body.key != self.key.public_key():
            raise errors.UnexpectedUpdate(regr)
        return regr
448446
async def check_response(response, valid_response_codes):
    """"""
    if response.status == 204:
        return True
    if response.status in valid_response_codes:
        _js = await response.json()
        return _js
    else:
        raise PvApiResponseStatusError(response.status)
1168149
def process_response(self, req, resp, resource):
        
        if 'result' not in req.context:
            return
        req.context['result']['is_login'] = 'user_id' in req.env['session']
        if settings.DEBUG:
            req.context['result']['_debug_queries'] = sys._debug_db_queries
            sys._debug_db_queries = []
        if resp.body is None and req.context['result']:
            resp.body = json.dumps(req.context['result'])

        try:
            log.debug("RESPONSE: %s" % resp.body)
        except:
            log.exception("ERR: RESPONSE CANT BE LOGGED ")
1019138
def validate_response(self):
        """"""
        if self.response is None:
            logger.error("Failed to submit")
            return False

        if not self.response:
            logger.error(
                "HTTP status %d: failed to submit to %s",
                self.response.status_code,
                self.response.url,
            )
            return False

        if not self.parsed_response:
            logger.error("Submit to %s failed, invalid response received", self.response.url)
            return False

        error_message = self.get_error_message()
        if error_message:
            logger.error("Submit to %s failed with error", self.response.url)
            logger.debug("Error message: %s", error_message)
            return False

        if not self.job_ids:
            logger.error("Submit to %s failed to get job id", self.response.url)
            return False

        logger.info("Results received by the Importer (HTTP status %d)", self.response.status_code)
        logger.info("Job IDs: %s", self.job_ids)

        return True
108090
protected function _verifyResponse($expected)
	{
		$parts = null;

		// Wait for a response from the server, but timeout after the set time limit
		$endTime = time() + $this->timeout;
		$this->response = '';

		do
		{
			$this->response .= fgets($this->conn, 4096);
		}

		while (!preg_match("/^([0-9]{3})(-(.*" . CRLF . ")+\\1)? [^" . CRLF . "]+" . CRLF . "$/", $this->response, $parts) && time() < $endTime);

		// Catch a timeout or bad response
		if (!isset($parts[1]))
		{
			Log::add(
				sprintf(
					'%1$s: Timeout or unrecognised response while waiting for a response from the server. Server response: %2$s',
					__METHOD__, $this->response
				),
				Log::WARNING, 'jerror'
			);

			return false;
		}

		// Separate the code from the message
		$this->_responseCode = $parts[1];
		$this->_responseMsg = $parts[0];

		// Did the server respond with the code we wanted?
		if (is_array($expected))
		{
			if (in_array($this->_responseCode, $expected))
			{
				$retval = true;
			}
			else
			{
				$retval = false;
			}
		}
		else
		{
			if ($this->_responseCode == $expected)
			{
				$retval = true;
			}
			else
			{
				$retval = false;
			}
		}

		return $retval;
	}
1340358
def check_response(response)
      if response.status >= 400
        parsed_body = JSON.parse(response.body)
        raise Errors::GenericError.new(parsed_body['code'], parsed_body['message'])
      end
    end
710443
public void verifyStatus() {
    if (sequential) {
      boolean unopenedIterator = responseIterator == null && !responses.isEmpty();
      if (unopenedIterator || responseIterator.hasNext()) {
        throw new VerificationAssertionError("More executions were expected");
      }
    }
  }
366601
function checkResponse(actual, expected, bindings) {

    debug('Checking response, expecting:', expected)

    addTest('Status: ' + expected.title, function() {
      assert.equal(actual.statusCode, expected.code)
    })

    for (var key in expected.headers) {
      var val = expected.headers[key]
      addTest('Header: ' + key + ': ' + val, function() {
        assert.ok(actual.headers[key], "Header " + key + " expected, but not found")
        assert.ok(interpolate.match(actual.headers[key], val, bindings), "Expected headers to match")
      })
    }

    if (expected.body) {
      assertBodyMatches(actual.body, expected.body, bindings)
    } else {
      addTest('No body', function() {
        if (actual.body) assert.fail(actual.body, '', "Expected empty body")
      })
    }
  }
1104457
def registration_request_verify(registration_request):
    
    try:
        registration_request.verify()
    except MessageException as e:
        raise InvalidClientRegistrationRequest(str(e), registration_request, oauth_error='invalid_request') from e
1249227
function detectResponseError(response) {
  if (response.statusCode && (response.statusCode < 200 || response.statusCode >= 300)) {
    return {
      status: response.statusCode,
      message: response.body || response.message || response
    }
  }
}
947930
def verify(self, **kwargs):
        
        super(RegistrationResponse, self).verify(**kwargs)

        has_reg_uri = "registration_client_uri" in self
        has_reg_at = "registration_access_token" in self
        if has_reg_uri != has_reg_at:
            raise VerificationError((
                "Only one of registration_client_uri"
                " and registration_access_token present"), self)

        return True
330813
def process_response(data):
    """"""
    # We check if the signature is valid. If not return
    if not is_signature_valid(data):
        logger.warning(
            "Django-Payzen : Response signature detected as invalid",
            extra={"stack": True}
        )
        return None

    from . import forms
    from . import models

    # The signature is valid
    vads_trans_id = data.get("vads_trans_id")
    vads_trans_date = data.get("vads_trans_date")
    vads_site_id = data.get("vads_site_id")
    try:
        instance = models.PaymentResponse.objects.get(
            vads_trans_id=vads_trans_id,
            vads_trans_date=vads_trans_date,
            vads_site_id=vads_site_id)
        form = forms.PaymentResponseForm(data, instance=instance)
    except models.PaymentResponse.DoesNotExist:
        form = forms.PaymentResponseForm(data)
    if form.is_valid():
        response = form.save()
        logger.info("Django-Payzen : Transaction {} response received !"
                    .format(response.vads_trans_id))
    else:
        logger.error("Django-Payzen : Response could not be saved - {} {}"
                     .format(form.errors, data),
                     extra={"stack": True})
        response = None
    return response
861767
def verify(self):
        """"""
        if self.is_number() and not self.is_test() and self.is_mod10():
            return self.get_type()
        return None
42798
def check_api_response(self, response):
        
        # check response
        if response.status_code == 200:
            return True
        elif response.status_code >= 400:
            logging.error(
                "{}: {} - {} - URL: {}".format(
                    response.status_code,
                    response.reason,
                    response.json().get("error"),
                    response.request.url,
                )
            )
            return False, response.status_code
771509
public function verifyPage(): ResponseInterface
    {
        $this->checkRegistrationAllowed();

        $title = I18N::translate('User verification');

        return $this->viewResponse('register-page', [
            'title' => $title,
        ]);
    }
45597
def verification_events(self):
        
        queued = self._assemble_event('Verifier_Queued')
        started = self._assemble_event('Verifier_Started')
        return [x for x in [queued, started] if x]
327338
def serviceResponse(self, response):
        '''
        
        '''

        PARCEL_TRUE = "Result: Parcel(00000000 00000001   '........')\r\n"
        ''' The TRUE response parcel '''
        if DEBUG:
            print >>sys.stderr, "serviceResponse: comparing '%s' vs Parcel(%s)" % (response, PARCEL_TRUE)
        return response == PARCEL_TRUE