+
     hB  c                   s    ^ RI t  ^ RIHt ^ RIHtHtHtHt Rt	 ! R R] P                  4      t]^,          t^ t^t^t ! R	 R] P                   4      tRR
RRRRRRRRR/R lltR#   ] d     ! R R4      t Lmi ; i)    N)PathLikec                   s    ] tR t^tRtR# )r    N)__name__
__module____qualname____firstlineno____static_attributes__r       6/usr/lib64/python3.14/site-packages/pyzstd/zstdfile.pyr   r      s    r   r   )ZstdCompressorZstdFileReaderZstdFileWriter_ZSTD_DStreamSizesZstdFilec                   sd   a a ] tR t^t oRtR tV 3R ltR tR tR t	R t
R tRR	 ltR
tVtV ;t# )ZstdDecompressReaderz*Adapt decompressor to RawIOBase reader APIc                s4    Wn         \        WW44      V n        R # N)_fpr   _decomp)selfZfp	zstd_dictoption	read_sizes   &&&&&r	   __init__ZZstdDecompressReader.__init__   s    %bVGr   c                s.   < R V n         \        SV `	  4       # r   )r   Zsuperclose)r   	__class__s   &r	   r   ZZstdDecompressReader.close   s    w}r   c                s    R # )Tr   r      &r	   readableZZstdDecompressReader.readable   s    r   c                6    V P                   P                  4       # r   )r   seekabler   r   r	   r   ZZstdDecompressReader.seekable   s    xx  ""r   c                s.    V P                   P                  # r   )r   posr   r   r	   tellZZstdDecompressReader.tell    s    ||r   c                s8    V P                   P                  V4      # r   )r   readintor   b   &&r	   r!   ZZstdDecompressReader.readinto#   s    ||$$Q''r   c                r   r   )r   readallr   r   r	   r%   ZZstdDecompressReader.readall&   s    ||##%%r   c                s   V^ 8X  d   MV^8X  d   V P                   P                  V,           pMuV^8X  dU   V P                   P                  ^ 8  d   V P                   P                  R4       V P                   P                  V,           pM\	        RP                  V4      4      hWP                   P                  8  dY   RV P                   n        ^ V P                   n        V P                   P                  4        V P                  P                  ^ 4       MWP                   P                  ,          pV P                   P                  V4       V P                   P                  # )r    NzInvalid whence value: {}F)
r   r   sizeZforward
ValueErrorformatZeofZreset_sessionr   seekr   ZoffsetZwhence   &&&r	   r)   ZZstdDecompressReader.seek+   s    Q;q[\\%%.Fq[||  1$$$T*\\&&/F7>>vFGG LL$$$$DLL DLLLL&&(HHMM!ll&&&FV$||r   )r   r   )r    )r   r   r   r   __doc__r   r   r   r   r    r!   r%   r)   r   __classdictcell__Z__classcell__)r   __classdict__s   @@r	   r   r      s6     4H# (&
   r   r   c            	       s&  a  ] tR t^Mt o Rt]P                  t]P                  t]t	RRRRRRRRR/R	 llt
R
 tRR ltR t]3R ltR R ltR R ltR tR tR R lt]P*                  3R ltR R ltR tR tR tR t]R 4       tR tR tR t Rt!V t"R# )!r   aJ  A file object providing transparent zstd (de)compression.

A ZstdFile can act as a wrapper for an existing file object, or refer
directly to a named file on disk.

Note that ZstdFile provides a *binary* file interface - data read is
returned as bytes, and data to be written should be an object that
supports the Buffer Protocol.
level_or_optionNr   r     
write_size c               s   RV n         RV n        \        V n        VR9   dF   \	        V\        R4      \        34      '       g   \        R4      hVR8w  d   \        R4      h\        pMkVR9   dK   \	        V\        R4      \        \        34      '       g   \        R4      hVR8w  d   \        R4      h\        pM\        R	P                  V4      4      h\	        V\        \        \        34      '       d4   R
V9  d
   VR
,          p\         P"                  ! W4      V n         RV n        M6\%        VR4      '       g   \%        VR4      '       d   Wn         M\        R4      hWpn        V\        8X  dB   V P'                  V P                   VVVR7      p\         P(                  ! V\*        4      V n        R# V\        8X  d(   ^ V n        \1        V P                   VVVR7      V n        R# R# )a  Open a zstd compressed file in binary mode.

filename can be either an actual file name (given as a str, bytes, or
PathLike object), in which case the named file is opened, or it can be
an existing file object to read from or write to.

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" respectively.

Parameters
level_or_option: When it's an int object, it represents compression
    level. When it's a dict object, it contains advanced compression
    parameters. Note, in read mode (decompression), it can only be a
    dict object, that represents decompression option. It doesn't
    support int type compression level in this case.
zstd_dict: A ZstdDict object, pre-trained dictionary for compression /
    decompression.
read_size: In reading mode, this is bytes number that read from the
    underlying file object each time, default value is zstd's
    recommended value. If use with Network File System, increasing
    it may get better performance.
write_size: In writing modes, this is output buffer's size, default
    value is zstd's recommended value. If use with Network File
    System, increasing it may get better performance.
