Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
ext.cpython-313.pyc77 linesDownload Raw Back to __pycache__
1�

2��j��X�SSKrSSKrSSKJr "SS\"SS55r"SS5rg)�N)�3namedtuplec�,^�\rSrSrSrU4SjrSrU=r$)�ExtType�z'ExtType represents ext type in msgpack.c��>�[U[5(d[S5e[U[5(d[S5eSUs=::aS::d
O [	S5e[4TU]XU5$)Nzcode must be intzdata must be bytesr�zcode must be 0~127)�5isinstance�int�	TypeError�bytes�6ValueError�super�__new__)�cls�code�data�	__class__s   ��QD:\code\apps\devtools\python\user_packages\Python313\site-packages\msgpack/ext.pyr�ExtType.__new__	s_����$��$�$��.�/�/��$��&�&��0�1�1��D��C���1�2�2��w��s�$�/�/��)�__name__�7__module__�__qualname__�__firstlineno__�__doc__r�__static_attributes__�
__classcell__)rs@rrrs���1�0�0rrz	code datac��\rSrSrSrSS/rSSjrSrSrSr	S	r8\S95rSr
\S5rS
r\S5rSrSr\S5rSrg)�	Timestamp�aBTimestamp represents the Timestamp extension type in msgpack.10 11When built with Cython, msgpack uses C methods to pack and unpack `Timestamp`.12When using pure-Python msgpack, :func:`to_bytes` and :func:`from_bytes` are used to pack and13unpack `Timestamp`.14 15This class is immutable: Do not override seconds and nanoseconds.16�seconds�nanosecondsc���[U[5(d[S5e[U[5(d[S5eSUs=::aS:d
O [S5eXlX lg)a�Initialize a Timestamp object.17 18:param int seconds:19    Number of seconds since the UNIX epoch (00:00:00 UTC Jan 1 1970, minus leap seconds).20    May be negative.21 22:param int nanoseconds:23    Number of nanoseconds to add to `seconds` to get fractional time.24    Maximum is 999_999_999.  Default is 0.25 26Note: Negative times (before the UNIX epoch) are represented as neg. seconds + pos. ns.27zseconds must be an integerznanoseconds must be an integerr�ʚ;z?nanoseconds must be a non-negative integer less than 999999999.N)r	r28rr
r"r#)�selfr"r#s   r�__init__�Timestamp.__init__sZ���'�3�'�'��8�9�9��+�s�+�+��<�=�=��[�(�5�(��^�_�_���&�rc�<�SURSURS3$)z#String representation of Timestamp.zTimestamp(seconds=z, nanoseconds=�)�r"r#�r&s r�__repr__�Timestamp.__repr__5s#��#�D�L�L�>���@P�@P�?Q�QR�S�Src��[U5URLa9URUR:H=(a URUR:H$g)z0Check for equality with another Timestamp objectF)�typerr"r#�r&�others  r�__eq__�Timestamp.__eq__9s>����;�$�.�.�(��<�<�5�=�=�0�Z�T�5E�5E��IZ�IZ�5Z�Z�rc�.�URU5(+$)z(not-equals method (see :func:`__eq__()`))r3r1s  r�__ne__�Timestamp.__ne__?s���;�;�u�%�%�%rc�D�[URUR45$)N)�hashr"r#r,s r�__hash__�Timestamp.__hash__Cs���T�\�\�4�#3�#3�4�5�5rc�@�[U5S:Xa[R"SU5SnSnOh[U5S:Xa%[R"SU5SnUS-nUS-	nO4[U5S:Xa[R"S	U5up!O[S295e[	X5$)z�Unpack bytes into a `Timestamp` object.30 31Used for pure-Python msgpack unpacking.32 33:param b: Payload from msgpack ext message with code -134:type b: bytes35 36:returns: Timestamp object unpacked from msgpack ext payload37:rtype: Timestamp38��!Lr��!Ql���"��!IqzFTimestamp type can only be created from 32, 64, or 96-bit byte objects)�len�struct�unpackr
r )�br"r#�data64s    r�39from_bytes�Timestamp.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�4�URS-	S:XaXURS-UR-nUS-S:Xa[R"SU5nU$[R"SU5nU$[R"SURUR5nU$)z�Pack this Timestamp object into bytes.40 41Used for pure-Python msgpack packing.42 43:returns data: Payload for EXT message with code -1 (timestamp type)44:rtype: bytes45rArl��r>r@rC)r"r#rE�pack)r&rHrs   r�to_bytes�Timestamp.to_bytesas���
�L�L�B��1�$��%�%��+�d�l�l�:�F��*�*�a�/��{�{�4��0����	�{�{�4��0�����;�;�u�d�&6�&6����E�D��rc�V�[US-5n[US-S-5n[X5$)z�Create a Timestamp from posix timestamp in seconds.46 47:param unix_float: Posix timestamp in seconds.48:type unix_float: int or float49�r%)r50r )�unix_secr"r#s   r�	from_unix�Timestamp.from_unixvs0���h�!�m�$���8�a�<�5�0�1����.�.rc�:�URURS--$)zVGet the timestamp as a floating-point value.51 52:returns: posix timestamp53:rtype: float54ge��Ar+r,s r�to_unix�Timestamp.to_unix�s���|�|�d�.�.��4�4�4rc�&�[[US56$)zCreate a Timestamp from posix timestamp in nanoseconds.55 56:param int unix_ns: Posix timestamp in nanoseconds.57:rtype: Timestamp58r%)r �divmod)�unix_nss r�from_unix_nano�Timestamp.from_unix_nano�s���&��%�0�1�1rc�:�URS-UR-$)zfGet the timestamp as a unixtime in nanoseconds.59 60:returns: posix timestamp in nanoseconds61:rtype: int62r%r+r,s r�to_unix_nano�Timestamp.to_unix_nano�s���|�|�e�#�d�&6�&6�6�6rc���[RRn[RRSU5[R"UR63URS-S9-$)zBGet the timestamp as a UTC datetime.64 65:rtype: `datetime.datetime`66r��)r"�microseconds)�datetime�timezone�utc�
fromtimestamp�	timedeltar"r#)r&rds  r�to_datetime�Timestamp.to_datetime�sV��67���#�#��� � �.�.�q�#�6��9K�9K��L�L�t�/?�/?�4�/G�:68�69�	70rc�^�[[UR55URS-S9$)zACreate a Timestamp from datetime with tzinfo.71 72:rtype: Timestamp73r`r+)r r74�	timestamp�microsecond)�dts r�
from_datetime�Timestamp.from_datetime�s&����R�\�\�^�!4�"�.�.�SW�BW�X�Xr)r#r"N)r)rrrrr�	__slots__r'r-r3r6r:�staticmethodrIrMrRrUrZr]rgrmrrrrr r s�����M�*�I�'�,T��&�6��/��/�4�*�/��/�5��2��2�7�75��Y��Yrr )rbrE�collectionsrrr rrr�<module>rrs/���
�"�760�j��K�0�770�WY�WYr
codekingpro/portable-devtools · Team Ai