Extract the content of the zip-file at `zip_path` into `target_folder`.
977915
def extract_zip(zip_path, target_folder):
    
    with zipfile.ZipFile(zip_path) as archive:
        archive.extractall(target_folder)
881274
def extract_zip(self, suffix, path='.'):
        
        zip_fd, zip_fn = tempfile.mkstemp(prefix='fuzzfetch-', suffix='.zip')
        os.close(zip_fd)
        try:
            _download_url(self.artifact_url(suffix), zip_fn)
            LOG.info('.. extracting')
            with zipfile.ZipFile(zip_fn) as zip_fp:
                for info in zip_fp.infolist():
                    _extract_file(zip_fp, info, path)
        finally:
            os.unlink(zip_fn)
836096
def unzip(from_file, to_folder):
    
    with ZipFile(os.path.abspath(from_file), 'r') as to_unzip:
        to_unzip.extractall(os.path.abspath(to_folder))
1098904
def extract_all(zipfile, dest_folder):
    
    z = ZipFile(zipfile)
    print(z)
    z.extract(dest_folder)
1267391
def extract_content(image_path, member_name, return_hash=False):
    '''
    '''
    if member_name.startswith('./'):
        member_name = member_name.replace('.','',1)
    if return_hash:
        hashy = hashlib.md5()

    try:
        content = Client.execute(image_path,'cat %s' %(member_name))
    except:
        return None

    if not isinstance(content,bytes):
        content = content.encode('utf-8')
        content = bytes(content)

    # If permissions don't allow read, return None
    if len(content) == 0:
        return None
    if return_hash:
        hashy.update(content)
        return hashy.hexdigest()
    return content
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
1355449
def cat_extract(tar, member, targetpath):
    
    assert member.isreg()

    # Fetch the TarInfo object for the given name and build the
    # destination pathname, replacing forward slashes to platform
    # specific separators.
    targetpath = targetpath.rstrip("/")
    targetpath = targetpath.replace("/", os.sep)

    # Create all upper directories.
    upperdirs = os.path.dirname(targetpath)
    if upperdirs and not os.path.exists(upperdirs):
        try:
            # Create directories that are not part of the archive with
            # default permissions.
            os.makedirs(upperdirs)
        except EnvironmentError as e:
            if e.errno == errno.EEXIST:
                # Ignore an error caused by the race of
                # the directory being created between the
                # check for the path and the creation.
                pass
            else:
                raise

    with files.DeleteOnError(targetpath) as dest:
        with pipeline.get_cat_pipeline(pipeline.PIPE, dest.f) as pl:
            fp = tar.extractfile(member)
            copyfileobj.copyfileobj(fp, pl.stdin)

    if sys.version_info < (3, 5):
        tar.chown(member, targetpath)
    else:
        tar.chown(member, targetpath, False)

    tar.chmod(member, targetpath)
    tar.utime(member, targetpath)
1229735
def get_contents_from_zip zip_file
        contents = {}
        Zip::File.open(zip_file) do |zip|
          zip.each_entry do |entry|
            entry.get_input_stream do |entryfile|
              contents[entry.name] = entryfile.read
            end
          end
        end
        return contents
      end
1238477
def extract_alzip (archive, compression, cmd, verbosity, interactive, outdir):
    """"""
    return [cmd, '-d', outdir, archive]
991032
def extract_zip(fileobj):
    """"""
    archive = zipfile.ZipFile(fileobj, mode='r')
    filenames = archive.namelist()

    for src_name, dst_name in filter_tzfiles(filenames):
        modified = archive.getinfo(src_name).date_time
        bytes = archive.read(src_name)

        yield dst_name, modified, bytes
826513
def extract_lzma(archive, compression, cmd, verbosity, interactive, outdir):
    """"""
    return _extract(archive, compression, cmd, 'alone', verbosity, outdir)
731941
public static void extractZipEntry(final ZipFile zipFile, final ZipEntry target,
		final File toDirectory) throws IOException
	{
		final File fileToExtract = new File(toDirectory, target.getName());
		new File(fileToExtract.getParent()).mkdirs();

		try (InputStream is = zipFile.getInputStream(target);
			BufferedInputStream bis = new BufferedInputStream(is);
			FileOutputStream fos = new FileOutputStream(fileToExtract);
			BufferedOutputStream bos = new BufferedOutputStream(fos))
		{
			for (int c; (c = bis.read()) != -1;)
			{
				bos.write((byte)c);
			}
			bos.flush();
		}
		catch (final IOException e)
		{
			throw e;
		}
	}
1295400
def do_extract(marfile, destdir, decompress):
    """"""
    with open(marfile, 'rb') as f:
        with MarReader(f) as m:
            m.extract(str(destdir), decompress=decompress)
355411
def extract_lzma(path):
    """"""
    tlfile = pathlib.Path(path)
    # open lzma file
    with tlfile.open("rb") as td:
        data = lzma.decompress(td.read())
    # write temporary tar file
    fd, tmpname = tempfile.mkstemp(prefix="odt_ex_", suffix=".tar")
    with open(fd, "wb") as fo:
        fo.write(data)
    return tmpname
114197
protected static void extractFile(ZipInputStream zipIn, String filePath) throws IOException {
		BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filePath));
		byte[] bytesIn = new byte[BUFFER_SIZE];
		int read = 0;
		while ((read = zipIn.read(bytesIn)) != -1) {
			bos.write(bytesIn, 0, read);
		}
		bos.close();
	}
308077
def compress_folder_dump(path, target):
    '''
    
    '''
    import tarfile
    if not path or not os.path.isdir(path):
        raise SystemExit(_error_codes.get(105))
    name_out_file = (target + 'dump-' +
                     datetime.datetime.now().strftime('%Y-%m-%d-%H-%M-%S'))
    tar = tarfile.open(name_out_file + '.tar.gz', 'w:gz')
    tar.add(path, arcname='dump')
    tar.close()
    return (name_out_file, name_out_file + '.tar.gz')
21787
def unzip(source_file, destination_dir):
    
    with zipfile.ZipFile(source_file) as zf:
        zf.extractall(destination_dir)