Retrieves the key from a parsed_json dictionary, or raises an exception if the
    key is not present
176186
def json_get(parsed_json, key):
    
    if key not in parsed_json:
        raise ValueError("JSON does not contain a {} field".format(key))
    return parsed_json[key]
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
971679
def get_json(self, key, default=None):
        
        value = self.get_str(key)
        if value is not None:
            value = from_json(value)
            if value is not None:
                return value

        if isinstance(default, (dict, list)):
            return default

        return from_json(default)
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
633411
def _get_key(key, scopes):
    """"""

    # If the key is a dot
    if key == '.':
        # Then just return the current scope
        return scopes[0]

    # Loop through the scopes
    for scope in scopes:
        try:
            # For every dot seperated key
            for child in key.split('.'):
                # Move into the scope
                try:
                    # Try subscripting (Normal dictionaries)
                    scope = scope[child]
                except (TypeError, AttributeError):
                    try:
                        # Try the dictionary (Complex types)
                        scope = scope.__dict__[child]
                    except (TypeError, AttributeError):
                        # Try as a list
                        scope = scope[int(child)]

            # Return an empty string if falsy, with two exceptions
            # 0 should return 0, and False should return False
            # While using is for this check is undefined it works and is fast
            if scope is 0:  # noqa: F632
                return 0
            if scope is False:
                return False

            try:
                # This allows for custom falsy data types
                # https://github.com/noahmorrison/chevron/issues/35
                if scope._CHEVRON_return_scope_when_falsy:
                    return scope
            except AttributeError:
                return scope or ''
        except (AttributeError, KeyError, IndexError, ValueError):
            # We couldn't find the key in the current scope
            # We'll try again on the next pass
            pass

    # We couldn't find the key in any of the scopes
    return ''
166514
def get_key(self, key_id):
        
        url = ENCRYPTION_KEY_URL.format(key_id)
        return self._key_from_json(self._get_resource(url))
432693
String parseObjectKey() throws IOException {
        if (cachedObjectKey != null) {
            String key = cachedObjectKey;
            cachedObjectKey = null;
            return key;
        }
        String str = parseString();
        acceptEvent(JsonEvent.COLON);
        return str;
    }
116593
def to_dict(dictish):
    
    if hasattr(dictish, 'iterkeys'):
        m = dictish.iterkeys
    elif hasattr(dictish, 'keys'):
        m = dictish.keys
    else:
        raise ValueError(dictish)

    return dict((k, dictish[k]) for k in m())
688899
def load_json_dict(filename, *args):
	""""""
	data = {}
	if os.path.exists(filename):
		with open(filename, "r") as f:
			try:
				data = json.load(f)
				if not isinstance(data, dict):
					data = {}
			except:
				pass 
		if args:
			return {key: data[key] for key in args if key in data}
	return data
396423
def parse_dict(self, attrs):
        """"""
        attrs = attrs or {}
        ident = attrs.get("id", "")
        classes = attrs.get("classes", [])
        kvs = OrderedDict((k, v) for k, v in attrs.items()
                          if k not in ("classes", "id"))

        return ident, classes, kvs
1130847
def fetch(self, keyDict):
        
        for key in keyDict:
            keyDict[key] = self.dict[key]
188084
def get(self, key):
        
        self._get_table()
        s = self.table.get_item(key=key)
        log.debug("Retrieved from key '%s' the object: '%s'" % (key, s['value']))
        return self.from_string(s['value'])
368785
def _get_value(data_structure, key):
    
    if len(key) == 0:
        raise KeyError()
    value = data_structure[key[0]]
    if len(key) > 1:
        return _get_value(value, key[1:])
    return value
189989
def get(self, key, default_val=None, require_value=False):
        
        val = dict.get(self, key, default_val)
        if val is None and require_value:
            raise KeyError('key "%s" not found' % key)
        if isinstance(val, dict):
            return AttributeDict(val)
        return val
434744
def json(self, **kwargs):
        
        try:
            return super(ScraperResponse, self).json(**kwargs)
        except ValueError as ve:
            raise ParseException(ve)
462176
def decode_dict_keys_to_str(src):
    '''
    
    '''
    if not six.PY3 or not isinstance(src, dict):
        return src

    output = {}
    for key, val in six.iteritems(src):
        if isinstance(key, bytes):
            try:
                key = key.decode()
            except UnicodeError:
                pass
        output[key] = val
    return output
667500
def _parse_dict_string(self, string, key, default):
        """"""
        try:
            for item in string.split(','):
                k, v = item.rsplit('=', 1)
                if k == key:
                    try:
                        return int(v)
                    except ValueError:
                        return v
            return default
        except Exception:
            self.log.exception("Cannot parse dictionary string: %s" % string)
            return default