The function for parsing the JSON response to the vars dictionary.
8656
def parse(self):
        

        try:

            self.vars['handle'] = self.json['handle'].strip()

        except (KeyError, ValueError):

            log.debug('Handle missing, json_output: {0}'.format(json.dumps(
                self.json)))
            raise InvalidNetworkObject('Handle is missing for RDAP network '
                                       'object')

        try:

            self.vars['ip_version'] = self.json['ipVersion'].strip()

            # RDAP IPv4 addresses are padded to 3 digits per octet, remove
            # the leading 0's.
            if self.vars['ip_version'] == 'v4':

                self.vars['start_address'] = ip_address(
                    ipv4_lstrip_zeros(self.json['startAddress'])
                ).__str__()

                self.vars['end_address'] = ip_address(
                    ipv4_lstrip_zeros(self.json['endAddress'])
                ).__str__()

            # No bugs found for IPv6 yet, proceed as normal.
            else:

                self.vars['start_address'] = self.json['startAddress'].strip()
                self.vars['end_address'] = self.json['endAddress'].strip()

        except (KeyError, ValueError, TypeError):

            log.debug('IP address data incomplete. Data parsed prior to '
                      'exception: {0}'.format(json.dumps(self.vars)))
            raise InvalidNetworkObject('IP address data is missing for RDAP '
                                       'network object.')

        try:

            self.vars['cidr'] = ', '.join(calculate_cidr(
                self.vars['start_address'], self.vars['end_address']
            ))

        except (KeyError, ValueError, TypeError, AttributeError) as \
                e:  # pragma: no cover

            log.debug('CIDR calculation failed: {0}'.format(e))
            pass

        for v in ['name', 'type', 'country']:

            try:

                self.vars[v] = self.json[v].strip()

            except (KeyError, ValueError):

                pass

        try:

            self.vars['parent_handle'] = self.json['parentHandle'].strip()

        except (KeyError, ValueError):

            pass

        self._parse()
942455
def _JsonDecodeDict(self, data):
    """"""
    rv = {}
    for key, value in data.iteritems():
      if isinstance(key, unicode):
        key = self._TryStr(key)
      if isinstance(value, unicode):
        value = self._TryStr(value)
      elif isinstance(value, list):
        value = self._JsonDecodeList(value)
      rv[key] = value
    if '__pyringe_type_name__' in data:
      # We're looking at a proxyobject
      rv = ProxyObject(rv)
    return rv
1322088
def json_request_response(f):
    
    @wraps(f)
    def wrapper(*args, **kwargs):
        response = f(*args, **kwargs)
        response.raise_for_status()
        return json.loads(response.content.decode('utf-8'))

    API_FUNCTIONS[f.__name__] = f
    return wrapper
1272127
def parse_json(response)
			json_response = JSON.parse(response)
			error = json_response['error']
			if !error.nil? then raise APIException.new(error) end
			return json_response
		end
696088
def to_vars_dict(self):
        
        return {
            'azure_client_id':        self.client_id,
            'azure_location':         self.location,
            'azure_secret':           self.secret,
            'azure_subscription_id':  self.subscription_id,
            'azure_tenant_id':        self.tenant_id,
        }
235995
function JSON_parse(jsonString) { // @arg String - JSON String
                                  // @ret Any
                                  // @throw SyntaxError("Unexpected token: ...")
    var unescaped = jsonString.trim().replace(/"(\\.|[^"\\])*"/g, "");

    if (/[^,:{}\[\]0-9\.\-+Eaeflnr-u \n\r\t]/.test(unescaped)) {
        throw new SyntaxError("Unexpected token:" + jsonString);
    }
    return (new Function("return " + jsonString))(); // raise error
}
233070
def _parse_line_vars(self, line):
        
        key_values = {}

        # Undocumented feature allows json in vars sections like so:
        #   [prod:vars]
        #   json_like_vars=[{'name': 'htpasswd_auth'}]
        # We'll try this first. If it fails, we'll fall back to normal var
        # lines. Since it's undocumented, we just assume some things.
        k, v = line.strip().split('=', 1)
        if v.startswith('['):
            try:
                list_res = ihateyaml.safe_load(v)
                if isinstance(list_res[0], dict):
                    key_values = list_res[0]
                    return key_values
            except ValueError:
                pass

        # Guess it's not YAML. Parse as normal host variables
        tokens = shlex.split(line.strip())
        key_values = self._parse_vars(tokens)
        return key_values
131967
function parseResponse(response) {
  let text;

  if (response && response.content && (typeof response.content === 'string')) {
    text = response.content;
  }

  if (response && response.text && (typeof response.text === 'string')) {
    text = response.text;
  }

  if (!text) {
    console.error('Did not supply any matching response format. Response is:', text);
    return null;
  }

  try {
    const parsedResponse = JSON.parse(text);

    if (
      parsedResponse
      && parsedResponse.data
      && (parsedResponse.data instanceof Object === true)
    ) {
      return parsedResponse.data;
    }
  } catch (err) {
    console.error('Error while parsing JSON', err);
  }

  return null;
}
1320711
def vars_(object=None):
    
    filtered_vars = {}
    vars_dict = vars(object)
    for key, value in six.iteritems(vars_dict):
        if key.startswith("_"):
            continue
        filtered_vars[_normalize_arg_name(key)] = value
    return filtered_vars
955262
def get_dict_from_response(response):
    """"""
    result = {}
    if getattr(response, '_resp') and response._resp.code > 400:
        return result

    for i in response.data:
        # strip the schema from the key
        k = i['Type'].replace(REMOTE_APP_RESOURCE_SCHEMA, '')
        result.setdefault(k, list())
        result[k].append(i['Value'])
    return result
444350
def json_loads(cls, s, **kwargs):
        
        if 'cls' not in kwargs:
            kwargs['cls'] = cls.json_decoder
        return json.loads(s, **kwargs)
1094066
def _json(self, response):
        
        if response.status_code == 204:
            return None
        try:
            return response.json()
        except ValueError as e:
            raise ValueError(
                'Exception: %s\n'
                'request: %s, response code: %s, response: %s' % (
                    str(e), response.request.url, response.status_code,
                    response.content,
                )
            )
1160298
def get_jsonparsed_data(url):
    
    response = urlopen(url)
    data = response.read().decode('utf-8')
    return json.loads(data)
84590
def get_json_response(self, content, **kwargs):
        """"""

        # Don't care to return a django form or view in the response here.
        # Remove those from the context.
        if isinstance(content, dict):
            response_content = {k: deepcopy(v) for k, v in content.items()
                                if k not in ('form', 'view') or k in ('form', 'view')
                                and not isinstance(v, (Form, View))}
        else:
            response_content = content

        return HttpResponse(content=json.dumps(response_content),
                            content_type='application/json; charset=utf-8',
                            **kwargs)
75867
def parse_vars(self, args):
        
        result = {}
        for arg in args:
            if '=' not in arg:
                raise ValueError(
                    'Variable assignment %r invalid (no "=")'
                    % arg)
            name, value = arg.split('=', 1)
            result[name] = value
        return result
11486
function serverResponseToRESPONSE (response) {
	try {
		const obj = JSON.parse(response);
		if (obj.result === RESPONSE_UNKNOWN) {
			return RESPONSE_UNKNOWN;
		} else {
			return obj.result.result;
		}
	} catch (e) {
		return RESPONSE_INVALID;
	}
}
707629
def function_dict(self):
        
        func_dict = OrderedDict()
        for var, func in self.vars_as_functions.items():
            expr = self.model_dict[var].xreplace(self.vars_as_functions)
            func_dict[func] = expr
        return func_dict