Set `default` if the key is not in the cache otherwise
        leave unchanged. Return the value of this key.
337990
def setdefault(self, key, default=None):
        
        self._wlock.acquire()
        try:
            try:
                return self[key]
            except KeyError:
                self[key] = default
                return default
        finally:
            self._wlock.release()
1014878
public String get(String key, String defaultValue) {
		addToDefaults(key, defaultValue);
		String value = get(key);
		if (value == null) {
			return defaultValue;
		} else {
			return value;
		}
	}
587140
def get(self, key, default=None):
        
        try:
            return self[key]
        except KeyError:
            return default or self._default
288790
def _set_default_key(mapping):
        """"""
        key_longest = sorted([(len(v), k) for k, v in mapping.items()],
                             reverse=True)[0][1]
        mapping['default'] = key_longest
        del (mapping[key_longest])
965843
def _setdefault(obj, key, value):
    
    v = obj.get(key)
    if v == None:
        obj[key] = value
        return value
    return v
804412
def cache_get(key):
    
    packed = cache.get(_hashed_key(key))
    if packed is None:
        return None
    value, refresh_time, refreshed = packed
    if (time() > refresh_time) and not refreshed:
        cache_set(key, value, settings.CACHE_SET_DELAY_SECONDS, True)
        return None
    return value
52023
def get(self, key, default=None):
        '''
        
        '''
        valu = self.data.get(key, default)
        if key in self.data:
            self.data.move_to_end(key)
        return valu
1204304
def get(self, default=None):
        
        d = cache.get(self.key)
        return ((json.loads(d.decode('utf-8')) if self.serialize else d)
                if d is not None
                else default)
1069879
def default(self):
        """"""

        if self._default is None or self._default not in self:
            self._default = list(self.keys())[0] if self else None

        return self._default
1330979
def get_true (self, key, default):
        
        if key not in self or not self[key]:
            return default
        return self[key]
493402
def _pop(self, key, default=None):
        
        value = default
        if key in self:
            value = self[key]
            del self[key]
        return value
421803
def set(self, key, value, **kw):
        

        self.impl.set(key, value, **self._get_cache_kw(kw, None))
7334
def get_bool(self, key, default=None):
        
        value = self.get_str(key)
        if value is not None:
            return to_boolean(value)

        return default
875491
def _set_request_cache_if_django_cache_hit(key, django_cached_response):
        
        if django_cached_response.is_found:
            DEFAULT_REQUEST_CACHE.set(key, django_cached_response.value)
275187
def get(self, key, default=None):
        

        #function arguments override defaults
        if default is None:
            default = self.DEFAULTS.get(key, None)
        vtype = type(default)

        #we now have a valid key and type
        if default is None:
            logger.warn("Unknown key: %s, must specify default value" % key)
            return None

        if vtype not in self.VALID_KEY_TYPES:
            logger.warn("Invalid key type: %s" % vtype)
            return None

        #for gconf refer to the full key path
        key = self._fix_key(key)

        if key not in self._notifications:
            self._client.notify_add(key, self._key_changed, None)
            self._notifications.append(key)

        value = self._client.get(key)
        if value is None:
            self.set(key, default)
            return default

        value = self._get_value(value, default)
        if value is not None:
            return value

        logger.warn("Unknown gconf key: %s" % key)
        return None
403113
def cache_get(cache_dir, cache_key, default=None):
    
    filename = os.path.join(cache_dir, cache_key)

    if os.path.isfile(filename):
        with open(filename, 'r') as f:
            return f.read()

    return default
449412
def get(self, key, default=None):
        
        result = self._loads(self._client.get(self.get_key(key)))
        if result is not None:
            return result
        else:
            return default or self._default