Parse the response from the device and return a map containing the property names and their values.
@param response The response from the device.
@return A map containing the property names as the keys and their values.
970650
public Map<Names, String> parseResponse(JSONArray response) throws CommandExecutionException {
        if (response == null) throw  new CommandExecutionException(CommandExecutionException.Error.INVALID_RESPONSE);
        if (response.length() != props.length) throw  new CommandExecutionException(CommandExecutionException.Error.INVALID_RESPONSE);
        Map<Names, String> ret = new HashMap<>(props.length);
        for (int i = 0; i < props.length; i++){
            ret.put(props[i], response.optString(i, ""));
        }
        return ret;
    }
679119
protected void parseRequest(HttpServletRequest request,
                                HttpServletResponse response) {
        requestParams = new HashMap<String, Object>();
        listFiles = new ArrayList<FileItemStream>();
        listFileStreams = new ArrayList<ByteArrayOutputStream>();

        // Parse the request
        if (ServletFileUpload.isMultipartContent(request)) {
            // multipart request
            try {
                ServletFileUpload upload = new ServletFileUpload();
                FileItemIterator iter = upload.getItemIterator(request);
                while (iter.hasNext()) {
                    FileItemStream item = iter.next();
                    String name = item.getFieldName();
                    InputStream stream = item.openStream();
                    if (item.isFormField()) {
                        requestParams.put(name,
                                          Streams.asString(stream));
                    } else {
                        String fileName = item.getName();
                        if (fileName != null && !"".equals(fileName.trim())) {
                            listFiles.add(item);

                            ByteArrayOutputStream os = new ByteArrayOutputStream();
                            IOUtils.copy(stream,
                                         os);
                            listFileStreams.add(os);
                        }
                    }
                }
            } catch (Exception e) {
                logger.error("Unexpected error parsing multipart content",
                             e);
            }
        } else {
            // not a multipart
            for (Object mapKey : request.getParameterMap().keySet()) {
                String mapKeyString = (String) mapKey;

                if (mapKeyString.endsWith("[]")) {
                    // multiple values
                    String values[] = request.getParameterValues(mapKeyString);
                    List<String> listeValues = new ArrayList<String>();
                    for (String value : values) {
                        listeValues.add(value);
                    }
                    requestParams.put(mapKeyString,
                                      listeValues);
                } else {
                    // single value
                    String value = request.getParameter(mapKeyString);
                    requestParams.put(mapKeyString,
                                      value);
                }
            }
        }
    }
1280512
function parseApplications(response) {
  let entities = {};
  Object.keys(response).forEach(key => {
    entities[key] = parseApplication(response[key]);
  });
  return entities;
}
62536
public Object string_to_resource(Class<?> responseClass, String response)
	{
		try
		{
			Gson gson = new Gson();
			return gson.fromJson(response, responseClass);
		}catch(Exception e)
		{
			System.out.println(e.getMessage());
		}
		
		return null;
	}
941963
private JSONObject getConvertedResponseAsJson(SpellCheckResponse response) {

        if (null == response) {
            return null;
        }

        final JSONObject suggestions = new JSONObject();
        final Map<String, Suggestion> solrSuggestions = response.getSuggestionMap();

        // Add suggestions to the response
        for (final String key : solrSuggestions.keySet()) {

            // Indicator to ignore words that are erroneously marked as misspelled.
            boolean ignoreWord = false;

            // Suggestions that are in the form "Xxxx" -> "xxxx" should be ignored.
            if (Character.isUpperCase(key.codePointAt(0))) {
                final String lowercaseKey = key.toLowerCase();
                // If the suggestion map doesn't contain the lowercased word, ignore this entry.
                if (!solrSuggestions.containsKey(lowercaseKey)) {
                    ignoreWord = true;
                }
            }

            if (!ignoreWord) {
                try {
                    // Get suggestions as List
                    final List<String> l = solrSuggestions.get(key).getAlternatives();
                    suggestions.put(key, l);
                } catch (JSONException e) {
                    LOG.debug("Exception while converting Solr spellcheckresponse to JSON. ", e);
                }
            }
        }

        return suggestions;
    }
361639
@Override
	public Map<String, Object> readKeyValues() {
		Map<String, Object> result = new HashMap<String, Object>();
		readKeyValues(result);
		return result;
	}
1250986
protected Token responseToToken(Map<String, String> response) {
		return new Token(response.get(OAUTH_TOKEN), response.get(OAUTH_TOKEN_SECRET));
	}
214636
public static byte[] serialize(Response response) {
    MiniMessagePack.Packer packer = new MiniMessagePack.Packer();
    packer.pack(VERSION);
    packer.pack(RESPONSE_MAGIC);
    packer.pack(response.getPayload());
    packer.pack(response.getSignature());
    return packer.getBytes();
  }
