+
    	:iB  c                   s|   R t RtRP                  4       ^,          P                  RR4      tRP                  4       ^,          t. ROw  tttt	^ RI
t
]
P                  R8  d   ]tR t ! R R	]4      tR
 tR tR tR;t;ttR tR tR tRsR tRR ltR tR tR t]! R4      t ]! R4      t!]! R4      t"]! R4      t#R# )aU  UUID objects (universally unique identifiers) according to RFC 4122.

This module provides immutable UUID objects (class UUID) and the functions
uuid1(), uuid3(), uuid4(), uuid5() for generating version 1, 3, 4, and 5
UUIDs as specified in RFC 4122.

If all you want is a unique ID, you should probably call uuid1() or uuid4().
Note that uuid1() may compromise privacy since it creates a UUID containing
the computer's network address.  uuid4() creates a random UUID.

Typical usage:

    >>> import uuid

    # make a UUID based on the host ID and current time
    >>> uuid.uuid1()
    UUID('a8098c1a-f86e-11da-bd1a-00112444be1e')

    # make a UUID using an MD5 hash of a namespace UUID and a name
    >>> uuid.uuid3(uuid.NAMESPACE_DNS, 'python.org')
    UUID('6fa459ea-ee8a-3ca4-894e-db77e160355e')

    # make a random UUID
    >>> uuid.uuid4()
    UUID('16fd2706-8baf-433b-82eb-8c7fada847da')

    # make a UUID using a SHA-1 hash of a namespace UUID and a name
    >>> uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org')
    UUID('886313e1-3b8a-5372-9b90-0c9aee199e5d')

    # make a UUID from a string of hex digits (braces and hyphens ignored)
    >>> x = uuid.UUID('{00010203-0405-0607-0809-0a0b0c0d0e0f}')

    # convert a UUID to a string of hex digits in standard form
    >>> str(x)
    '00010203-0405-0607-0809-0a0b0c0d0e0f'

    # get the raw 16 bytes of the UUID
    >>> x.bytes
    '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f'

    # make a UUID from a 16-byte string
    >>> uuid.UUID(bytes=x.bytes)
    UUID('00010203-0405-0607-0809-0a0b0c0d0e0f')

This module works with Python 2.3 or higher.zKa-Ping Yee <ping@zesty.ca>z$Date: 2006/08/24 19:08:53 $Z/-z$Revision: 1.2 $Nc                 s    W8  W8  ,
          # N )ZxZy   &&8/usr/lib/python3.14/site-packages/setroubleshoot/uuid.py<lambda>r   =   s    AEae$    c                   s  a  ] tR t^@t o RtRR ltR tR tR tR t	R t
R	 tR
 t]! ]4      tR t]! ]4      tR t]! ]4      tR t]! ]4      tR t]! ]4      tR t]! ]4      tR t]! ]4      tR t]! ]4      tR t]! ]4      tR t]! ]4      t R t!]! ]!4      t"R t#]! ]#4      t$R t%]! ]%4      t&R t']! ]'4      t(Rt)V t*R# )UUIDa  Instances of the UUID class represent UUIDs as specified in RFC 4122.
UUID objects are immutable, hashable, and usable as dictionary keys.
Converting a UUID to a string with str() yields something in the form
'12345678-1234-1234-1234-123456789abc'.  The UUID constructor accepts
four possible forms: a similar string of hexadecimal digits, or a
string of 16 raw bytes as an argument named 'bytes', or a tuple of
six integer fields (with 32-bit, 16-bit, 16-bit, 8-bit, 8-bit, and
48-bit values respectively) as an argument named 'fields', or a single
128-bit integer as an argument named 'int'.

UUIDs have these read-only attributes:

    bytes       the UUID as a 16-byte string

    fields      a tuple of the six integer fields of the UUID,
                which are also available as six individual attributes
                and two derived attributes:

        time_low                the first 32 bits of the UUID
        time_mid                the next 16 bits of the UUID
        time_hi_version         the next 16 bits of the UUID
        clock_seq_hi_variant    the next 8 bits of the UUID
        clock_seq_low           the next 8 bits of the UUID
        node                    the last 48 bits of the UUID

        time                    the 60-bit timestamp
        clock_seq               the 14-bit sequence number

    hex         the UUID as a 32-character hexadecimal string

    int         the UUID as a 128-bit integer

    urn         the UUID as a URN as specified in RFC 4122

    variant     the UUID variant (one of the constants RESERVED_NCS,
                RFC_4122, RESERVED_MICROSOFT, or RESERVED_FUTURE)

    version     the UUID version number (1 through 5, meaningful only
                when the variant is RFC_4122)
