Determines if the return value is cached. Always returns false if
        the registered value is not an instance of :class:`FunctionCache`.

        :param name:
            The name of the provider.
435770
def is_cached(self, name):
        
        try:
            cached = super(Container, self).get(name).cached
        except AttributeError:
            cached = False

        return cached
62944
def is_cached(self, link):
        '''
        '''
        if link is None:
            return False
        elif hasattr(link, 'uri'):
            return link.uri in self.id_map
        else:
            return link in self.id_map
768114
def cache_as_field(cache_name):
    """"""
    def cache_wrapper(func):
        @functools.wraps(func)
        def inner_wrapper(self, *args, **kwargs):
            value = getattr(self, cache_name, UndefToken)
            if value != UndefToken:
                return value

            ret = func(self, *args, **kwargs)
            setattr(self, cache_name, ret)
            return ret
        return inner_wrapper
    return cache_wrapper
257218
def check_cache(cache):
    
    if isinstance(cache, BaseCache):
        return cache
    elif cache is False:
        return DictCache()
    elif cache is None:
        return DummyCache()
    else:
        raise ValueError('Provided cache must implement BaseCache')
1152963
def _check_token_cache_type(self, cache_value):
        '''
        
        '''
        def check_string_value(name):
            return (
                isinstance(cache_value[name], str) or
                isinstance(cache_value[name], unicode)
            )

        def check_refresh_token():
            if 'refresh' in cache_value:
                return check_string_value('refresh')
            else:
                return True

        return (
            isinstance(cache_value, dict) and
            'token' in cache_value and
            'expires' in cache_value and
            check_string_value('token') and
            isinstance(cache_value['expires'], float) and
            check_refresh_token()
        )
228977
def decode(self, name, as_map_key=False):
        """"""
        if is_cache_key(name) and (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
724512
static <K, V> boolean isRegistered(AbstractJCache<K, V> cache, ObjectNameType objectNameType) {
      Set<ObjectName> registeredObjectNames;
      MBeanServer mBeanServer = cache.getMBeanServer();

      if (mBeanServer != null) {
         ObjectName objectName = calculateObjectName(cache, objectNameType);
         registeredObjectNames = SecurityActions.queryNames(objectName, null, mBeanServer);

         return !registeredObjectNames.isEmpty();
      } else {
         return false;
      }
   }
57941
def cached_property(func):
    
    name = func.__name__
    doc = func.__doc__

    def getter(self, name=name):
        try:
            return self.__dict__[name]
        except KeyError:
            self.__dict__[name] = value = func(self)
            return value

    getter.func_name = name
    return property(getter, doc=doc)
1197838
def cache(cls, func):
        

        @functools.wraps(func)
        def func_wrapper(*args, **kwargs):
            func_key = cls.get_key(func)
            val_cache = cls.get_cache(func_key)
            lock = cls.get_cache_lock(func_key)

            return cls._get_value_from_cache(
                func, val_cache, lock, *args, **kwargs)

        return func_wrapper
766658
def isset(name):
    
    def wrapped(func):
        @functools.wraps(func)
        def _decorator(*args, **kwargs):
            if core.isset(name):
                return func(*args, **kwargs)
        return _decorator
    return wrapped
731616
final public function issetCache($name) {
	
		return ((is_array($this->cache) and array_key_exists($name, $this->cache)) ? TRUE : FALSE);
	
	}
1088970
function (key, val) {
    if (this._cache[key]) {
      return this._cache[key];
    }
    if (typeof val === 'function') {
      val = val.call(this);
    }
    return (this._cache[key] = val);
  }
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)
1065847
def cache_result(cache_key, timeout):
    """"""
    def decorator(f):
        cache_name = settings.WAFER_CACHE

        @functools.wraps(f)
        def wrapper(*args, **kw):
            cache = caches[cache_name]
            result = cache.get(cache_key)
            if result is None:
                result = f(*args, **kw)
                cache.set(cache_key, result, timeout)
            return result

        def invalidate():
            cache = caches[cache_name]
            cache.delete(cache_key)

        wrapper.invalidate = invalidate
        return wrapper
    return decorator
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()
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
464655
def __cache( self, method_name, *args, **kwargs ):
        
        trace_string           = util.get_stack(method_name)
        call_hash              = self.__get_hash(args, trace_string, kwargs)
        cd                     = call_descriptor.fetch( call_hash )
        if not cd:
            c  = self.__store__['callables'][method_name]
            if hasattr( c, '__class__' ) and c.__class__ == LazyBones:
                c = c.init()
            returnval = c(*args, **kwargs)
            cd = call_descriptor.CallDescriptor( hash      = call_hash,
                                                 stack     = trace_string,
                                                 method    = method_name,
                                                 returnval = returnval,
                                                 args      = args,
                                                 kwargs    = kwargs )
            cd.save()
            if not call_hash:
                raise Exception("CALL HASH IS NONE")

            util.last_hash = call_hash
            self.last_cached = call_hash
        else:
            returnval = cd.returnval

        if inspect.isclass(returnval):
            returnval = LazyBones( c, args, kwargs )

        return returnval