Parse Memcache key into (MapName, Key) pair.
332926
public static MapNameAndKeyPair parseMemcacheKey(String key) {
        key = decodeKey(key, "UTF-8");
        String mapName = DEFAULT_MAP_NAME;
        int index = key.indexOf(':');
        if (index != -1) {
            mapName = MAP_NAME_PREFIX + key.substring(0, index);
            key = key.substring(index + 1);
        }
        return new MapNameAndKeyPair(mapName, key);
    }
251172
def keys(self, pattern, *, encoding=_NOTSET):
        """"""
        return self.execute(b'KEYS', pattern, encoding=encoding)
911561
def p_ex_map_pair(self, p):
        """"""
        try:
            p[0] = {p[1]: p[3]}
        except TypeError:
            msg = u"%s is an invalid hash key because it cannot be hashed." % repr(p[1])
            self.errors.append((msg, p.lineno(2), self.path))
            p[0] = {}
934321
def get_action_cache_key(name, argument):
    """"""
    tokens = [str(name)]
    if argument:
        tokens.append(str(argument))
    return '::'.join(tokens)
439282
def key_to_metric(self, key):
        """"""
        return ''.join(l if l in string.letters else '_' for l in key)
452237
def cache_key(*args, **kwargs):
    
    key = ""
    for arg in args:
        if callable(arg):
            key += ":%s" % repr(arg)
        else:
            key += ":%s" % str(arg)

    return key
429498
public function read($key)
    {
        if ($value = $this->memcache->get($key)) {
            $arr = unserialize($value);
            $this->changed = $arr['changed'];
            $this->ip      = $arr['ip'];
            $this->vars    = $arr['vars'];
            $this->key     = $key;
        }

        if ($this->debug) {
            $this->debug('get', $key, $value);
        }

        return $this->vars ?: '';
    }
182385
private function parseKey($key)
    {
        if (is_object($key) and $key instanceof AccessKey) {
            return $key;
        }

        $key = AccessKey::create($key);

        return $key;
    }
1011217
def keys(self, prefix=None):
        """"""
        query = Setting.query
        if prefix:
            query = query.filter(Setting.key.startswith(prefix))

        # don't use iteritems: 'value' require little processing whereas we only
        # want 'key'
        return [i[0] for i in query.yield_per(1000).values(Setting.key)]
1037361
def parse_mappings(mappings, key_rvalue=False):
    
    parsed = {}
    if mappings:
        mappings = mappings.split()
        for m in mappings:
            p = m.partition(':')

            if key_rvalue:
                key_index = 2
                val_index = 0
                # if there is no rvalue skip to next
                if not p[1]:
                    continue
            else:
                key_index = 0
                val_index = 2

            key = p[key_index].strip()
            parsed[key] = p[val_index].strip()

    return parsed
714454
def _get_cache_key(self, args, kwargs):
        
        hash_input = json.dumps({'name': self.name, 'args': args, 'kwargs': kwargs}, sort_keys=True)
        # md5 is used for internal caching, not need to care about security
        return hashlib.md5(hash_input).hexdigest()
230576
def cache_key(model, pk):
    ""
    app = model._meta.app_label
    name = model._meta.module_name
    return 'api:{0}:{1}:{2}'.format(app, name, pk)
819462
def get_dict_key(data, key):
    '''  '''

    if isinstance(data, Mapping):
        if key in data:
            yield data[key]
        for key_data in data.values():
            for found in get_dict_key(key_data, key):
                yield found
1208356
def hkeys(self, name):
        
        with self.pipe as pipe:
            f = Future()
            res = pipe.hkeys(self.redis_key(name))

            def cb():
                m_decode = self.memberparse.decode
                f.set([m_decode(v) for v in res.result])

            pipe.on_execute(cb)
            return f
186012
private static String computeKeyHash(String memcachedPrefix, NamedKey key)
  {
    // hash keys to keep things under 250 characters for memcached
    return memcachedPrefix + ":" + DigestUtils.sha1Hex(key.namespace) + ":" + DigestUtils.sha1Hex(key.key);
  }
659718
def encode(self, name, as_map_key=False):
        """"""
        if name in self.key_to_value:
            return self.key_to_value[name]
        return self.encache(name) if is_cacheable(name, as_map_key) else name
223842
static MPApiResponse getFromCache(String key) {
        HashMap<String, MPApiResponse> mapCache = getMapCache();
        MPApiResponse response = null;
        try {
            response = mapCache.get(key).clone();
        } catch (Exception ex) {
            // Do nothing
        }
        if (response != null) {
            response.fromCache = Boolean.TRUE;
        }
        return response;
    }