Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/site-packages/pip/_vendor/msgpack/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/site-packages/pip/_vendor/msgpack/__pycache__/ext.cpython-312.pyc

�

4Μg���X�ddlmZddlZddlZGd�dedd��ZGd�d�Zy)�)�
namedtupleNc�"��eZdZdZ�fd�Z�xZS)�ExtTypez'ExtType represents ext type in msgpack.c����t|t�std��t|t�std��d|cxkrdkst	d��t	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/usr/local/lib/python3.12/site-packages/pip/_vendor/msgpack/ext.pyrzExtType.__new__	sl����$��$��.�/�/��$��&��0�1�1��D��C���1�2�2� ��1�2�2��w��s�D�$�/�/�)�__name__�
__module__�__qualname__�__doc__r�
__classcell__)rs@rrrs���1�0�0rrz	code datac��eZdZdZddgZdd�Zd�Zd�Zd�Zd�Z	e
d	��Zd
�Ze
d��Z
d�Ze
d
��Zd�Zd�Ze
d��Zy)�	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�nanosecondsc���t|t�std��t|t�std��d|cxkrdkstd��td��||_||_y)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__si���'�3�'��8�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#��#�D�L�L�>���@P�@P�?Q�QR�S�Src��t|�|jur4|j|jk(xr|j|jk(Sy)z0Check for equality with another Timestamp objectF)�typerrr�r �others  r�__eq__zTimestamp.__eq__9s>����;�$�.�.�(��<�<�5�=�=�0�Z�T�5E�5E��IZ�IZ�5Z�Z�rc�&�|j|�S)z(not-equals method (see :func:`__eq__()`))r+r)s  r�__ne__zTimestamp.__ne__?s���;�;�u�%�%�%rc�D�t|j|jf�S)N)�hashrrr%s r�__hash__zTimestamp.__hash__Cs���T�\�\�4�#3�#3�4�5�5rc�8�t|�dk(rtjd|�d}d}net|�dk(r$tjd|�d}|dz}|dz	}n3t|�dk(rtjd	|�\}}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�Q�;��m�m�D�!�,�Q�/�G��K�
��V�q�[��]�]�4��+�A�.�F��1�1�G� �B�,�K�
��V�r�\�#)�=�=���#:� �K���X��
���+�.�.rc�(�|jdz	dk(rT|jdz|jz}|dzdk(rtjd|�}|Stjd|�}|Stjd|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�L�B��1�$��%�%��+�d�l�l�:�F��*�*�a�/��{�{�4��0����	�{�{�4��0�����;�;�u�d�&6�&6����E�D��rc�X�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_unixvs2���h�!�m�$���8�a�<�5�0�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�&�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�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�6�6rc��tjj}tjjd|�tj|j���zS)zRGet the timestamp as a UTC datetime.

        :rtype: `datetime.datetime`
        r)r)�datetime�timezone�utc�
fromtimestamp�	timedeltarG)r rQs  r�to_datetimezTimestamp.to_datetime�sH��
���#�#��� � �.�.�q�#�6��9K�9K�TX�T`�T`�Tb�9c�c�crc�H�tj|j��S)zQCreate a Timestamp from datetime with tzinfo.

        :rtype: Timestamp
        )rrE�	timestamp)�dts r�
from_datetimezTimestamp.from_datetime�s���"�"�2�<�<�>�2�2rN)r)rrrr�	__slots__r!r&r+r-r0�staticmethodr>rArErGrKrMrTrX�rrrrs�����M�*�I�'�,T��&�6��/��/�4�*�/��/�5��2��2�7�d��3��3rr)�collectionsrrOr:rrr[rr�<module>r]s-��"��
�
0�j��K�0�
0�U3�U3r

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists