deeppavlov/core/data/utils.py
def ungzip(file_path, extract_path: Path = None):
    """Simple .gz archive extractor

        Args:
            file_path: path to the gzip file to be extracted
            extract_path: path where the file will be extracted

        """
    CHUNK = 16 * 1024
    file_path = Path(file_path)
    extract_path = extract_path or file_path.with_suffix('')

    with gzip.open(file_path, 'rb') as fin, extract_path.open('wb') as fout:
        while True:
            block = fin.read(CHUNK)
            if not block:
                break
            fout.write(block)
def ungzip(file_path, extract_path: Path = None):
    """Simple .gz archive extractor

        Args:
            file_path: path to the gzip file to be extracted
            extract_path: path where the file will be extracted

        """
    CHUNK = 16 * 1024
    file_path = Path(file_path)
    extract_path = extract_path or file_path.with_suffix('')

    with gzip.open(file_path, 'rb') as fin, extract_path.open('wb') as fout:
        while True:
            block = fin.read(CHUNK)
            if not block:
                break
            fout.write(block)
Simple .gz archive extractor

        Args:
            file_path: path to the gzip file to be extracted
            extract_path: path where the file will be extracted