Creates or returns an existing function cache.

@return FunctionCache
320411
public function getFunctionCache()
    {
        if (!$this->functionCache) {
            $this->functionCache = new FunctionCache($this->gatherer);
        }

        return $this->functionCache;
    }
440960
public function cache()
    {
        if ($this->cache !== null) {
            return $this->cache;
        }
        switch ($this->driver) {
            case self::DRIVER_MYSQL:
                return $this->cache = new Cache\MySQL\Manage($this->pdo);
        }
        throw new DatabaseException('Unsupported PDO driver.');
    }
1251004
public function getCacheFactory(): ?Factory
    {
        if (!$this->hasCacheFactory()) {
            $this->setCacheFactory($this->getDefaultCacheFactory());
        }
        return $this->cacheFactory;
    }
1286337
public function cache()
    {
        $this->cache->remember($this->getCacheKey(), $this->getCacheLifetime(), function () {
            return $this->scan();
        });
    }
1269214
public function getCache() {
    if (!isset($this->cache))
      $this->cache = new \Doctrine\Common\Cache\ArrayCache;
      
    return $this->cache;
  }
641053
public function getResultCache() {
    if (!isset($this->resultCache)) 
      $this->resultCache = new \Doctrine\Common\Cache\ArrayCache;
      
    return $this->resultCache;
  }
408205
public function get()
    {
        if (Cache::has($this->getCacheKey()))
            return Cache::get($this->getCacheKey());

        return $this->create();
    }
972032
public function get($functionName, CompilationContext $compilationContext, Call $call, $exists)
    {
        if (isset($this->cache[$functionName])) {
            return $this->cache[$functionName].', '.SlotsCache::getExistingFunctionSlot($functionName);
        }

        if (!$exists) {
            return 'NULL, 0';
        }

        $cacheSlot = SlotsCache::getFunctionSlot($functionName);

        $number = 0;
        if (!$compilationContext->insideCycle) {
            $gatherer = $this->gatherer;
            if ($gatherer) {
                $number = $gatherer->getNumberOfFunctionCalls($functionName);
                if ($number <= 1) {
                    return 'NULL, '.$cacheSlot;
                }
            }
        }

        if ($compilationContext->insideCycle || $number > 1) {
            $functionCacheVariable = $compilationContext->symbolTable->getTempVariableForWrite('zephir_fcall_cache_entry', $compilationContext);
            $functionCacheVariable->setMustInitNull(true);
            $functionCacheVariable->setReusable(false);
            $functionCache = '&'.$functionCacheVariable->getName();
        } else {
            $functionCache = 'NULL';
        }

        $this->cache[$functionName] = $functionCache;

        return $functionCache.', '.$cacheSlot;
    }
219981
def memoize(function):
    
    cache = {}
    @functools.wraps(function)
    def _memoize(*args):
        if args in cache:
            return cache[args]
        result = function(*args)
        cache[args] = result
        return result
    return function
659191
public function getCache()
    {
        if ($this->cache) {
            return $this->cache;
        }

        if (property_exists($this, 'app') && $this->app instanceof ServiceContainer
            && isset($this->app['cache']) && $this->app['cache'] instanceof CacheInterface) {
            return $this->cache = $this->app['cache'];
        }

        return $this->cache = $this->createDefaultCache();
    }
233106
def memcache(self, f):
        """"""
        name = _fullname(f)
        cache = self.load_memcache(name)

        @wraps(f)
        def memcached(*args):
            """Cache the function in memory."""
            # The arguments need to be hashable. Much faster than using hash().
            h = args
            out = cache.get(h, None)
            if out is None:
                out = f(*args)
                cache[h] = out
            return out
        return memcached
447284
public function functions()
    {
        if (is_null($this->functionRequests)) {
            $this->functionRequests = new FunctionRequests($this->client);
        }

        return $this->functionRequests;
    }
31747
public function getFromCache($key, $default = null)
    {
        $fullKey = $this->makeCacheKey($key);

        return Cache::get($fullKey, $default);
    }
116709
function cached (fn) {
  var cache = Object.create(null);
  return (function cachedFn (str) {
    var hit = cache[str];
    return hit || (cache[str] = fn(str))
  })
}
1156187
def memoize(fn):
    ''''''

    cache = {}

    @wraps(fn)
    def wrapped_function(*args):
        if args in cache:
            return cache[args]

        else:
            result = fn(*args)
            cache[args] = result
            return result

    return wrapped_function
700837
public function cache()
    {
        if (!$this->cache) {
            $this->cache = new Manager($this->configure('cache'), $this->taskworker);
        }
        return $this->cache;
    }
1275573
public static <K,V> CacheLoader<K,V> loader(Function<K,V> function) {
        return new FunctionCacheLoader<>(function);
    }