Function load.

        :return: file contents
        :raises: NotFoundError if file not found
510179
def _load(self):
        
        if self.is_exists():
            return open(self._ref, "rb").read()
        raise NotFoundError("File %s not found" % self._ref)
1046379
def load_file(self, file):
        

        if not foundations.common.path_exists(file):
            raise foundations.exceptions.FileExistsError(
                "{0} | '{1}' file doesn't exists!".format(self.__class__.__name__,
                                                          file))

        LOGGER.debug("> Loading '{0}' file.".format(file))
        reader = foundations.io.File(file)
        self.setPlainText(reader.read())
        self.set_file(file)
        self.__set_document_signals()
        self.file_loaded.emit()
        return True
1365636
def load(self):
        
        if VERBOSE_PREF:
            print('[pref.load()]')
            #if not os.path.exists(self._intern.fpath):
            #    msg = '[pref] fpath=%r does not exist' % (self._intern.fpath)
            #    return msg
        fpath = self.get_fpath()
        try:
            with open(fpath, 'rb') as f:
                if VERBOSE_PREF:
                    print('load: %r' % fpath)
                pref_dict = pickle.load(f)
        except EOFError as ex1:
            util_dbg.printex(ex1, 'did not load pref fpath=%r correctly' % fpath, iswarning=True)
            #warnings.warn(msg)
            raise
            #return msg
        except ImportError as ex2:
            util_dbg.printex(ex2, 'did not load pref fpath=%r correctly' % fpath, iswarning=True)
            #warnings.warn(msg)
            raise
            #return msg
        if not util_type.is_dict(pref_dict):
            raise Exception('Preference file is corrupted')
        self.add_dict(pref_dict)
        return True
1330870
def content(self):
        '''
        '''
        if not self._content_data:
            if is_seekable(self.file):
                with wpull.util.reset_file_offset(self.file):
                    self._content_data = self.file.read()
            else:
                self._content_data = self.file.read()

        return self._content_data
410473
function _load(source, callback) {
  fs.readFile(source, {encoding: 'utf8'}, _jsonLoaded.bind(null, callback));
}
398224
def load(f, dict_=dict):
    
    if not f.read:
        raise ValueError('The first parameter needs to be a file object, ',
                         '%r is passed' % type(f))
    return loads(f.read(), dict_)
316184
function loadFileContents(filePath, preloaded)
{
    //use pre-supplied contents?
    if (typeof preloaded !== 'undefined' && preloaded !== null)
    {
        //return a promise which will get resolved with the preloaded value
        if (preloaded instanceof Buffer)
        {
            return promiseValue(preloaded.toString());
        }
        else
        {
            return promiseValue(String(preloaded));
        }
    }
    else
    {
        return Q.nfcall(fs.readFile, filePath).invoke('toString');
    }
}
59014
def get(self, filename, reset=False):
        
        if filename in self.files and not reset:
            return self.files[filename]

        # load a single file, and process
        files = {}
        path = os.path.join(self.source, filename)
        files[filename] = frontmatter.load(path, 
            filename=filename,
            slug=os.path.splitext(filename)[0])

        # call middleware
        for func in self.middleware:
            func(files, self)

        # cache the processed post
        self.files.update(files)

        # return just the post
        try:
            return files[filename]
        except KeyError:
            raise PostNotFound('{0} not found'.format(filename))
903832
def _load_from_file(metadata, load_func):
    
    config_filename = get_config_filename(metadata)
    if config_filename is None:
        return dict()

    with open(config_filename, "r") as file_:
        data = load_func(file_.read())
        return dict(data)
1062754
function load(file) {

    let contents = null;

    file = path.resolve(file);

    // handle .env files
    if (constants.REGEX.envfile.test(file)) {
        contents = util.parse(fs.readFileSync(file, 'utf8'));

    // handle .js/.json files
    } else {
        contents = require(file);
    }

    return env(contents);

}
175360
def file_contents(file_name):
    """"""
    curr_dir = os.path.abspath(os.path.dirname(__file__))
    with open(os.path.join(curr_dir, file_name)) as the_file:
        contents = the_file.read()
    return contents
1163683
def load(filepath):
        '''
        
        '''

        try:
            with open(filepath, "r") as fh:
                source = fh.read()
        except Exception as e:
            return None, e
        return source, None
159141
def load_from_file_object(cls, fd, format=None):
        
        format = 'pickle' if format is None else format
        load = getattr(cls, "load_%s" % format, None)
        if load is None:
            raise ValueError("Unknown format '%s'." % format)
        return load(fd)
1238570
def loadFile(self, var, close_on_fail = True):
    
    out = None
    try:
      # First see if it is a full path or directly links from the current
      # working directory
      out = np.load(var)
      if self.Verbose: print("Loading "+var+" from numpy binary")
    except:
      try:
        out = np.loadtxt(var)
        if self.Verbose: print("Loading "+var+" ASCII")
      except:
        # Then see if it is relative to the location of the configuration file
        try:
          out = load(self.inpath + var)
          if self.Verbose: print("Loading "+var+" from numpy binary")
        except:
          try:
            out = np.loadtxt(self.inpath + var)
            if self.Verbose: print("Loading "+var+" ASCII")
          # If failure
          except:
            if close_on_fail:
              print("Cannot find "+var+" file")
              print(""+var+" path = " + var)
              print("Looked relative to model python files.")
              print("Also looked relative to configuration file path,")
              print("  ", self.inpath)
              print("Exiting.")
              sys.exit()
            else:
              pass
    return out
1205384
def get_file_contents(self, path, ref=github.GithubObject.NotSet):
        
        assert isinstance(path, (str, unicode)), path
        assert ref is github.GithubObject.NotSet or isinstance(ref, (str, unicode)), ref
        url_parameters = dict()
        if ref is not github.GithubObject.NotSet:
            url_parameters["ref"] = ref
        headers, data = self._requester.requestJsonAndCheck(
            "GET",
            self.url + "/contents/" + urllib.quote(path),
            parameters=url_parameters
        )
        if isinstance(data, list):
            return [
                github.ContentFile.ContentFile(self._requester, headers, item, completed=False)
                for item in data
            ]
        return github.ContentFile.ContentFile(self._requester, headers, data, completed=True)
365305
def read_file(self):
        
        file_obj = open(self.file, 'r')
        content = file_obj.read()
        file_obj.close()
        if content:
            content = json.loads(content)
            return content
        else:
            return {}
1065638
def load(self):
        
        try:
            with open(self.file_root + '.pkl', "rb") as f:
                return pickle.load(f)
        except IOError:
            raise CacheMissing(self.file_root)