/*!
\returns the cached value of the is_informationcollector value
337147
function contentClassAttributeIsInformationCollector()
    {
        if ( $this->ContentClassAttributeIsInformationCollector === null )
        {
            eZDebug::accumulatorStart( 'class_a_is_ic', 'Sytem overhead', 'Fetch class attribute name' );

            $classAttribute = eZContentClassAttribute::fetch( $this->ContentClassAttributeID );
            $this->ContentClassAttributeIsInformationCollector = $classAttribute->attribute( 'is_information_collector' );
            eZDebug::accumulatorStop( 'class_a_is_ic' );
        }

        return $this->ContentClassAttributeIsInformationCollector;
    }
127220
function (cache) {
                // Collect over the readset
                var that = this;
                this._mtx.rset.apply(function (key, value) {
                    var obj = cache.find(key);
                    shared.utils.dassert(obj != null);
                    that.collectObject(obj);
                    return true;
                });
            }
528872
function(key, callback) {
          if (callback) {
            return body(callback);
          } else {
            return Promise.promisify(body)();
          }
          function body(callback) {
            return self.cacheCollection.findOne({
              name: name,
              key: key
            }, function(err, item) {
              if (err) {
                return callback(err);
              }
              if (!item) {
                return callback(null);
              }
              // MongoDB's expireAfterSeconds mechanism isn't instantaneous, so we
              // should still enforce this at get() time
              if (item.expires && (item.expires < (new Date()))) {
                return callback(null);
              }
              return callback(null, item.value);
            });
          }
        }
116709
function cached (fn) {
  var cache = Object.create(null);
  return (function cachedFn (str) {
    var hit = cache[str];
    return hit || (cache[str] = fn(str))
  })
}
510825
private boolean valueCached(int index) {
        boolean result = false;

        if (generatedCacheMap.containsKey(index) == true || resultSetCacheMap.containsKey(index) == true) {
            result = true;
        }

        return result;
    }
255609
function cache(source) {
    var _err = Nil
    var _value = Nil
    var _result = null
    var listeners = null

    return function continuable(callback) {
        if (_err !== Nil || _value !== Nil) {
            callback(_err, _value)
        } else if (listeners) {
            listeners.push(callback)
        } else {
            listeners = [callback]
            _result = source(function (err, value) {
                _err = err
                _value = value

                listeners.forEach(function (l) { l(err, value) })
            })
        }

        return _result
    }
}
895666
def get_cache(self, decorated_function, *args, **kwargs):
		
		self.__check(decorated_function, *args, **kwargs)
		if decorated_function in self._storage:
			for i in self._storage[decorated_function]:
				if i['instance']() == args[0]:
					result = i['result'].cache_entry(*args, **kwargs)
					if self.__statistic is True:
						if result.has_value is True:
							self.__cache_hit += 1
						else:
							self.__cache_missed += 1
					return result

		if self.__statistic is True:
			self.__cache_missed += 1

		return WCacheStorage.CacheEntry()
260787
private function getValuePrepareCallback(PersistentCollectionInterface $coll) : Closure
    {
        $mapping = $coll->getMapping();
        if (isset($mapping['embedded'])) {
            return function ($v) use ($mapping) {
                return $this->pb->prepareEmbeddedDocumentValue($mapping, $v);
            };
        }

        return function ($v) use ($mapping) {
            return $this->pb->prepareReferencedDocumentValue($mapping, $v);
        };
    }
12391
function getCacheCtor(cache){
  if (!cache){
    return;
  }

  if (typeof cache === 'function'){
    return cache;
  }

  function runtimeLoad(moduleRef){
    return require(moduleRef);
  }

  var cacheCtors = {
    disabled: runtimeLoad('./DisabledCache'),
    memory: runtimeLoad('./MemoryStore'),
    memcached: runtimeLoad('./MemcachedStore'),
    redis: runtimeLoad('./RedisStore')
  };

  if (!(cache in cacheCtors)){
    throw new Error('Unsupported cache provider: ' + cache);
  }

  return cacheCtors[cache];
}
123095
function memoize( f ) {
   const cache = {};
   return key => {
      let value = cache[ key ];
      if( value === undefined ) {
         value = f( key );
         cache[ key ] = value;
      }
      return value;
   };
}
1230857
private V retrieveCachedValue(boolean loadIfExpired, boolean updateStats) {

		V result;
		V oldValue = null;
		Throwable error = null;
		boolean missed = false;

		// race conditions are allowed
		this.approxAccessCounter++;

		long now;

		CachedValue<V> cached = cachedValue; // read the cached value

		if (cached != null) {

			long expiresAt = cached.expiresAt;
			if (expiresAt == Long.MAX_VALUE) {
				updateStats(false, false);
				return cached.value;
			}

			now = U.time();
			if (now <= expiresAt) {
				updateStats(false, false);
				return cached.value;
			}

		} else {
			now = U.time();
		}

		// ----------------- START LOCKS -----------------

		readLock();

		cached = cachedValue; // read the cached value again, inside the read lock

		if (cached == null || now > cached.expiresAt) {

			readUnlock();
			writeLock();

			// double-check: another thread might have acquired write lock and changed state already
			if (cached == null || now > cached.expiresAt) {

				V newValue;

				if (loadIfExpired) {
					try {
						newValue = loader != null ? loader.map(key) : null;

					} catch (Throwable e) {
						error = e;
						newValue = null;
					}

				} else {
					newValue = null;
				}

				oldValue = setValueInsideWriteLock(newValue);

				missed = true;
			}

			// downgrade by acquiring read lock before releasing write lock
			readLock();
			writeUnlock();
		}

		cached = cachedValue;
		result = cached != null ? cached.value : null; // read the cached value

		readUnlock();

		releaseOldValue(oldValue); // release the old value - outside of lock

		if (updateStats) {
			updateStats(missed, error != null);
		}

		if (error != null) {
			throw U.rte("Couldn't recalculate the cache value!", error);
		}

		return result;
	}
1051940
public IDescriptorResult getCachedDescriptorValue(IAtom atom) {
        if (cachedDescriptorValues == null) return null;
        return (IDescriptorResult) cachedDescriptorValues.get(atom);
    }
848993
function(model) {
		var _d = this._d,
			model = this.collection.get(model.id ? model.id : model),
			sortingValue = this.sortBy(model),
			cacheValue = { s: sortingValue, m: model };

		return _.sortedIndex(_d.listCache, cacheValue, 's');
	}
94964
void notifyCacheCollected() {
      int result = expectedCaches.decrementAndGet();
      if (isTraceEnabled()) {
         log().tracef("[%s] Cache collected. Missing=%s.", xid, result);
      }
      if (result == 0) {
         onCachesCollected();
      }
   }
622634
public function readBytes($isCollectionElement = false) {
		if ($isCollectionElement)
				$this->readShort();
		$length = $this->readInt();

		if ($length == -1)
			return null;
		
		return $this->read($length);
	}
607033
public int getLastElementCollectionObjectCount(Object rowKey)
    {
        if (getElementCollectionCache().get(rowKey) == null)
        {
            log.debug("No element collection object map found in cache for Row key " + rowKey);
            return -1;
        }
        else
        {
            Map<Object, String> elementCollectionMap = getElementCollectionCache().get(rowKey);
            Collection<String> elementCollectionObjectNames = elementCollectionMap.values();
            int max = 0;

            for (String s : elementCollectionObjectNames)
            {
                String elementCollectionCountStr = s.substring(s.indexOf(Constants.EMBEDDED_COLUMN_NAME_DELIMITER) + 1);
                int elementCollectionCount = 0;
                try
                {
                    elementCollectionCount = Integer.parseInt(elementCollectionCountStr);
                }
                catch (NumberFormatException e)
                {
                    log.error("Invalid element collection Object name " + s);
                    throw new CacheException("Invalid element collection Object name " + s,e);
                }
                if (elementCollectionCount > max)
                {
                    max = elementCollectionCount;
                }
            }
            return max;
        }
    }
601318
static function get($namespace, $name = null, $isall = false)
    {
        $cacheName = 'config:'.$namespace;
        if (!Cache::has($cacheName)) {
            $data = self::setCache($namespace);
        } else {
            $data = Cache::get($cacheName, []);
            if($name) {
                if(!$isall) return isset($data[$name]['value']) ? $data[$name]['value'] : null;
                return isset($data[$name]) ? $data[$name] : [];
            }
        }
        if(!$isall) {
            $rdata = array();
            foreach ($data as $key => $value) {
                $rdata[$key] = $value['value'];
            }
            return $rdata;
        }
        return $data;
    }