Sets the cache buster value for a given file path
972942
def set_cache_buster(redis, path, hash):
    """"""
    redis.hset("cache-buster:{}:v3".format(oz.settings["s3_bucket"]), path, hash)
325476
def _write_cache(self, lines, append=False):
        """"""
        mode = 'at' if append else 'wt'
        with open(self.filepath, mode, encoding='utf8') as fh:
            fh.writelines(line + '\n' for line in lines)
985831
def dump(path, value)
      return unless disk_cache_enabled?

      FileUtils.mkdir_p(File.dirname(path))
      File.open(path, "wb") do |cached_file|
        Marshal.dump(value, cached_file)
      end
    end
469095
def set_item(key,value):
    """"""
    CACHED_KEY_FILE = os.path.join(CURRENT_DIR, key)

    open(CACHED_KEY_FILE, "wb").write(json.dumps({"_": value}).encode('UTF-8'))

    return value
572642
def update_cache(filename, opts=default_opts, module_globals=None):
    """"""

    if not filename: return None

    orig_filename = filename
    filename = pyc2py(filename)
    if filename in file_cache: del file_cache[filename]
    path = os.path.abspath(filename)
    stat = None
    if get_option('use_linecache_lines', opts):
        fname_list = [filename]
        mapped_path = file2file_remap.get(path)
        if mapped_path:
            fname_list.append(mapped_path)
            for filename in fname_list:
                try:
                    stat = os.stat(filename)
                    plain_lines = linecache.getlines(filename)
                    trailing_nl = has_trailing_nl(plain_lines[-1])
                    lines = {
                        'plain'   : plain_lines,
                        }
                    file_cache[filename] = LineCacheInfo(stat, None, lines,
                                                         path, None)
                except:
                    pass
                pass
            if orig_filename != filename:
                file2file_remap[orig_filename] = filename
                file2file_remap[os.path.abspath(orig_filename)] = filename
                pass
            file2file_remap[path] = filename
            return filename
        pass
    pass

    if os.path.exists(path):
        stat = os.stat(path)
    elif module_globals and '__loader__' in module_globals:
        name = module_globals.get('__name__')
        loader = module_globals['__loader__']
        get_source = getattr(loader, 'get_source', None)
        if name and get_source:
            try:
                data = get_source(name)
            except (ImportError, IOError):
                pass
            else:
                if data is None:
                    # No luck, the PEP302 loader cannot find the source
                    # for this module.
                    return None
                # FIXME: DRY with code below
                lines = {'plain' : data.splitlines()}
                raw_string        = ''.join(lines['plain'])
                trailing_nl       = has_trailing_nl(raw_string)
                if 'style' in opts:
                    key = opts['style']
                    highlight_opts = {'style': key}
                else:
                    key = 'terminal'
                    highlight_opts = {}

                lines[key] = highlight_array(raw_string.split('\n'),
                                    trailing_nl, **highlight_opts)
                file_cache[filename] = \
                  LineCacheInfo(None, None, lines, filename, None)
                file2file_remap[path] = filename
                return True
            pass
        pass
    if not os.path.isabs(filename):
        # Try looking through the module search path, which is only useful
        # when handling a relative filename.
        stat = None
        for dirname in sys.path:
            path = os.path.join(dirname, filename)
            if os.path.exists(path):
                stat = os.stat(path)
                break
            pass
        if not stat: return False
        pass

    try:
        mode = 'r' if PYTHON3 else 'rU'
        with open(path, mode) as fp:
                lines = {'plain' : fp.readlines()}
                eols = fp.newlines
    except:
        return None

    # FIXME: DRY with code above
    raw_string        = ''.join(lines['plain'])
    trailing_nl       = has_trailing_nl(raw_string)
    if 'style' in opts:
        key = opts['style'] or 'default'
        highlight_opts = {'style': key}
    else:
        key = 'terminal'
        highlight_opts = {}

    lines[key] = highlight_array(raw_string.split('\n'),
                                 trailing_nl, **highlight_opts)
    if orig_filename != filename:
        file2file_remap[orig_filename] = filename
        file2file_remap[os.path.abspath(orig_filename)] = filename
        pass
    pass

    file_cache[filename] = LineCacheInfo(stat, None, lines, path, None, eols)
    file2file_remap[path] = filename
    return True
457205
def cache_local_file(path):
    '''
    
    '''
    if not os.path.exists(path):
        return ''

    path_cached = is_cached(path)

    # If the file has already been cached, return the path
    if path_cached:
        path_hash = hash_file(path)
        path_cached_hash = hash_file(path_cached)

        if path_hash['hsum'] == path_cached_hash['hsum']:
            return path_cached

    # The file hasn't been cached or has changed; cache it
    return _client().cache_local_file(path)
369751
private Bitmap loadFromLruCache(final String path, boolean tryFromDisk) {

        int key = getKey(path);

        Bitmap bitmap = mImagesCache.get(key); //try to retrieve from lruCache

        Log.d(TAG, "bitmap " + path + " from lruCache [" + key + "] " + bitmap);

        if (tryFromDisk && bitmap == null) {
            bitmap = loadFromDiskLruCache(key); //try to retrieve from disk cache

            Log.d(TAG, "bitmap " + path + " from diskLruCache " + bitmap);
            if (bitmap != null) { //if found on disk cache
                mImagesCache.put(key, bitmap); //save it into lruCache
            }
        }

        return bitmap;
    }
4721
def set(self, key, val, bucket):
        

        if bucket not in self._cache:
            self._cache[bucket] = {}

        self._cache[bucket][key] = val
1306550
def cache_file(self, path, saltenv='base', cachedir=None, source_hash=None):
        '''
        
        '''
        return self.get_url(
            path, '', True, saltenv, cachedir=cachedir, source_hash=source_hash)
809116
def _fill_cache(self):
        """"""
        for irow in range(len(self._table)):
            file_handle = self._make_file_handle(irow)
            self._cache[file_handle.path] = file_handle
552505
def load(path)
      raise unless disk_cache_enabled?

      cached_file = File.open(path, "rb")
      value = Marshal.load(cached_file)
      cached_file.close
      value
    end
265302
public function file_cache($key,$value=null,$expire=70,$prefix=''){
        if (empty($key)) return false;
        $option = array(
            'type'=>'File',
            'prefix'=>$prefix,
            'path'=>CACHE_PATH,
        );
        $expire = empty($expire)?0:$expire;
        $cache = \think\Cache::connect($option);
        if ($value){
            return $cache->set($key,$value,$expire);
        }else{
            return $cache->rm($key);
        }
    }
1317504
def enable_caching(self, file_path=None):
        

        if not file_path:
            file_path = tempfile.mktemp(prefix="pylast_tmp_")

        self.cache_backend = _ShelfCacheBackend(file_path)
206776
def set_value(self, value):
        """"""
        cache, cache_key = self._get_cache_plus_key()
        cache.set(cache_key, value)
616320
protected void putToCache(String cacheName, String key, Object value) {
        putToCache(cacheName, key, value, 0);
    }
688527
def copy_file(self, from_path, to_path, replace=False):
        
        f = self.get_file(from_path)
        if f.copy(to_path, replace):
            self.set_cache_buster(to_path, f.hash())
926204
function getFile(path) {
	const
		cache = validateCache(path, filesCache);

	if (!cache.fromCache) {
		filesCache[path] = {
			mtime: cache.mtime,
			content: fs.readFileSync(path, 'utf-8')
		};
	}

	return filesCache[path].content;
}