Retrieve an array of the archive contents.
973242
public function contents()
    {
        $files = array();
        foreach ($this->tar->listContent() as $data) {
          $files[$data['filename']] = $data;
        }

        return $files;
    }
723685
def _search_archive(pattern, archive, verbosity=0, interactive=True):
    """"""
    grep = util.find_program("grep")
    if not grep:
        msg = "The grep(1) program is required for searching archive contents, please install it."
        raise util.PatoolError(msg)
    tmpdir = util.tmpdir()
    try:
        path = _extract_archive(archive, outdir=tmpdir, verbosity=-1)
        return util.run_checked([grep, "-r", "-e", pattern, "."], ret_ok=(0, 1), verbosity=1, cwd=path)
    finally:
        shutil.rmtree(tmpdir, onerror=rmtree_log_error)
1369740
def get_archive(self, archive_id):
        
        response = requests.get(self.endpoints.archive_url(archive_id), headers=self.json_headers(), proxies=self.proxies, timeout=self.timeout)

        if response.status_code < 300:
            return Archive(self, response.json())
        elif response.status_code == 403:
            raise AuthError()
        elif response.status_code == 404:
            raise NotFoundError("Archive not found")
        else:
            raise RequestError("An unexpected error occurred", response.status_code)
334051
def archive_filenames(self):
        """"""
        try:
            return _bfd.archive_list_filenames(self._ptr)
        except TypeError, err:
            raise BfdException(err)
776417
def unpack_archive(archive_format, archive_path, source_path):
    """"""
    if archive_format not in ('zip', 'tar'):
        raise ValueError('Unknown archive format "%s".' % archive_format)
    if archive_format == 'zip':
        with zipfile.ZipFile(archive_path) as archive:
            archive.extractall(source_path)
    if archive_format == 'tar':
        with tarfile.open(archive_path) as archive:
            archive.extractall(source_path)
210404
public static function getByArchive($value, $limit = false, $offset = false, $moreQuerySettings = [])
    {
        return self::getBy(Ajax::ARCHIVE, $value, $limit, $offset, $moreQuerySettings);
    }
1248427
def get(self, name):
        
        # not much we can do with that
        if name is None:
            return

        # if name isn't in archive try some similar values
        if name not in self.archive:
            if hasattr(name, 'decode'):
                name = name.decode('utf-8')
            # try with cleared whitespace, split paths
            for option in [name,
                           name.lstrip('./'),
                           name.strip(),
                           name.split('/')[-1]]:
                if option in self.archive:
                    name = option
                    break
        # read file object from beginning
        self.archive[name].seek(0)
        # data is stored as a file object
        data = self.archive[name].read()

        return data
5060
def get_files(conn, aid: int) -> AnimeFiles:
    """"""
    with conn:
        cur = conn.cursor().execute(
            'SELECT anime_files FROM cache_anime WHERE aid=?',
            (aid,))
        row = cur.fetchone()
        if row is None:
            raise ValueError('No cached files')
        return AnimeFiles.from_json(row[0])
700980
function() {
      var documents = [];
      // search localstorage for saved documents
      for ( var i = 0, max = localStorage.length; i < max; i++) {
        var key = localStorage.key(i);
        // value is a document if key confirms to prefix
        if (key.indexOf(prefix) == 0) {
          var doc = getDocumentByKey(key);
          if (doc) {
            documents.push(doc);
          }
        }
      }
      return documents;
    }
422270
def all(self, archived=False, limit=None, page=None):
        """"""
        path = partial(_path, self.adapter)
        if not archived:
            path = _path(self.adapter)
        else:
            path = _path(self.adapter, 'archived')
        return self._get(path, limit=limit, page=page)
546148
def items(self):
        """"""
        contents = self.paths
        contents = (
            BinFile(path.path) if path.is_file else BinDir(path.path)
            for path in contents
        )
        return contents
653719
def _extract(archive, compression, cmd, format, verbosity, outdir):
    """"""
    targetname = util.get_single_outfile(outdir, archive)
    try:
        with lzma.LZMAFile(archive, **_get_lzma_options(format)) as lzmafile:
            with open(targetname, 'wb') as targetfile:
                data = lzmafile.read(READ_SIZE_BYTES)
                while data:
                    targetfile.write(data)
                    data = lzmafile.read(READ_SIZE_BYTES)
    except Exception as err:
        msg = "error extracting %s to %s: %s" % (archive, targetname, err)
        raise util.PatoolError(msg)
    return None
1018316
def (self):
        """"""

        archive_data = {"packets": self.recv_msgs,
                        "dataset": self.dataset_name,
                        "num_packets": len(self.recv_msgs),
                        "created": rnow()}
        self.write_to_file(archive_data,
                           self.archive_file)
1080372
public Archive[] as(final Class<? extends Archive> archive) {
      final List<? extends Archive> archives = asList(archive);
      return archives.toArray(new Archive[archives.size()]);
   }
1069117
def read_bytes(self):
        """"""

        with ZipFile(self.path, mode='r') as archive:
            return archive.read(self.filename)
685510
def retrieveVals(self):
        """"""
        if self._diskList:
            self._fetchDevAll('disk', self._diskList, 
                              self._info.getDiskStats)
        if self._mdList:
            self._fetchDevAll('md', self._mdList, 
                              self._info.getMDstats)
        if self._partList:
            self._fetchDevAll('part', self._partList, 
                              self._info.getPartitionStats) 
        if self._lvList:
            self._fetchDevAll('lv', self._lvList, 
                              self._info.getLVstats)
        self._fetchDevAll('fs', self._fsList, 
                          self._info.getFilesystemStats)
87922
def archives(self):
        '''
        
        '''
        arc_files = []
        tmpdir = tempfile.gettempdir()
        for filename in os.listdir(tmpdir):
            mtc = re.match(r'\w+-\w+-\d+-\d+\.bz2', filename)
            if mtc and len(filename) == mtc.span()[-1]:
                arc_files.append(os.path.join(tmpdir, filename))

        return arc_files