Load a Digest from a `.digest` file adjacent to the given directory.

    :return: A Digest, or None if the Digest did not exist.
502532
def load(cls, directory):
    
    read_file = maybe_read_file(cls._path(directory))
    if read_file:
      fingerprint, length = read_file.split(':')
      return Digest(fingerprint, int(length))
    else:
      return None
281315
def consume_file(self, filename):
        """"""
        with screed.open(filename) as sequences:
            for seq in sequences:
                self.consume(seq['sequence'])
1163683
def load(filepath):
        '''
        
        '''

        try:
            with open(filepath, "r") as fh:
                source = fh.read()
        except Exception as e:
            return None, e
        return source, None
1203195
function loadDir(dir, db, callback) {
    callback = callback || function() {};
    
    //Get the absolute dir path if a relative path was given
    if (dir.substr(0, 1) !== '/') {
        var parentPath = module.parent.filename.split('/');
        parentPath.pop();
        dir = parentPath.join('/') + '/' + dir;
    }
    
    //Load each file in directory
    fs.readdir(dir, function(err, files){
        if (err) return callback(err);
        
        var iterator = function(file, next){
            loadFile(dir + '/' + file, db, next);
        };
        async.forEach(files, iterator, callback);
    });
}
755817
def load(self, path):
        
        self.dct = wrapper.Dictionary()
        self.guide = wrapper.Guide()

        with open(path, 'rb') as f:
            self.dct.read(f)
            self.guide.read(f)

        return self
1284507
def download_if_not_exists(url: str, filename: str,
                           skip_cert_verify: bool = True,
                           mkdir: bool = True) -> None:
    
    if os.path.isfile(filename):
        log.info("No need to download, already have: {}", filename)
        return
    if mkdir:
        directory, basename = os.path.split(os.path.abspath(filename))
        mkdir_p(directory)
    download(url=url,
             filename=filename,
             skip_cert_verify=skip_cert_verify)
1754
def digest_dirname(file_path)
      slash_path(File.dirname(file_path)).sub(slash_path(self.source.path), '')
    end
180634
def digest_sha1(*files)
      files.flatten.collect { |file| 
        File.exists?(file) ? Digest::SHA1.hexdigest(File.read(file)) : nil
      }
    end
811665
def load_file(self, file_name):
        
        locator = self._make_locator()

        path = locator.find_file(file_name, self.search_dirs)

        return self.read(path)
1272491
def load_file_or_directory(path):
    
    assert os.path.exists(path), "{0} does not exist!".format(path)
    absolute_path = os.path.abspath(path)
    if not os.path.isdir(path):
        yield absolute_path
    else:
        for root, dirs, file_paths in os.walk(path):
            for file_path in file_paths:
                yield os.path.join(root, file_path)
1091869
def load(self, path):
        
        with open(path) as f:
            code = f.read()
            exec(code, {}, self.__dict__)
1191114
def add(self, path):
        '''
        
        '''
        with salt.utils.files.fopen(path, 'rb') as ifile:
            for chunk in iter(lambda: ifile.read(self.__buff), b''):
                self.__digest.update(chunk)
565752
def _read_object(self, path):
    ''''''
    if not os.path.exists(path):
      return None

    if os.path.isdir(path):
      raise RuntimeError('%s is a directory, not a file.' % path)

    with open(path) as f:
      file_contents = f.read()

    return file_contents
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
1279804
def load(self, path):
        
        try:
            self._load_binary(path)
        except CLIPSError:
            self._load_text(path)
1161643
def fetch_archive(savedir, url, fname, checksum, force=False):
    """"""
    dest = pjoin(savedir, fname)
    scheme, digest_ref = checksum.split(':')

    if os.path.exists(dest) and not force:
        info("already have %s" % dest)
        digest = checksum_file(scheme, fname)
        if digest == digest_ref:
            return dest
        else:
            warn("but checksum %s != %s, redownloading." % (digest, digest_ref))
            os.remove(fname)
    
    info("fetching %s into %s" % (url, savedir))
    if not os.path.exists(savedir):
        os.makedirs(savedir)
    req = urlopen(url)
    with open(dest, 'wb') as f:
        f.write(req.read())
    digest = checksum_file(scheme, dest)
    if digest != digest_ref:
        fatal("%s %s mismatch:\nExpected: %s\nActual  : %s" % (
            dest, scheme, digest_ref, digest))
    return dest
1222285
def load_resfile(directory, resfile_path=None):
    

    if resfile_path is None:
        workspace = workspace_from_dir(directory)
        resfile_path = workspace.resfile_path

    from klab.rosetta.input_files import Resfile
    return Resfile(resfile_path)