Nc           	     s8   WW4.P                  R4      ^8w  d   \        R4      hVek   VP                  RR4      P                  RR4      pVP                  R4      P                  RR4      p\	        V4      ^ 8w  d   \        R4      h\        V^4      pVeF   \	        V4      ^8w  d   \        R	4      h\        R\        \        \        V4      4      ,          ^4      pVEex   \	        V4      ^8w  d   \        R
4      hVw  rgprp^ Tu;8:  d   \        R4      8  g   M \        R4      h^ Tu;8:  d   \        R4      8  g   M \        R4      h^ Tu;8:  d   \        R4      8  g   M \        R4      h^ T	u;8:  d   \        R4      8  g   M \        R4      h^ T
u;8:  d   \        R4      8  g   M \        R4      h^ Tu;8:  d   \        R4      8  g   M \        R4      hV	\        ^4      ,          V
,          pV\        ^`4      ,          V\        ^P4      ,          ,          V\        ^@4      ,          ,          V\        ^04      ,          ,          V,          pVe-   ^ Tu;8:  d   ^\        ^4      ,          8  g   M \        R4      hVe   ^Tu;8:  d   ^8:  g   M \        R4      hVR\        ^04      ,          ( ,          pVR\        ^04      ,          ,          pVR\        ^@4      ,          ( ,          pWE\        ^L4      ,          ,          pW@P                  R&   R# )a  Create a UUID from either a string of 32 hexadecimal digits,
a string of 16 bytes as the 'bytes' argument, a tuple of six
integers (32-bit time_low, 16-bit time_mid, 16-bit time_hi_version,
8-bit clock_seq_hi_variant, 8-bit clock_seq_low, 48-bit node) as
the 'fields' argument, or a single 128-bit integer as the 'int'
argument.  When a string of hex digits is given, curly braces,
hyphens, and a URN prefix are all optional.  For example, these
expressions all yield the same UUID:

UUID('{12345678-1234-5678-1234-567812345678}')
UUID('12345678123456781234567812345678')
UUID('urn:uuid:12345678-1234-5678-1234-567812345678')
UUID(bytes='\x12\x34\x56\x78'*4)
UUID(fields=(0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x567812345678))
UUID(int=0x12345678123456781234567812345678)

Exactly one of 'hex', 'bytes', 'fields', or 'int' must be given.
The 'version' argument is optional; if given, the resulting UUID
will have its variant and version number set according to RFC 4122,
overriding bits in the given 'hex', 'bytes', 'fields', or 'int'.
Nz+need just one of hex, bytes, fields, or intzurn: zuuid:z{}r    z$badly formed hexadecimal UUID stringzbytes is not a 16-char stringzfields 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)zillegal version numberi      i   intz@%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02xl        i      l          )Zcount	TypeErrorreplacestriplenZ
ValueErrorlongZtuplemapordZ__dict__)selfhexbytesfieldsr
   versiontime_lowtime_midtime_hi_versionclock_seq_hi_variantclock_seq_lownode	clock_seqs   &&&&&&       r   __init__ZUUID.__init__j   s   0 $**40A5IJJ?++fb)11'2>C))D/))#r2C3x2~ !GHHsB-C5zR !@AAuSe_'==rBC6{a !:;;:@8X!$04=0 !MNN04=0 !MNN7$w-7 !MNN,;tF|; !MNN4V4 !MNN,tG}, !MNN-a8MIIR(Xb-AB#tBx/14=b4IKMQRC?,a49n, !MNN$1$ !9::VtBx'((C6T"X%%CVtBx'((Cd2h&&C"er   c                sl    \        V\        4      '       d   V P                  VP                  8  # \        # r   )Z
isinstancer   r
   ZNotImplemented)r   Zotherr   r   __lt__ZUUID.__lt__   s(    eT""88eii''r   c                s,    \        V P                  4      # r   )Zhashr
   r      &r   __hash__ZUUID.__hash__   s    DHH~r   c                s    V P                   # r   r
   r!   r"   r   __int__ZUUID.__int__   s    xxr   c                s&    R \        V 4      ,          # )zUUID(%r)Zstrr!   r"   r   __repr__ZUUID.__repr__   s    CI%%r   c                s    \        R 4      h)zUUID objects are immutable)r   )r   namevalues   &&&r   __setattr__ZUUID.__setattr__   s    455r   c           
     s    R V P                   ,          pVR,          : RVR,          : RVR,          : RVR,          : RVR,          : 2	# )%032x:N   Nr    :r,      N:r-      N:r.      N:r/   NNr$   )r   r   s   & r   __str__ZUUID.__str__   sC     GGSYYE

CJJCB 	Br   c                s    R p\        ^ ^^4       F-  p\        V P                  V,	          ^,          4      V,           pK/  	  V# )r   )rangechrr
   )r   r   Zshifts   &  r   	get_bytesZUUID.get_bytes   s<    1c1%EU*d23e;E &r   c                s    V P                   V P                  V P                  V P                  V P                  V P
                  3# r   )r   r   r   r   r   r   r!   r"   r   
get_fieldsZUUID.get_fields   s:    t}}d.B.B))4+=+=tyyJ 	Jr   c                s:    V P                   \        ^`4      ,	          # )i`   r
   r   r!   r"   r   get_time_lowZUUID.get_time_low   s    xx48##r   c                sH    V P                   \        ^P4      ,	          R,          # )iP     r5   r!   r"   r   get_time_midZUUID.get_time_mid       DH$..r   c                sH    V P                   \        ^@4      ,	          R,          # )i@   r7   r5   r!   r"   r   get_time_hi_versionZUUID.get_time_hi_version   r9   r   c                sH    V P                   \        ^84      ,	          ^,          # )i8   r5   r!   r"   r   get_clock_seq_hi_variantZUUID.get_clock_seq_hi_variant       DH$,,r   c                sH    V P                   \        ^04      ,	          ^,          # )i0   r5   r!   r"   r   get_clock_seq_lowZUUID.get_clock_seq_low   r<   r   c                s    V P                   R ,          \        ^04      ,          V P                  \        ^ 4      ,          ,          V P                  ,          # )  )r   r   r   r   r!   r"   r   get_timeZUUID.get_time   s?    &&/DH<$r(*,.2mm< 	=r   c                s|    V P                   \        ^?4      ,          \        ^4      ,          V P                  ,          # )i?   )r   r   r   r!   r"   r   get_clock_seqZUUID.get_clock_seq   s0    ++d4j8T!WD""# 	$r   c                s(    V P                   R ,          # )l    r$   r!   r"   r   get_nodeZUUID.get_node   s    xx.((r   c                s(    R V P                   ,          # )r+   r$   r!   r"   r   get_hexZUUID.get_hex   s    !!r   c                s&    R \        V 4      ,           # )z	urn:uuid:r&   r!   r"   r   get_urnZUUID.get_urn  s    SY&&r   c                s(   V P                   R \        ^04      ,          ,          '       g   \        # V P                   R\        ^04      ,          ,          '       g   \        # V P                   R\        ^04      ,          ,          '       g   \        # \
        # )r	   i @  i    )r
   r   RESERVED_NCSRFC_4122RESERVED_MICROSOFTRESERVED_FUTUREr!   r"   r   get_variantZUUID.get_variant  sa    xx6T"X-..VtBx/00OVtBx/00%%""r   c                s    V P                   \        8X  d-   \        V P                  \        ^L4      ,	          ^,          4      # R# )iL   N)variantrE   r
   r   r!   r"   r   get_versionZUUID.get_version  s0    <<8#DH,344 $r   r   )NNNNN)+Z__name__Z
