The real guts of parseNetworkResponse. Broken out for readability.
191891
private Response<Bitmap> doParse(NetworkResponse response) {
        byte[] data = response.data;
        BitmapFactory.Options decodeOptions = new BitmapFactory.Options();
        Bitmap bitmap = null;
        if (mMaxWidth == 0 && mMaxHeight == 0) {
            decodeOptions.inPreferredConfig = mDecodeConfig;
            bitmap = BitmapFactory.decodeByteArray(data, 0, data.length, decodeOptions);
        } else {
            // If we have to resize this image, first get the natural bounds.
            decodeOptions.inJustDecodeBounds = true;
            BitmapFactory.decodeByteArray(data, 0, data.length, decodeOptions);
            int actualWidth = decodeOptions.outWidth;
            int actualHeight = decodeOptions.outHeight;

            // Then compute the dimensions we would ideally like to decode to.
            int desiredWidth = getResizedDimension(mMaxWidth, mMaxHeight,
                    actualWidth, actualHeight, mScaleType);
            int desiredHeight = getResizedDimension(mMaxHeight, mMaxWidth,
                    actualHeight, actualWidth, mScaleType);

            // Decode to the nearest power of two scaling factor.
            decodeOptions.inJustDecodeBounds = false;

             decodeOptions.inPreferQualityOverSpeed = PREFER_QUALITY_OVER_SPEED;
            decodeOptions.inSampleSize =
                findBestSampleSize(actualWidth, actualHeight, desiredWidth, desiredHeight);
            Bitmap tempBitmap =
                BitmapFactory.decodeByteArray(data, 0, data.length, decodeOptions);

            // If necessary, scale down to the maximal acceptable size.
            if (tempBitmap != null && (tempBitmap.getWidth() > desiredWidth ||
                    tempBitmap.getHeight() > desiredHeight)) {
                bitmap = Bitmap.createScaledBitmap(tempBitmap,
                        desiredWidth, desiredHeight, true);
            } else {
                bitmap = tempBitmap;
            }
        }

        if (bitmap == null) {
            return Response.error(new ParseError(response));
        } else {
            return Response.success(bitmap, HttpHeaderParser.parseCacheHeaders(response));
        }
    }
910028
def post_parse(self, uri, params={}, data={}):
        '''
        '''
        return self._request_parse(self.post, uri, params, data)
1219363
def __parseResponse(self, result):
        """"""
        response = []
        for data in result['data'] :
            result_dict={}
            for k,v in data.items() :
                column = self.getOutputColumn(k)
                if column != None:
                    type = column.getSqlColumnType()
                    if type != None and type.startswith('int'): 
                        result_dict.update({
                                k : int(v)
                        })
                    elif type != None and type.startswith('float'):
                        result_dict.update({
                                k : float(v)
                        })
                    elif type != None  and type.startswith('timestamp'):
                        (dt, mSecs)= v.split(".")
                        dt = datetime.strptime(dt,"%Y-%m-%dT%H:%M:%S")
                        mSeconds = timedelta(microseconds = int(mSecs))
                        result_dict.update({
                                k : dt+mSeconds
                        })
                    else :
                        result_dict.update({
                                k : v
                        })                    
            response.append(result_dict)
        return response
2690
private void processBatchRequestResponse(CloseableHttpResponse response) throws IOException,
      UnexpectedResponseException {
    String entityStr = EntityUtils.toString(response.getEntity());
    int statusCode = response.getStatusLine().getStatusCode();
    if (statusCode >= 400) {
      throw new RuntimeException("Failed due to " + entityStr + " (Detail: "
          + ToStringBuilder.reflectionToString(response, ToStringStyle.SHORT_PREFIX_STYLE) + " )");
    }

    JsonObject jsonBody = new JsonParser().parse(entityStr).getAsJsonObject();
    if (!jsonBody.get("hasErrors").getAsBoolean()) {
      return;
    }

    JsonArray results = jsonBody.get("results").getAsJsonArray();
    for (JsonElement jsonElem : results) {
      JsonObject json = jsonElem.getAsJsonObject();
      int subStatusCode = json.get("statusCode").getAsInt();
      if (subStatusCode < 400) {
        continue;
      } else if (subStatusCode == 400
                 && Operation.INSERT_ONLY_NOT_EXIST.equals(operation)) {
        JsonElement resultJsonElem = json.get("result");
        Preconditions.checkNotNull(resultJsonElem, "Error response should contain result property");
        JsonObject resultJsonObject = resultJsonElem.getAsJsonArray().get(0).getAsJsonObject();
        if (isDuplicate(resultJsonObject, subStatusCode)) {
          continue;
        }
      }
      throw new RuntimeException("Failed due to " + jsonBody + " (Detail: "
          + ToStringBuilder.reflectionToString(response, ToStringStyle.SHORT_PREFIX_STYLE) + " )");
    }
  }
