Args:
            key (str):
        Return:
            (dict): from json string
190990
def get_from_cache(key):
        

        try:
            value = cache.get(key)
            return json.loads(value), key if value else None
        except Exception as e:
            # todo should add log.error()
            return None
489677
def from_json(cls, json):
    
    return cls(json[cls.BLOB_KEY_PARAM],
               json[cls.START_INDEX_PARAM],
               json[cls.END_INDEX_PARAM])
992154
def get(self, key, default=None):
        
        if key in self:
            return self.items_dict[self.__dict__[str(type(key))][key]]
        else:
            return default
881999
def key(self):
        '''  '''
        prefix = type(self).cls_key()

        return '{}:{}:obj'.format(prefix, self.id)
1321415
def to_dict(self):
        
        return dict((k, self.get(k)) for k in self.flags.keys())
166514
def get_key(self, key_id):
        
        url = ENCRYPTION_KEY_URL.format(key_id)
        return self._key_from_json(self._get_resource(url))
317531
def _opts_to_dict(*opts):
	''''''
	ret = {}
	for key, val in opts:
		if key[:2] == '--':
			key = key[2:]
		elif key[:1] == '-':
			key = key[1:]
		if val == '':
			val = True
		ret[key.replace('-','_')] = val
	return ret
1281113
def translate_key(jsonkey):
  ""
  nombre,pkey,field=ujson.loads(jsonkey)
  return FieldKey(nombre,tuple(pkey),field)
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())
8265
def object(self, key):
    
    return _object.Object(self._name, key, context=self._context)
746565
def create_key(self, title, key):
        
        json = None
        if title and key:
            data = {'title': title, 'key': key}
            url = self._build_url('keys', base_url=self._api)
            json = self._json(self._post(url, data=data), 201)
        return Key(json, self) if json else None
49100
def get_dict(dictionary, *keys,**kwargs):
    

    if 'default' in kwargs:
        default = kwargs['default']
    else:
        default = None

    existing = dictionary
    for i in range(0, len(keys)):

        if keys[i] in existing:

            existing = existing[keys[i]]
        else:

            return default
    return existing
686119
def extract(dictionary, keys):
    
    return dict((k, dictionary[k]) for k in keys if k in dictionary)
668466
def key(self, id_num):
        
        json = None
        if int(id_num) > 0:
            url = self._build_url('keys', str(id_num), base_url=self._api)
            json = self._json(self._get(url), 200)
        return Key(json, self) if json else None
1274622
def key_dict( from_dict ):
	
	new_dict = {}
	old2new = {}
	new2old = {}
	for key in from_dict:
		k = normalizeUnicode(key,'identifier')
		if k != key:
			i = ''
			while new_dict.has_key("%s%s" % (k,i) ):
				if not i:
					i = 1
				else:
					i += 1
			k = "%s%s" % (k,i)
			old2new[key] = k
			new2old[k] = key
		new_dict[k] = from_dict[key]
	return (new_dict.keys(), new_dict, old2new, new2old)
335085
def _from_dict(cls, _dict):
        """"""
        args = {}
        if 'fields' in _dict:
            args['fields'] = [
                Field._from_dict(x) for x in (_dict.get('fields'))
            ]
        return cls(**args)
907724
def get(self, key):

    

    try:
      try:
        obj = self.bucket.get(key)
      except:
        raise

      return dict(obj or {})

    except:
      raise