Ë
    ��h^  ã                   óX   — d dl Z d dlZd dlmZ  G d„ d edd«      «      Z G d„ d«      Zy)é    N)Ú
namedtuplec                   ó"   ‡ — e Zd ZdZˆ fd„Zˆ xZS )ÚExtTypez'ExtType represents ext type in msgpack.c                 óÖ   •— t        |t        «      st        d«      ‚t        |t        «      st        d«      ‚d|cxk  rdk  st	        d«      ‚ t	        d«      ‚t
        ‰| �  | ||«      S )Nzcode must be intzdata must be bytesr   é   zcode must be 0~127)Ú
isinstanceÚintÚ	TypeErrorÚbytesÚ
ValueErrorÚsuperÚ__new__)ÚclsÚcodeÚdataÚ	__class__s      €úU/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/pip/_vendor/msgpack/ext.pyr   zExtType.__new__	   sl   ø€ Ü˜$¤Ô$ÜÐ.Ó/Ð/Ü˜$¤Ô&ÜÐ0Ó1Ð1Ø�DÔ˜CÒÜÐ1Ó2Ð2ð  ÜÐ1Ó2Ð2Ü‰w‰˜s D¨$Ó/Ð/ó    )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú__classcell__)r   s   @r   r   r      s   ø„ Ù1÷0ð 0r   r   z	code datac                   ó�   — e Zd ZdZddgZdd„Zd„ Zd„ Zd„ Zd„ Z	e
d	„ «       Zd
„ Ze
d„ «       Zd„ Ze
d„ «       Zd„ Zd„ Ze
d„ «       Zy)Ú	TimestampaV  Timestamp 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        «      st        d«      ‚t        |t        «      st        d«      ‚d|cxk  rdk  st        d«      ‚ t        d«      ‚|| _        || _        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.
        zseconds must be an integerznanoseconds must be an integerr   é Êš;z?nanoseconds must be a non-negative integer less than 999999999.N)r   r	   r
   r   r   r   )Úselfr   r   s      r   Ú__init__zTimestamp.__init__   si   € ô ˜'¤3Ô'ÜÐ8Ó9Ð9Ü˜+¤sÔ+ÜÐ<Ó=Ð=Ø�[Ô( 5Ò(ÜÐ^Ó_Ð_ð )ÜÐ^Ó_Ð_ØˆŒØ&ˆÕr   c                 ó<   — d| j                   › d| j                  › d�S )z#String representation of Timestamp.zTimestamp(seconds=z, nanoseconds=ú)©r   r   ©r    s    r   Ú__repr__zTimestamp.__repr__5   s#   € à# D§L¡L >°À×@PÑ@PÐ?QÐQRÐSÐSr   c                 óš   — t        |«      | j                  u r4| j                  |j                  k(  xr | j                  |j                  k(  S y)z0Check for equality with another Timestamp objectF)Útyper   r   r   ©r    Úothers     r   Ú__eq__zTimestamp.__eq__9   s>   € ä�‹;˜$Ÿ.™.Ñ(Ø—<‘< 5§=¡=Ñ0ÒZ°T×5EÑ5EÈ×IZÑIZÑ5ZÐZØr   c                 ó&   — | j                  |«       S )z(not-equals method (see :func:`__eq__()`))r+   r)   s     r   Ú__ne__zTimestamp.__ne__?   s   € à—;‘;˜uÓ%Ð%Ð%r   c                 óD   — t        | j                  | j                  f«      S )N)Úhashr   r   r%   s    r   Ú__hash__zTimestamp.__hash__C   s   € Ü�T—\‘\ 4×#3Ñ#3Ð4Ó5Ð5r   c                 ó8  — t        | «      dk(  rt        j                  d| «      d   }d}net        | «      dk(  r$t        j                  d| «      d   }|dz  }|dz	  }n3t        | «      dk(  rt        j                  d	| «      \  }}nt        d
«      ‚t	        ||«      S )a  Unpack 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   )Úbr   r   Údata64s       r   Ú
from_byteszTimestamp.from_bytesF   sœ   € ô ˆq‹6�QŠ;Ü—m‘m D¨!Ó,¨QÑ/ˆGØ‰KÜ�‹V�qŠ[Ü—]‘] 4¨Ó+¨AÑ.ˆFØÐ1Ñ1ˆGØ  B™,‰KÜ�‹V�rŠ\Ü#)§=¡=°¸Ó#:Ñ ˆK™äØXóð ô ˜ +Ó.Ð.r   c                 ó(  — | j                   dz	  dk(  rT| j                  dz  | j                   z  }|dz  dk(  rt        j                  d|«      }|S t        j                  d|«      }|S t        j                  d| 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
        r6   r   l       üÿ r3   r5   r8   )r   r   r:   Úpack)r    r=   r   s      r   Úto_byteszTimestamp.to_bytesa   s�   € ð �L‰L˜BÑ 1Ò$Ø×%Ñ%¨Ñ+¨d¯l©lÑ:ˆFØÐ*Ñ*¨aÒ/ä—{‘{ 4¨Ó0�ð ˆô	 —{‘{ 4¨Ó0�ð ˆô —;‘;˜u d×&6Ñ&6¸¿¹ÓEˆDØˆr   c                 óX   — t        | dz  «      }t        | dz  dz  «      }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_secr   r   s      r   Ú	from_unixzTimestamp.from_unixv   s2   € ô �h !‘mÓ$ˆÜ˜8 a™<¨5Ñ0Ó1ˆÜ˜ +Ó.Ð.r   c                 ó:   — | j                   | j                  dz  z   S )znGet the timestamp as a floating-point value.

        :returns: posix timestamp
        :rtype: float
        g    eÍÍAr$   r%   s    r   Úto_unixzTimestamp.to_unix�   s   € ð �|‰|˜d×.Ñ.°Ñ4Ñ4Ð4r   c                 ó&   — t        t        | 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_nanozTimestamp.from_unix_nano‰   s   € ô œ& ¨%Ó0Ð1Ð1r   c                 ó:   — | j                   dz  | j                  z   S )z~Get the timestamp as a unixtime in nanoseconds.

        :returns: posix timestamp in nanoseconds
        :rtype: int
        r   r$   r%   s    r   Úto_unix_nanozTimestamp.to_unix_nano’   s   € ð �|‰|˜eÑ# d×&6Ñ&6Ñ6Ð6r   c                 óÔ   — t         j                  j                  }t         j                   j                  d|«      t        j                  | j
                  | j                  dz  ¬«      z   S )zRGet the timestamp as a UTC datetime.

        :rtype: `datetime.datetime`
        r   éè  )r   Úmicroseconds)ÚdatetimeÚtimezoneÚutcÚfromtimestampÚ	timedeltar   r   )r    rS   s     r   Úto_datetimezTimestamp.to_datetimeš   sV   € ô
 ×Ñ×#Ñ#ˆÜ× Ñ ×.Ñ.¨q°#Ó6¼×9KÑ9KØ—L‘L¨t×/?Ñ/?À4Ñ/Gô:
ñ 
ð 	
r   c                 ód   — t        t        | j                  «       «      | j                  dz  ¬«      S )zQCreate a Timestamp from datetime with tzinfo.

        :rtype: Timestamp
        rO   r$   )r   r	   Ú	timestampÚmicrosecond)Údts    r   Úfrom_datetimezTimestamp.from_datetime¤   s&   € ô ¤ R§\¡\£^Ó!4À"Ç.Á.ÐSWÑBWÔXÐXr   N)r   )r   r   r   r   Ú	__slots__r!   r&   r+   r-   r0   Ústaticmethodr>   rA   rE   rG   rK   rM   rV   r[   © r   r   r   r      s“   „ ñð ˜MÐ*€Ió'ò,Tòò&ò6ð ñ/ó ð/ò4ð* ñ/ó ð/ò5ð ñ2ó ð2ò7ò
ð ñYó ñYr   r   )rQ   r:   Úcollectionsr   r   r   r^   r   r   ú<module>r`      s/   ðÛ Û Ý "ô
0‰j˜ KÓ0ô 
0÷WYò WYr   