623199
private void parseResponse(HttpResponse response) throws MPException {
        this.statusCode = response.getStatusLine().getStatusCode();
        this.reasonPhrase = response.getStatusLine().getReasonPhrase();

        if (response.getEntity() != null) {
            HttpEntity respEntity = response.getEntity();
            try {
                this.stringResponse = MPCoreUtils.inputStreamToString(respEntity.getContent());
            } catch (Exception ex) {
                throw new MPException(ex);
            }

            // Try to parse the response to a json, and a extract the entity of the response.
            // When the response is not a json parseable string then the string response must be used.
            try {
                this.jsonElementResponse = new JsonParser().parse(this.stringResponse);

            } catch (JsonParseException jsonParseException) {
                // Do nothing
            }
        }
    }
335913
def parse(self, response):
        
        self.headers = response.headers

        if 'xml' in self.headers.get('Content-Type'):
            # Got an XML response, likely an error code.
            xml = xmltodict.parse(response.text)
            self.analyze_reply_code(xml_response_dict=xml)

        lines = response.text.split('\r\n')
        if len(lines) < 3:
            lines = response.text.split('\n')

        for line in lines:
            line = line.strip()

            name, value = self.read_line(line)
            if name:
                if name in self.valid_transactions or re.match(pattern='/^X\-/', string=name):
                    self.capabilities[name] = value
                else:
                    self.details[name] = value
124617
function buildResponse(data) {
    var response = {};
    response.totalItems = data.length;
    response.itemsPerPage = itemsPerPage;
    response.totalPages = itemsPerPage === null ? 1 : Math.ceil(data.length / itemsPerPage);
    response.currentPage = itemsPerPage === null ? 1 : currentPage;
    response.data = itemsPerPage === null ? data : data.slice(itemsPerPage * (currentPage - 1), itemsPerPage);

    return response;
}
720403
private void parseResponse(ModelNode response, AsyncCallback<Map<String,String>> callback) {

        //System.out.println(response.toString());

        Map<String, String> serverValues = new HashMap<String,String>();

        if(isStandalone)
        {
            serverValues.put("Standalone Server", response.get(RESULT).asString());
        }
        else if(response.hasDefined("server-groups"))
        {

            List<Property> groups = response.get("server-groups").asPropertyList();
            for(Property serverGroup : groups)
            {
                List<Property> hosts = serverGroup.getValue().get("host").asPropertyList();
                for(Property host : hosts)
                {
                    List<Property> servers = host.getValue().asPropertyList();
                    for(Property server : servers)
                    {
                        serverValues.put(server.getName(),
                                server.getValue().get("response").get("result").asString()
                        );
                    }
                }
            }
        }

        callback.onSuccess(serverValues);
    }
1331623
def decode_produce_response(cls, response):
        
        return [
            kafka.structs.ProduceResponsePayload(topic, partition, error, offset)
            for topic, partitions in response.topics
            for partition, error, offset in partitions
        ]
454713
def parse_response(response)
      case response.content_type
      when JSON_CONTENT_TYPE
        JSON.parse(response.body, quirks_mode: true, symbolize_names: true)
      else
        response.body
      end
    end
446146
function parse(method, req, res, options) {
    return new Promise(function(resolve, reject) {
        BodyParser[method](options)(req, res, function(err) {
            if (err) {
                return reject(err);
            }

            return resolve();
        });
    });
}
995024
function handleResponse() {
		if (this.readyState === 4 && this.pendingInteraction && !this.pendingInteraction.completed) {
			// enrich interaction with information
			var sContentLength = this.getResponseHeader("content-length"),
				bCompressed = this.getResponseHeader("content-encoding") === "gzip",
				sFesrec = this.getResponseHeader("sap-perf-fesrec");
			this.pendingInteraction.bytesReceived += sContentLength ? parseInt(sContentLength) : 0;
			this.pendingInteraction.bytesReceived += this.getAllResponseHeaders().length;
			this.pendingInteraction.bytesSent += this.requestHeaderLength || 0;
			// this should be true only if all responses are compressed
			this.pendingInteraction.requestCompression = bCompressed && (this.pendingInteraction.requestCompression !== false);
			// sap-perf-fesrec header contains milliseconds
			this.pendingInteraction.networkTime += sFesrec ? Math.round(parseFloat(sFesrec, 10) / 1000) : 0;
			var sSapStatistics = this.getResponseHeader("sap-statistics");
			if (sSapStatistics) {
				var aTimings = window.performance.getEntriesByType("resource");
				this.pendingInteraction.sapStatistics.push({
					// add response url for mapping purposes
					url: this.responseURL,
					statistics: sSapStatistics,
					timing: aTimings ? aTimings[aTimings.length - 1] : undefined
				});
			}
			delete this.requestHeaderLength;
			delete this.pendingInteraction;
		}
	}
146937
private String parseEnvelope() {
        List<String> response = new ArrayList<>();
        //1. Date ---------------
        response.add(LB + Q + sentDateEnvelopeString + Q + SP);
        //2. Subject ---------------
        if (subject != null && (subject.length() != 0)) {
            response.add(Q + escapeHeader(subject) + Q + SP);
        } else {
            response.add(NIL + SP);
        }
        //3. From ---------------
        addAddressToEnvelopeIfAvailable(from, response);
        response.add(SP);
        //4. Sender ---------------
        addAddressToEnvelopeIfAvailableWithNetscapeFeature(sender, response);
        response.add(SP);
        addAddressToEnvelopeIfAvailableWithNetscapeFeature(replyTo, response);
        response.add(SP);
        addAddressToEnvelopeIfAvailable(to, response);
        response.add(SP);
        addAddressToEnvelopeIfAvailable(cc, response);
        response.add(SP);
        addAddressToEnvelopeIfAvailable(bcc, response);
        response.add(SP);
        if (inReplyTo != null && inReplyTo.length > 0) {
            response.add(inReplyTo[0]);
        } else {
            response.add(NIL);
        }
        response.add(SP);
        if (messageID != null && messageID.length > 0) {
            messageID[0] = escapeHeader(messageID[0]);
            response.add(Q + messageID[0] + Q);
        } else {
            response.add(NIL);
        }
        response.add(RB);

        StringBuilder buf = new StringBuilder(16 * response.size());
        for (String aResponse : response) {
            buf.append(aResponse);
        }

        return buf.toString();
    }
1052780
function parseTextBody(req, res, next){
    if (req.body === undefined) {
      req.body = '';
      req.on('data', function(chunk){ req.body += chunk });
      req.on('end', next);
    } else {
      next();
    }
  }
284567
def wrapped_resource(response):
    
    # decode response text, assuming utf-8 if unset
    response_content = response.content.decode(response.encoding or 'utf-8')

    try:
        content = json.loads(response_content)
    except ValueError:
        # not JSON
        content = response_content
    if isinstance(content, list):
        result = ResourceList(content)
    else:
        result = Resource(content)
        if hasattr(result, 'collection'):
            result.collection = ResourceList(result.collection)
    result.raw_data = response_content

    for attr in ('encoding', 'url', 'status_code', 'reason'):
        setattr(result, attr, getattr(response, attr))

    return result
163769
def _parse_method_response(self, method_name, method_response, httpStatus):
        '''
        
        '''
        method_response_models = {}
        method_response_pattern = '.*'
        if method_response.schema:
            method_response_models['application/json'] = method_response.schema
            method_response_pattern = self._get_pattern_for_schema(method_response.schema, httpStatus)

        method_response_params = {}
        method_integration_response_params = {}
        for header in method_response.headers:
            response_header = 'method.response.header.{0}'.format(header)
            method_response_params[response_header] = False
            header_data = method_response.headers.get(header)
            method_integration_response_params[response_header] = (
                "'{0}'".format(header_data.get('default')) if 'default' in header_data else "'*'")

        response_templates = self._get_response_template(method_name, httpStatus)

        return {'params': method_response_params,
                'models': method_response_models,
                'integration_params': method_integration_response_params,
                'pattern': method_response_pattern,
                'response_templates': response_templates}
86310
async def parse_result(response, response_type=None, *, encoding="utf-8"):
    
    if response_type is None:
        ct = response.headers.get("content-type")
        if ct is None:
            cl = response.headers.get("content-length")
            if cl is None or cl == "0":
                return ""
            raise TypeError(
                "Cannot auto-detect response type "
                "due to missing Content-Type header."
            )
        main_type, sub_type, extras = parse_content_type(ct)
        if sub_type == "json":
            response_type = "json"
        elif sub_type == "x-tar":
            response_type = "tar"
        elif (main_type, sub_type) == ("text", "plain"):
            response_type = "text"
            encoding = extras.get("charset", encoding)
        else:
            raise TypeError("Unrecognized response type: {ct}".format(ct=ct))
    if "tar" == response_type:
        what = await response.read()
        return tarfile.open(mode="r", fileobj=BytesIO(what))
    if "json" == response_type:
        data = await response.json(encoding=encoding)
    elif "text" == response_type:
        data = await response.text(encoding=encoding)
    else:
        data = await response.read()
    return data