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

Ë
j^ãóXddlZddlZddlmZGddedd««ZGdd«Zy)éN)Ú
namedtuplecó"eZdZdZˆfdZˆ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ø€Ü˜ÔÐ ˜$¤ÔÐ ˜CÒÜÐ  ÜÐ ‰w‰˜s D¨$Ó)Ú__name__Ú
__module__Ú __qualname__Ú__doc__rÚ
__classcell__)rs@rrrsø„Ù0rrz code datacóeZdZdZddgZddZdZdZdZdZ e
d „«Z d
Z e
d «Z
d Ze
d
«ZdZdZe
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)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ÔÐ ˜+¤sÔÐ ( Ð Ð ˆŒ Ø&ˆÕrcó<d|jd|jdS)z#String representation of Timestamp.zTimestamp(seconds=z, nanoseconds=úrr©r s rÚ__repr__zTimestamp.__repr__5s#à# D§L¡L À×@PÑ@PÐ?QÐQRÐ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§=¡=ÑZ°T×5EÑ5EÈ×IZÑIZÑ5ZÐ rcó&|j|« S)z(not-equals method (see :func:`__eq__()`))r+r)s rÚ__ne__zTimestamp.__ne__?sà—;;˜%rcóDt|j|jf«S)N)Úhashrrr%s rÚ__hash__zTimestamp.__hash__CsÜT—\\ 4×#3Ñ#3Ð5rcó8t|«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_bytesFô ˆq6QŠ;Ü—m‘m D¨!Ó,¨QÑ/ˆG؉KÜ
‹VqŠ[Ü—]‘] 4¨Ó+¨AÑ.ˆFØÐ1ˆGØ  B™,‰KÜ
VrŠ\Ü#)§=¡=°¸Ó#:Ñ ˆK™äØð
ô˜ .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ˆˆ rcóXt|dz«}t|dzdz«}t||«S)zCreate 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 !$ˆÜ˜8 a™<¨5Ñ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_unixsð |‰|˜d×Ñ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ôœ& ¨%Ó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_nanosð |‰|˜# d×&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°#Ó×9KÑ9KØ—LL¨t×/?Ñ/?À4Ñ/Gô:
ñ