Load a file, find it's partials, and return the relevant data.
963114
function handleFile(name, file, options, cache, callback) {
	var cachedData;
	if(!options || !options.settings || options.settings['view cache'] !== false) {
		cachedData = cache && cache.get(file);
	}
	if (!cachedData) {
		loadFile(file, function(err, fileData) {
			if (err) {
				return callback(err);
			}

			var partials;
			try {
				partials = findPartials(fileData);
			} catch (err) {
				return callback(err);
			}

			var data = {
				name: name,
				data: fileData,
				partials: partials
			};
			if (cache) {
				cache.set(file, data);
			}
			return callback(null, data);
		});
	}
	else {
		return callback(null, cachedData);
	}
}
24430
def load(self):
        """"""
        if not self.loaded:
            self.values = configobj.ConfigObj({}, **self.DEFAULT_CONFIG_OPTS)
            for path in self.locations():
                try:
                    part = configobj.ConfigObj(infile=path, **self.DEFAULT_CONFIG_OPTS)
                except configobj.ConfigObjError as cause:
                    raise LoggedFailure("Error in file '{path}': {cause}".format(path=pretty_path(path), cause=cause))
                self.values.merge(part)
            self.loaded = True
        return self.values
921915
def get_resource(self, request, filename):
        """"""
        filename = join("shared", basename(filename))
        try:
            data = pkgutil.get_data(__package__, filename)
        except OSError:
            data = None
        if data is not None:
            mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream"
            return Response(data, mimetype=mimetype)
        return Response("Not Found", status=404)
820098
def load_files(self, cursor, target, files, options):
        ""
        for fname in files:
            self.load_file(cursor, target, fname, options)
1097132
function loadPartials (options) {
    // return cached partials if caching enabled
    if (options.cache && GLOBAL.partials) {
        return GLOBAL.partials
    }
    // load partials
    GLOBAL.partials = loadTemplates(GLOBAL.partialDirs, options)
    // return promise that will be resolved with partials
    return GLOBAL.partials
}
1194927
def load_file(self):
        

        # We first split file into pieces
        searchunks = self._split_file()

        if searchunks:

            # And then we parse pieces into meaningful data
            usage = self._parse_file(searchunks)

            if 'CPU' in usage:
                return False

            self._sarinfo = usage
            del usage
            return True

        else:
            return False
1030184
def load_from_file(cls, file_path):
        """"""
        data = None
        if os.path.exists(file_path):
            metadata_file = open(file_path)
            data = json.loads(metadata_file.read())
        return cls(initial=data)
424677
def parse_files(self, req, name, field):
        """"""
        return core.get_value(req.FILES, name, field)
1124255
def load(self, size):
        """"""
        if self.exists() and self.isfile():
            return eval(open(self).read(size))
80069
def load(self, filething, **kwargs):
        """"""

        fileobj = filething.fileobj

        try:
            self.tags = _IFFID3(fileobj, **kwargs)
        except ID3NoHeaderError:
            self.tags = None
        except ID3Error as e:
            raise error(e)
        else:
            self.tags.filename = self.filename

        fileobj.seek(0, 0)
        self.info = AIFFInfo(fileobj)
1350551
def load(cls, filename, store_password, try_decrypt_keys=True):
        
        with open(filename, 'rb') as file:
            input_bytes = file.read()
            ret = cls.loads(input_bytes,
                            store_password,
                            try_decrypt_keys=try_decrypt_keys)
        return ret
1336983
def load_object(filename):
    """"""
    logging.info('loading {}...'.format(filename))
    try:
        with gzip.GzipFile(filename, 'rb') as f:
            buf = ''
            while True:
                data = f.read()
                if data == '':
                    break
                buf += data
            return pickle.loads(buf)
    except Exception as e:
        logging.error('load failure: {}'.format(e))
        raise
493073
def get_data(url, gallery_dir):
    """"""

    # shelve keys need to be str in python 2
    if sys.version_info[0] == 2 and isinstance(url, unicode):
        url = url.encode('utf-8')

    cached_file = os.path.join(gallery_dir, 'searchindex')
    search_index = shelve.open(cached_file)
    if url in search_index:
        data = search_index[url]
    else:
        data = _get_data(url)
        search_index[url] = data
    search_index.close()

    return data
91949
def load(self, patterns, dirs, ignore=None):
        
        for dir_ in dirs:
            dir_root = dir_
            if os.path.exists(os.path.join(dir_, "__init__.py")):
                dir_root = os.path.abspath(os.path.join(dir_, os.pardir))

            for path in self.find_files(patterns=patterns, dirs=[dir_], ignore=ignore):
                data = self.read_file(path=path)
                if data:
                    data["relative_path"] = os.path.relpath(path, dir_root)
                    self.paths[path] = data
791212
function getPartials(file, sourcePath, templates, customPartialName, callback) {
  const { partials } = templates;
  if (file.meta.customLayout === undefined) {
    async.nextTick(callback, null, partials);
    return;
  }

  const customLayoutPath = path.join(
    sourcePath,
    path.resolve(path.sep, file.meta.filePath.dir, file.meta.customLayout)
  );
  read(customLayoutPath, ReadMode.UTF8, (error, data) => {
    if (error) {
      console.error(`${file.path}: Could not load the custom layout`);
      async.nextTick(callback, error);
      return;
    }

    const customPartials = { [customPartialName]: data };
    async.nextTick(callback, null, Object.assign({}, partials, customPartials));
  });
}
930537
def load_source(self):
    """"""
    if self.filename in self.STDIN_NAMES:
      self.filename = 'stdin'
      self.source = pycodestyle.stdin_get_value()
    else:
      with pep257.tokenize_open(self.filename) as fd:
        self.source = fd.read()
777371
def _load_from_file(self, filename):
    """"""
    if not tf.gfile.Exists(filename):
      raise ValueError("File %s not found" % filename)
    with tf.gfile.Open(filename) as f:
      self._load_from_file_object(f)