HEX
Server: LiteSpeed
System: Linux us-bos-web1978.main-hosting.eu 5.14.0-611.27.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Feb 4 04:40:11 EST 2026 x86_64
User: u773298991 (773298991)
PHP: 8.3.30
Disabled: system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/cloudlinux/venv/lib64/python3.11/site-packages/msgpack/__pycache__/ext.cpython-311.pyc
�

�bh^��l�ddlZddlZddlmZGd�dedd����ZGd�d��ZdS)�N)�
namedtuplec�"��eZdZdZ�fd�Z�xZS)�ExtTypez'ExtType represents ext type in msgpack.c���t|t��std���t|t��std���d|cxkrdksnt	d���t���|||��S)Nzcode must be intzdata must be bytesr�zcode must be 0~127)�
isinstance�int�	TypeError�bytes�
ValueError�super�__new__)�cls�code�data�	__class__s   ��B/opt/cloudlinux/venv/lib64/python3.11/site-packages/msgpack/ext.pyrzExtType.__new__	s�����$��$�$�	0��.�/�/�/��$��&�&�	2��0�1�1�1��D�����C������1�2�2�2��w�w���s�D�$�/�/�/�)�__name__�
__module__�__qualname__�__doc__r�
__classcell__)rs@rrrs>�������1�1�0�0�0�0�0�0�0�0�0rrz	code datac��eZdZdZddgZdd�Zd�Zd�Zd�Zd	�Z	e
d
���Zd�Ze
d���Z
d
�Ze
d���Zd�Zd�Ze
d���ZdS)�	TimestampaVTimestamp represents the Timestamp extension type in msgpack.

    When built with Cython, msgpack uses C methods to pack and unpack `Timestamp`.
    When using pure-Python msgpack, :func:`to_bytes` and :func:`from_bytes` are used to pack and
    unpack `Timestamp`.

    This class is immutable: Do not override seconds and nanoseconds.
    �seconds�nanosecondsrc���t|t��std���t|t��std���d|cxkrdksntd���||_||_dS)a�Initialize a Timestamp object.

        :param int seconds:
            Number of seconds since the UNIX epoch (00:00:00 UTC Jan 1 1970, minus leap seconds).
            May be negative.

        :param int nanoseconds:
            Number of nanoseconds to add to `seconds` to get fractional time.
            Maximum is 999_999_999.  Default is 0.

        Note: Negative times (before the UNIX epoch) are represented as neg. seconds + pos. ns.
        zseconds must be an integerznanoseconds must be an integerr�ʚ;z?nanoseconds must be a non-negative integer less than 999999999.N)rr	r
rrr)�selfrrs   r�__init__zTimestamp.__init__s����'�3�'�'�	:��8�9�9�9��+�s�+�+�	>��<�=�=�=��[�(�(�(�(�5�(�(�(�(��^�_�_�_����&����rc�(�d|j�d|j�d�S)z#String representation of Timestamp.zTimestamp(seconds=z, nanoseconds=�)�rr�r s r�__repr__zTimestamp.__repr__5s ��S�D�L�S�S��@P�S�S�S�Src�r�t|��|jur |j|jko|j|jkSdS)z0Check for equality with another Timestamp objectF)�typerrr�r �others  r�__eq__zTimestamp.__eq__9s9����;�;�$�.�(�(��<�5�=�0�Z�T�5E��IZ�5Z�Z��urc�.�|�|��S)z(not-equals method (see :func:`__eq__()`))r+r)s  r�__ne__zTimestamp.__ne__?s���;�;�u�%�%�%�%rc�8�t|j|jf��S)N)�hashrrr%s r�__hash__zTimestamp.__hash__Cs���T�\�4�#3�4�5�5�5rc�l�t|��dkrtjd|��d}d}ntt|��dkr&tjd|��d}|dz}|dz	}n;t|��dkrtjd	|��\}}ntd
���t	||��S)aUnpack bytes into a `Timestamp` object.

        Used for pure-Python msgpack unpacking.

        :param b: Payload from msgpack ext message with code -1
        :type b: bytes

        :returns: Timestamp object unpacked from msgpack ext payload
        :rtype: Timestamp
        ��!Lr��!Ql���"��!IqzFTimestamp type can only be created from 32, 64, or 96-bit byte objects)�len�struct�unpackrr)�brr�data64s    r�
from_byteszTimestamp.from_bytesFs����q�6�6�Q�;�;��m�D�!�,�,�Q�/�G��K�K�
��V�V�q�[�[��]�4��+�+�A�.�F��1�1�G� �B�,�K�K�
��V�V�r�\�\�#)�=���#:�#:� �K����X���
���+�.�.�.rc���|jdz	dkrG|jdz|jz}|dzdkrtjd|��}n6tjd|��}n tjd|j|j��}|S)z�Pack this Timestamp object into bytes.

        Used for pure-Python msgpack packing.

        :returns data: Payload for EXT message with code -1 (timestamp type)
        :rtype: bytes
        r6rl��r3r5r8)rrr:�pack)r r=rs   r�to_byteszTimestamp.to_bytesas���
�L�B��1�$�$��%��+�d�l�:�F��*�*�a�/�/��{�4��0�0����{�4��0�0����;�u�d�&6���E�E�D��rc�p�t|dz��}t|dzdz��}t||��S)z�Create a Timestamp from posix timestamp in seconds.

        :param unix_float: Posix timestamp in seconds.
        :type unix_float: int or float
        �r)r	r)�unix_secrrs   r�	from_unixzTimestamp.from_unixvs;���h�!�m�$�$���8�a�<�5�0�1�1����+�.�.�.rc�&�|j|jdzzS)znGet the timestamp as a floating-point value.

        :returns: posix timestamp
        :rtype: float
        ge��Ar$r%s r�to_unixzTimestamp.to_unix�s���|�d�.��4�4�4rc�0�tt|d���S)z�Create a Timestamp from posix timestamp in nanoseconds.

        :param int unix_ns: Posix timestamp in nanoseconds.
        :rtype: Timestamp
        r)r�divmod)�unix_nss r�from_unix_nanozTimestamp.from_unix_nano�s���&��%�0�0�1�1rc�&�|jdz|jzS)z~Get the timestamp as a unixtime in nanoseconds.

        :returns: posix timestamp in nanoseconds
        :rtype: int
        rr$r%s r�to_unix_nanozTimestamp.to_unix_nano�s���|�e�#�d�&6�6�6rc��tjj}tj�d|��tj|j|jdz���zS)zRGet the timestamp as a UTC datetime.

        :rtype: `datetime.datetime`
        r��)r�microseconds)�datetime�timezone�utc�
fromtimestamp�	timedeltarr)r rSs  r�to_datetimezTimestamp.to_datetime�sR��
��#��� �.�.�q�#�6�6��9K��L�t�/?�4�/G�:
�:
�:
�
�	
rc�r�tt|�����|jdz���S)zQCreate a Timestamp from datetime with tzinfo.

        :rtype: Timestamp
        rOr$)rr	�	timestamp�microsecond)�dts r�
from_datetimezTimestamp.from_datetime�s/����R�\�\�^�^�!4�!4�"�.�SW�BW�X�X�X�XrN)r)rrrr�	__slots__r!r&r+r-r0�staticmethodr>rArErGrKrMrVr[�rrrrs*���������M�*�I�'�'�'�'�,T�T�T����&�&�&�6�6�6��/�/��\�/�4���*�/�/��\�/�5�5�5��2�2��\�2�7�7�7�
�
�
��Y�Y��\�Y�Y�Yrr)rQr:�collectionsrrrr^rr�<module>r`s�������
�
�
�
�"�"�"�"�"�"�
0�
0�
0�
0�
0�j�j��K�0�0�
0�
0�
0�WY�WY�WY�WY�WY�WY�WY�WY�WY�WYr