Parse API response.

        :param dict data: Parsed JSON response from API 'data' key.
188271
def _parse(self, data):
        
        super(Image, self)._parse(data)
        self.height = data['height']
        self.type = data['type']
        self.width = data['width']
1144170
def _parse_response_for_dict(response):
    ''' '''

    if response is None:
        return None
    http_headers = ['server', 'date', 'location', 'host',
                    'via', 'proxy-connection', 'connection']
    return_dict = _HeaderDict()
    if response.headers:
        for name, value in response.headers:
            if not name.lower() in http_headers:
                return_dict[name] = value

    return return_dict
219528
def _parse_response(self, response, target_object=strack):
        
        objects = json.loads(response.read().decode("utf-8"))
        list = []
        for obj in objects:
            list.append(target_object(obj, client=self.client))
        return list
760802
def parse(self, json_data):
        
        data = current.read(json_data, 'ipynb')
        json_data.close()
        return data
1148128
def from_json(self, data):
        
        try:
            d = json.loads(data)
        except ValueError:
            raise InvalidMessageException()
        self.from_dict(d)
583393
def _parse_response(response, post_request=False):
        
        try:
            data = response.json()
        except:
            msg = 'Unhandled HTTP %s response, shown truncated below:\n%s...' % (
                response.status_code, response.text[:50]
            )
            raise ValueError(msg)

        if not response.ok:
            utils.error_message_and_exit(None, data)

        if post_request and not data['success']:
            raise Exception('Asmaster Api Error: [%s]' % data['error'])

        return data
1300734
def _deserialize(self, data: dict, silent=True) -> dict:
        '''  '''
        deserialized_data = {}
        for name, field in self._fields.items():
            if field._readonly is False and name in data:
                deserialized_data[name] = data.get(name)
        return deserialized_data
1160298
def get_jsonparsed_data(url):
    
    response = urlopen(url)
    data = response.read().decode('utf-8')
    return json.loads(data)
399144
def __respond_with_list(self, data):
        
        response = []
        if isinstance(data, dict):
            data.pop('seq', None)
            data = list(data.values())

        for item in data:
            values = item
            if isinstance(item, list) or isinstance(item, dict):
                values = self.__respond_with_list(item)

            if isinstance(values, list) and len(values) == 1:
                response.extend(values)
            else:
                response.append(values)

        return response
1174372
def parse(self, data):
        
        method = getattr(self, '_parse_{0}'.format(self._format))
        return method(data)
638203
def _parse(cls, data, key=None):
        
        parse = cls.parse if cls.parse is not None else cls.get_endpoint()

        if callable(parse):
            data = parse(data)
        elif isinstance(parse, str):
            data = data[key]
        else:
            raise Exception('"parse" should be a callable or string got, {0}'
                            .format(parse))
        return data
884993
def parse_response(response)
      if response.headers['Content-Type'].include?('application/json')
        parse_json(response.body)
      else
        response.body
      end
    end
598786
def parse_json(raw_json):
        
        result = json.loads(raw_json)

        if 'results' in result:
            result = result['results']

        return result
1246132
def from_json(self, json_data):
        
        try:
            data = json_data.decode()
        except Exception:
            data = json_data
        self.__dict__ = json.loads(data)
75494
def decode_response(status: int, headers: MutableMapping, body: bytes) -> dict:
    
    data = decode_body(headers, body)
    raise_for_status(status, headers, data)
    raise_for_api_error(headers, data)

    return data
1149082
def _parse_content(response):
    """"""
    if response.status_code != 200:
        raise ApiError(f'unknown error: {response.content.decode()}')
    result = json.loads(response.content)
    if not result['ok']:
        raise ApiError(f'{result["error"]}: {result.get("detail")}')
    return result
306703
def parse(self, data):
        
        parsed_data = self.yacc.parse(
            data, lexer=self.lexer.get_yacc_compat_lexer(), debug=self.debug)
        self.errors = self.lexer.errors + self.errors
        return parsed_data, self.errors