§
    !xÅjz$  ã                   óþ  — d Z ddlZdej        cxk    rdk     sn  edej        › �¦  «        ‚dZddlmc mZ ddl	Z	ddlm
Z
mZmZmZmZmZ ddlmZmZmZ g  eej        d	z  d	¦  «        ¢ej        d	z  ‘R Z	 ed
k     r ed¦  «        ‚ej        Z	  G d„ d¦  «        Zd„ Zd„ Zd„ Zdd„Zdd„Z G d„ de	j        ¦  «        Z  G d„ de	j        ¦  «        Z! G d„ de	j        ¦  «        Z" ej#        e e!¦  «         d„ Z$dS )zGPython bindings to the Zstandard (zstd) compression library (RFC-8878).é    N)é   é
   )r   é   zUnsupported Python version: )ÚCOMPRESSION_LEVEL_DEFAULTÚcompressÚCompressionParameterÚ
decompressÚDecompressionParameterÚfinalize_dictÚget_frame_infoÚStrategyÚ
train_dictÚregister_shutilÚopenÚZstdFileÚget_frame_sizeÚzstd_versionÚzstd_version_infoÚZstdCompressorÚZstdDecompressorÚZstdDictÚ	ZstdError)r   r   r   r   r   r   )r   r   Ú_nbyteséd   )é   é   é   zzstd version is too oldc                   ó2   ‡ — e Zd ZdZdZˆ fd„Zd„ Zd„ Zˆ xZS )Ú	FrameInfoz$Information about a Zstandard frame.©Údecompressed_sizeÚdictionary_idc                 ó�   •— t          ¦   «                              d|¦  «         t          ¦   «                              d|¦  «         d S )Nr!   r"   )ÚsuperÚ__setattr__)Úselfr!   r"   Ú	__class__s      €úHC:\Projects\Historical\venv\Lib\site-packages\backports/zstd/__init__.pyÚ__init__zFrameInfo.__init__;   s?   ø€ Ý‰Œ×ÒÐ/Ð1BÑCÔCÐCÝ‰Œ×Ò˜O¨]Ñ;Ô;Ð;Ð;Ð;ó    c                 ó(   — d| j         › d| j        › d�S )NzFrameInfo(decompressed_size=z, dictionary_id=ú)r    ©r&   s    r(   Ú__repr__zFrameInfo.__repr__?   s0   € ð7¨tÔ/Eð 7ð 7Ø!%Ô!3ð7ð 7ð 7ð 	8r*   c                 ó&   — t          d|›�¦  «        ‚)Nzcan't set attribute )ÚAttributeError)r&   ÚnameÚ_s      r(   r%   zFrameInfo.__setattr__C   s   € ÝÐ<°DÐ<Ð<Ñ=Ô=Ð=r*   )	Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r)   r.   r%   Ú__classcell__)r'   s   @r(   r   r   6   sa   ø€ € € € € Ø.Ð.à4€Ið<ð <ð <ð <ð <ð8ð 8ð 8ð>ð >ð >ð >ð >ð >ð >r*   r   c                 ó8   — t          t          j        | ¦  «        Ž S )a¥  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   Ú_zstdr   )Úframe_buffers    r(   r   r   G   s   € õ •eÔ*¨<Ñ8Ô8Ð9Ð9r*   c                 ó`  — t          |t          ¦  «        s't          |¦  «        j        }t	          d|›d�¦  «        ‚t          | ¦  «        } d                     | ¦  «        }t          d„ | D ¦   «         ¦  «        }|st          d¦  «        ‚t          j	        |||¦  «        }t          |¦  «        S )zéReturn 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 ú.r*   c              3   ó4   K  — | ]}t          |¦  «        V — Œd S ©N©r   ©Ú.0Úsamples     r(   ú	<genexpr>ztrain_dict.<locals>.<genexpr>g   ó(   è è € Ð>Ð>¨F� ™œÐ>Ð>Ð>Ð>Ð>Ð>r*   z2samples contained no data; can't train dictionary.)Ú
isinstanceÚintÚtyper5   Ú	TypeErrorÚtupleÚjoinÚ
ValueErrorr:   r   r   )ÚsamplesÚ	dict_sizeÚds_clsÚchunksÚchunk_sizesÚdict_contents         r(   r   r   Y   s±   € õ �i¥Ñ%Ô%ð MÝ�i‘”Ô-ˆÝÐKÀÐKÐKÐKÑLÔLÐLå�G‰nŒn€GØ�XŠX�gÑÔ€FÝÐ>Ð>°gÐ>Ñ>Ô>Ñ>Ô>€KØð OÝÐMÑNÔNÐNÝÔ# F¨K¸ÑCÔC€LÝ�LÑ!Ô!Ð!r*   c                óÎ  — t          | t          ¦  «        st          d¦  «        ‚t          |t          ¦  «        st          d¦  «        ‚t          |t          ¦  «        st          d¦  «        ‚t	          |¦  «        }d                     |¦  «        }t	          d„ |D ¦   «         ¦  «        }|st          d¦  «        ‚t          j        | j	        ||||¦  «        }t          |¦  «        S )aH  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   ó4   K  — | ]}t          |¦  «        V — Œd S r?   r@   rA   s     r(   rD   z finalize_dict.<locals>.<genexpr>‹   rE   r*   z=The samples are empty content, can't finalize the dictionary.)
rF   r   rI   rG   rJ   rK   rL   r:   r   rR   )Ú	zstd_dictrM   rN   ÚlevelrP   rQ   rR   s          r(   r   r   n   sñ   € õ( �i¥Ñ*Ô*ð KÝÐIÑJÔJÐJÝ�i¥Ñ%Ô%ð GÝÐEÑFÔFÐFÝ�e�SÑ!Ô!ð CÝÐAÑBÔBÐBå�G‰nŒn€GØ�XŠX�gÑÔ€FÝÐ>Ð>°gÐ>Ñ>Ô>Ñ>Ô>€KØð (Ýð 'ñ (ô (ð 	(åÔ& yÔ'=¸vØ'2°I¸uñFô F€Lå�LÑ!Ô!Ð!r*   c                 óh   — t          |||¬¦  «        }|                     | t           j        ¬¦  «        S )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.
    )rV   ÚoptionsrU   )Úmode)r   r   ÚFLUSH_FRAME)ÚdatarV   rX   rU   Úcomps        r(   r   r   ”   s1   € õ  ¨wÀ)ÐLÑLÔL€DØ�=Š=˜¥NÔ$>ˆ=Ñ?Ô?Ð?r*   c                 óæ   — g }	 t          ||¬¦  «        }|                     |                     | ¦  «        ¦  «         |j        st	          d¦  «        ‚|j        } | snŒZd                     |¦  «        S )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.
    T)rX   rU   zACompressed data ended before the end-of-stream marker was reachedr*   )r   Úappendr	   Úeofr   Úunused_datarK   )r[   rU   rX   ÚresultsÚdecomps        r(   r	   r	   ¤   s‘   € ð €GðÝ!¨'¸YÐGÑGÔGˆØ�Š�v×(Ò(¨Ñ.Ô.Ñ/Ô/Ð/ØŒzð 	@Ýð ?ñ @ô @ð @àÔ!ˆØð 	Øðð �8Š8�GÑÔÐr*   c                   ó"  — e Zd ZdZej        Zej        Zej	        Z
ej        Zej        Zej        Zej        Zej        Zej        Zej        Zej        Zej        Zej        Zej        Z ej!        Z"ej#        Z$ej%        Z&ej'        Z(ej)        Z*d„ Z+dS )r   zCompression parameters.c                 ó8   — t          j        | j        d¬¦  «        S )z�Return the (lower, upper) int bounds of a compression parameter.

        Both the lower and upper bounds are inclusive.
        T©Úis_compress©r:   Úget_param_boundsÚvaluer-   s    r(   ÚboundszCompressionParameter.boundsÕ   s   € õ
 Ô% d¤j¸dÐCÑCÔCÐCr*   N),r3   r4   r5   r6   r:   ÚZSTD_c_compressionLevelÚcompression_levelÚZSTD_c_windowLogÚ
window_logÚZSTD_c_hashLogÚhash_logÚZSTD_c_chainLogÚ	chain_logÚZSTD_c_searchLogÚ
search_logÚZSTD_c_minMatchÚ	min_matchÚZSTD_c_targetLengthÚtarget_lengthÚZSTD_c_strategyÚstrategyÚ!ZSTD_c_enableLongDistanceMatchingÚenable_long_distance_matchingÚZSTD_c_ldmHashLogÚldm_hash_logÚZSTD_c_ldmMinMatchÚldm_min_matchÚZSTD_c_ldmBucketSizeLogÚldm_bucket_size_logÚZSTD_c_ldmHashRateLogÚldm_hash_rate_logÚZSTD_c_contentSizeFlagÚcontent_size_flagÚZSTD_c_checksumFlagÚchecksum_flagÚZSTD_c_dictIDFlagÚdict_id_flagÚZSTD_c_nbWorkersÚ
nb_workersÚZSTD_c_jobSizeÚjob_sizeÚZSTD_c_overlapLogÚoverlap_logrj   © r*   r(   r   r   »   sË   € € € € € Ø!Ð!àÔ5ÐØÔ'€JØÔ#€HØÔ%€IØÔ'€JØÔ%€IØÔ-€MØÔ$€Hà$)Ô$KÐ!ØÔ*€LØÔ,€MØÔ7ÐØÔ3ÐàÔ4ÐØÔ-€MØÔ*€LàÔ'€JØÔ#€HØÔ)€KðDð Dð Dð Dð Dr*   r   c                   ó&   — e Zd ZdZej        Zd„ ZdS )r
   zDecompression parameters.c                 ó8   — t          j        | j        d¬¦  «        S )zƒReturn the (lower, upper) int bounds of a decompression parameter.

        Both the lower and upper bounds are inclusive.
        Fre   rg   r-   s    r(   rj   zDecompressionParameter.boundsâ   s   € õ
 Ô% d¤j¸eÐDÑDÔDÐDr*   N)r3   r4   r5   r6   r:   ÚZSTD_d_windowLogMaxÚwindow_log_maxrj   r‘   r*   r(   r
   r
   Ý   s6   € € € € € Ø#Ð#àÔ.€NðEð Eð Eð Eð Er*   r
   c                   ó�   — e Zd ZdZej        Zej        Zej	        Z
ej        Zej        Zej        Zej        Zej        Zej        ZdS )r   zÖCompression 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.
    N)r3   r4   r5   r6   r:   Ú	ZSTD_fastÚfastÚ
ZSTD_dfastÚdfastÚZSTD_greedyÚgreedyÚ	ZSTD_lazyÚlazyÚ
ZSTD_lazy2Úlazy2ÚZSTD_btlazy2Úbtlazy2Ú
ZSTD_btoptÚbtoptÚZSTD_btultraÚbtultraÚZSTD_btultra2Úbtultra2r‘   r*   r(   r   r   ê   s`   € € € € € ðð ð Œ?€DØÔ€EØÔ€FØŒ?€DØÔ€EØÔ €GØÔ€EØÔ €GØÔ"€H€H€Hr*   r   c                 óR   — | dk    rddl m} |S t          dt          ›d| ›�¦  «        ‚)Nr   r   )r   zmodule z has no attribute )Úbackports.zstd._shutilr   r0   r3   )r1   r   s     r(   Ú__getattr__r«     sE   € ØÐ Ò Ð Ø:Ð:Ð:Ð:Ð:Ð:ØÐÝ
ÐI¥8ÐIÐIÀÐIÐIÑ
JÔ
JÐJr*   )NNN)NN)%r6   ÚsysÚversion_infoÚRuntimeErrorÚversionÚ__all__Úbackports.zstd._zstdÚzstdr:   Úenumr   r   r   r   r   r   Úbackports.zstd._zstdfiler   r   r   ÚdivmodÚzstd_version_numberr   ÚZSTD_CLEVEL_DEFAULTr   r   r   r   r   r   r	   ÚIntEnumr   r
   r   Úset_parameter_typesr«   r‘   r*   r(   ú<module>rº      s­  ðØ MÐ Mà 
€
€
€
Ø�3Ô#Ð-Ð-Ò-Ð- gÒ-Ð-Ð-Ð-Ø
ˆ,ÐC°c´kÐCÐCÑ
DÔ
DÐDð€ð: %Ð $Ð $Ð $Ð $Ð $Ð $Ð $Ð $Ø €€€ð@ð @ð @ð @ð @ð @ð @ð @ð @ð @ð @ð @ð @ð @ð @ð @à <Ð <Ð <Ð <Ð <Ð <Ð <Ð <Ð <Ð <ð6�f�f˜UÔ6¸#Ñ=¸sÑCÔCð 6ØÔ.°Ñ4ð6ð 6Ð à Hà�yÒ Ð Ø
ˆ,Ð0Ñ
1Ô
1Ð1à!Ô5Ð Ø Að>ð >ð >ð >ð >ñ >ô >ð >ð":ð :ð :ð$"ð "ð "ð*#"ð #"ð #"ðL@ð @ð @ð @ð ð ð ð ð.Dð Dð Dð Dð D˜4œ<ñ Dô Dð DðD
Eð 
Eð 
Eð 
Eð 
E˜Tœ\ñ 
Eô 
Eð 
Eð#ð #ð #ð #ð #ˆtŒ|ñ #ô #ð #ð( €Ô Ð.Ð0FÑ GÔ GÐ GðKð Kð Kð Kð Kr*   