__module__Z__qualname__Z__firstlineno____doc__r   r    r#   r%   r'   r*   r0   r3   Zpropertyr   r4   r   r6   r   r8   r   r:   r   r;   r   r=   r   r?   timer@   r   rA   r   rB   r   rC   ZurnrH   rI   rJ   r   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r   r   r   @   s$    'RD#L
&6B
 YEJ j!F$ %H/ %H/ 23O- $$<=- ./M= HD$ 'I) HD" 7
C' 7
C# {#G5
 {#Gr   r   c            	     s   ^ RI p R F  p V P                  V P                  P                  VR4      4      pT Fx  pTP                  4       P                  4       p\        \        T4      4       F?  pYE,          R9   g   K  \        YE^,           ,          P                  RR4      ^4      u u u # 	  Kz  	  K  	  R#   \         d     K  i ; i)z5Get the hardware address on Unix by running ifconfig.Nr   Zifconfig:)r   z/sbin/z	/usr/sbin)ZhwaddrZether)ospopenpathjoinIOErrorlowersplitr1   r   r
   r   )rN   dpipelineZwordsis         r   _ifconfig_getnoderY     s    (	88BGGLLJ78D DJJL&&(E3u:&822uU|33C<bAA '  )  		s   +B::C	C	c                 s   ^ RI p ^ RIp. R
Op ^ RIpVP                  R4      pVP                  P
                  P                  VR4       VP                  ^ VP                  P                  R4      4       T F  p T P                  T P                  P                  TR4      R,           4      pT Fo  pTP                  R4      R,          P                  4       P!                  4       pTP#                  RT4      '       g   KQ  \%        TP'                  R	R4      ^4      u u # 	  K  	  R#     L; i  \         d     K  i ; i)z<Get the hardware address on Windows by running ipconfig.exe.Nr   i,  ZmbcsZipconfigz /allrM   z&([0-9a-f][0-9a-f]-){5}[0-9a-f][0-9a-f]r    )r   zc:\windows\system32zc:\winnt\system32i)rN   rectypesZcreate_string_bufferZwindllZkernel32ZGetSystemDirectoryAZinsertr)   ZdecoderO   rP   rQ   rR   rT   r   rS   Zmatchr
   r   )	rN   rZ   Zdirsr[   ZbufferrU   rV   rW   r)   s	            r   _ipconfig_getnoder\   +  s   =D,,S12263?Av||**623 	88BGGLLJ7'ABD DJJsOB'--/557Exx@%HH5==b1266    		s   A&D' :2D.'D+.D=<D=c                 s   ^ RI p ^ RIpVP                  4       pVP                  Vn        VP                  4       ;Vn        pVP                  4        V P                  V4      ^ 8w  d   R# VP                  4        \        VP                  4       EF  pVP                  4        VP                  Vn        \        VP                  V,          4      Vn        V P                  V4      ^ 8w  d   K^  VP                  4        VP"                  Vn        \        VP                  V,          4      Vn        RP%                  ^4      Vn        VP)                  4       ;Vn        pV P                  V4      ^ 8w  d   K  VP                  4        \+        \        VP,                  4      pV^ ,          \/        ^(4      ,          V^,          \/        ^ 4      ,          ,           V^,          \/        ^4      ,          ,           V^,          \/        ^4      ,          ,           V^,          \/        ^4      ,          ,           V^,          ,           u # 	  R# )zpGet the hardware address on Windows using NetBIOS calls.
See http://support.microsoft.com/kb/118623 for details.NZ*)	win32wnetnetbiosZNCBZNCBENUMZCommandZ	LANA_ENUMZBufferZ_packZNetbiosZ_unpackr1   ZlengthZResetZNCBRESETr   ZlanaZLana_numZNCBASTATZljustZCallnameZADAPTER_STATUSr   Zadapter_addressr   )r]   r^   ZncbZadaptersrX   Zstatusr   s          r   _netbios_getnoder_   B  s    
++-C//CK#--//CJNN"8??#		&&8==+,S!Q&		&&8==+,yy}%4466
VS!Q&C//0qT"X%%(d2h*>?qT"X%'*/(d2h*>@qT!W$&(-a1 	2 $r   c                 sh    \        \        4       \        \        P                  R7      P                  # )z.Get the hardware address on Unix using ctypes.r   )_uuid_generate_time_bufferr   rawr   r   r   r   _unixdll_getnoderd   d  s     gkk"'''r   c                 sv    \        \        4      ^ 8X  d%   \        \        P                  R7      P                  # R# )z1Get the hardware address on Windows using ctypes.r`   N)_UuidCreaterb   r   rc   r   r   r   r   _windll_getnoderf   j  s)    7q '++&+++ !r   c                 sn    ^ RI p V P                  ^ ^\        ^04      ,          4      \        R4      ,          # )zCGet a random node ID, with eighth bit set as suggested by RFC 4122.Nl        )random	randranger   )rg   s    r   _random_getnoderi   p  s*    AqDH}-^0DDDr   c                 s    \         e   \         # ^ RIp V P                  R8X  d   \        \        \
        .pM\        \        .pV\        .,            F  p V! 4       s \         f   K  \         u # 	  R#     K&  ; i)a  Get the hardware address as a 48-bit integer.  The first time this
runs, it may launch a separate program, which could be quite slow.  If
all attempts to obtain the hardware address fail, we choose a random
48-bit number with its eighth bit set to 1 as recommended in RFC 4122.NZwin32)	_nodesysZplatformrf   r_   r\   rd   rY   ri   )rk   ZgettersZgetters      r   getnoderl   x  so     
||w"$46GH#%67_---	HE L .	s   A11A6c                s   \         '       d7   Yu;J d   f-   M M)\        \        4       \        \        P                  R7      # ^ RIp\        VP	                  4       R,          4      p\        V^d,          4      \        R4      ,           pVf&   ^ RIpVP                  ^\        ^4      ,          4      pV\        R4      ,          pV\        ^ 4      ,	          \        R4      ,          pV\        ^04      ,	          \        R4      ,          pV\        ^4      ,          p	V\        ^4      ,	          \        ^?4      ,          p
V f   \        4       p \        WgVWV 3^R7      # )	a  Generate a UUID from a host ID, sequence number, and the current time.
If 'node' is not given, getnode() is used to obtain the hardware
address.  If 'clock_seq' is given, it is used as the sequence number;
otherwise a random 14-bit sequence number is chosen.Nr`   g    eAl    @'Hwl    r7   r>   )r   r   )
ra   rb   r   rc   rL   r
   r   rg   rh   rl   )r   r   rL   ZnanosecondsZ	timestamprg   r   r   r   r   r   s   &&         r   uuid1rm     s    t88G$'++&&diikC'(K K#%&.@)AAI$$Q$r(]3	4
++HT"X%f5H DH,V<OT
*M%a0DJ>|yO,TCLMO Or   c                s    ^ RI pVP                  V P                  V,           4      P                  4       p\        VR,          ^R7      # )zAGenerate a UUID from the MD5 hash of a namespace UUID and a name.NNr.   Nr   r   )md5r   digestr   )	namespacer(   rp   my_hash   &&  r   uuid3ru     6    ggioo,-446GgclA..r   c            	     sN   \         '       d*   \        \        4       \        \        P                  R7      #  ^ RIp \        V P                  ^4      ^R7      #    ^ RIp\        ^4       Uu. uF  p\        TP                  R4      4      NK  	  Mu upi pp\        T^R7      u # ; i)zGenerate a random UUID.r`   Nro   r   )
_uuid_generate_randomrb   r   rc   rN   Zurandomrg   r1   r2   rh   )rN   rg   rX   r   s       r   uuid4rx     s     g&'++&&,"**R.!44,5:2Y?YV%%c*+Y??%++s   A B$*#BB$c                s    ^ RI pVP                  V P                  V,           4      P                  4       p\        VR,          ^R7      # )zCGenerate a UUID from the SHA-1 hash of a namespace UUID and a name.Nrn   ro   )shar   rq   r   )rr   r(   ry   rs   rt   r   uuid5rz     rv   r   z$6ba7b810-9dad-11d1-80b4-00c04fd430c8z$6ba7b811-9dad-11d1-80b4-00c04fd430c8z$6ba7b812-9dad-11d1-80b4-00c04fd430c8z$6ba7b814-9dad-11d1-80b4-00c04fd430c8)zreserved for NCS compatibilityzspecified in RFC 4122z$reserved for Microsoft compatibilityzreserved for future definition)i   )NN)$rK   Z
__author__rT   r   Z__date__Z__version__rD   rE   rF   rG   rk   Zversion_infor
   r   ZcmpZobjectr   rY   r\   r_   rw   ra   re   rd   rf   ri   rj   rl   rm   ru   rx   rz   ZNAMESPACE_DNSZNAMESPACE_URLZNAMESPACE_OIDZNAMESPACE_X500r   r   r   <module>r{      s  -0^ +
)//1!4<<S#F &&(+?N ;h*O
 dD$Y$6 Y$xB7.2> =A @  @+k(,E
 	2O>/,"/ ;<;<;<<=r   