Wc  dZdZddlZddlZddlZddlZddlZddlZddddddddd d d Zejd Z d Z ejd ejZ dQdZdRdZejdZ dSdZ ddlZdZgdZgdZdZdZdZdTdZdZdUdZd ZdVd!Zd"Zd#Z dRd$Z!d%Z"dRd&Z#d'd(d)dZ$ejJddfd*Z&d+Z'Gd,d-Z(d.Z)Gd/d0ejTd1d2Z+da,d3Z-d4Z.d5Z/d6Z0d7Z1d8Z2d9Z3ejd:ejZ4ejd;ejZ5ejd<Z6ejd=Z7iZ8dWd>Z9d?Z:d@Z;dAZdDZ?dEZ@iZAdXdFZBejdGZCejdHZDdIZEdaFdJZGdKZHeIdLkr^dMejvp dNejvZKdOejvo dPejvZLeMeBeLeKejddSdS#e$rdZYwxYw)Ya Copyright (c) 1999-2000, Marc-Andre Lemburg; mailto:mal@lemburg.com Copyright (c) 2000-2010, eGenix.com Software GmbH; mailto:info@egenix.com Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee or royalty is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation or portions thereof, including modifications, that you make. EGENIX.COM SOFTWARE GMBH DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE ! z1.0.8N (2) devalphaabetabcRCrcplpz([0-9]+|[._+-])cg}tj|D],}|dvs t|d}d}|j ||f.|S#t$rtj |d}Y;wxYw)Nz._+-rdr) _component_resplitint ValueError _ver_stagesgetextend)versionresultvts !/usr/lib64/python3.12/platform.py_comparable_versionr!s F   )"" F?? *2J MM1a& ! ! ! M * * *OOAq) *sA  "A/.A/sC(__libc_init)|(GLIBC_([0-9.]+))|(libc(_\w+)?\.so(?:\.(\d[0-9.]*))?)@cX |sa tjd}|jd}t|dkr t |S tj}|s||fSt}tjj|}t|d5}|j|}d} | t|kr0d|vsd|vrtj!|| } nd} | r | j#t|kr<|j|} | r%|t%| t|d z d| z}d} | snd | j'D\} } }}}}| r|sd }nd| r"|d krd }|}nW||||krC|}n@|r>|d kr8d }|r|r||||kr|}|r|t| d|kr||z}| j#} | t|kr0ddd||fS#t t tf$rYwxYw#1swY||fSxYw) NCS_GNU_LIBC_VERSION)maxsplitrbrslibcsGLIBCic<g|]}||jdn|S)Nlatin1)decode).0ss r zlibc_ver..s:E%E%E%'(m""::E%libcglibc)osconfstrrlentupleAttributeErrorrOSErrorsys executabler!pathrealpathopenread _libc_searchsearchendmaxgroups)r:libr chunksizeverpartsVfbinaryposmchunklibcinitr2 glibcversionsothreads soversions r libc_verrSs  : **23CIIqI)E5zQU|# ^^ z< A!!*-J j$ "1 "CK&  H$6$6 ''413v;..y)5#CS[4-?$@$ABUJFCqE%E%E%E% AHe\2w x'>>!C*GGQ|_qqz11*GG'>> C y''QQy\AAgJ5N5N"+w7CL=>#:g#E#E")G"3%%'C?CK"""""F <e G4    D """"""""F <sAG?EH?HHH)c  |jd}|r|j| ttttt |}dj|dd}|S#t $r|}Y%wxYw)N.)rappendlistmapstrrrjoin)rbuildlstringss r _norm_versionr_s  cA u s3C ,-hhwr{#G N s/A// A>=A>z'(?:([\w ]+) ([\w.]+) .*\[.* ([\d.]+)\])win32win16dosc tj|vr|||fSddl}dD]/} |j||j|jdd}n|||fS|j}tj|}|D|j\}}}|ddkr|dd}|ddkr|dd}t|}|||fS#t |j f$r }Yd}~d}~wwxYw)Nr)rFzcommand /c verz cmd /c verT)stdinstderrtextshellrU) r9platform subprocess check_outputDEVNULLr8CalledProcessErrorstrip _ver_outputmatchrCr_) systemreleasersupported_platformsrkcmdinfowhyrLs r _syscmd_verrxsC  ||...w''6 ( ( **31;1C1C2<2D2D0415 +7D Ew'' ::z_wmi_query..Gs+551akk#&&&&&55r0c.i|]}|d|dS)rr(rs r z_wmi_query..Hs 444AQqT1Q4ZZ4r0c3*K|] }|dSNr)r-k dict_datas r rz_wmi_query..Is#++ ! ++r0)_wmi exec_queryformatr[r)tablekeysdata split_datars @r _wmi_queryr>s)$   299 HHTN    5; 6555 4444 ++++d+++r0ctd)Nz not supported)r8)rs r rr;s o&&r0) )rr&rpost11))rriU11)r10)rrVrz8.1)rr(r8)rr&r7)rrrVista))r(iXP64)rr(rXPMedia))rr&rXP)rrr2000) )rpost2022Server))rri|O 2022Server))rricE 2019Server)r 2016Server)r 2012ServerR2)r 2012Server)r 2008ServerR2)r 2008Server)r 2003Server)r 2000ServerctdvS)N)IoTUAP NanoServerWindowsCoreHeadless IoTEdgeOS) win32_editionrr0r win32_is_iotrgs ?Z ZZr0c  ddl} d}|j|j|5}|j |ddcdddS#t$rddl}YTwxYw#1swYnxYw dS#t $rYdSwxYw#t$rYdSwxYw)Nr,SOFTWARE\Microsoft\Windows NT\CurrentVersion EditionId)winreg ImportError_winreg OpenKeyExHKEY_LOCAL_MACHINE QueryValueExr8)rcvkeykeys r rrjs=  % MMM  CE!!&";";UC @s**3 .s,BBda!z//BBr0)rr6rYrr_WIN32_CLIENT_RELEASES_WIN32_SERVER_RELEASESnext)rsrrrrreleasesrs @r win32_verrs{I%/e%D"GS%w3sGMM#$678 -6Y))>"  t b$1 ]]1 !"GKhhj  G,,, K (( ttsB B BBB$rc. t}||S|||fSr)r)rsrrrvs r mac_verrs* >D   K ((r0cdddlm} |j|}||S|S#t$r|cYSwxYw)Nr)System) java.langr getPropertyr7)namedefaultrvalues r _java_getproprs\      ""4( =N s  //cR ddl}td|}td|}|\}}}td|}td|}td|}|||f}|\}} } td| } td|}td | } || | f}||||fS#t$r ||||fcYSwxYw) Nrz java.vendorz java.versionz java.vm.namezjava.vm.vendorzjava.vm.versionz java.os.archz java.os.namezjava.os.version)rrr) rsvendorvminfoosinfojavavm_name vm_release vm_vendoros_name os_versionos_archs r java_verr s /=& 1FNG4G%+"GZNG4G. :I0*=J j) +F#) GZNG4GNG4G0*=J j' )F FFF **! ///..../sBB&%B&c |dkrf|dkr|||fS|jd}|r; t|d}|dz }t||d<dj|}|dkrd}n d}n|dvrd }|||fS#t$rY#wxYw) NSunOS5rUrrV6SolarisrarbWindows)rrrZr[r)rrrsrr]rs r system_aliasrs S==7G+ + MM#  1 &AaD  5z!((1+ S==FFFF % % % 7G ##'    sA99 BBc, djdtt|D}|jdd}|jdd}|jdd}|jdd}|jdd}|jd d}|jd d}|jd d}|jd d } |jdd}||krn|}|ddkr|dd}|ddkr|S)N-c3:K|]}|jdSr)ro)r-xs r rz_platform..Ns$==a ==r0 _/\:;"()unknownr"Tz--ri)r[filterr5replace)argsrjcleaneds r _platformr%Hs4xx==6#t+<===HS)HS)Hc*HS)HS)HS)HS)HS)H 2.H ""4- h     2,#  CR= 2,#   Or0cz ddl} |jS#t$r|cYSwxYw#t$r|cYSwxYwNr)socketr gethostnamer8)rr(s r _noder*hsu !!##  s+ (( ::c tjj|}tjj|rtjj tjj tjj |tj|}tjj|r|Sr)r3r;abspathislinknormpathr[dirnamereadlink)filepaths r _follow_symlinksr2wswwx(H ''.. " "77## GGLL2BKK4I JL ''.. " " Or0c` tjdvr|S ddl}t |}t t jd} |jdd|g|j|}|s|S|jdS#t$r|cYSwxYw#t|jf$r|cYSwxYw) N)rcrarbrC)LC_ALLfilez-b)rfenvzlatin-1) r9rjrkrr2dictr3environrlrmr8rnr,)targetrrkr7outputs r _syscmd_filer<s ||000f %F rzz# & &C((&$)?0:0B0B-0)2 6 == ###  Z22 3s#B"B BBB-,B-)r" WindowsPE)r"r)r"MSDOSc |s)ddl}|jd}t|dzdz}|rt|d}nd}|sX|tj krCtj tvr'ttj \}}|r|}|r|}||fSd|vrd|vr||fSd|vrd }nd |vrd }d |vrd }||fSd |vrd|vrd}||fSd }||fSd|vrd}||fSd|vrd}||fS ||fS)NrPbitr"r:z shared objectz32-bit32bitz64-bit64bitELFPErr=COFFzMS-DOSr>)structcalcsizerZr<r9r:rj_default_architecture)r:bitslinkagerHsizefileoutr r]s r architecturerOs* 4 s#4!8}u$zz2. 7S^^## <<0 0 0(6DAqqqW}7""g'E'EW}7 W    =    !G =G = 7   = W   = =r0c. tdd^}} gdt|}|r|St j jddp!t j jddS#ttf$rYWwxYw#t$rYgwxYw)Nr} Architecture) x86MIPSAlpharNARMia64NNAMD64NNARM64PROCESSOR_ARCHITEW6432r"PROCESSOR_ARCHITECTURE)rrr IndexErrorr8r3r9r)archrs r _get_machine_win32r]s~6  $iDt  /4 5 /4 J'    D       s"BA00BB BBc2eZdZedZdZdZdZdS) _Processorclt|dtj|j}|pdS)Nget_r")rr9rjfrom_subprocess)clsfuncs r rz_Processor.gets1s13<<1133F3FGtv|r0c tddd\}}|d|S#t$r/tjj dt cYSwxYw)Nr} ManufacturerCaption, PROCESSOR_IDENTIFIER)rr8r3r9rr]) manufacturercaptions r get_win32z_Processor.get_win32sq 0$.uni$P !L'//// / P P P::>>"8:L:NO O O O Ps6AAcn ddl}|jdd\}}|dkrdSdS#t$rYdSwxYw)NrzSYI$_CPUrTVAX)vms_libgetsyir)rpcsid cpu_numbers r get_OpenVMSz_Processor.get_OpenVMS%s` ; NNN '~~j!< D*(C//7 :U :     DD s & 44c ddl} |jddg|jdj S#t$rYdSwxYw#t |j f$rYdSwxYw)Nrrz-pT)rfrg)rkrrlrmror8rn)rks r rbz_Processor.from_subprocess.s       **$!))+eg     44 667    DD s 8/A AA A#"A#N)__name__ __module__ __qualname__ classmethodrrlrtrbrr0r r_r_sX000;;;r0r_c|dkrdS|S)Nr r"r)vals r _unknown_as_blankr|@s !!2*s*r0cjeZdZ ejdZfdZedZdZ dZ dZ xZ S) uname_resultcDttjSr)r|r_rselfs r processorzuname_result.processorRs !122r0c|tjtj|jfSr) itertoolschainsuper__iter__r)r __class__s r rzuname_result.__iter__Vs, G    ^^   r0ct|j}|j|g|R}t||dzkr d|dt|}t||S)Nr&z Expected z arguments, got )r5_fields__new__ TypeError)rciterable num_fieldsrmsgs r _makezuname_result._make\sh% S,8,,, v;*q. ( (GjGG#f+GGCC.  r0c(t||Sr)r6)rrs r __getitem__zuname_result.__getitem__fsT{3r0cHttt|Sr)r5r6iterrs r __len__zuname_result.__len__is5d$%%r0cZtt|dt|jfSr)r~r6r5rrs r __reduce__zuname_result.__reduce__ls"U4[);#dll*;<<L C w&((('G sD++/EEc0 tjSr)rrrrr0r rrrrs 7>>r0c0 tjSr)rrrr0r rrs 7<<r0c0 tjSr)rrsrr0r rsrs 7??r0c0 tjSr)rrrr0r rrrr0c0 tjSr)rrrr0r rrrr0c0 tjSr)rrrr0r rrs 7  r0zL([\w.+]+)\s*\(#?([^,]+)(?:,\s*([\w ]*)(?:,\s*([\w :]*))?)?\)\s*\[([^\]]+)\]?z;IronPython\s*([\d\.]+)(?: \(([\d\.]+)\))? on (.NET [\d\.]+)zU([\d.]+)\s*\(IronPython\s*[\d.]+\s*\(([\d.]+)\) on ([\w.]+ [\d.]+(?: \(\d+-bit\))?)\)zE([\w.+]+)\s*\(#?([^,]+),\s*([\w ]+),\s*([\w :]+)\)\s*\[PyPy [^\]]+\]?c* |tj}tj|d}||Sd|vr{d}|j drt j |}ntj |}|tdt|z|j\}}}d}d}n3tjj drcd}tj |}|tdt|z|j\}}}} } |d}tj}nd|vrOd}tj |}|tdt|z|j\}}}} d}n\tj |}|td t|z|j\}}}} }d }|d}n | r|d z| z}ttd rtj\} } } n-ttd rtj \} } } nd} d} |j#d} t%| dkr$| j'ddj)| }||| | |||f}|t|<|S)N IronPythonz*failed to parse IronPython sys.version: %sr"rJythonz&failed to parse Jython sys.version: %sPyPyz$failed to parse PyPy sys.version: %sz'failed to parse CPython sys.version: %sCPythonr_git _mercurialrUr(r)r9r_sys_version_cacher startswith_ironpython_sys_version_parserrq _ironpython26_sys_version_parserrreprrCrj_sys_version_parser_pypy_sys_version_parserhasattrrrrr5rWr[) sys_versionrrrqr alt_versioncompilerbuildno builddate buildtimerbranchrevisionr]s r _sys_versionr$s&kk  # #K 6F  {""  ! !, / /288EEE4::;GE =<[!"# #*/&h   ( (#))+6 =8[!"# #5:LLN1)Y  I<< ;  (..{; =C!+./0 016.)Y$))+6 =9[!"# #lln 9)Y  II Y!C)3IsF!hh688 l # #!nn688  cA 1v{{  ((1+GVXw 8 LF&,{# Mr0c( tdSr'rrr0r python_implementationr >! r0c( tdS)Nr&rrr0r python_versionrs >! r0c^ ttdjdS)Nr&rU)r6rrrr0r python_version_tuplers& "((- ..r0c( tdS)Nr(rrr0r python_branchrs >! r0c( tdS)NrVrrr0r python_revisionrrr0c" tddS)Nrrrrr0r python_buildrs >!A r0c( tdS)Nrrrr0r python_compilerrs >! r0c  tj||fd}||St\}}}}}}||krd}|rt|||\}}}|dkrt d} | rd}| }|dkr4t |\} } } } |rt ||}nt |||| }n|dvr%t\}}t ||||d||z}n|dkr=t\}}}\}}}|s|st |||}nVt |||d |||}nB|rt ||}n1ttj\}}t ||||||}|t||f<|S) Nr"DarwinrmacOSr)Linuxwithron) _platform_cacherrrrrr%rSr rOr9r:)aliasedterserrrrrsrrr macos_releaserelversrrrjlibcname libcversionrrrrrr rKrLs r rjrjs" '5!14 8F  :?6FD'7GY) w#/#I   ! =F#G  )' 2T3 5 1HH '3?HH :   ( +VWgy#%k13 6  7?z41f4w G 5 ':HH '!%!(*g?HH 5 1HH(8MD' '!*D';H)1OWe$% Or0zA^(?P[a-zA-Z0-9_]+)=(?P["']?)(?P.*)(?P=quote)$z\\([\\\$\"\'`]))z/etc/os-releasez/usr/lib/os-releasecdddd}|D]W}tj|}|tjd|j d||j d<Y|S)Nrlinux)NAMEID PRETTY_NAMEz\1rr)_os_release_linerq_os_release_unescapesubgroup)linesrvlinemos r _parse_os_releaser6sv  D   # #D ) >%9%=%=rxx(&D&! " " Kr0c| tpd}tD]?} t|d5}t|adddtjSt |ddj ttjS#1swY\xYw#t$r}|j }Yd}~d}~wwxYw)Nzutf-8)encodingzUnable to read files rh)_os_release_cache_os_release_candidatesr=rr8errnor[copy)r candidaterIes r freedesktop_os_releaserIs /  I )g66=!(9!(<%=====  ! ! ## K 2H(IKK   ! ! ##=========    s-BB BB B B;% B66B;__main__rz--terse nonaliasedz --nonaliased)Nr"r"r#)r")r"r"r"r`)r"r"r"r")r"rr")r"r"rrr)rr)O __copyright__ __version__ collectionsr3rer9rrrcompilerr!ASCIIr?rSr_rprxrrrrrrrrrrrrr rr%r*r2r<rJr:rOr]r_r| namedtupler~rrrrrrsrrrrrrrrrrrrrrrrrrjrrrrrrrvargvrrprintexitrr0r rsr *    b R B C    -.    rzzBDF88 M HHHHT    bjj-. 02#</$/$/$/$b,KKK , , ,      [[[$<*<*<*| ( ( ( ())),))))&   ++++F&$&$&$T@        $ $ $ $N    NNRIIIIX8&&&&&&&R+++ '='='='='=K-/'='=T UUUr   !bjjhh  ",88 "%$.2:::$ &2:: ffffP    / / /      HHHH^2::I"rzz"45C&$$$2 z  9I$9E388+NNchh4NG E((7E "## CHHQKKKK Q!'''''''''sH22H>=H>