Handle an incoming response.
554045
def response(self, msgtype, msgid, error, result):
        """"""
        self._proxy.response(msgid, error, result)
913721
def _handle_response(self, request: Request, response: Response):
        ''''''
        self._item_session.update_record_value(status_code=response.reply.code)
        is_listing = isinstance(response, ListingResponse)

        if is_listing and not self._processor.fetch_params.remove_listing or \
                not is_listing:
            filename = self._file_writer_session.save_document(response)
            action = self._result_rule.handle_document(self._item_session, filename)
        else:
            self._file_writer_session.discard_document(response)
            action = self._result_rule.handle_no_document(self._item_session)

        if isinstance(response, ListingResponse):
            self._add_listing_links(response)

        return action
963211
def _result_handler(self, response: Dict[str, Any]):
        
        res = response.get("MESSAGE")
        result = res.get("RESULT")
        return result
1332764
def _handle_response(self, response):
        
        self.client.status = response.code
        self.response_headers = response.headers
        # XXX This workaround (which needs to be improved at that) for possible
        # bug in Twisted with new client:
        # http://twistedmatrix.com/trac/ticket/5476
        if self._method.upper() == 'HEAD' or response.code == NO_CONTENT:
            return succeed('')
        receiver = self.receiver_factory()
        receiver.finished = d = Deferred()
        receiver.content_length = response.length
        response.deliverBody(receiver)
        if response.code >= 400:
            d.addCallback(self._fail_response, response)
        return d
11481
def handle(self):
        """"""
        self.close_connection = 1

        self.handle_one_request()
        while not self.close_connection:
            self.handle_one_request()
939456
def process_response(self, response):
        """"""
        self.response_headers = [(k, v) for k, v in sorted(response.headers.items())]
724822
def handle_error(response):
    """"""
    status_code = response.status_code

    if status_code not in A_OK_HTTP_CODES:
        error_explanation = A_ERROR_HTTP_CODES.get(status_code)
        raise_error = "{}: {}".format(status_code, error_explanation)
        raise Exception(raise_error)
    else:
        return True
238864
def handle_response(self, data):
        """"""
        identifier = data.get('id')
        self._buffer[identifier]['data'] = data.get('result')
        self._buffer[identifier]['flag'].set()
1272335
@Override
    public void handle(T result, HttpResponse response) {
        String expirationHeader =
            response.getHeaders().get(Headers.EXPIRATION);

        if ( expirationHeader != null ) {
            result.setExpirationTime(parseDate(expirationHeader));
            result.setExpirationTimeRuleId(parseRuleId(expirationHeader));
        }
    }
1129826
def handle_response(response)
      type, msgid, error, result = response
      if observable = @requests[msgid]
        @requests[msgid].set_response(result, error)
      else
        warn "unknown response with id=#{msgid}"
      end
    end
504615
def process_response(self, request, response, spider):
        """"""
        return response.replace(body=str(BeautifulSoup(response.body, self.parser)))
89688
def handle_response(self, msg, address):
        """"""
        now = current_time_millis()

        sigs = []
        precache = []

        for record in msg.answers:
            if isinstance(record, DNSSignature):
                sigs.append(record)
            else:
                precache.append(record)

            for e in precache:
                for s in sigs:
                    if self.verify(e, s):
                        # print "DNS: %s verified with %s" % (e,s)

                        if self.adaptive and e.type == _TYPE_A:
                            if e.address == '\x00\x00\x00\x00':
                                e.address = socket.inet_aton(address)

                        if e in self.cache.entries():
                            if e.is_expired(now):
                                for i in self.hooks:
                                    try:
                                        i.remove(e)
                                    except:
                                        pass
                                self.cache.remove(e)
                                self.cache.remove(s)
                            else:
                                entry = self.cache.get(e)
                                sig = self.cache.get(s)
                                if (entry is not None) and (sig is not None):
                                    for i in self.hooks:
                                        try:
                                            i.update(e)
                                        except:
                                            pass
                                    entry.reset_ttl(e)
                                    sig.reset_ttl(s)
                        else:
                            e.rrsig = s
                            self.cache.add(e)
                            self.cache.add(s)
                            for i in self.hooks:
                                try:
                                    i.add(e)
                                except:
                                    pass

                        precache.remove(e)
                        sigs.remove(s)
                        self.update_record(now, record)

        if self.bypass:
            for e in precache:
                if e in self.cache.entries():
                    if e.is_expired(now):
                        for i in self.hooks:
                            try:
                                i.remove(e)
                            except:
                                pass
                        self.cache.remove(e)
                    else:
                        entry = self.cache.get(e)
                        if (entry is not None):
                            for i in self.hooks:
                                try:
                                    i.update(e)
                                except:
                                    pass
                            entry.reset_ttl(e)
                else:
                    self.cache.add(e)
                    for i in self.hooks:
                        try:
                            i.add(e)
                        except:
                            pass

                self.update_record(now, record)
1327590
@Override
    public void handle(T result, HttpResponse response) {
        String transitionHeader = response.getHeaders().get(Headers.IBM_TRANSITION);
        if (transitionHeader != null) {
            result.setTransitionDate(parseDate(transitionHeader));
            String transition = parseTransition(transitionHeader);
            if (transition != null) {
                result.setTransition(transition);
            }
        }
    }
367712
function handleRefreshResponse (key, data, err, response) {
    if(!err) {
      this.set(key, response, (data.lifeSpan / 1000), data.refresh, function(){});
    }
  }
937823
def handle_response(response):
    

    # ignore valid responses
    if response.status_code < 400:
        return

    cls = _status_to_exception_type.get(response.status_code, HttpError)

    kwargs = {
        'code': response.status_code,
        'method': response.request.method,
        'url': response.request.url,
        'details': response.text,
    }

    if response.headers and 'retry-after' in response.headers:
        kwargs['retry_after'] = response.headers.get('retry-after')

    raise cls(**kwargs)
1354362
private void handleResponse(PowerShellResponseHandler response, PowerShellResponse powerShellResponse) {
        try {
            response.handle(powerShellResponse);
        } catch (Exception ex) {
            logger.log(Level.SEVERE, "PowerShell not available", ex);
        }
    }
240975
private void processResponse(Response response) {
        // at this point a server response should contain a secure JSON with challenges
        JSONObject jsonResponse = Utils.extractSecureJson(response);
        JSONObject jsonChallenges = (jsonResponse == null) ? null : jsonResponse.optJSONObject(CHALLENGES_VALUE_NAME);

        if (jsonChallenges != null) {
            startHandleChallenges(jsonChallenges, response);
        } else {
            listener.onSuccess(response);
        }
    }