e.Sr/SQrSrSSKJr SSKrSSKrSSKrSSK J r J r Sr Sr "S S \R5rSS jrSS jrS rg)zInterface to the libbzip2 compression library. This module provides a file interface, classes for incremental (de)compression, and functions for one-shot (de)compression. )BZ2File BZ2CompressorBZ2Decompressoropencompress decompressz%Nadeem Vawda )rN)rrc\rSrSrSrSSS.SjjrSr\S5r\S5r \S 5r S r S r S r S rSSjrSSjrSSjrSrSSjrSSjrSrSr\R04SjrSrSrg)ra,A file object providing transparent bzip2 (de)compression. A BZ2File can act as a wrapper for an existing file object, or refer directly to a named file on disk. Note that BZ2File provides a *binary* file interface - data read is returned as bytes, and data to be written should be given as bytes.  compresslevelcSUlSUlSUlSUs=::aS::d O [S5eUS;a Sn[nOlUS;aS n[ n[ U5UlOMUS ;aS n[ n[ U5UlO.US ;aS n[ n[ U5UlO[SU<35e[U[[[R45(a[X5UlSUlX@lO:[US5(d[US5(a XlX@lO [S5eUR[:XaD[ R""UR[$[&S9n[(R*"U5UlgSUlg)aOpen a bzip2-compressed file. If filename is a str, bytes, or PathLike object, it gives the name of the file to be opened. Otherwise, it should be a file object, which will be used to read or write the compressed data. mode can be 'r' for reading (default), 'w' for (over)writing, 'x' for creating exclusively, or 'a' for appending. These can equivalently be given as 'rb', 'wb', 'xb', and 'ab'. If mode is 'w', 'x' or 'a', compresslevel can be a number between 1 and 9 specifying the level of compression: 1 produces the least compression, and 9 (default) produces the most compression. If mode is 'r', the input file may be the concatenation of multiple compressed streams. NFr r z%compresslevel must be between 1 and 9)rrbr)wwbr)xxbr)aabrInvalid mode: Treadwritez6filename must be a str, bytes, file or PathLike object)trailing_errorr)_fp_closefp_mode ValueError _MODE_READ _MODE_WRITEr _compressor isinstancestrbytesosPathLike _builtin_openhasattr TypeError _compressionDecompressReaderrOSErrorioBufferedReader_buffer_pos)selffilenamemoder mode_coderaws )/opt/imh/python3.13/lib/python3.13/bz2.py__init__BZ2File.__init__%sN$  ]'a'DE E ? "D"I [ D#I,];D  [ D#I,];D  [ D#I,];D 49: : heR[[ 9 : :$X4DH DM"J Xv & &'(G*D*DH"JTU U :: #//9C,,S1DLDIcUR(agUR[:XaURR 5 ONUR[ :Xa:UR RURR55 SUlUR(aUR R 5 SUlSUl SUlg!SUlSUl SUlf=f!UR(aUR R 5 SUlSUl SUlf!SUlSUl SUlf=f=f)zFlush and close the file. May be called more than once without error. Once the file is closed, any other operation on it will raise a ValueError. NF) closedr r"r2closer#rrr$flushrr4s r9r? BZ2File.closeas ;;  $zzZ' ""${*t//5578#'  $==HHNN$ % #   % #  $==HHNN$ % #   % # s0A=C-+CC*-E /+D0E 0EE cURSL$)zTrue if this file is closed.N)rrAs r9r>BZ2File.closedxsxx4r<cNUR5 URR$)N)_check_not_closedrnamerAs r9rG BZ2File.name}s  xx}}r<c2UR[:XaS$S$)Nrr)r r#rAs r9r6 BZ2File.modeszz[0t:d:r<cVUR5 URR5$)z3Return the file descriptor for the underlying file.)rFrfilenorAs r9rLBZ2File.filenos  xx  r<cdUR5=(a URR5$)z)Return whether the file supports seeking.)readabler2seekablerAs r9rPBZ2File.seekables }}:4<<#8#8#::r<cHUR5 UR[:H$)z/Return whether the file was opened for reading.)rFr r"rAs r9rOBZ2File.readables  zzZ''r<cHUR5 UR[:H$)z/Return whether the file was opened for writing.)rFr r#rAs r9writableBZ2File.writables  zz[((r<cXUR5 URRU5$)zReturn buffered data without advancing the file position. Always returns at least one byte of data, unless at EOF. The exact number of bytes returned is unspecified. )_check_can_readr2peek)r4ns r9rY BZ2File.peeks' ||  ##r<cXUR5 URRU5$)zRead up to size uncompressed bytes from the file. If size is negative or omitted, read until EOF is reached. Returns b'' if the file is already at EOF. )rXr2rr4sizes r9r BZ2File.reads% ||  &&r<cUR5 US:a[RnURR U5$)zRead up to size uncompressed bytes, while trying to avoid making multiple reads from the underlying stream. Reads up to a buffer's worth of data if size is negative. Returns b'' if the file is at EOF. r)rXr0DEFAULT_BUFFER_SIZEr2read1r]s r9rb BZ2File.read1s7  !8))D||!!$''r<cXUR5 URRU5$)zBRead bytes into b. Returns the number of bytes read (0 for EOF). )rXr2readinto)r4bs r9reBZ2File.readintos% ||$$Q''r<c[U[5(d,[US5(d [S5eUR 5nUR 5 UR RU5$)zRead a line of uncompressed bytes from the file. The terminating newline (if present) is retained. If size is non-negative, no more than size bytes will be read (in which case the line may be incomplete). Returns b'' if already at EOF. __index__Integer argument expected)r%intr+r,rirXr2readliner]s r9rlBZ2File.readlinesW$$$4-- ;<<>>#D ||$$T**r<c[U[5(d,[US5(d [S5eUR 5nUR 5 UR RU5$)zRead a list of lines of uncompressed bytes from the file. size can be specified to control the number of lines read: no further lines will be read once the total size of the lines read so far equals or exceeds size. rirj)r%rkr+r,rirXr2 readlinesr]s r9roBZ2File.readlinessW$$$4-- ;<<>>#D ||%%d++r<c8UR5 [U[[45(a [ U5nO[ U5nUR nURRU5nURRU5 U=RU- sl U$)zWrite a byte string to the file. Returns the number of uncompressed bytes written, which is always the length of data in bytes. Note that due to buffering, the file on disk may not reflect the data written until close() is called. ) _check_can_writer%r' bytearraylen memoryviewnbytesr$rrrr3)r4datalength compresseds r9r BZ2File.writesy  dUI. / /YFd#D[[F%%..t4  z" V  r<c@[RRX5$)zWrite a sequence of byte strings to the file. Returns the number of uncompressed bytes written. seq can be any iterable yielding byte strings. Line separators are not added between the written byte strings. )r- BaseStream writelines)r4seqs r9r}BZ2File.writeliness&&11$<rGr6rLrPrOrUrYrrbrerlrorr}r0SEEK_SETrr__static_attributes__r<r9rrs:A:x$.  ;;! ;( ) $' (( + ,*=#%++1$r<rc0SU;aSU;a[SU<35eO*Ub [S5eUb [S5eUb [S5eURSS5n[XUS9nSU;a-[R"U5n[R "XsXE5$U$) aOpen a bzip2-compressed file in binary or text mode. The filename argument can be an actual filename (a str, bytes, or PathLike 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 BZ2File constructor: BZ2File(filename, mode, compresslevel). In this case, the encoding, errors and newline arguments must not be provided. For text mode, a BZ2File object is created, and wrapped in an io.TextIOWrapper instance with the specified encoding, error handling behavior, and line ending(s). trfrz0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary moderr)r!replacerr0 text_encoding TextIOWrapper)r5r6rencodingerrorsnewlinebz_mode binary_files r9rrs* d{ $;49: :   OP P  MN N  NO Oll3#G(=IK d{##H- vGGr<c\[U5nURU5UR5-$)zCompress a block of data. compresslevel, if given, must be a number between 1 and 9. For incremental compression, use a BZ2Compressor object instead. )rrr@)rwrcomps r9rrAs(  'D ==  --r<c$/nU(a^[5nURU5nURU5 UR(d [ S5eUR nU(aM^SRU5$![a U(aM%ef=f)zbDecompress a block of data. For incremental decompression, use a BZ2Decompressor object instead. zACompressed data ended before the end-of-stream marker was reachedr<)rrr/appendeofr! unused_datajoin)rwresultsdecompress r9rrLs G  " ##D)C szz@A A!! $ 88G    sA99B B)rr NNN)r )r__all__ __author__builtinsrr*r0r(r-_bz2rrr"r#r|rrrrr<r9rs`  -5 * /  zl%%zz-.-1'T.r<