Returns the associated cache backend.
498026
def get_backend(self):
        
        try:
            cache = caches[machina_settings.ATTACHMENT_CACHE_NAME]
        except InvalidCacheBackendError:
            raise ImproperlyConfigured(
                'The attachment cache backend ({}) is not configured'.format(
                    machina_settings.ATTACHMENT_CACHE_NAME,
                ),
            )
        return cache
993498
def get_cache_key(self, offset=0, limit=0, order=None, post_slug=''):
        
        return hashlib.sha1(
            '.'.join([
                str(self._get_data_source_url()),
                str(offset),
                str(limit),
                str(order),
                str(post_slug),
                ])
        ).hexdigest()
1263471
def cache(self, name='cache', default_timeout=3600):
        
        return Cache(self, name=name, default_timeout=default_timeout)
434409
def _build_cache():
    """"""
    sets = current_oaiserver.sets
    if sets is None:
        # build sets cache
        sets = current_oaiserver.sets = [
            oaiset.spec for oaiset in OAISet.query.filter(
                OAISet.search_pattern.is_(None)).all()]
    return sets
664283
public function getCache()
    {
        $data = $this->memcache->get(
            $this->config['key_prefix'] .
            '.storage'
        );
        $this->isCached = !empty($data);

        return $data;
    }
142976
def get_disk_cache(self, key=None):
        """"""
        key = self.model.hash if key is None else key
        if not getattr(self, 'disk_cache_location', False):
            self.init_disk_cache()
        disk_cache = shelve.open(self.disk_cache_location)
        self._results = disk_cache.get(key)
        disk_cache.close()
        return self._results
1310648
def backend_run(self):
        """"""
        key = self.model.hash
        if self.use_memory_cache and self.get_memory_cache(key):
            return self._results
        if self.use_disk_cache and self.get_disk_cache(key):
            return self._results
        results = self._backend_run()
        if self.use_memory_cache:
            self.set_memory_cache(results, key)
        if self.use_disk_cache:
            self.set_disk_cache(results, key)
        return results
511888
protected function _getFrontend()
    {
        // @codingStandardsIgnoreEnd
        $frontend = parent::_getFrontend();

        if ($frontend === null) {
            $frontend = $this->frontendPool->get(self::CACHE_TYPE);
        }

        return $frontend;
    }
806402
def get_cache(self):
        
        #This is used by external programs that import `CheeseShop` and don't
        #want a cache file written to ~/.pypi and query PyPI every time.
        if self.no_cache:
            self.pkg_list = self.list_packages()
            return

        if not os.path.exists(self.yolk_dir):
            os.mkdir(self.yolk_dir)
        if os.path.exists(self.pkg_cache_file):
            self.pkg_list = self.query_cached_package_list()
        else:
            self.logger.debug("DEBUG: Fetching package list cache from PyPi...")
            self.fetch_pkg_list()
1305746
def get(self, res, pk):
        ""
        B = get_backend()
        return B.get_object(B.get_concrete(res), pk)
779372
public com.google.api.Backend getBackend() {
    return backend_ == null ? com.google.api.Backend.getDefaultInstance() : backend_;
  }
470282
public function getCacheProvider()
    {
        $conf = $this->getConfig()->getCacheConfig();

        return isset($conf['provider']) && is_subclass_of($conf['provider'], '\BackBee\Cache\AExtendedCache')
            ? $conf['provider']
            : '\BackBee\Cache\DAO\Cache'
        ;
    }
619652
def cache_url(self, var=DEFAULT_CACHE_ENV, default=NOTSET, backend=None):
        
        return self.cache_url_config(self.url(var, default=default), backend=backend)
917880
def get_cached(self):
        '''
        
        '''
        msg = self.serial.dumps('minions')
        self.creq_out.send(msg)
        min_list = self.serial.loads(self.creq_out.recv())
        return min_list
1060223
def clear_cache(self, back=None):
        '''
        
        '''
        back = self.backends(back)
        cleared = []
        errors = []
        for fsb in back:
            fstr = '{0}.clear_cache'.format(fsb)
            if fstr in self.servers:
                log.debug('Clearing %s fileserver cache', fsb)
                failed = self.servers[fstr]()
                if failed:
                    errors.extend(failed)
                else:
                    cleared.append(
                        'The {0} fileserver cache was successfully cleared'
                        .format(fsb)
                    )
        return cleared, errors
1214139
def get_cache_key(request, meta, orgaMode, currentOrga):
    """"""

    # Caching
    cacheKey = None

    if 'cache_time' in meta:
        if meta['cache_time'] > 0:

            # by default, no cache by user
            useUser = False

            # If a logged user in needed, cache the result by user
            if ('only_logged_user' in meta and meta['only_logged_user']) or \
                    ('only_member_user' in meta and meta['only_member_user']) or \
                    ('only_admin_user' in meta and meta['only_admin_user']) or \
                    ('only_orga_member_user' in meta and meta['only_orga_member_user']) or \
                    ('only_orga_admin_user' in meta and meta['only_orga_admin_user']):
                useUser = True

            # If a value if present in meta, use it
            if 'cache_by_user' in meta:
                useUser = meta['cache_by_user']

            cacheKey = '-'

            # Add user info if needed
            if useUser:
                cacheKey += str(request.user.pk) + 'usr-'

            # Add orga
            if orgaMode:
                cacheKey += str(currentOrga.pk) + 'org-'

            # Add current query
            cacheKey += request.get_full_path()

            # Add current template (if the template changed, cache must be invalided)
            cacheKey += meta['template_tag']

    return cacheKey
41793
function getCache() {
      return new Promise(function(resolve, reject) {
        // create and fetch the cache key
        get(getKey(), function(err, data) {
          if (err) {
            return reject(err);
          }
          resolve(data);
        });
      });
    }