Parses the json_response, wraps it in an array if needed and filters the
 fields based on the selected_fields
765627
def filter_result(json_response)
      result = JSON[json_response] rescue []
      result = [result] unless result.is_a? Array
      result.map! { |r| r.select! { |k, _v| selected_fields.any? { |f| f.match k } } } unless selected_fields.empty?
      result
    end
1143845
protected function parse()
    {
        $json = $this->httpResponse->json();

        $this->services = [];

        foreach ($json['objects'] as $serviceJson) {
            $this->services[] = $this->parseService($serviceJson);
        }
    }
957553
def _parse_fields(self, result, field_name):
        
        field_list = []
        for key, value in result.get('schema', {}).get(field_name, {}).items():
            if key not in field_list:
                field_list.append(key)
        return field_list
1076275
private function parseDateFields()
    {
        if ('' === $this->getFromDate()) {
            $this->unsFromDate();
        }

        if ('' === $this->getToDate()) {
            $this->unsToDate();
        }

        foreach ([self::FROM_DATE, self::TO_DATE] as $dateField) {
            if ($this->hasData($dateField) && is_string($this->getData($dateField))) {
                $this->setData($dateField, $this->dateFilter->filter($this->getData($dateField)));
            }
        }
    }
222253
private function process($post_fields)
    {
        $string = $this->build_query_string($post_fields);
        $result = $this->curl($string);
        $parsed = $this->parse_result($result);

        return $parsed;
    }
10424
async def handle_json_response(responses):
        
        json_data = {}
        if responses.status != 200:
            err_msg = HttpProcessingError(code=responses.status,
                                          message=await responses.json())
            logging.error("Wallabag: aiohttp error {err_msg}".format(
                err_msg=err_msg))
        else:
            try:
                json_data = responses.json()
            except ClientResponseError as e:
                # sometimes json_data does not return any json() without
                # any error. This is due to the grabbing URL which "rejects"
                # the URL
                logging.error("Wallabag: aiohttp error {code} {message}"
                              .format(code=e.code, message=e.message))
        return await json_data
1160298
def get_jsonparsed_data(url):
    
    response = urlopen(url)
    data = response.read().decode('utf-8')
    return json.loads(data)
48383
private JsonArray getJsonFromResponse(HttpResponse response) throws IOException
    {
        InputStream content = response.getEntity().getContent();
        Reader reader = new InputStreamReader(content);
        JsonObject json = gson.fromJson(reader, JsonObject.class);
        JsonElement jsonElement = json.get("rows");
        return jsonElement == null ? null : jsonElement.getAsJsonArray();
    }
255036
def parse_filter(filter)
      filter.is_a?(Hash) ? URI.encode(filter.to_json) : filter
    end
487997
private String parseResponseAlbumIds(String json) {
    StringJoiner sj = new StringJoiner(",");
    try {
      JsonNode jsonNode = this.objectMapper.readTree(json);
      for (JsonNode node : jsonNode.get("albums").get("items")) {
        sj.add(node.get("id").asText());
      }
    } catch (IOException e) {
      throw new RuntimeException("Failed to parse JSON", e);
    }
    return sj.toString();
  }
11459
def fields_from_json(json)
      fields = {
        :transaction_id => json['x_trans_id'],
        :invoice_num => json['x_invoice_num'],
        :subscription_id => json['x_subscription_id'],
        :subscription_paynum => json['x_subscription_paynum'],
        :transaction_type => json['x_type'],
        :card_type => json['x_card_type'],
        :account_number => json['x_account_number'],
        :description => json['x_description'],
        :response_reason_code => json['x_response_reason_code'],
        :response_reason_text => json['x_response_reason_text']
      }
      begin
        fields[:amount] = BigDecimal.new(json['x_amount'])
      rescue TypeError
        fields[:amount] = nil
      end
      return fields
    end
730037
def deserialize(self, response_json):
        
        response_objects = dict()
        if all((t in response_json for t in ('ticket', 'audit'))):
            response_objects["ticket_audit"] = self.object_mapping.object_from_json(
                "ticket_audit",
                response_json
            )

        # Locate and store the single objects.
        for zenpy_object_name in self.object_mapping.class_mapping:
            if zenpy_object_name in response_json:
                zenpy_object = self.object_mapping.object_from_json(
                    zenpy_object_name,
                    response_json[zenpy_object_name]
                )
                response_objects[zenpy_object_name] = zenpy_object

        # Locate and store the collections of objects.
        for key, value in response_json.items():
            if isinstance(value, list):
                zenpy_object_name = as_singular(key)
                if zenpy_object_name in self.object_mapping.class_mapping:
                    response_objects[key] = []
                    for object_json in response_json[key]:
                        zenpy_object = self.object_mapping.object_from_json(
                            zenpy_object_name,
                            object_json
                        )
                        response_objects[key].append(zenpy_object)
        return response_objects
1267627
def parse(data, options = {})

      return nil if data.nil? || data == ""
      json = get_json_structure(data, options)
      parse_json(json)

    end
261042
def _from_json_list(cls, response_raw, wrapper=None):
        

        json = response_raw.body_bytes.decode()
        obj = converter.json_to_class(dict, json)
        array = obj[cls._FIELD_RESPONSE]
        array_deserialized = []

        for item in array:
            item_unwrapped = item if wrapper is None else item[wrapper]
            item_deserialized = converter.deserialize(cls, item_unwrapped)
            array_deserialized.append(item_deserialized)

        pagination = converter.deserialize(client.Pagination,
                                           obj[cls._FIELD_PAGINATION])

        return client.BunqResponse(array_deserialized, response_raw.headers,
                                   pagination)
923380
private JsonParser parseResponse(Response response) throws IOException {
		InputStream is = response.getInputStream();
		Reader r = new BufferedReader(new InputStreamReader(is, "UTF-8"));
		return new JsonParser(new JsonLexer(r));
	}
924243
def for_json(self):
        """"""

        if self.multiselect:
            return super(MultiSelectField, self).for_json()

        value = self.get_python()
        if hasattr(value, 'for_json'):
            return value.for_json()

        return value
217837
def parse_json(self, req, name, field):
        """"""
        if not (req.body and is_json_request(req)):
            return core.missing
        json_data = req.json
        if json_data is None:
            return core.missing
        return core.get_value(json_data, name, field, allow_many_nested=True)