NFzIn read mode (decompression), level_or_option argument should be a dict object, that represents decompression option. It doesn't support int type compression level in this case.r2   z1write_size argument is only valid in write modes.z6level_or_option argument should be int or dict object.r0   z.read_size argument is only valid in read mode.zInvalid mode: {!r}r#   Treadwritez6filename must be a str, bytes, file or PathLike object)r   r   r   )r/   r   r1   )rrb)ZwZwbZaZabZxZxb)r   _closefp_MODE_CLOSED_modeZ
isinstanceZtypeZdictZ	TypeErrorr'   
_MODE_READZint_MODE_WRITEr(   ZstrZbytesr   ioopenhasattr_READER_CLASSZBufferedReader_ZSTD_DStreamOutSize_buffer_posr   _writer)	r   filenamemoder/   r   r   r1   Z	mode_codeZraws	   &&&$$$$  r	   r   ZZstdFile.__init__\   s   : !
 ;oT
D/ABB%' '
 V# GI I"I66oT
C/FGG "A C CF" DF F#I188>?? heX 677$wwx.DH DMXv&&'(G*D*DH 7 9 9 
 
"$$ HH&/#2&/	 % 1C
 ,,S2FGDL+%DI) HH,;&/'1	3DL &r   c                s   V P                   \        8X  d   R#  \        V R4      '       d$    V P                  P	                  4        RV n        M5\        V R4      '       d$    V P                  V P                  4       RV n         V P                  '       d   V P                  P	                  4        RV n	        RV n        \        V n         R#   RT n        i ; i  RT n        i ; i  RT n	        RT n        \        T n         i ; i   T P                  '       d   T P                  P	                  4        RT n	        RT n        \        T n         i   RT n	        RT n        \        T n         i ; i; i)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.
NrA   rC   F)
r9   r8   r>   rA   r   flushFLUSH_FRAMErC   r7   r   r   r   r	   r   ZZstdFile.close   s    ::%	* tY''(LL&&( $(DLy))(JJt//0 $(DL*===HHNN$ %)
 $(DL $(DL   %)
*===HHNN$ %)
   %)
s^   D C D !C <D ,C# 	CD 	C  D #C>E',E	/E'	E$$E'c                s    V P                   \        8X  d   \        R 4      hV\        8X  d.   V P                   \        8w  d   \        P
                  ! R4      h h V\        8X  d,   V P                   \        8w  d   \        P
                  ! R4      hh )zI/O operation on closed filezFile not open for readingzFile not open for writing)r9   r8   r'   r:   r<   ZUnsupportedOperationr;   )r   Zexpected_moder$   r	   _check_modeZZstdFile._check_mode   sy    ::%;<< J&zzZ'--.IJJ ( 	 k)zz[(--.IJJ 	r   c                s     V P                   P                  V4      w  r#V ;P
                  X,          un        V#   \         d    T P                  \        4        L=i ; i)zWrite a bytes-like object 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 .flush()
or .close() is called.
)rC   r4   AttributeErrorrH   r;   rB   )r   ZdataZ
input_sizeZ_s   &&  r	   r4   ZZstdFile.write   sR    	* LL..t4MJ 			Z		  	*[)	*s   :  AAc                s    V P                   \        8w  d(   V P                   \        8X  d   R# V P                  4        V P                  P                  V4       R# )ao  Flush remaining data to the underlying stream.

The mode argument can be ZstdFile.FLUSH_BLOCK, ZstdFile.FLUSH_FRAME.
Abuse of this method will reduce compression ratio, use it only when
necessary.

If the program is interrupted afterwards, all data can be recovered.
To ensure saving to disk, also need to use os.fsync(fd).

This method does nothing in reading mode.
N)r9   r;   r:   rH   rC   rF   )r   rE   r$   r	   rF   ZZstdFile.flush   sA     ::$ zzZ' 	4 r   c                    Vf   Rp V P                   P                  V4      #   \         d    T P                  \        4        R# i ; i)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.
N)rA   r3   rI   rH   r:   r   r&   r$   r	   r3   ZZstdFile.read  sE     <D	)<<$$T** 	)Z(	)   #  AAc                s    V^ 8  d   \         p V P                  P                  V4      #   \         d    T P	                  \
        4        R# i ; i)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.
N)r@   rA   read1rI   rH   r:   rL   r$   r	   rN   ZZstdFile.read1  sG     !8'D	)<<%%d++ 	)Z(	)s   *  AAc                     V P                   P                  V4      #   \         d    T P                  \        4        R# i ; i)zBRead bytes into b.

Returns the number of bytes read (0 for EOF).
N)rA   r!   rI   rH   r:   r"   r$   r	   r!   ZZstdFile.readinto-  s9    
	)<<((++ 	)Z(	)     A Ac                rO   )zRead bytes into b, while trying to avoid making multiple reads
from the underlying stream.

