[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@18.227.46.202: ~ $
�

0�Dg�b���ddlZddlZddlmZ	ddlmZn#e$rGd�d��ZYnwxYw	ddlTddlmZm	Z	m
Z
n1#e$r)	ddlTddlmZm	Z	m
Z
d	Zn#e$red
���wxYwYnwxYwdZ
dZd
Zdd�Zdd�Zd�Zd�Zd�ZdZGd�dej��ZdZdZdZGd�dej��Zddddddd�d�ZdS)�N)�maxsize)�PathLikec��eZdZdS)rN)�__name__�
__module__�__qualname__���q/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib64/python3.11/site-packages/pyzstd/__init__.pyrrs�������r
r�)�*)�_train_dict�_finalize_dict�_ZSTD_DStreamInSizeTapyzstd module: Neither C implementation nor CFFI implementation can be imported. If pyzstd module is dynamically linked to zstd library, make sure not to remove zstd library, and the run-time zstd library's version can't be lower than that at compile-time.z0.15.3z�Python bindings to Zstandard (zstd) compression library, the API is similar to
Python's bz2/lzma/zlib modules.

Documentation: https://pyzstd.readthedocs.io
GitHub: https://github.com/animalize/pyzstd
PyPI: https://pypi.org/project/pyzstd)�ZstdCompressor�RichMemZstdCompressor�ZstdDecompressor�EndlessZstdDecompressor�
CParameter�
DParameter�Strategy�	ZstdError�compress�richmem_compress�
decompress�compress_stream�decompress_stream�ZstdDict�
train_dict�
finalize_dict�get_frame_info�get_frame_size�ZstdFile�open�zstd_version�zstd_version_info�zstd_support_multithread�compressionLevel_valuesc�b�t||��}|�|tj��S)a�Compress a block of data, return a bytes object.

    Compressing b'' will get an empty content frame (9 bytes or more).

    Parameters
    data:            A bytes-like object, data to be compressed.
    level_or_option: When it's an int object, it represents compression level.
                     When it's a dict object, it contains advanced compression
                     parameters.
    zstd_dict:       A ZstdDict object, pre-trained dictionary for compression.
    )rr�FLUSH_FRAME��data�level_or_option�	zstd_dict�comps    rrr3s*���/�9�5�5�D��=�=��~�9�:�:�:r
c�L�t||��}|�|��S)aBCompress a block of data, return a bytes object.

    Use rich memory mode, it's faster than compress() in some cases, but
    allocates more memory.

    Compressing b'' will get an empty content frame (9 bytes or more).

    Parameters
    data:            A bytes-like object, data to be compressed.
    level_or_option: When it's an int object, it represents compression level.
                     When it's a dict object, it contains advanced compression
                     parameters.
    zstd_dict:       A ZstdDict object, pre-trained dictionary for compression.
    )rrr+s    rrrCs%��!��)�<�<�D��=�=����r
c��t|ttf��rt|��St	|��jS�N)�
isinstance�bytes�	bytearray�len�
memoryview�nbytes)�dats r�_nbytesr:Vs3���#��y�)�*�*���3�x�x���c�?�?�!�!r
c�V�t|t��std���g}g}|D]9}|�|��|�t	|�����:d�|��}|st
d���t|||��}t|��S)z�Train a zstd dictionary, return a ZstdDict object.

    Parameters
    samples:   An iterable of samples, a sample is a bytes-like object
               represents a file.
    dict_size: The dictionary's maximum size, in bytes.
    �+dict_size argument should be an int object.r
z6The samples are empty content, can't train dictionary.)	r3�int�	TypeError�appendr:�join�
ValueErrorrr)�samples�	dict_size�chunks�chunk_sizes�chunk�dict_contents      rrr\s����i��%�%�G��E�F�F�F��F��K��+�+���
�
�e�������7�5�>�>�*�*�*�*�
�X�X�f�
�
�F��S��Q�R�R�R�
�v�{�I�>�>�L��L�!�!�!r
c�<�tdkrdtz}t|���t|t��std���t|t��std���t|t��std���g}g}|D]9}|�|��|�t|�����:d�	|��}|std���t|j||||��}t	|��S)a�Finalize a zstd dictionary, return a ZstdDict object.

    Given a custom content as a basis for dictionary, and a set of samples,
    finalize dictionary by adding headers and statistics according to the zstd
    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 can be a "raw content" dictionary, see is_raw parameter in
    ZstdDict.__init__ method.

    Parameters
    zstd_dict: A ZstdDict object, basis dictionary.
    samples:   An iterable of samples, a sample is a bytes-like object
               represents a file.
    dict_size: The dictionary's maximum size, in bytes.
    level:     The compression level expected to use in production. The
               statistics for each compression level differ, so tuning the
               dictionary for the compression level can help quite a bit.
    )r��z�This function only available when the underlying zstd library's version is greater than or equal to v1.4.5, the current underlying zstd library's version is v%s.�/zstd_dict argument should be a ZstdDict object.r<z'level argument should be an int object.r
z9The samples are empty content, can't finalize dictionary.)
r&r%�NotImplementedErrorr3rr>r=r?r:r@rArrG)	r.rBrC�level�msgrDrErFrGs	         rr r {s;��*�9�$�$�G�JV�W��"�#�&�&�&��i��*�*�K��I�J�J�J��i��%�%�G��E�F�F�F��e�S�!�!�C��A�B�B�B��F��K��+�+���
�
�e�������7�5�>�>�*�*�*�*�
�X�X�f�
�
�F��V��T�U�U�U�"�)�"8�"(�+�"+�U�4�4�L��L�!�!�!r
i�c�0�eZdZd�Zdd�Zejfd�ZdS)�ZstdDecompressReaderc��g}	|�t��}|sn|�|���3d�|��S)NTr
)�readrr?r@)�selfrDr,s   r�readallzZstdDecompressReader.readall�sU����	 ��9�9�W�%�%�D��
���M�M�$����	 ��x�x����r
���c��|dkr|���S|r|jrdS	|jjrR|j�t��}|s0|jjrd|_|j|_	dStd���nd}|j�||��}|r|xjt|��z
c_|S��)Nrr
TzACompressed file ended before the end-of-stream marker was reached)
rT�_eof�
_decompressor�needs_input�_fprRr�
at_frame_edge�_pos�_size�EOFErrorrr6)rS�size�rawblockr,s    rrRzZstdDecompressReader.read�s����!�8�8��<�<�>�>�!��	�t�y�	��3�	��!�-�
��8�=�=�)<�=�=���K��)�7�K�$(��	�%)�Y��
�"�s�&�(J�K�K�K�
K����%�0�0��4�@�@�D��
��	�	�S��Y�Y�&�	�	���#	r
c�H�|tjkrn�|tjkr|j|z}n}|tjkrK|jdkr5|�t��r	|�t���|j|z}n"td�	|�����||jkr|�
��n
||jz}|dkrC|�tt|����}|sn|t|��z}|dk�C|jS)NrzInvalid value for whence: {})
�io�SEEK_SET�SEEK_CURr\�SEEK_ENDr]rR�_32_KiBrA�format�_rewind�minr6)rS�offset�whencer,s    r�seekzZstdDecompressReader.seek�s���R�[� � ��
�r�{�
"�
"��Y��'�F�F�
�r�{�
"�
"��z�A�~�~��i�i��(�(����i�i��(�(���Z�&�(�F�F��;�B�B�6�J�J�K�K�K��D�I����L�L�N�N�N�N��d�i��F��q�j�j��9�9�S��&�1�1�2�2�D��
���c�$�i�i��F�	�q�j�j��y�r
N�rU)rrrrTrRrbrcrlr	r
rrPrP�sR������
 �
 �
 �����:#%�+������r
rP�c��eZdZdZdddd�d�Zd�Zdd�Zd�Zd	�Zdd�Z	dd�Z
d
�Zd�Zdd�Z
ejfd�Zdd�Zd�Zd�Zed���Zd�Zd�Zd�ZdS)r#a?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 must be given as bytes.
    �rN�r-r.c���d|_d|_t|_t	|td��tf��std���|dvr=t	|td��tf��sd}t|���t}n�|dvr_t	|td��ttf��sd}t|���t}t||��|_
d|_n"td	�|�����t	|t"t$t&f��r2d
|vr|d
z
}t)j||��|_d|_||_n>t-|d��st-|d
��r||_||_ntd���|tkrDt/|jt0t2||���}t)j|t6��|_dSdS)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.
        NFrK)rp�rbz�In 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.)�w�wb�a�ab�x�xbz6level_or_option argument should be int or dict object.rzInvalid mode: {!r}�bTrR�writez6filename must be a str, bytes, file or PathLike object)�trailing_errorr.�option)rZ�_closefp�_MODE_CLOSED�_moder3�typerr>�dict�
_MODE_READr=�_MODE_WRITEr�_compressorr\rArg�strr4rrbr$�hasattrrPrr�BufferedReaderrf�_buffer)rS�filename�moder-r.rN�	mode_code�raws        r�__init__zZstdFile.__init__.s���*�����
�!��
��)�d�4�j�j�(�%;�<�<�	O��M�N�N�N��;����o��T�
�
�D�/A�B�B�
%�'�� ��n�n�$�"�I�I�
�6�
6�
6��o��T�
�
�C��/F�G�G�
%�N����n�n�$�#�I�-�o�y�I�I�D���D�I�I��1�8�8��>�>�?�?�?��h��e�X� 6�7�7�
	V��$��������w�x��.�.�D�H� �D�M�#�D�J�J�
�X�v�
&�
&�	V�'�(�G�*D�*D�	V��D�H�"�D�J�J��T�U�U�U��
�"�"�&�t�x�1H�6?�1:�?�T�T�T�C��,�S�'�:�:�D�L�L�L�	#�"r
c���|jtkrdS	t|d��r.	|j���d|_nb#d|_wxYw|jt
krF	|j�|j�	����d|_n#d|_wxYw	|j
r|j���d|_d|_
t|_dS#d|_d|_
t|_wxYw#	|j
r|j���d|_d|_
t|_n#d|_d|_
t|_wxYwwxYw)z�Flush 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.
        Nr�F)r�rr�r��closer�rZr{r��flushr~�rSs rr�zZstdFile.closets����:��%�%��F�	*��t�Y�'�'�
,�(��L�&�&�(�(�(�$(�D�L�L��4�D�L�'�'�'�'���{�*�*�,��H�N�N�4�#3�#9�#9�#;�#;�<�<�<�(,�D�$�$��t�D�$�+�+�+�+�
*��=�%��H�N�N�$�$�$���� %��
�)��
�
�
�� ��� %��
�)��
�)�)�)�)��

*��=�%��H�N�N�$�$�$���� %��
�)��
�
�� ��� %��
�)��
�)�)�)�)�)�)�)�)s]�D�A�D�	A�D�#1B�D�	B%�%D�) C%�%D�E!� E�&E!�E�E!c��|jtkrtd���|tkr%|jtkrt	jd���n/|tkr$|jtkrt	jd����)NzI/O operation on closed filezFile not open for readingzFile not open for writing)r�rrAr�rb�UnsupportedOperationr�)rS�
expected_modes  r�_check_modezZstdFile._check_mode�s~���:��%�%��;�<�<�<��J�&�&��z�Z�'�'��-�.I�J�J�J�(�
�k�
)�
)��z�[�(�(��-�.I�J�J�J�	r
c�n�t|ttf��rt|��}nt	|��}|j}	|j�|��}n*#t$r|�	t��YnwxYw|r|j�|��|xj
|z
c_
|S)aWrite 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 close()
        is called.
        )r3r4r5r6r7r8r�r�AttributeErrorr�r�rZr{r\)rSr,�length�
compresseds    rr{zZstdFile.write�s����d�U�I�.�/�/�	!���Y�Y�F�F��d�#�#�D��[�F�	*��)�2�2�4�8�8�J�J���	*�	*�	*����[�)�)�)�)�)�	*����
�	'��H�N�N�:�&�&�&��	�	�V��	�	��
s�A�$B�Bc�V�|jtkrdS	|j�tj��}n$#t$r|���YnwxYw|r|j�	|��t|jd��r|j���dSdS)a�Flush remaining data to the underlying stream.

        It uses ZstdCompressor.FLUSH_BLOCK mode. 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.
        Nr�)r�r�r�r�r�FLUSH_BLOCKr�r�rZr{r�)rSr�s  rr�zZstdFile.flush�s����:��#�#��F�	��)�/�/��0J�K�K�J�J���	�	�	���������	����
�	'��H�N�N�:�&�&�&��4�8�W�%�%�	��H�N�N������	�	s�$9�A�ArUc��	|j�|��S#t$r|�t��YdSwxYw)z�Read 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)r�rRr�r�r��rSr_s  rrRz
ZstdFile.read�sU��	)��<�$�$�T�*�*�*���	)�	)�	)����Z�(�(�(�(�(�(�	)������$A�Ac��|dkrt}	|j�|��S#t$r|�t
��YdSwxYw)z�Read 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.
        rN)rfr��read1r�r�r�r�s  rr�zZstdFile.read1�se���!�8�8��D�	)��<�%�%�d�+�+�+���	)�	)�	)����Z�(�(�(�(�(�(�	)���s�)�$A�Ac��	|j�|��S#t$r|�t��YdSwxYw)zRRead bytes into b.

        Returns the number of bytes read (0 for EOF).
        N)r��readintor�r�r��rSrzs  rr�zZstdFile.readinto�sU��
	)��<�(�(��+�+�+���	)�	)�	)����Z�(�(�(�(�(�(�	)���r�c��	|j�|��S#t$r|�t��YdSwxYw)z�Read bytes into b, while trying to avoid making multiple reads
        from the underlying stream.

        Returns the number of bytes read (0 for EOF).
        N)r��	readinto1r�r�r�r�s  rr�zZstdFile.readinto1sU��	)��<�)�)�!�,�,�,���	)�	)�	)����Z�(�(�(�(�(�(�	)���r�c��	|j�|��S#t$r|�t��YdSwxYw)a
Read 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.
        N)r��readliner�r�r�r�s  rr�zZstdFile.readlinesU��	)��<�(�(��.�.�.���	)�	)�	)����Z�(�(�(�(�(�(�	)���r�c��	|j�||��S#t$r|�t��YdSwxYw)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)r�rlr�r�r�)rSrjrks   rrlz
ZstdFile.seeksW��	)��<�$�$�V�V�4�4�4���	)�	)�	)����Z�(�(�(�(�(�(�	)���s��$A�Ac��	|j�|��S#t$r|�t��YdSwxYw)z�Return 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)r��peekr�r�r�r�s  rr�z
ZstdFile.peek3sU��	)��<�$�$�T�*�*�*���	)�	)�	)����Z�(�(�(�(�(�(�	)���r�c��|jtkr|j���S|jtkr|jS|���dS)z!Return the current file position.N)r�r�r��tellr�r\r�r�s rr�z
ZstdFile.tell@sR���:��#�#��<�$�$�&�&�&�
�Z�;�
&�
&��9��	
�������r
c��	|j���S#t$r|���YdSwxYw)z3Return the file descriptor for the underlying file.N)rZ�filenor�r�r�s rr�zZstdFile.filenoJsO��	��8�?�?�$�$�$���	�	�	����������	���s��=�=c�"�|jtkS)zTrue if this file is closed.)r�rr�s r�closedzZstdFile.closedRs���z�\�)�)r
c�v�|jtkrdS|jtkrdS|���dS)z/Return whether the file was opened for writing.TFN)r�r�r�r�r�s r�writablezZstdFile.writableWs@���:��$�$��4�
�Z�:�
%�
%��5�	
�������r
c�v�|jtkrdS|jtkrdS|���dS)z/Return whether the file was opened for reading.TFN)r�r�r�r�r�s r�readablezZstdFile.readableas@���:��#�#��4�
�Z�;�
&�
&��5�	
�������r
c��|jtkr|j���S|jtkrdS|���dS)z)Return whether the file supports seeking.FN)r�r�r��seekabler�r�r�s rr�zZstdFile.seekableksO���:��#�#��<�(�(�*�*�*�
�Z�;�
&�
&��5�	
�������r
)rpr2rm)rrr�__doc__r�r�r�r{r�rRr�r�r�r�rbrcrlr�r�r��propertyr�r�r�r�r	r
rr#r#$sy��������D;�!%��D;�D;�D;�D;�D;�L*�*�*�D���� ���<���>	)�	)�	)�	)�
)�
)�
)�
)�)�)�)�	)�	)�	)�
)�
)�
)�
)�#%�+�)�)�)�)�*)�)�)�)��������*�*��X�*�����������r
r#rs)r-r.�encoding�errors�newlinec�*�d|vrd|vrtd|�����n3|�td���|�td���|�td���|�dd��}t||||�	��}d|vrtj||||��S|S)
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).
    �trzzInvalid mode: Nz0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary mode�rq)rA�replacer#rb�
TextIOWrapper)	r�r�r-r.r�r�r��	zstd_mode�binary_files	         rr$r$ws���6�d�{�{��$�;�;��*�4�4�9�:�:�:�����O�P�P�P����M�N�N�N����N�O�O�O����S�"�%�%�I��8�Y�+:�i�Q�Q�Q�K��d�{�{����X�v�w�G�G�G��r
)NN)rs)�_compressionrb�sysr�osr�ImportError�
c.c_pyzstdrrr�cffi.cffi_pyzstd�CFFI_PYZSTD�__version__r��__all__rrr:rr rf�DecompressReaderrPrr�r��BufferedIOBaser#r$r	r
r�<module>r�s�������	�	�	�	�������
����������
�
�
�
�
�
�
�
�
�
�
�
�
�
����
P�����0�0�0�0�0�0�0�0�0�0�0���P�P�P�P�'�'�'�'�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:������P�P�P��k�
O�P�P�	P�P����	��
P������)��B��
;�
;�
;�
;� ����&"�"�"�"�"�"�>7"�7"�7"�z��K�K�K�K�K�<�8�K�K�K�\���
���&O�O�O�O�O�r� �O�O�O�f
-����t�T�-�-�-�-�-�-�-s3��,�,�?�A-�A�A-�A'�'A-�,A-

Filemanager

Name Type Size Permission Actions
__init__.cpython-311.pyc File 26.9 KB 0644