Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
uuid.cpython-314.pyc301 linesDownload Raw Back to __pycache__
1+
2��i���.�Rt^RIt^RIt^RIt^RIHtHtRt]PR29dR;t	t3M5]PR8XdRt4Rt	M^RIt]P!4t]R	8Ht	]R39t5R6t
Rt]	'dRt
Rt.R4Owtttt]t]t]!]4!RR
44t^^�,^,7tR5tR6tR7tR8tR9tR:tR;tR<t !RR4t!Rt"Rt#Rt$Rt%Rt&Rt'Rt(Rt)Rt*Rt+^RI,t,]-!],RR4t.],P^t0]-!],RR4t1Rt3Rt4Rt5]8'd](]'.t6M>]PR8Xd]'])]+.t6M']PR8Xd.t6M]	'd]+.t6M]'](])]+]*.t6]PnR8Xd]3.]6,t8M]PnR 8Xd]4.]6,t8M]6t8Rs9R!t:Rs;R=R"lt<R#t=R$t>R%t?Rs@R=R&ltARsB^sCR'tDR(tER>R)ltFR*tG]!!R+4tH]!!R,4tI]!!R-4tJ]!!R.4tK]!!R/4tL]!!R04tM]NR18Xd9]G!4R#R# ]2d
Rt,Rt.Rt0Rt1ELi;i)?a�UUID objects (universally unique identifiers) according to RFC 4122/9562.10 11This module provides immutable UUID objects (class UUID) and functions for12generating UUIDs corresponding to a specific UUID version as specified in13RFC 4122/9562, e.g., uuid1() for UUID version 1, uuid3() for UUID version 3,14and so on.15 16Note that UUID version 2 is deliberately omitted as it is outside the scope17of the RFC.18 19If all you want is a unique ID, you should probably call uuid1() or uuid4().20Note that uuid1() may compromise privacy since it creates a UUID containing21the computer's network address.  uuid4() creates a random UUID.22 23Typical usage:24 25    >>> import uuid26 27    # make a UUID based on the host ID and current time28    >>> uuid.uuid1()    # doctest: +SKIP29    UUID('a8098c1a-f86e-11da-bd1a-00112444be1e')30 31    # make a UUID using an MD5 hash of a namespace UUID and a name32    >>> uuid.uuid3(uuid.NAMESPACE_DNS, 'python.org')33    UUID('6fa459ea-ee8a-3ca4-894e-db77e160355e')34 35    # make a random UUID36    >>> uuid.uuid4()    # doctest: +SKIP37    UUID('16fd2706-8baf-433b-82eb-8c7fada847da')38 39    # make a UUID using a SHA-1 hash of a namespace UUID and a name40    >>> uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org')41    UUID('886313e1-3b8a-5372-9b90-0c9aee199e5d')42 43    # make a UUID from a string of hex digits (braces and hyphens ignored)44    >>> x = uuid.UUID('{00010203-0405-0607-0809-0a0b0c0d0e0f}')45 46    # convert a UUID to a string of hex digits in standard form47    >>> str(x)48    '00010203-0405-0607-0809-0a0b0c0d0e0f'49 50    # get the raw 16 bytes of the UUID51    >>> x.bytes52    b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f'53 54    # make a UUID from a 16-byte string55    >>> uuid.UUID(bytes=x.bytes)56    UUID('00010203-0405-0607-0809-0a0b0c0d0e0f')57 58    # get the Nil UUID59    >>> uuid.NIL60    UUID('00000000-0000-0000-0000-000000000000')61 62    # get the Max UUID63    >>> uuid.MAX64    UUID('ffffffff-ffff-ffff-ffff-ffffffffffff')65N)�Enum�_simple_enumzKa-Ping Yee <ping@zesty.ca>�win32�darwinF�linuxT�AIX�:�.c�"�]tRt^^t^tRtRtRtR#)�SafeUUIDN������)�__name__�66__module__�__qualname__�__firstlineno__�safe�unsafe�unknown�__static_attributes__r��Lib\uuid.pyrr^s���D�
�F��Grrc�a�]tRt^rtoRtR"tR#R]P/Rllt]	R4t67RtRtRt
R	tR68tRtRtR
tRtRtRtRt]R4t]R4t]R4t]R4t]R4t]R4t]R4t]R4t]R4t ]R4t!]R4t"]R4t#]R4t$]R4t%]R 4t&R!t'Vt(R#)$�UUIDa�69Instances of the UUID class represent UUIDs as specified in RFC 4122.70UUID objects are immutable, hashable, and usable as dictionary keys.71Converting a UUID to a string with str() yields something in the form72'12345678-1234-1234-1234-123456789abc'.  The UUID constructor accepts73five possible forms: a similar string of hexadecimal digits, or a tuple74of six integer fields (with 32-bit, 16-bit, 16-bit, 8-bit, 8-bit, and7548-bit values respectively) as an argument named 'fields', or a string76of 16 bytes (with all the integer fields in big-endian order) as an77argument named 'bytes', or a string of 16 bytes (with the first three78fields in little-endian order) as an argument named 'bytes_le', or a79single 128-bit integer as an argument named 'int'.80 81UUIDs have these read-only attributes:82 83    bytes       the UUID as a 16-byte string (containing the six84                integer fields in big-endian byte order)85 86    bytes_le    the UUID as a 16-byte string (with time_low, time_mid,87                and time_hi_version in little-endian byte order)88 89    fields      a tuple of the six integer fields of the UUID,90                which are also available as six individual attributes91                and two derived attributes. Those attributes are not92                always relevant to all UUID versions:93 94                    The 'time_*' attributes are only relevant to version 1.95 96                    The 'clock_seq*' and 'node' attributes are only relevant97                    to versions 1 and 6.98 99                    The 'time' attribute is only relevant to versions 1, 6100                    and 7.101 102        time_low                the first 32 bits of the UUID103        time_mid                the next 16 bits of the UUID104        time_hi_version         the next 16 bits of the UUID105        clock_seq_hi_variant    the next 8 bits of the UUID106        clock_seq_low           the next 8 bits of the UUID107        node                    the last 48 bits of the UUID108 109        time                    the 60-bit timestamp for UUIDv1/v6,110                                or the 48-bit timestamp for UUIDv7111        clock_seq               the 14-bit sequence number112 113    hex         the UUID as a 32-character hexadecimal string114 115    int         the UUID as a 128-bit integer116 117    urn         the UUID as a URN as specified in RFC 4122/9562118 119    variant     the UUID variant (one of the constants RESERVED_NCS,120                RFC_4122, RESERVED_MICROSOFT, or RESERVED_FUTURE)121 122    version     the UUID version number (1 through 8, meaningful only123                when the variant is RFC_4122)124 125    is_safe     An enum indicating whether the UUID has been generated in126                a way that is safe for multiprocessing applications, via127                uuid_generate_time_safe(3).128�is_safeNc�z�WW4V.PR4^8wd\R4hVeEM}VemVPRR4PRR4pVPR4PRR4p\	V4^ 8wd\R4h\
V^4pEM
Ve�\	V4^8wd\R	4h\V\4'gQ\V44hV^RR1,V^^R1,,V^^R1,,VR129,,p\PV4pEMuVeY\	V4^8wd\R4h\V\4'gQ\V44h\PV4pEMVEe\	V4^8wd\R4hVwr�p130r�p
^Tu;8:dR8gM\R
4h^T	u;8:dR8gM\R4h^T131u;8:dR8gM\R4h^Tu;8:dR8gM\R4h^Tu;8:dR8gM\R4h^T
u;8:dR8gM\R4hV^,V,pV^`,V	^P,,V132^@,,V^0,,V
,p^Tu;8:d\8:gM\R4hVeB^Tu;8:d^8:gM\R4hV\,pVR,pWV^L,,p\PVRV4\PVRV4R#)a�Create a UUID from either a string of 32 hexadecimal digits,133a string of 16 bytes as the 'bytes' argument, a string of 16 bytes134in little-endian order as the 'bytes_le' argument, a tuple of six135integers (32-bit time_low, 16-bit time_mid, 16-bit time_hi_version,1368-bit clock_seq_hi_variant, 8-bit clock_seq_low, 48-bit node) as137the 'fields' argument, or a single 128-bit integer as the 'int'138argument.  When a string of hex digits is given, curly braces,139hyphens, and a URN prefix are all optional.  For example, these140expressions all yield the same UUID:141 142UUID('{12345678-1234-5678-1234-567812345678}')143UUID('12345678123456781234567812345678')144UUID('urn:uuid:12345678-1234-5678-1234-567812345678')145UUID(bytes='\x12\x34\x56\x78'*4)146UUID(bytes_le='\x78\x56\x34\x12\x34\x12\x78\x56' +147              '\x12\x34\x56\x78\x12\x34\x56\x78')148UUID(fields=(0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x567812345678))149UUID(int=0x12345678123456781234567812345678)150 151Exactly one of 'hex', 'bytes', 'bytes_le', 'fields', or 'int' must152be given.  The 'version' argument is optional; if given, the resulting153UUID will have its variant and version set according to RFC 4122,154overriding the given 'hex', 'bytes', 'bytes_le', 'fields', or 'int'.155 156is_safe is an enum exposed as an attribute on the instance.  It157indicates whether the UUID has been generated in a way that is safe158for multiprocessing applications, via uuid_generate_time_safe(3).159NzGone of the hex, bytes, bytes_le, fields, or int arguments must be givenzurn:�zuuid:z{}�-z$badly formed hexadecimal UUID stringz bytes_le is not a 16-char string��NNzbytes is not a 16-char stringzfields is not a 6-tuplez*field 1 out of range (need a 32-bit value)z*field 2 out of range (need a 16-bit value)z*field 3 out of range (need a 16-bit value)z*field 4 out of range (need an 8-bit value)z*field 5 out of range (need an 8-bit value)z*field 6 out of range (need a 48-bit value)z*int is out of range (need a 128-bit value)zillegal version number��intrr
li��)�count�	TypeError�replace�strip�len�160ValueError�int_�161isinstance�bytes_�repr�162from_bytes�
_UINT_128_MAX�_RFC_4122_CLEARFLAGS_MASK�object�__setattr__)�self�hex�bytes�bytes_le�fieldsr!�versionr�time_low�time_mid�time_hi_version�clock_seq_hi_variant�
clock_seq_low�node�	clock_seqs&&&&&&&$       r�__init__�
UUID.__init__�s���@
��#�.�4�4�T�:�a�?��=�>�
>��?��
�_��+�+�f�b�)�1�1�'�2�>�C��)�)�D�/�)�)�#�r�2�C��3�x�2�~� �!G�H�H��s�B�-�C�
�
!��8�}��"� �!C�D�D��h��/�/�?��h��?�/��c�g�2�g�&��#�c�"�*�)=�=��c�#�b�j�)�*�,4�R�L�9�E��/�/�%�(�C�
�
��5�z�R�� �!@�A�A��e�V�,�,�9�d�5�k�9�,��/�/�%�(�C�
�
��6�{�a�� �!:�;�;�:@�
8�X��
!�$���,�G�,� �!M�N�N���,�G�,� �!M�N�N���3�7�3� �!M�N�N��,�7��7� �!M�N�N��
�0��0� �!M�N�N���(��(� �!M�N�N�-��2�m�C�I���N�x�2�~�6�#�r�)�+�.7�2�o�?�AE�F�C��C�(�=�(��I�J�J�����$�1�$� �!9�:�:��,�,�C��(�(�C��b�=� �C����4���,����4��G�4rc���^Tu;8:d\8:gMQ\V44h\PV4p\P	VRV4\P	VR\163P4V#)z9Create a UUID from an integer *value*. Internal use only.r!r)r/r-r1�__new__r2rr)�cls�valuer3s&& r�	_from_int�UUID._from_ints]���E�*�]�*�7�D��K�7�*��~�~�c�"�����4���.����4��H�,<�,<�=��rc��RVP/pVP\P8wdVPPVR&V#)r!r)r!rrrrE)r3�ds& r�__getstate__�UUID.__getstate__s<��
�D�H�H����<�<�8�+�+�+� �<�<�-�-�A�i�L��rc���\PVRVR,4\PTRRV9d\VR,44R#\P4R#)r!rN)r1r2rr)r3�states&&r�__setstate__�UUID.__setstate__sQ�����4���e��5����4��'�5�0�$�E�)�$4�5�	H�6>�6F�6F�	Hrc�l�\V\4'dVPVP8H#\#�N�r+rr!�NotImplemented�r3�others&&r�__eq__�UUID.__eq__#�(���e�T�"�"��8�8�u�y�y�(�(��rc�l�\V\4'dVPVP8#\#rQrRrTs&&r�__lt__�UUID.__lt__+�(���e�T�"�"��8�8�e�i�i�'�'��rc�l�\V\4'dVPVP8�#\#rQrRrTs&&r�__gt__�UUID.__gt__0r\rc�l�\V\4'dVPVP8*#\#rQrRrTs&&r�__le__�UUID.__le__5rXrc�l�\V\4'dVPVP8�#\#rQrRrTs&&r�__ge__�UUID.__ge__:rXrc�,�\VP4#rQ)�hashr!�r3s&r�__hash__�
UUID.__hash__?s���D�H�H�~�rc��VP#rQ�r!rhs&r�__int__�UUID.__int__Bs���x�x�rc�P�VPP:R\V4:R2#)�(�))�	__class__r�strrhs&r�__repr__�
UUID.__repr__Es���>�>�2�2�C��I�>�>rc��\R4h)zUUID objects are immutable)r%)r3�namerEs&&&rr2�UUID.__setattr__Hs���4�5�5rc164��VPpVR,RVR,RVR,RVR,RVR,2	#):NrNr:r�N:rz�N:r{�N:r|NN)r4)r3�xs& r�__str__�UUID.__str__KsB���H�H���B�%���!�D�'��!�A�e�H�:�Q�q��x�j��!�C�&��B�Brc�8�VPP^4#)r{)r!�to_bytesrhs&rr5�165UUID.bytesOs���x�x� � ��$�$rc��VPpV^RR1,V^^R1,,V^^R1,,VR,,#)�Nrr
�r5)r3r5s& rr6�
UUID.bytes_leSsI���166�167���c�g�2�g���s�3�r�z�!2�2�U�3�s�2�:�5F�F��b�	��	rc��VPVPVPVPVPVP1683#rQ)r9r:r;r<r=r>rhs&rr7�UUID.fieldsYs:���
�
�t�}�}�d�.B�.B��)�)�4�+=�+=�t�y�y�J�	Jrc�(�VP^`,	#)�`rlrhs&rr9�
UUID.time_low^s���x�x�2�~�rc�6�VP^P,	R,#)�P���rlrhs&rr:�
UUID.time_midb������B��&�(�(rc�6�VP^@,	R,#)�@r�rlrhs&rr;�UUID.time_hi_versionfr�rc�6�VP^8,	^�,#)�8rlrhs&rr<�UUID.clock_seq_hi_variantj������B��$�&�&rc�6�VP^0,	^�,#)�0rlrhs&rr=�UUID.clock_seq_lownr�rc���VP^8XdVVP^`,	pVP^@,	R,pV^,VP^,,V,#VP^8XdVP^P,	#VP^@,	R,pVP^`,	pV^0,VP^ ,,V,#)���)r8r!r:)r3�time_hi�time_los&  r�time�	UUID.timers����<�<�1���h�h�"�n�G��x�x�2�~��/�G��b�=�D�M�M�R�$7�8�7�B�B�
�\�\�Q�
��8�8�r�>�!��x�x�2�~��/�G��h�h�"�n�G��b�=�D�M�M�R�$7�8�7�B�Brc�X�VP^?,^,VP,#)�?)r<r=rhs&rr?�UUID.clock_seq�s(���+�+�d�2�q�8��"�"�#�	$rc�(�VPR,#)����rlrhs&rr>�	UUID.node�s���x�x�.�(�(rc�6�VPP4#rQ)r5r4rhs&rr4�UUID.hex�s���z�z�~�~��rc�&�R\V4,#)z	urn:uuid:)rsrhs&r�urn�UUID.urn�s���S��Y�&�&rc���VPR,'g\#VPR,'g\#VPR,'g\#\#)i�r ll)r!�RESERVED_NCS�RFC_4122�RESERVED_MICROSOFT�RESERVED_FUTURErhs&r�variant�UUID.variant�sF���x�x�<�(�(������\�*�*��O����\�*�*�%�%�"�"rc�v�VP\8Xd$\VP^L,	^,4#R#)�LN)r�r�r!rhs&rr8�UUID.version�s-���<�<�8�#�����B��#�-�.�.�$rr)r!r�__weakref__)NNNNNN))rrrr�__doc__�	__slots__rrr@�classmethodrFrJrNrVrZr^rardrirmrtr2r~�propertyr5r6r7r9r:r;r<r=r�r?r>r4r�r�r8r�__classdictcell__)�
__classdict__s@rrrrs�����;�z2�I�W5�"*�"2�"2�W5�r�����H���169�170�171�172��?�6�C��%��%�����173�J��J������)��)��)��)��'��'��'��'��C��C�$�$��$��)��)�� �� ��'��'��#��#��/��/rrc�h�^RIp^RIp^RIp^RIpVPPRVP4PVP4pVPRR.4VPWPPV4R7pVfR#\VP4pRVR&VR	8wdV.VO5pMV3pVPVVPVPVR7p	V	'gR#V	P!4wr�VP#V1744# \$TP&3dR#i;i)175�N�PATHz/sbinz	/usr/sbin)�path�C�LC_ALL)�stdout�stderr�env)r)�io�os�shutil�176subprocess�environ�get�defpath�split�pathsep�extend�which�join�dict�Popen�PIPE�DEVNULL�communicate�BytesIO�OSError�SubprocessError)�command�argsr�r�r�r��	path_dirs�177executabler��procr�r�s&*          r�_get_command_stdoutr��s��%�%���J�J�N�N�6�2�:�:�6�<�<�R�Z�Z�H�	����'�;�/�0��\�\�'�178�179���	�0J�\�K�180�����2�:�:�����H�
��5�=�!�)�D�)�G�!�m�G�����'1���'1�'9�'9�$'� �)�����)�)�+����z�z�&�!�!���Z�/�/�0����s�BD�AD�3"D�D1�0D1c��VR,'*#)�lr��macs&r�
_is_universalr��s���w�� � rc���\W4pVfR#RpVF�pVP4P4P4p\	\V44FdpWx,V9gKWs!V4,p	\
V	P\R4^4p181\V1824'dV183uu#T;'gT184pKf	K�	T;'gR# \\3dK�i;i)a�Searches a command's output for a MAC address near a keyword.185 186Each line of words in the output is case-insensitively searched for187any of the given keywords.  Upon a match, get_word_index is invoked188to pick a word from the line, given the index of the match.  For189example, lambda i: 0 would get the first word on the line, while190lambda i: i - 1 would get the word preceding the keyword.191Nr)r��lower�rstripr��ranger(r!r&�192_MAC_DELIMr�r)�193IndexError)r�r��keywords�get_word_indexr��first_local_mac�line�words�i�wordr�s&&&&       r�_find_mac_near_keywordr��s���!��
/�F�
�~���O����194�195��#�#�%�+�+�-���s�5�z�"�A��x�8�#�
=� ���!2�3�D��d�l�l�:�s�;�R�@�C�%�S�)�)�"�196�&5�&<�&<��O�#��$�"�"�d�"��#�J�/���
�s�,.C�C&�%C&c���VP\4p\V4^8wdR#\'dV\;QJdRV4F'dKRM	RM
!RV44'gR#RPRV44pMM\;QJdRV4F'dKRM	RM
!RV44'gR#RPV4p\
V^4# \dR#i;i)r�Nc3�`"�TF$p^\V4u;8*;'d^8*Mux�K&	R#5i)r�N�r(��.0�parts& r�	<genexpr>�_parse_mac.<locals>.<genexpr>s$���9�5�4�1��D�	�&�&�Q�&�&�5�s�,.FTrc3�D"�TFqP^R4x�K	R#5i)��0N)�rjustr�s& rr�r�s���@�%�$�*�*�Q��-�-�%�s� c3�>"�TFp\V4^8Hx�K	R#5i)r�Nr�r�s& rr�r�s���4�e�d�3�t�9��>�e�s�)r�r�r(�_MAC_OMITS_LEADING_ZEROES�allr�r!r))r��parts�hexstrs&  r�197_parse_macr�s���
�J�J�z�"�E�198�5�z�Q��� � �199�s�9�5�9�s�s�s�9�5�9�9�9�����@�%�@�@���s�4�e�4�s�s�s�4�e�4�4�4�����%�����6�2��������s�C#�#C2�1C2c��\W4pVfR#VP4P4P4pVP	V4pRpTFXpTP4P4pY�,p	\T	4p200T201fK;\T2024'dT203u#TeKVT204pKZ	T# \205dR#i;i \dK~i;i)aLooks for a MAC address under a heading in a command's output.206 207The first line of words in the output is searched for the given208heading. Words at the same word index as the heading in subsequent209lines are then examined to see if they look like MAC addresses.210N)	r��readliner�r��indexr)r�rr�)r�r��headingr�r��column_indexr�r�r�r�r�s&&&        r�_find_mac_under_headingrs���!��
/�F�
�~����� �'�'�)�/�/�1�H���~�~�g�.���O������
�#�#�%��	��&�D������;�������J��"�!�O�����'������	��	�s#�B2�6C�2C�C�C�Cc�P�RpRFp\RWR4pV'gKVu#	R#)z5Get the hardware address on Unix by running ifconfig.�ifconfigc��V^,#�r�r�r�s&r�<lambda>�#_ifconfig_getnode.<locals>.<lambda>Ds��1�Q�3rN)shwaddrsethersaddress:slladdr)rz-az-av�r�)r�r�r�s   r�_ifconfig_getnoder?s0��=�H�!��$�Z���O���3��J�"�rc�:�\RRR.R4pV'dV#R#)z/Get the hardware address on Unix by running ip.�ip�links211link/etherc��V^,#rrrs&rr�_ip_getnode.<locals>.<lambda>Ls��!�A�#rNrr�s r�_ip_getnoderIs!��!��v�
��
�212N�C�213��214�rc��^RIp^RIp\VR4'gR#VPVP	44p\
RRTP!T4.R4pT'dT#\
RRTP!T4.R4pT'dT#\
RRTP!RT,4.R4pT'dT#R# \215dR#i;i)	z0Get the hardware address on Unix by running arp.N�
gethostbyname�arpz-anc��R#)r�r
rrs&rr�_arp_getnode.<locals>.<lambda>\s��QSrc��V^,#rrrs&rrras��QR�ST�QTrz(%s)c��V^,#)r�rrs&rrrgs��a��cr)r��socket�hasattrr�gethostnamer�r��fsencode)r�r"�ip_addrr�s    r�_arp_getnoder'Qs�����6�?�+�+����&�&�v�'9�'9�';�<��216!������G�0D�/E�|�217T�C�218��219�!������G�0D�/E�}�220U�C�221��222�!������F�W�<L�0M�/N�!�#�C���223���'����s�C�C�Cc�"�\RRR.R4#)z4Get the hardware address on Unix by running lanscan.�lanscanz-aislan0c��^#)r�rrs&rr�"_lanscan_getnode.<locals>.<lambda>ps��rrrrr�_lanscan_getnoder,ms��"�)�U�W�I�{�K�Krc��\RRR4#)z4Get the hardware address on Unix by running netstat.�netstatz-iansAddress)rrrr�_netstat_getnoder/rs��#�9�f�j�A�Ar�generate_time_safe�224UuidCreatec�~�\'d1\'d#\4wr\VR7P#R#R#)zBGet the hardware address on Unix using the _uuid extension module.r�N)�_generate_time_safe�_has_stable_extractable_noderr>)�	uuid_time�_s  r�
_unix_getnoder7�s1����;�;�*�,��	��)�$�)�)�)� <�rc�z�\'d/\'d!\4p\VR7P#R#R#)zEGet the hardware address on Windows using the _uuid extension module.)r6N)�_UuidCreater4rr>)�225uuid_bytess r�_windll_getnoder;�s,���{�3�3� �]�226��Z�(�-�-�-�4�{rc�b�\P\P!^44R,#)zGet a random node ID.l�r!r.r��urandomrrr�_random_getnoder?�s ���>�>�"�*�*�Q�-�(�G�4�4r�posix�ntc���\e\#\\.,F4pV!4s\fK^\u;8:dR8gK*\u#K6	QRP\44h KW;i)aGet the hardware address as a 48-bit positive integer.227 228The first time this runs, it may launch a separate program, which could229be quite slow.  If all attempts to obtain the hardware address fail, we230choose a random 48-bit number with its eighth bit set to 1 as recommended231in RFC 4122.232z,_random_getnode() returned invalid value: {}r#)�_node�_GETTERSr?�format)�getters r�getnoderG�sq��
�����o�.�.�.��	��H�E�
��A��$:�'�$:��L�%;�/�O�@�G�G��N�N�5��		��s�A3�3A8c�8�\e2Yu;Jdf(MM$\4wr#\V4p\	W$R7#\233P!4pV^d,R,p\eV\8:d\^,pVsVf^RIpVP^4pVR,pV^ ,	R,p	V^0,	R,p234V^�,pV^,	^?,pVf\4p\	W�V235W�V3^R7# \d\PpL�i;i)aGenerate a UUID from a host ID, sequence number, and the current time.236If 'node' is not given, getnode() is used to obtain the hardware237address.  If 'clock_seq' is given, it is used as the sequence number;238otherwise a random 14-bit sequence number is chosen.N)r5r�@'Hw�
���r�r�)r7r8)r3rr)rrr��time_ns�_last_timestamp�random�getrandbitsrG)
r>r?r5�safely_generatedr�nanoseconds�	timestamprMr9r:r;r=r<s
&&           r�uuid1rR�s���&�4�+D�+D�&9�&;�#�	�	'��/�0�G��)�5�5��,�,�.�K��s�"�%7�7�I��"�y�O�'C�#�a�'�	��O�����&�&�r�*�	��:�%�H��R��6�)�H� �B��&�0�O���$�M�%��N�d�2���|��y����O�,�T�C�LM�O�O��-�	'��&�&�G�	'�s�C;�;D�Dc�:�\V\4'd
\VR4p^RIpVP	VPV,RR7p\239P
VP44pV\,pV\,p\PV4#)zAGenerate a UUID from the MD5 hash of a namespace UUID and a name.�utf-8NF��usedforsecurity)r+rsr5�hashlib�md5r!r.�digestr0�_RFC_4122_VERSION_3_FLAGSrrF)�	namespacerwrW�h�240int_uuid_3s&&   r�uuid3r^�sr���$�����T�7�#������I�O�O�d�*�E��B�A�������241�+�J��+�+�J��+�+�J��>�>�*�%�%rc��\P\P!^44pV\,pV\242,p\PV4#)zGenerate a random UUID.)r!r.r�r>r0�_RFC_4122_VERSION_4_FLAGSrrF)�243int_uuid_4s r�uuid4rbs=������244�245�2��/�J��+�+�J��+�+�J��>�>�*�%�%rc�H�\V\4'd
\VR4p^RIpVP	VPV,RR7p\246P
VP4R,4pV\,pV\,p\PV4#)zCGenerate a UUID from the SHA-1 hash of a namespace UUID and a name.rTNFrU:Nr{N)r+rsr5rW�sha1r!r.rYr0�_RFC_4122_VERSION_5_FLAGSrrF)r[rwrWr\�247int_uuid_5s&&   r�uuid5rg
sv���$�����T�7�#������Y�_�_�t�+�U��C�A�������248�3��0�J��+�+�J��+�+�J��>�>�*�%�%rc���^RIpVP!4pV^d,R,p\eV\8:d\^,pVsVf^RIpVP	^4pV^,	R,pVR,pVR,pVf\4pV^P,p	W�^@,,p	W�^0,,p	W�R,,p	V	\,p	\PV	4#)aXSimilar to :func:`uuid1` but where fields are ordered differently249for improved DB locality.250 251More precisely, given a 60-bit timestamp value as specified for UUIDv1,252for UUIDv6 the first 48 most significant bits are stored first, followed253by the 4-bit version (same position), followed by the remaining 12 bits254of the original 60-bit timestamp.255NrIr�r�i�?)	r�rK�_last_timestamp_v6rMrNrG�_RFC_4122_VERSION_6_FLAGSrrF)256r>r?r�rPrQrM�time_hi_and_midr��clock_s�257int_uuid_6s258&&        r�uuid6rns�����,�,�.�K��s�"�%7�7�I��%�)�7I�*I�&��*�	�"������&�&�r�*�	� �B��*:�:�O��&� �G��&� �G��|��y��!�B�&�J��R�-��J��R�-��J��)�)�)�J��+�+�J��>�>�*�%�%rc��\P\P!^25944pV^ ,	R,pVR,pW3#)�260l���rJr=)�rand�counter�tails   r�_uuid7_get_counter_and_tailrtCs8���>�>�"�*�*�R�.�)�D��r�z�_�,�G��+��D��=�rc�\�\P!4pVR,p\eV\8�d\4wr#MkV\8d\^,p\^,pVR8�dV^,
p\4wr#M)\261P
\P!^44pVR,pV^,	pVR,pVR,pVR,pV^P,pW�^@,,pW�^ ,,pW�,pV\,p\PV4p	VsVsV	#)z�Generate a UUID from a Unix timestamp in milliseconds and random bits.262 263UUIDv7 objects feature monotonicity within a millisecond.264i@Bl���r�r�i���?rJ)r�rK�_last_timestamp_v7rt�_last_counter_v7r!r.r�r>�_RFC_4122_VERSION_7_FLAGSrrF)265rP�timestamp_msrrrs�266unix_ts_ms�counter_msbs�267counter_hi�268counter_lo�269int_uuid_7�ress270          r�uuid7r�Ls��*�,�,�.�K��)�+�L��!�\�4F�%F�3�5�
����,�,�-��1�L�"�Q�&���_�$��A��L�7�9�M�G�T��>�>�"�*�*�Q�-�0�D�� 0�0�J��b�=�L���&�J��;�&�J�	�K��D��r�!�J���"�"�J���"�"�J���J��+�+�J�271�.�.��272$�C�&�����Jrc�F�Vf^RIpVP^04pVf^RIpVP^4pVf^RIpVP^>4pVR,^P,pWAR,^@,,pWBR,,pV\,p\P	V4#)aGenerate a UUID from three custom blocks.273 274* 'a' is the first 48-bit chunk of the UUID (octets 0-5);275* 'b' is the mid 12-bit chunk (octets 6-7);276* 'c' is the last 62-bit chunk (octets 8-15).277 278When a value is not specified, a pseudo-random value is generated.279Nr�r�l����)rMrN�_RFC_4122_VERSION_8_FLAGSrrF)�a�b�crM�280int_uuid_8s&&&  r�uuid8r��s���	�y�����r�"���y�����r�"���y�����r�"���&�&�2�-�J��u�9��#�#�J��+�+�+�J��+�+�J��>�>�*�%�%rc��R\R\R\R\R\R\281R\/pR$pR\R	\R282\R\/p^RIpVPVPR
RR7pVPRRVP4RRR7VPRRR.VP4ORR7VPRRRR7VPRRR\ ^R R!7VP#4pWP$,pVP&pVP(pVP$V9dxV'd	V'g VP+R"VP$R#24Wr9d	W',M283\-V4p\/VP04Fp	\3V!Wx44K	R#\/VP04Fp	\3V!44K	R#)%z$Run the uuid command line interface.rRr^rbrgrnr�r�z@dnsz@urlz@oidz@x500Nz1Generate a UUID using the selected UUID function.T)�formatter_class�description�colorz-uz--uuidzfunction to generate the UUID)�choices�default�helpz-nz--namespacezany UUIDzUuuid3/uuid5 only: a UUID, or a well-known predefined UUID addressed by namespace name)r�r�z-Nz--namez:uuid3/uuid5 only: name used as part of generating the UUID)r�z-Cz--count�NUMzgenerate NUM fresh UUIDs)�metavar�typer�r�zIncorrect number of arguments. zO requires a namespace and a name. Run 'python -m uuid -h' for more information.)r^rg)rRr^rbrgrnr�r��
NAMESPACE_DNS�
NAMESPACE_URL�
NAMESPACE_OID�NAMESPACE_X500�argparse�ArgumentParser�ArgumentDefaultsHelpFormatter�add_argument�keysr!�284parse_args�uuidr[rw�errorrr�r$�print)285�286uuid_funcs�uuid_namespace_funcs�287namespacesr��parserr��	uuid_funcr[rwr6s288          r�mainr��s���	���������������J�.���
��
��
���	�J��
�
$�
$� �>�>�G��%��F�289����h� *��� 1� '�<��>�����m�!+� @�j�o�o�.?� @�,��-�290����h�C��D�����i��S�!�7��9�����D��9�9�%�I����I��9�9�D��y�y�(�(����L�L�1��9�9�+�@�@�
�291.7�-D�J�)�$�y�/�	��t�z�z�"�A��)�I�,�-�#��t�z�z�"�A��)�+��#rz$6ba7b810-9dad-11d1-80b4-00c04fd430c8z$6ba7b811-9dad-11d1-80b4-00c04fd430c8z$6ba7b812-9dad-11d1-80b4-00c04fd430c8z$6ba7b814-9dad-11d1-80b4-00c04fd430c8z$00000000-0000-0000-0000-000000000000z$ffffffff-ffff-ffff-ffff-ffffffffffff�__main__>�wasirr�292emscripten)�Linux�Android)zreserved for NCS compatibilityzspecified in RFC 4122z$reserved for Microsoft compatibilityzreserved for future definitionl����llll293lll)NN)NNN)Or�r��sysr��enumrr�294__author__�platform�_AIX�_LINUX�system�_platform_systemr�rr�r�r�r�r!r*r5r,rr/r0�_RFC_4122_VERSION_1_FLAGSrZr`rerjrxr�rr�r�r�rrrrr'r,r/�_uuid�getattrr3�has_stable_extractable_noder4r9�ImportErrorr7r;r?�_OS_GETTERSrwrDrCrGrLrRr^rbrgrirnrvrwrtr�r�r�r�r�r�r��NIL�MAXrrrr�<module>r�s���8�t295�296��#�+�297��<�<�<�<���D�6��\�\�W��
�F��D�����(���5�(�D��#7�7�F�
�298�!����J� $��?N�;��h�*�O���	���d�������c��Q��
�>��7��7��7��7��7��7��7��s/�s/�l	�\!� #�F�8!�L���8L�299B�	��!�%�)=�t�D��#(�#D�#D� ��%��t�4�K�*�.�5�0300�� 1�2�K��\�\�X��$�l�4D�E�K��\�\�W���K�	�#�$�K�$�k�<�#�%5�7�K��7�7�g�����,�H��W�W��_�� �;�.�H��H���O�,��#O�J	&�&�	&���"&�J�����=�@&�49�|�;�<�
��;�<�
��;�<�
��<�=���1�2��301�1�2���z���F���a���E���#(� ��K�	�s�$H�H�H
codekingpro/portable-devtools · Team Ai