python (3.11.7)

(root)/
lib/
python3.11/
__pycache__/
gzip.cpython-311.pyc

e
^rdZddlZddlZddlZddlZddlZddlZddlZddlZgdZ	d\Z
ZZZ
Zd\ZZdZdZdZd	edddfd
ZdZGdd
ZGddeZGddejZdZdZGddejZ	ddede fdZ!efdddZ"dZ#dZ$e%dkre$dSdS)zFunctions that read and write gzipped files.

The user of the file doesn't have to worry about the compression,
but random access is not allowed.N)BadGzipFileGzipFileopencompress
decompress))rr	r	rbc"d|vrd|vrtd|n3|td|td|td|dd}t|ttt
jfrt|||}nBt|d	st|d
rtd|||}ntdd|vr+tj|}tj||||S|S)aOpen a gzip-compressed file in binary or text mode.

    The filename argument can be an actual filename (a str or bytes object), or
    an existing file object to read from or write to.

    The mode argument can be "r", "rb", "w", "wb", "x", "xb", "a" or "ab" for
    binary mode, or "rt", "wt", "xt" or "at" for text mode. The default mode is
    "rb", and the default compresslevel is 9.

    For binary mode, this function is equivalent to the GzipFile constructor:
    GzipFile(filename, mode, compresslevel). In this case, the encoding, errors
    and newline arguments must not be provided.

    For text mode, a GzipFile object is created, and wrapped in an
    io.TextIOWrapper instance with the specified encoding, error handling
    behavior, and line ending(s).

    tbzInvalid mode: Nz0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary modereadwritez1filename must be a str or bytes object, or a file)
