Retrieve cached value
194317
def [](key = nil)
      key ||= BasicCache.caller_name
      raise KeyError, 'Key not cached' unless include? key.to_sym
      @store[key.to_sym]
    end
289105
def retrieve(self, key):
        """"""
        column_file = os.path.join(self._hash_dir, '%s.json' % key)
        cache_file = os.path.join(self._hash_dir, '%s.npy' % key)

        if os.path.exists(cache_file):
            data = np.load(cache_file)
            if os.path.exists(column_file):
                with open(column_file, 'r') as json_file:
                    columns = json.load(json_file)
                data = pd.DataFrame(data, columns=columns)
        else:
            return None

        return data
594696
def __retrieve(self, key):
        ''' 
        '''
        with self.get_conn() as conn:
            try:
                c = conn.cursor()
                if key is None:
                    c.execute("SELECT value FROM cache_entries WHERE key IS NULL")
                else:
                    c.execute("SELECT value FROM cache_entries WHERE key = ?", (key,))
                result = c.fetchone()
                if result is None or len(result) != 1:
                    getLogger().info("There's no entry with key={key}".format(key=key))
                    return None
                else:
                    return result[0]
            except:
                getLogger().exception("Cannot retrieve")
                return None
287368
def _get_dataobject(self, name, multivalued):
        """"""
        logger.debug("Querying server for uncached data object %s", name)
        # This will retrieve the value and inject it into the cache
        self.update_view_data(properties=[name])
        return self._cache[name][0]
386564
def cached(key, timeout=3600):
    

    def decorator(f):
        @wraps(f)
        def wrapped(*args, **kwargs):
            cache = get_cache()
            # Check if key is a function
            if callable(key):
                cache_key = key(*args, **kwargs)
            else:
                cache_key = key
            # Try to get the value from cache
            cached_val = cache.get(cache_key)
            if cached_val is None:
                # Call the original function and cache the result
                cached_val = f(*args, **kwargs)
                cache.set(cache_key, cached_val, timeout)
            return cached_val

        return wrapped

    return decorator
438136
def find_in_cache(cacheKey):
    """"""
    # If we have to use cache, we try to find the result in cache
    if cacheKey:

        data = cache.get('plugit-cache-' + cacheKey, None)

        # We found a result, we can return it
        if data:
            return (data['result'], data['menu'], data['context'])
    return (None, None, None)
21731
def get_value_for_datastore(self, model_instance, cached=False):
        """"""
        value = getattr(model_instance, self._attr_name(), None)
        if not cached:
            value = getattr(model_instance, self.property_name).keys()
            setattr(model_instance, self._attr_name(), value)
        return value
211283
def get(self, key, default=CACHE_MISS):
        
        if not self.options.enabled:
            return CACHE_DISABLED
        ret = default
        if self.has(key):
            ret = self._dict[key].value
        logger.debug('get({}, default={}) == {}'.format(repr(key), repr(default), repr(ret)))
        return ret
831468
@Nullable
    public V get() {
        if (!valueRetrieved) {
            cacheValue = databaseReader.get();
            valueRetrieved = true;
        }
        return cacheValue;
    }
602090
def _get_from_cache(self, expr):
        """"""
        is_cached, res = super()._get_from_cache(expr)
        if is_cached:
            indent_str = "    " * self._print_level
            return True, indent(res, indent_str)
        else:
            return False,  None
1049949
def cached_property(func):
    """"""
    @functools.wraps(func)
    def cached_func(self):
        cacheattr = '_{}'.format(func.func_name)
        try:
            return getattr(self, cacheattr)
        except AttributeError:
            value = func(self)
            setattr(self, cacheattr, value)
            return value
    return property(cached_func)
176346
def _set_cached_value(self, xblock, value):
        """"""
        # pylint: disable=protected-access
        if not hasattr(xblock, '_field_data_cache'):
            xblock._field_data_cache = {}
        xblock._field_data_cache[self.name] = value
660453
def _get(self, key):
        """"""
        self._populate_cache()
        if key not in self._cache:
            raise AttributeError("DataField has no member {}".format(key))

        return self._cache[key]
571175
def getCachedDataKey(engineVersionHash, key):
		
		cacheFile = CachedDataManager._cacheFileForHash(engineVersionHash)
		return JsonDataManager(cacheFile).getKey(key)
304506
function(key, defaultValue){
    var c = getCache(this.ns)

    if(arguments.length === 0) {
      return c
    }

    return c[key] !== undefined ? c[key] : defaultValue
  }
148702
def cached(f):
    
    @functools.wraps(f)
    def wrapped(*args, **kwargs):
        with _cache_lock:
            identifier = (f.__name__,  args, kwargs)
            key = pickle.dumps(identifier)
            value = cache.get(key)
            if value is not None:
                logger.debug("HIT for %s -> %s" % (str(identifier), value))
            else:
                logger.debug("MISS for %s" % str(identifier))
                value = f(*args, **kwargs)
                cache[key] = value
            return value
    return wrapped
19534
public void cacheValue(Object objKey, Object objValue)
    {
//x        if ((objKey == null) || (objValue == null))
        if (objKey == null)
            return;
        Class<?> classKey = this.getField().getDataClass();
        objKey = this.convertKey(objKey, classKey);
        if (m_hmCache == null)
            m_hmCache = new HashMap<Object,Object>();
        m_hmCache.put(objKey, objValue);
    }