+
    i7"  c                   s   R t Rt^ RIt^ RIt^ RIHtHtHtHtHtH	t	 ^ RI
HtHtHt . ]! ]P                  ^d,          ^d4      O]P                  ^d,          N5t ]P"                  t  ! R R4      tR	 tR
 tR tRR ltRR lt ! R R]P2                  4      t ! R R]P2                  4      t ! R R]P2                  4      t]P:                  ! ]]4       R# )zGPython bindings to the Zstandard (zstd) compression library (RFC-8878).CompressionParameterDecompressionParameterStrategyN)ZstdCompressorZstdDecompressorZstdDict	ZstdErrorget_frame_sizezstd_version)ZstdFileopen_nbytesc                   sF   a a ] tR t^,t oRtRtV 3R ltR tR tRt	Vt
V ;t# )	FrameInfoz$Information about a Zstandard frame.c                sH   < \         SV `  R V4       \         SV `  RV4       R# )decompressed_sizedictionary_idN)Zsuper__setattr__)selfr   r   	__class__s   &&&2/usr/lib64/python3.14/compression/zstd/__init__.py__init__ZFrameInfo.__init__1   s#    /1BCO];    c                s<    R V P                    RV P                   R2# )zFrameInfo(decompressed_size=z, dictionary_id=Z)r   r   r      &r   __repr__ZFrameInfo.__repr__5   s.    .t/E/E.F G!!%!3!3 4A7 	8r   c                s     \        R V: 24      h)zcan't set attribute )ZAttributeError)r   ZnameZ_s   &&&r   r   ZFrameInfo.__setattr__9   s    3D8<==r    r   )__name__
__module____qualname____firstlineno____doc__Z	__slots__r   r   r   __static_attributes____classdictcell__Z__classcell__)r   __classdict__s   @@r   r   r   ,   s!     .4I<8> >r   r   c                s<    \        \        P                  ! V 4      !  # )ay  Get Zstandard frame information from a frame header.

*frame_buffer* is a bytes-like object. It should start from the beginning
of a frame, and needs to include at least the frame header (6 to 18 bytes).

The returned FrameInfo object has two attributes.
'decompressed_size' is the size in bytes of the data in the frame when
decompressed, or None when the decompressed size is unknown.
'dictionary_id' is an int in the range (0, 2**32). The special value 0
means that the dictionary ID was not recorded in the frame header,
the frame may or may not need a dictionary to be decoded,
and the ID of such a dictionary is not specified.
)r   _zstdget_frame_info)Zframe_bufferr   r   r#   r#   =   s     e**<899r   c                sr   \        V\        4      '       g&   \        V4      P                  p\	        RV: R24      h\        V 4      p RP                  V 4      p\
        ;QJ d    . R V  4       F  NK  	  5M! R V  4       4      pV'       g   \        R4      h\        P                  ! W4V4      p\        V4      # )zReturn a ZstdDict representing a trained Zstandard dictionary.

*samples* is an iterable of samples, where a sample is a bytes-like
object representing a file.

*dict_size* is the dictionary's maximum size, in bytes.
z%dict_size must be an int object, not Z.r   c              3   8   "   T F  p\        V4      x  K  	  R # 5iNr   Z.0Zsample   & r   	<genexpr>Ztrain_dict.<locals>.<genexpr>\        >gFg   z2samples contained no data; can't train dictionary.)
isinstanceintZtyper   	TypeErrortuplejoin
ValueErrorr"   
train_dictr   )samples	dict_sizeZds_clschunkschunk_sizesdict_contents   &&    r   r2   r2   N   s     i%%i--?zKLLGnGXXgF%>g>%%>g>>KMNN##FCLL!!r   c               s   \        V \        4      '       g   \        R4      h\        V\        4      '       g   \        R4      h\        V\        4      '       g   \        R4      h\	        V4      pRP                  V4      p\        ;QJ d    . R V 4       F  NK  	  5M! R V 4       4      pV'       g   \        R4      h\        P                  ! V P                  VWRV4      p\        V4      # )a  Return a ZstdDict representing a finalized Zstandard dictionary.

Given a custom content as a basis for dictionary, and a set of samples,
finalize *zstd_dict* by adding headers and statistics according to the
Zstandard dictionary format.

You may compose an effective dictionary content by hand, which is used as
basis dictionary, and use some samples to finalize a dictionary. The basis
dictionary may be a "raw content" dictionary. See *is_raw* in ZstdDict.

*samples* is an iterable of samples, where a sample is a bytes-like object
representing a file.
*dict_size* is the dictionary's maximum size, in bytes.
*level* is the expected compression level. The statistics for each
compression level differ, so tuning the dictionary to the compression level
can provide improvements.
z/zstd_dict argument should be a ZstdDict object.z+dict_size argument should be an int object.z'level argument should be an int object.r   c              3   r$   r%   r&   r'   r(   r   r)   Z finalize_dict.<locals>.<genexpr>   r*   r+   z=The samples are empty content, can't finalize the dictionary.)
r,   r   r.   r-   r/   r0   r1   r"   finalize_dictr7   )	zstd_dictr3   r4   levelr5   r6   r7   s   "&&&   r   r8   r8   c   s    & i**IJJi%%EFFeS!!ABBGnGXXgF%>g>%%>g>>K ' ( 	(&&y'='=v'2uFLL!!r   c                s^    \        WVR7      pVP                  V \         P                  R7      # )a  Return Zstandard compressed *data* as bytes.

*level* is an int specifying the compression level to use, defaulting to
COMPRESSION_LEVEL_DEFAULT ('3').
*options* is a dict object that contains advanced compression
parameters. See CompressionParameter for more on options.
*zstd_dict* is a ZstdDict object, a pre-trained Zstandard dictionary. See
the function train_dict for how to train a ZstdDict on sample data.

For incremental compression, use a ZstdCompressor instead.
)r:   optionsr9   )Zmode)r   compressZFLUSH_FRAME)datar:   r;   r9   Zcomps   &&&& r   r<   r<      s)     )LD==N$>$>=??r   c                s    . p \        W!R7      pVP                  VP                  V 4      4       VP                  '       g   \	        R4      hVP
                  p V '       d   K`   RP                  T4      # )a  Decompress one or more frames of Zstandard compressed *data*.

*zstd_dict* is a ZstdDict object, a pre-trained Zstandard dictionary. See
the function train_dict for how to train a ZstdDict on sample data.
*options* is a dict object that contains advanced compression
parameters. See DecompressionParameter for more on options.

For incremental decompression, use a ZstdDecompressor instead.
)r;   r9   zACompressed data ended before the end-of-stream marker was reachedr   )r   Zappend
decompressZeofr   Zunused_datar0   )r=   r9   r;   ZresultsZdecomps   &&&  r   r>   r>      sl     G
!'Gv((./zzz ? @ @!!t88Gr   c                   s  a  ] tR t^t o Rt]P                  t]P                  t	]P                  t]P                  t]P                  t]P                   t]P$                  t]P(                  t]P,                  t]P0                  t]P4                  t]P8                  t]P<                  t]P@                  t!]PD                  t#]PH                  t%]PL                  t']PP                  t)]PT                  t+R t,Rt-V t.R# )r    zCompression parameters.c                F    \         P                  ! V P                  RR7      # )zqReturn the (lower, upper) int bounds of a compression parameter.

Both the lower and upper bounds are inclusive.
TZis_compressr"   Zget_param_boundsZvaluer   r   r   boundsZCompressionParameter.bounds   s    
 %%djjdCCr   r   N)/r   r   r   r   r   r"   ZZSTD_c_compressionLevelZcompression_levelZZSTD_c_windowLogZ
window_logZZSTD_c_hashLogZhash_logZZSTD_c_chainLogZ	chain_logZZSTD_c_searchLogZ
search_logZZSTD_c_minMatchZ	min_matchZZSTD_c_targetLengthZtarget_lengthZZSTD_c_strategyZstrategyZ!ZSTD_c_enableLongDistanceMatchingZenable_long_distance_matchingZZSTD_c_ldmHashLogZldm_hash_logZZSTD_c_ldmMinMatchZldm_min_matchZZSTD_c_ldmBucketSizeLogZldm_bucket_size_logZZSTD_c_ldmHashRateLogZldm_hash_rate_logZZSTD_c_contentSizeFlagZcontent_size_flagZZSTD_c_checksumFlagZchecksum_flagZZSTD_c_dictIDFlagZdict_id_flagZZSTD_c_nbWorkersZ
nb_workersZZSTD_c_jobSizeZjob_sizeZZSTD_c_overlapLogZoverlap_logrB   r   r    r!      @r   r    r       s     !55''J##H%%I''J%%I--M$$H$)$K$K!**L,,M773344--M**L''J##H))KD Dr   c                   sB   a  ] tR t^t o Rt]P                  tR tRt	V t
R# )r   zDecompression parameters.c                r?   )zsReturn the (lower, upper) int bounds of a decompression parameter.

Both the lower and upper bounds are inclusive.
Fr@   rA   r   r   r   rB   ZDecompressionParameter.bounds   s    
 %%djjeDDr   r   N)r   r   r   r   r   r"   ZZSTD_d_windowLogMaxZwindow_log_maxrB   r   r    rC   rD   r   r   r      s     #..NE Er   c                   s    ] tR t^tRt]P                  t]P                  t	]P                  t]P                  t]P                  t]P                   t]P$                  t]P(                  t]P,                  tRtR# )r   zCompression strategies, listed from fastest to strongest.

Note that new strategies might be added in the future.
Only the order (from fast to strong) is guaranteed,
the numeric value might change.
r   N)r   r   r   r   r   r"   Z	ZSTD_fastZfastZ
ZSTD_dfastZdfastZZSTD_greedyZgreedyZ	ZSTD_lazyZlazyZ
ZSTD_lazy2Zlazy2ZZSTD_btlazy2Zbtlazy2Z
ZSTD_btoptZbtoptZZSTD_btultraZbtultraZZSTD_btultra2Zbtultra2r   r   r   r   r   r      sh     ??DEF??DE  GE  G""Hr   )COMPRESSION_LEVEL_DEFAULTr<   r    r>   r   r8   r#   r   r2   r
   r	   r   r   zstd_version_infor   r   r   r   )NNN)NN)r   Z__all__r"   Zenumr   r   r   r   r   r   Zcompression.zstd._zstdfiler	   r
   r   ZdivmodZzstd_version_numberrF   ZZSTD_CLEVEL_DEFAULTrE   r   r#   r2   r8   r<   r>   ZIntEnumr    r   r   Zset_parameter_typesr   r   r   <module>rG      s    M4  1 1 > >6fU66#=sC 6..46  H!55  A> >":""*""J@ .D4<< DD
ET\\ 
E#t|| #(   .0F Gr   