ValueErrorreplace
isinstancestrbytesosPathLikerhasattr	TypeErrorio
text_encoding
TextIOWrapper)filenamemode
compresslevelencodingerrorsnewlinegz_modebinary_files        8/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/gzip.pyrrs2(d{{$;;*449:::OPPPMNNNNOOOll3##G(S%566Mx-@@	6	"	"Mgh&@&@MtWmXFFKLLL
d{{#H--XvwGGGcV|tjd|dS)Nz<L)rstructpack)outputvalues  r*write32ur1Fs(LLT5))*****r+c4eZdZdZd	dZdZd	dZdZdZdS)
_PaddedFilezMinimal read-only file object that prepends a string to the contents
    of an actual file. Shouldn't be used outside of gzip.py, as it lacks
    essential functionality.r+cX||_t||_||_d|_dSNr)_bufferlen_lengthfile_read)selffprepends   r*__init__z_PaddedFile.__init__Ps(7||	


r+cF|j|j|S|j|z|jkr+|j}|xj|z
c_|j||jS|j}d|_|j|d|j||jz
|zzSN)r:r9rr8r6)r;sizers   r*rz_PaddedFile.readVs:9>>$''':,,:DJJ$JJ<TZ00:DDJ<&9>>$t|"3D"899:
:r+c|j||_n|xjt|zc_dSt|j|_d|_dSr5)r:r6r7r8)r;r=s  r*r=z_PaddedFile.prependcsJ:"DLLJJ#g,,&JJF4<((


r+cRd|_d|_|j|Sr@)r:r6r9seek)r;offs  r*rDz_PaddedFile.seekls$
y~~c"""r+cdSNTr;s r*seekablez_PaddedFile.seekableqtr+N)r+)	__name__
__module____qualname____doc__r>rr=rDrJrHr+r*r3r3Kss  :::###
r+r3ceZdZdZdS)rz6Exception raised in some cases for invalid gzip files.N)rLrMrNrOrHr+r*rrus@@@@r+rceZdZdZdZddeddfdZedZedZ	dZ
dZdZd	Z
ddZddZd
ZedZdZejfdZdZdZdZdZdZejfdZddZdS)ra
The GzipFile class simulates most of the methods of a file object with
    the exception of the truncate() method.

    This class only supports opening files in binary mode. If you need to open a
    compressed file in text mode, use the gzip.open() function.

    Nc|r*d|vsd|vr"td||r	d|vr|dz
}|tj||pdx}|_|0t|dd}t
|ttfsd}ntj
|}|}|t|d	d}|d
r<t|_
t|}tj||_||_n|dr| ddl}|d
t*dt,|_
||t1j|t0jt0jt0jd|_||_n"td|||_|j
t,kr| |dSdS)aGConstructor for the GzipFile class.

        At least one of fileobj and filename must be given a
        non-trivial value.

        The new class instance is based on fileobj, which can be a regular
        file, an io.BytesIO object, or any other object which simulates a file.
        It defaults to None, in which case filename is opened to provide
        a file object.

        When fileobj is not None, the filename argument is only used to be
        included in the gzip file header, which may include the original
        filename of the uncompressed file.  It defaults to the filename of
        fileobj, if discernible; otherwise, it defaults to the empty string,
        and in this case the original filename is not included in the header.

        The mode argument can be any of 'r', 'rb', 'a', 'ab', 'w', 'wb', 'x', or
        'xb' depending on whether the file will be read or written.  The default
        is the mode of fileobj if discernible; otherwise, the default is 'rb'.
        A mode of 'r' is equivalent to one of 'rb', and similarly for 'w' and
        'wb', 'a' and 'ab', and 'x' and 'xb'.

        The compresslevel argument is an integer from 0 to 9 controlling the
        level of compression; 1 is fastest and produces the least compression,
        and 9 is slowest and produces the most compression. 0 is no compression
        at all. The default is 9.

        The mtime argument is an optional numeric timestamp to be written
        to the last modification time field in the stream when compressing.
        If omitted or None, the current time is used.

        rUzInvalid mode: {!r}rNrnamerr#r)waxrzGzipFile was opened for writing, but this will change in future Python releases.  Specify the mode argument for opening it for writing.r	)!rformatbuiltinsr	myfileobjgetattrrrrrfspath
startswithREADr#_GzipReaderrBufferedReaderr6rTwarningswarn
FutureWarningWRITE_init_writezlibcompressobjDEFLATED	MAX_WBITS
DEF_MEM_LEVELr_write_mtimefileobj_write_gzip_header)	r;r"r#r$rmmtimeorigmoderawrbs	         r*r>zGzipFile.__init__sF	@SD[[C4KK188>>???	CtOOCKD?'/}Xt|t'L'LLGdnw33Hhe55
y**H<7FD11D??3	@DIg&&C,S11DL DII
___
-
-	@

L"1	&&&
DIX&&& ,]-1].2n_-1-?-.	00DM
!&D188>>???9##M22222r+cddl}|dtd|jtkr|jdddkr
|jdzS|jS)Nrzuse the name attributer	.gz)rbrcDeprecationWarningr#rerT)r;rbs  r*r"zGzipFile.filenamesY

.0BAFFF9$)BCC.E"9"99u$$yr+c$|jjjS)z0Last modification time read from stream, or None)r6rq_last_mtimerIs r*rozGzipFile.mtimes|++r+ct|j}d|ddzdztt|zdzS)Nz<gzip r >)reprrmhexid)r;ss  r*__repr__zGzipFile.__repr__s?!AbD'!C'#bhh--7#==r+c~||_tjd|_d|_g|_d|_d|_dSNr+r)rTrgcrc32crcrAwritebufbufsizeoffset)r;r"s  r*rfzGzipFile._init_writes8	:c??	
r+c\|jd|jd	tj|j}t
|ts|d}|	dr
|dd}n#t$rd}YnwxYwd}|rt}|jt|d|j
}|tj}t|jt!||t"krd}n|t$krd	}nd
}|j||jd|r|j|d
zdSdS)Nzlatin-1s.gzrsr+r)rmrrpathbasenamerTrrencodeendswithUnicodeEncodeErrorFNAMEchrrltimer1int_COMPRESS_LEVEL_BEST_COMPRESS_LEVEL_FAST)r;r$fnameflagsroxfls      r*rnzGzipFile._write_gzip_headers;'''7###		G$$TY//EeU++
0Y//~~f%%
#crc
!			EEE		E3u::,,Y77888!=IKKEs5zz***000CC
2
2
2CCC37###	0Luw/////	0	0sA-B$$B32B3c||jtkrddl}t	|jd|jtdt|ttfrt|}nt|}|j
}|dkrq|j|j||xj|z
c_t#j||j|_|xj|z
c_|S)Nrz$write() on read-only GzipFile objectz!write() on closed GzipFile object)_check_not_closedr#reerrnoOSErrorEBADFrmrrr	bytearrayr7
memoryviewnbytesrrrArgrrr)r;datarlengths    r*rzGzipFile.writes   9LLL%+'MNNN<@AAAdUI.//	!YYFFd##D[FA::Lt}55d;;<<<IIIIz$11DHKK6!KK
r+ryc||jtkrddl}t	|jd|j|S)Nrz$read() on write-only GzipFile object)rr#r_rrrr6rr;rArs   r*rz
GzipFile.read(sS   9LLL%+'MNNN|  &&&r+c||jtkrddl}t	|jd|dkrtj}|j	|S)zdImplements BufferedIOBase.read1()

        Reads up to a buffer's worth of data if size is negative.rNz%read1() on write-only GzipFile object)
rr#r_rrrrDEFAULT_BUFFER_SIZEr6read1rs   r*rzGzipFile.read1/sf	
   9LLL%+'NOOO!88)D|!!$'''r+c||jtkrddl}t	|jd|j|S)Nrz$peek() on write-only GzipFile object)rr#r_rrrr6peek)r;nrs   r*rz
GzipFile.peek<sS   9LLL%+'MNNN|  ###r+c|jduSr@)rmrIs r*closedzGzipFile.closedCs|t##r+c|j}|dSd|_	|jtkrZ||jt
||jt
||jdzn)|jtkr|j
|j}|rd|_|dSdS#|j}|rd|_|wwxYw)N)
rmr#rerrflushr1rrAr_r6closer[)r;rmr[s   r*rzGzipFile.closeGs,?F	"yE!!

dm1133444$(+++$)j"89999d""""$$$I
"!%!!!!!
"
"I
"!%!!!!
"sBC'C6c||jtkrM|j|j||jdSdSr@)rr#rermrrr)r;	zlib_modes  r*rzGzipFile.flushZsi   9Lt}229==>>>L     r+c4|jS)zInvoke the underlying file object's fileno() method.

        This will raise AttributeError if the underlying file object
        doesn't support fileno().
        )rmfilenorIs r*rzGzipFile.filenoas|""$$$r+cx|jtkrtd|jddS)z[Return the uncompressed stream file position indicator to the
        beginning of the filezCan't rewind in write moderN)r#r_rr6rDrIs r*rewindzGzipFile.rewindis<96777!r+c"|jtkSr@)r#r_rIs r*readablezGzipFile.readablepsyD  r+c"|jtkSr@)r#rerIs r*writablezGzipFile.writablessyE!!r+cdSrGrHrIs r*rJzGzipFile.seekablevrKr+c|jtkr|tjkr*|tjkr|j|z}nt
d||jkrtd||jz
}d}t|dzD]}|	||	d|dzzn?|jtkr/||j
||S|jS)NzSeek from end not supportedzNegative seek in write modesir)r#rerSEEK_SETSEEK_CURrrrrangerr_rr6rD)r;rwhencecountchunkis      r*rDz
GzipFile.seekys9$$R[((![61FF$%BCCC##;<<<T[(E E5D=))
"
"

5!!!!JJu-....
Y$

""$$$<$$VV444{r+c^||j|Sr@)rr6readline)r;rAs  r*rzGzipFile.readlines*   |$$T***r+ry)rLrMrNrOr[rr>propertyr"rorrfrnrrrrrrrgZ_SYNC_FLUSHrrrrrrJrrrDrrHr+r*rrysI $43TO3O3O3O3bX,,X,>>>000@0''''(((($$$$$X$"""&".!!!!%%%!!!"""#%+(++++++r+rc||}t||krN||t|z
}|std||z
}t||kN|S)z}Read exactly *n* bytes from `fp`

    This method is required because fp may be unbuffered,
    i.e. return short reads.
    ACompressed file ended before the end-of-stream marker was reached)rr7EOFError)fprrrs    r*_read_exactrs}771::D

d))a--GGAD		M""	?>??
?	d))a--Kr+cB|d}|dkrdS|dkrtd|ztjdt	|d\}}}|dkrtd|t
zr5tjd	t	|d\}t	|||tzr 	|d}|r|dkrn|tzr 	|d}|r|dkrn|tzrt	|d|S)
zRead a gzip header from `fp` and progress to the end of the header.

    Returns last mtime if header was present or None otherwise.
    r	r+NrzNot a gzipped file (%r)z<BBIxxrzUnknown compression methodz<HTrr)	rrr-unpackrFEXTRArFCOMMENTFHCRC)rmagicmethodflag
last_mtime	extra_lenrs       r*_read_gzip_headerrsI

GGAJJE||t3e;<<<!'xR9K9K!L!LVT:
{{6777f}#]4R););<<
	B	"""e|	

A
7

	h	

A
7

	e|Br+cHeZdZfdZdZdZd	dZdZdZfdZ	xZ
S)
r`ctt|tjtjd|_d|_dS)NwbitsT)superr>r3rg
decompressobjrj_new_memberrw)r;r	__class__s  r*r>z_GzipReader.__init__sP
R$*< $		0	0	0 r+cFtjd|_d|_dSr)rgr_crc_stream_sizerIs r*
_init_readz_GzipReader._init_readsJsOO	r+cDt|j}|dS||_dS)NFT)r_fprw)r;rs  r*rz_GzipReader._read_gzip_headers)&tx00
5%tr+ryc8|dkr|S|sdS	|jjr2|d|_|jdi|j|_|jr=||s|j	|_
dSd|_|jtj}|j||}|jjdkr%|j|jjn4|jjdkr$|j|jj|dkrn|dkrt'dH|||xj	t+|z
c_	|S)Nrr+TFrrH)readall
_decompressoreof	_read_eofr_decomp_factory_decomp_argsrr_pos_sizerrrrrunconsumed_tailr=unused_datar_add_read_datar7)r;rAbuf
uncompresss    r*rz_GzipReader.reads!88<<>>!	3
#	C!%
)
   #' %9T%9&)&)'&)&)"
)!!!--//!%DJ3#( (-- 677C+66sDAAJ!1S88  !3!CDDDD#/366  !3!?@@@S  czz BCCCE#	CJ	
Z)))		S__$		r+c|tj||j|_|jt	|z|_dSr@)rgrrrr7)r;rs  r*rz_GzipReader._add_read_data
s3JtTY//	 -D		9r+ctjdt|jd\}}||jkr4tdt
|dt
|j||jdzkrtdd}|dkr |jd}|dk |r|j	|dSdS)	N<IIrzCRC check failed z != r!Incorrect length of data producedrr)
r-rrrrrr}rrr=)r;risizecs    r*rz_GzipReader._read_eofs
}UK!,D,DEEuDI+SZZZZ=@^^^MNN
N
t(:5
6
6ABBB

7ll

a  A7ll	 HQ	 	 r+cVtd|_dSrG)r_rewindr)r;rs r*rz_GzipReader._rewind&s%
r+r)rLrMrNr>rrrrrr
__classcell__)rs@r*r`r`s     1111f:::   *         r+r`r$returnc
|tj}|tkrd}n|tkrd}nd}tjdddddt||d	S)
a
    Write a simple gzip header with no extra fields.
    :param compresslevel: Compresslevel used to determine the xfl bytes.
    :param mtime: The mtime (must support conversion to a 32-bit integer).
    :return: A bytes object representing the gzip header.
    Nr	r
rz<BBBBLBBr)rrrr-r.r)r$rors   r*_create_simple_gzip_headerr+se
}	,,,	.	.	.;z4q!SZZcJJJr+)roc|dkrtj||dSt||}tjdtj|t
|dz}|tj||dz|zS)zCompress data in one shot and return the compressed string.

    compresslevel sets the compression level in range of 0-9.
    mtime can be used to set the modification time. The modification time is
    set to the current time by default.
    rr)levelrz<LLri)rgrrr-r.rr7)rr$roheadertrailers     r*rr@s
zz}TbAAAA
'
u
=
=Fk%D!1!1CII
4JLLGT]4}CHHHH
r+cg}	tj|}t|d|St	jtj}|||d}|j	rt|jdkrtdtjd|jdd\}}|t	j|krt!d|t|d	zkrt!d
|||jddd}_)zYDecompress a gzip compressed string in one shot.
    Return the decompressed string.
    TNr+rrrrzCRC check failedrrr)rBytesIOrjoinrgrrjrtellrr7rrr-rrrappendlstrip)rdecompressed_membersrdodecompressedrrs       r*rrRsO2
Z

R  (880111

t~o
6
6
6}}T"''))**%566v	1R^,,q00011
1mE2>"1"+=>>V$*\****0111c,''*455ABBB##L111~abb!((11#2r+cddlm}|d}|}|ddd|d	dd
|dddd
|dddgd|}t
}|jrt}n|jrt}|j
D]}|jr|dkr3tddtjj}tjj}n|dddkrtjd|t%|d}t'j|ddd}nb|dkr4tjj}tddtjj|}n(t'j|d}t%|dzd}	|t*j}|sn||8|tjjur||tjjur|dS)Nr)ArgumentParserzeA simple command line interface for the gzip module: act like gzip, but do not delete the input file.)descriptionz--fast
store_truezcompress faster)actionhelpz--bestzcompress betterz-dz--decompresszact like gunzip instead of gzipargs*-r9)nargsdefaultmetavarrr)r"r#rmrsrtzfilename doesn't end in .gz: wb)r"r#rmr$)argparseradd_mutually_exclusive_groupadd_argument
parse_args_COMPRESS_LEVEL_TRADEOFFfastrbestrrrrsysstdinbufferstdoutexitrrZrrrrr)	rparsergrouprr$argr<grs	         r*mainr2kss''''''
^	,---F
//11E	x;LMMM	x;LMMM	t^L>@@@cC5&IIID,My-,

	
-,
y?	,czzbtSY=MNNNJ%rss8u$$HDSDDEEEdOOM#crc(D11czzI$btSZ=N+8:::M#t,,ud++	FF2122E

GGENNN		

CJ%%%
GGIIICI$$$
GGIII5r+__main__r@)&rOr-r)rrrgrZr_compression__all__FTEXTrrrrr_rerr&rrr1r3rr
BaseStreamrrrDecompressReaderr`rrrrrr2rLrHr+r*<module>r9sS%%				
G
G
G(6%ufeXe,@tT++++Z+++
''''''''TAAAAA'AAAV+V+V+V+V+|&V+V+V+r


 """Ja a a a a ,/a a a J(,KKcK05KKKK*"6$2222...`zDFFFFFr+