Returns the number of bytes read (0 for EOF).
N)rA   	readinto1rI   rH   r:   r"   r$   r	   rQ   ZZstdFile.readinto17  s9    	)<<))!,, 	)Z(	)rP   c                rJ   )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.
NrK   )rA   readlinerI   rH   r:   rL   r$   r	   rR   ZZstdFile.readlineB  sE     <D	)<<((.. 	)Z(	)rM   c                s     V P                   P                  W4      #   \         d    T P                  \        4        R# i ; i)a  Change the file position.

The new position is specified by offset, relative to the
position indicated by whence. Possible values for whence are:

    0: start of stream (default): offset must not be negative
    1: current stream position
    2: end of stream; offset must not be positive

Returns the new file position.

Note that seeking is emulated, so depending on the arguments,
this operation may be extremely slow.
N)rA   r)   rI   rH   r:   r*   r+   r	   r)   ZZstdFile.seekP  s9    	)<<$$V44 	)Z(	)rP   c                rO   )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.
N)rA   peekrI   rH   r:   rL   r$   r	   rS   ZZstdFile.peeke  s9    	)<<$$T** 	)Z(	)rP   c                sn     V P                    V #   \         d    T P                  \        4        T # i ; ir   )rA   rI   rH   r:   r   r   r	   __iter__ZZstdFile.__iter__r  s9    	)LL   	)Z(	)s     44c                sV    V P                   P                  4       pV'       d   V# \        hr   )rA   rR   ZStopIteration)r   Zrets   & r	   __next__ZZstdFile.__next__y  s"    ll##%Jr   c                s    V P                   \        8X  d   V P                  P                  4       # V P                   \        8X  d   V P
                  # V P                  4        R# )z!Return the current file position.N)r9   r:   rA   r    r;   rB   rH   r   r   r	   r    ZZstdFile.tell  sE    ::#<<$$&&ZZ;&99 	r   c                s|     V P                   P                  4       #   \         d    T P                  4         R# i ; i)z3Return the file descriptor for the underlying file.N)r   filenorI   rH   r   r   r	   rV   ZZstdFile.fileno  s3    	88??$$ 		s    ;;c                s(    V P                   \        8H  # )zTrue if this file is closed.)r9   r8   r   r   r	   closedZZstdFile.closed  s     zz\))r   c                    V P                   \        8X  d   R# V P                   \        8X  d   R# V P                  4        R# )z/Return whether the file was opened for writing.TFN)r9   r;   r:   rH   r   r   r	   writableZZstdFile.writable  s.    ::$ZZ:% 	r   c                rX   )z/Return whether the file was opened for reading.TFN)r9   r:   r;   rH   r   r   r	   r   ZZstdFile.readable  s.    ::#ZZ;& 	r   c                s    V P                   \        8X  d   V P                  P                  4       # V P                   \        8X  d   R# V P                  4        R# )z)Return whether the file supports seeking.FN)r9   r:   rA   r   r;   rH   r   r   r	   r   ZZstdFile.seekable  s>    ::#<<((**ZZ;& 	r   )rA   r7   r   r9   rB   rC   )r5   r   )rK   )#r   r   r   r   r,   r
   ZFLUSH_BLOCKrG   r   r?   r   r   rH   r4   rF   r3   rN   r!   rQ   rR   r<   ZSEEK_SETr)   rS   rT   rU   r    rV   ZpropertyrW   rY   r   r   r   r-   )r.   s   @r	   r   r   M   s      !,,K ,,K(MW3!%W315W3!W3.4W3r*D"$ % !.)))	)) #%++ )*) * * r   r/   r   encodingerrorsnewlinec               s   RV9   d   RV9   d   \        RV: 24      hM-Ve   \        R4      hVe   \        R4      hVe   \        R4      hVP                  RR4      p\        WW#R7      pRV9   d   \        P                  ! WWV4      # V# )	a  Open a zstd compressed file in binary or text mode.

filename can be either an actual file name (given as a str, bytes, or
PathLike object), in which case the named file is opened, or it can be an
existing file object to read from or write to.

The mode parameter can be "r", "rb" (default), "w", "wb", "x", "xb", "a",
"ab" for binary mode, or "rt", "wt", "xt", "at" for text mode.

The level_or_option and zstd_dict parameters specify the settings, as for
ZstdCompressor, ZstdDecompressor and ZstdFile.

When using read mode (decompression), the level_or_option parameter can
only be a dict object, that represents decompression option. It doesn't
support int type compression level in this case.

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

For text mode, an ZstdFile object is created, and wrapped in an
io.TextIOWrapper instance with the specified encoding, error handling
behavior, and line ending(s).
Ztr#   zInvalid mode: z0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary modeZ )r/   r   )r'   Zreplacer   r<   ZTextIOWrapper)	rD   rE   r/   r   rZ   r[   r\   Z	zstd_modeZbinary_files	   &&$$$$$  r	   r=   r=     s    6 d{$;49::  OPPMNNNOOS"%I8+:QK d{vGGr   )r   r=   )r6   )r<   Zosr   ZImportErrorZpyzstdr
   r   r   r   Z__all__Z	RawIOBaser   r@   r8   r:   r;   ZBufferedIOBaser   r=   r   r   r	   <module>r]      s    	6 6 7 2<< 7 r *!, 
er   eR- - --#--1-e   s   A& &A:9A: