Files
intellecton/venv/lib/python3.12/site-packages/msgpack/__pycache__/ext.cpython-312.pyc
T

78 lines
8.1 KiB
Plaintext
Raw Normal View History

Ë
KÀj^ãóX—ddlZddlZddlmZGd„dedd««ZGd„d«Zy)éN)Ú
namedtuplecó"‡—eZdZdZˆfd„ZˆxZS)ÚExtTypez'ExtType represents ext type in msgpack.cóÖ•—t|t«s td«‚t|t«s td«‚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 €úN/home/antigravity/intellecton/venv/lib/python3.12/site-packages/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 „«Z d
„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«s td«‚t|t«s td«‚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 |«\}}n td
«‚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|jdz zS)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
|j dz¬«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šsV€ô
×Ñ×#Ñ#ˆÜ× Ñ ×.Ñ.¨q°#Ó6¼×9KÑ9KØ—L‘L¨t×/?Ñ/?À4Ñ/Gô:
ñ