Ë
   øên*	Zûã                   ó¬   — d dl Z d dlZd dlmZ  e j                   ddde j                  j
                  ¬«      Z G d„ d edd«      «      Z G d	„ d
«      Zy)é    N)Ú
namedtuplei²  é   )Útzinfoc                   ó"   ‡ — 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      €á+  /home/conda/feedstock_root/build_artifacts/bld/rattler-build_msgpack-python_1788525103/host_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib/python3.12/site-packages/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__7   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__;   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__A   s   € à—;‘;˜uÓ%Ð%Ð%r   c                 óD   — t        | j                  | j                  f«      S )N)Úhashr   r   r'   s    r   Ú__hash__zTimestamp.__hash__E   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_bytesH   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
        r8   r   l       üÿ r5   r7   r:   )r   r   r<   Úpack)r"   r?   r   s      r   Úto_byteszTimestamp.to_bytesc   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   r   )Úunix_secr   r   s      r   Ú	from_unixzTimestamp.from_unixx   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                 ól   — t         t        j                  | j                  | j                  dz  ¬«      z   S )zRGet the timestamp as a UTC datetime.

        :rtype: `datetime.datetime`
        éè  )r   Úmicroseconds)Ú_EPOCHÚdatetimeÚ	timedeltar   r   r'   s    r   Úto_datetimezTimestamp.to_datetimeœ   s2   € ô
 œ×*Ñ*Ø—L‘L¨t×/?Ñ/?À4Ñ/Gô
ñ 
ð 	
r   c                 ó´   — | j                   €| j                  «       } | t        z
  }t        |j                  dz  |j
                  z   |j                  dz  ¬«      S )zQCreate a Timestamp from datetime with tzinfo.

        :rtype: Timestamp
        i€Q rP   r&   )r   Ú
astimezonerR   r   Údaysr   rQ   )ÚdtÚdeltas     r   Úfrom_datetimezTimestamp.from_datetime¥   sR   € ð �9‰9Ðà—‘“ˆBØ”V‘ˆÜØ—J‘J Ñ&¨¯©Ñ6Ø×*Ñ*¨TÑ1ô
ð 	
r   N)r   )r   r   r   r   Ú	__slots__r#   r(   r-   r/   r2   Ústaticmethodr@   rC   rF   rH   rL   rN   rU   r[   © r   r   r   r      s‘   „ ñð ˜MÐ*€Ió'ò,Tòò&ò6ð ñ/ó ð/ò4ð* ñ/ó ð/ò5ð ñ2ó ð2ò7ò
ð ñ
ó ñ
r   r   )	rS   r<   Úcollectionsr   ÚtimezoneÚutcrR   r   r   r^   r   r   Ú<module>rb      sQ   ðÛ Û Ý "à	ˆ×	Ñ	˜4  A¨h×.?Ñ.?×.CÑ.CÔ	D€ô
0‰j˜ KÓ0ô 
0÷c
ò c
r   