1084835
private Collection<String> buildTopicNames(Response response) {
		Collection<String> topicNames = new HashSet<>();
		
		Collection<String> detectionSystemNames = appSensorServer.getConfiguration().getRelatedDetectionSystems(response.getDetectionSystem());
		
		for(String detectionSystemName : detectionSystemNames) {
			topicNames.add(KafkaUtils.buildResponseTopicName(detectionSystemName));
		}

		return topicNames;
	}
321405
static public Map<String,Object> propertiesToMap(Properties properties)
    {
        Map<String,Object> map = null;
        if (properties != null)
        {
	        map = new Hashtable<String,Object>();
	        for (Object key : properties.keySet())
	        {
                map.put((String)key, properties.get(key));	            
	        }
        }
        return map;
    }
1166340
@Override
    public Map<String, Object> getParameters(
            HttpServletRequest request, HttpServletResponse response) {
        final Map<String, Object> mergedParameters = new LinkedHashMap<String, Object>();

        for (final TransformerConfigurationSource source : this.sources) {
            final Map<String, Object> parameters = source.getParameters(request, response);
            if (parameters != null) {
                mergedParameters.putAll(parameters);
            }
        }

        return mergedParameters;
    }
801383
def parseTlvProperties(response):
    
    d = {
            'raw': response,
        }

    # create a new list to consume it
    tmp = list(response)
    while tmp:
        tag = tmp[0]
        len = tmp[1]
        data = tmp[2:2 + len]

        if PCSCv2_PART10_PROPERTY_sFirmwareID == tag:
            # convert to a string
            data = "".join([chr(c) for c in data])
        # we now suppose the value is an integer
        elif 1 == len:
            # byte
            data = data[0]
        elif 2 == len:
            # 16 bits value
            data = data[1] * 256 + data[0]
        elif 4 == len:
            # 32 bits value
            data = ((data[3] * 256 + data[2]) * 256 + data[1]) * 256 + data[0]

        # store the value in the dictionnary
        try:
            d[Properties[tag]] = data
        except KeyError:
            d["UNKNOWN"] = data

        del tmp[0:2 + len]

    return d
191131
public static JSONObject extractSecureJson(Response response) {
        try {
            String responseText = response.getResponseText();

            if (!responseText.startsWith(SECURE_PATTERN_START) || !responseText.endsWith(SECURE_PATTERN_END)) {
                return null;
            }

            int startIndex = responseText.indexOf(SECURE_PATTERN_START);
            int endIndex = responseText.indexOf(SECURE_PATTERN_END, responseText.length() - SECURE_PATTERN_END.length() - 1);

            String jsonString = responseText.substring(startIndex + SECURE_PATTERN_START.length(), endIndex);

            return new JSONObject(jsonString);
        } catch (Throwable t) {
            logger.error("extractSecureJson failed with exception: " + t.getLocalizedMessage(), t);
            return null;
        }
    }
1016546
def _parse_properties(response, result_class):
    '''
    
    '''

    if response is None or response.headers is None:
        return None

    props = result_class()
    for key, value in response.headers:
        info = GET_PROPERTIES_ATTRIBUTE_MAP.get(key)
        if info:
            if info[0] is None:
                setattr(props, info[1], info[2](value))
            else:
                attr = getattr(props, info[0])
                setattr(attr, info[1], info[2](value))

    return props
286220
public static StringBuilder computeMessageBuffer(HttpResponse response) {
    StringBuilder builder = new StringBuilder();
    int statusCode = response.getStatusCode();
    if (statusCode != 0) {
      builder.append(statusCode);
    }
    String statusMessage = response.getStatusMessage();
    if (statusMessage != null) {
      if (statusCode != 0) {
        builder.append(' ');
      }
      builder.append(statusMessage);
    }
    return builder;
  }
1125586
public User parseResponse(JSONObject response) throws JSONException {
        GsonBuilder gsonBuilder = new GsonBuilder();
        gsonBuilder.registerTypeAdapter(Date.class, new JsonDeserializer<Date>() {

            @Override
            public Date deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException {
                try {
                    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                    return format.parse(jsonElement.getAsString());
                } catch (ParseException e) {
                    return null;
                }
            }
        });
        Gson gson = gsonBuilder.setDateFormat("yyyy-MM-dd HH:mm:ss").create();
        User user = gson.fromJson(String.valueOf(response.get("data")), User.class);
        user = parseArray(user, response.getJSONObject("data"));
        return user;
    }
1033487
public Object getResponseProp(String key) {
        return responseProps == null ? null : responseProps.get(key);
    }