Read Cache objects from the files named and concatenate the results into a
		single Cache.
326286
def fromfilenames(cls, filenames, coltype=LIGOTimeGPS):
		
		cache = cls()
		for filename in filenames:
			cache.extend(cls.fromfile(open(filename), coltype=coltype))
		return cache
635388
public static void concatenate(List<File> files, File concatenatedFile) {

        BufferedWriter writer;
        try {
            writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(concatenatedFile.getAbsoluteFile(),
                    false), DataUtilDefaults.charSet));

            FileInputStream inputStream;
            for(File input : files) {
                inputStream = new FileInputStream(input);
                BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
                String line;
                while((line = reader.readLine()) != null) {
                    writer.write(line + DataUtilDefaults.lineTerminator);
                }
                inputStream.close();
            }
            writer.flush();
            writer.close();
        } catch (UnsupportedEncodingException e) {
            throw new DataUtilException(e);
        } catch (FileNotFoundException e) {
            throw new DataUtilException(e);
        } catch (IOException e) {
            throw new DataUtilException(e);
        }
    }
1331592
def _iterOutFiles(self):
        
        out = StringIO()
        self.callgrind(out, relative_path=True)
        yield (
            'cachegrind.out.pprofile',
            out.getvalue(),
            'application/x-kcachegrind',
        )
        for name, lines in self.iterSource():
            lines = ''.join(lines)
            if lines:
                if isinstance(lines, unicode):
                    lines = lines.encode('utf-8')
                yield (
                    os.path.normpath(
                        os.path.splitdrive(name)[1]
                    ).lstrip(_ALLSEP),
                    lines,
                    'text/x-python',
                )
        sql_name_template = 'query_%%0%ii-%%i_hits_%%6fs.sql' % len(
            str(len(self.sql_dict)),
        )
        for index, (query, time_list) in enumerate(
            sorted(
                self.sql_dict.iteritems(),
                key=lambda x: (sum(x[1]), len(x[1])),
                reverse=True,
            ),
        ):
            yield (
                sql_name_template % (
                    index,
                    len(time_list),
                    sum(time_list),
                ),
                b'\n'.join(b'-- %10.6fs' % x for x in time_list) + b'\n' + query,
                'application/sql',
            )
        if self.zodb_dict:
            yield (
                'ZODB_setstate.txt',
                '\n\n'.join(
                    (
                        '%s (%fs)\n' % (
                            db_name,
                            sum(sum(x) for x in oid_dict.itervalues()),
                        )
                    ) + '\n'.join(
                        '%s (%i): %s' % (
                            oid.encode('hex'),
                            len(time_list),
                            ', '.join('%fs' % x for x in time_list),
                        )
                        for oid, time_list in oid_dict.iteritems()
                    )
                    for db_name, oid_dict in self.zodb_dict.iteritems()
                ),
                'text/plain',
            )
        if self.traverse_dict:
            yield (
                'unrestrictedTraverse_pathlist.txt',
                tabulate(
                    ('self', 'path', 'hit', 'total duration'),
                    sorted(
                        (
                            (context, path, len(duration_list), sum(duration_list))
                            for (context, path), duration_list in self.traverse_dict.iteritems()
                        ),
                        key=lambda x: x[3],
                        reverse=True,
                    ),
                ),
                'text/plain',
            )
983305
function(paths, callback) {
        var results = [];

        //soft merge
        for(var path in paths) {
            if(paths.hasOwnProperty(path)) {
                acquire.cache[path] = paths[path];
                results.push(acquire.cache[path]);
            }
        }

        callback.apply(null, results);

        return results;
    }
663061
private void reads() {
    int index = random.nextInt();
    for (;;) {
      Integer key = ints[index++ & MASK];
      cache.get(key);
      calls.increment();
    }
  }
1204180
function _addReadCallbacks(filename, cache) {
  const callbacks = new Set();
  cache.set(filename, true);
  readFileCallbacks.set(filename, callbacks);
  return callbacks;
}
954796
def load_files(filenames,multiproc=False,**kwargs):
    
    filenames = np.atleast_1d(filenames)
    logger.debug("Loading %s files..."%len(filenames))

    kwargs = [dict(filename=f,**kwargs) for f in filenames]

    if multiproc:
        from multiprocessing import Pool
        processes = multiproc if multiproc > 0 else None
        p = Pool(processes,maxtasksperchild=1)
        out = p.map(load_file,kwargs)
    else:
        out = [load_file(kw) for kw in kwargs]

    dtype = out[0].dtype
    for i,d in enumerate(out):
        if d.dtype != dtype: 
            # ADW: Not really safe...
            logger.warn("Casting input data to same type.")
            out[i] = d.astype(dtype,copy=False)

    logger.debug('Concatenating arrays...')
    return np.concatenate(out)
704273
def _read_cache(self):
        """"""
        if os.path.exists(self.filepath):
            with open(self.filepath, 'rt', encoding='utf8') as fh:
                lines = [x.strip() for x in fh]
        else:
            logger.debug("Index not found, starting empty")
            lines = []
        return lines
754368
protected void loadCacheMapping() {
		File f = new File(getCacheFilePath());
		if (f.exists()) {
			try(InputStream is = new FileInputStream(f); BufferedReader rd = new BufferedReader(new FileReader(f))) {
				cacheProperties.load(is);
				for (Enumeration<?> properyNames = cacheProperties.propertyNames(); properyNames.hasMoreElements();) {
					String propName = (String) properyNames.nextElement();
					if (propName.startsWith(JAWR_MAPPING_PREFIX)) {

						String value = cacheProperties.getProperty(propName);

						String resourceMapping = propName.substring(JAWR_MAPPING_PREFIX.length());
						String[] mappings = value.split(SEMICOLON);
						List<FilePathMapping> fMappings = new CopyOnWriteArrayList<>();

						// TODO check the use of mappingModified
						boolean mappingModified = true;
						for (String fmapping : mappings) {
							String[] mapping = fmapping.split(MAPPING_TIMESTAMP_SEPARATOR);
							long lastModified = Long.parseLong(mapping[1]);
							String filePath = mapping[0];
							if (rsHandler.getLastModified(filePath) != lastModified) {
								mappingModified = false;
								break;
							}
							FilePathMapping fmap = new FilePathMapping(filePath, lastModified);
							fMappings.add(fmap);
						}

						if (mappingModified) {
							linkedResourceMap.put(resourceMapping, fMappings);
						}
					}
				}

			} catch (IOException e) {
				throw new BundlingProcessException("Unable to initialize " + getName() + " Generator cache", e);
			}
		}
	}
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)
204005
def cache_files(self, paths, saltenv='base', cachedir=None):
        '''
        
        '''
        ret = []
        if isinstance(paths, six.string_types):
            paths = paths.split(',')
        for path in paths:
            ret.append(self.cache_file(path, saltenv, cachedir=cachedir))
        return ret
917871
private Properties loadCacheData(final File cacheFile) {
        final Properties cacheProperties = new Properties();
        if (cacheFile.isFile()) {
            //try to load cache data if present
            try {
                final FileInputStream fileInputStream = new FileInputStream(cacheFile);
                try {
                    cacheProperties.load(fileInputStream);
                } finally {
                    fileInputStream.close();
                }
            } catch (IOException e) {
                logger.debug("failed to load cache data from file: " + cacheFile);
            }
        }
        return cacheProperties;
    }
901501
private List<File> loadFromCache(Properties props) {
        String ts = props.getProperty("timestamp");
        if (ts==null)   return null;

        long timestamp = Long.valueOf(ts);
        if (isStale(timestamp))
            return null;

        List<File> files = new ArrayList<File>();

        for (Object k : props.keySet()) {
            String key = k.toString();
            if (key.startsWith("pom.")) {
                File f = new File(props.getProperty(key));
                if (!isUpToDate(f,timestamp))
                    return null;
            }
            if (key.startsWith("jar.")) {
                File f = new File(props.getProperty(key));
                if (!isUpToDate(f, timestamp))
                    return null;
                files.add(f);
            }
        }

        return files;
    }
1163069
def cache_generator(self, key, generator):
        """"""
        results = []
        for result in generator:
            results.append(result)
            yield result

        self.inferred[key] = tuple(results)
403113
def cache_get(cache_dir, cache_key, default=None):
    
    filename = os.path.join(cache_dir, cache_key)

    if os.path.isfile(filename):
        with open(filename, 'r') as f:
            return f.read()

    return default
705431
function _readFileOnEnd(filename, contents, cache) {
  loading--;
  const data = Buffer.concat(contents);
  cache.set(filename, data);
  _fireReadFileCallbacks(filename, data);
  _runFileQueue();
}
1132269
def read_cache(self):
        """"""
        if os.path.exists(self._cache_file):
            self._cache = read_cache_file(self._cache_file)
        else:
            self._cache = {}