Wcc s 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 iii(i2i) ZdevZalphaZaZbetabZcZRCZrcplZpz([0-9]+|[._+-])csg}tj|D],}|dvs t|d}d}|j ||f.|S#t$rtj |d}Y;wxYw)Nz._+-ridr) _component_resplitint ValueError _ver_stagesgetZextend)versionresultvZt !/usr/lib64/python3.12/platform.py_comparable_versionrs F   )"" F?? *2J MM1a& ! ! ! M * * *OOAq) *sA  "A/.A/sC(__libc_init)|(GLIBC_([0-9.]+))|(libc(_\w+)?\.so(?:\.(\d[0-9.]*))?)@csX |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) NZCS_GNU_LIBC_VERSION)ZmaxsplitrbrslibcsGLIBCics<g|]}||jdn|S)NZlatin1)decode).0Zs rz zlibc_ver..s:E%E%E%'(m""::E%Zlibcglibc)osZconfstrrlentupleAttributeErrorrOSErrorsys executablerpathZrealpathopenZread _libc_searchZsearchZendZmaxgroups)r Zlibr Z chunksizeverZpartsZVfZbinaryZposmZchunkZlibcinitrZ glibcversionZsoZthreadsZ soversions rlibc_verr(s  : **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 s |jd}|r|j| ttttt |}dj|dd}|S#t $r|}Y%wxYw)N.)rappendZlistmapstrrrjoin)r buildlZstringsr r _norm_versionr1s  cA u s3C ,-hhwr{#G N s/A// A>=A>z'(?:([\w ]+) ([\w.]+) .*\[.* ([\d.]+)\])win32win16doscs 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)r%zcommand /c verz cmd /c verT)ZstdinstderrtextZshellr)) rplatform subprocess check_outputDEVNULLrCalledProcessErrorstrip _ver_outputmatchr$r1) systemreleaser Zsupported_platformsr:ZcmdinfoZwhyr's r _syscmd_verrDsC  ||...w''6 ( ( **31;1C1C2<2D2D0415 +7D Ew'' ::_wmi_query..Gs+551akk#&&&&&55rcs.i|]}|d|dS)rrrGrrz z_wmi_query..Hs 444AQqT1Q4ZZ4rc3s*K|] }|dSNrJ)rZk dict_datas rrHrIIs#++ ! ++r)_wmiZ exec_queryformatr.r)ZtablekeysZdataZ split_datarLs @r _wmi_queryrP>s)$   299 HHTN    5; 6555 4444 ++++d+++rcstd)Nz not supported)r)rO rrPrP;s o&&r) )rrrZpost11))rriUZ11)rZ10)rTr*rz8.1)rTrrZ8)rTrrZ7)rTrrVista))riZXP64)r[rrZXPMedia))r[rrZXP)r[rrZ2000) )rRZpost2022Server))rri|OZ 2022Server))rricEZ 2019Server)rSZ 2016Server)rVZ 2012ServerR2)rWZ 2012Server)rXZ 2008ServerR2)rYZ 2008Server)r\Z 2003Server)r]Z 2000ServercstdvS)N)ZIoTUAPZ NanoServerZWindowsCoreHeadlessZ IoTEdgeOS) win32_editionrJrr win32_is_iotr_gs ?Z ZZrcs  ddl} d}|j|j|5}|j |ddcdddS#t$rddl}YTwxYw#1swYnxYw dS#t $rYdSwxYw#t$rYdSwxYw)Nr,SOFTWARE\Microsoft\Windows NT\CurrentVersionZ EditionId)winreg ImportError_winreg OpenKeyExHKEY_LOCAL_MACHINE QueryValueExr)racvkeykey rr^r^js=  % MMM  CE!!&";";UC @s**3 .s,BBda!z//BBr)rrrr,rr_WIN32_CLIENT_RELEASES_WIN32_SERVER_RELEASESZnext)rBr rnrorpZreleasesrts @r win32_verrws{I%/e%D"GS%w3sGMM#$678 -6Y))>"  t b$1 ]]1 !"GKhhj  G,,, K (( ttsB B BBB$rxcs. t}||S|||fSrK)r~)rBr}r|rCr rmac_verrs* >D   K ((rcsdddlm} |j|}||S|S#t$r|cYSwxYw)Nr)System) java.langrZ getPropertyr)namedefaultrvaluer r _java_getproprs\      ""4( =N s  //csR 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)rrbr) rBvendorvminfoosinfojavaZvm_nameZ vm_releaseZ vm_vendoros_name os_versionos_archs rjava_verrs /=& 1FNG4G%+"GZNG4G. :I0*=J j) +F#) GZNG4GNG4G0*=J j' )F FFF **! ///..../sBB&%B&cs |dkrf|dkr|||fS|jd}|r; t|d}|dz }t||d<dj|}|dkrd}n d}n|dvrd }|||fS#t$rY#wxYw) NZSunOSZ5r)rr*Z6ZSolarisr3r4Windows)rrr-r.r)rArBr r0rq r system_aliasrs S==7G+ + MM#  1 &AaD  5z!((1+ S==FFFF % % % 7G ##'    sA99 BBcs, djdtt|D}|jdd}|jdd}|jdd}|jdd}|jdd}|jd d}|jd d}|jd d}|jd d } |jdd}||krn|}|ddkr|dd}|ddkr|S)Nz-c3s:K|]}|jdSrK)r>)rZxrrrHz_platform..Ns$==a ==r _z/z\z:z;z"z(z)unknownrTz--r8)r.ZfilterrZreplace)Zargsr9Zcleanedrir _platformrHs4xx==6#t+<===HS)HS)Hc*HS)HS)HS)HS)HS)H 2.H ""4- h     2,#  CR= 2,#   Orcsz ddl} |jS#t$r|cYSwxYw#t$r|cYSwxYwNr)socketrbZ gethostnamer)rrrr_noderhsu !!##  s+ (( ::cs tjj|}tjj|rtjj tjj tjj |tj|}tjj|r|SrK)rr!ZabspathZislinkZnormpathr.ZdirnameZreadlink)ZfilepathrQr_follow_symlinksrwswwx(H ''.. " "77## GGLL2BKK4I JL ''.. " " Orcs` tjdvr|S ddl}t |}t t jd} |jdd|g|j|}|s|S|jdS#t$r|cYSwxYw#t|jf$r|cYSwxYw) N)r5r3r4rZC)ZLC_ALLZfilez-b)r6envzlatin-1) rr9r:rbrZdictrenvironr;r<rr=r)Ztargetrr:rZoutputrr _syscmd_filers ||000f %F rzz# & &C((&$)?0:0B0B-0)2 6 == ###  Z22 3s#B"B BBB-,B-)r WindowsPE)rr)rMSDOScs |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)NrZPiZbitrr z shared objectz32-bit32bitz64-bitZ64bitZELFZPErrZCOFFzMS-DOSr)structZcalcsizer-rrr r9_default_architecture)r bitslinkagerZsizeZfileoutrr0s r architecturers* 4 s#4!8}u$zz2. 7S^^## <<0 0 0(6DAqqqW}7""g'E'EW}7 W    =    !G =G = 7   = W   = =rcs. tdd^}} gdt|}|r|St j jddp!t j jddS#ttf$rYWwxYw#t$rYgwxYw)NrFZ Architecture) Zx86ZMIPSAlpharyNZARMZia64NNZAMD64NNZARM64ZPROCESSOR_ARCHITEW6432rZPROCESSOR_ARCHITECTURE)rPrrZ IndexErrorrrrr )Zarchrrr_get_machine_win32rs~6  $iDt  /4 5 /4 J'    D       s"BA00BB BBcs2eZdZedZdZdZdZdS) _Processorcslt|dtj|j}|pdS)NZget_r)rmrr9from_subprocess)clsZfuncrrr z_Processor.gets1s13<<1133F3FGtv|rcs tddd\}}|d|S#t$r/tjj dt cYSwxYw)NrFZ ManufacturerZCaption, ZPROCESSOR_IDENTIFIER)rPrrrr r)Z manufacturerZcaptionrr get_win32z_Processor.get_win32sq 0$.uni$P !L'//// / P P P::>>"8:L:NO O O O Ps6AAcsn ddl}|jdd\}}|dkrdSdS#t$rYdSwxYw)NrzSYI$_CPUirZVAX)vms_libZgetsyirb)rZcsidZ cpu_numberrir get_OpenVMSz_Processor.get_OpenVMS%s` ; NNN '~~j!< D*(C//7 :U :     DD s & 44cs ddl} |jddg|jdj S#t$rYdSwxYw#t |j f$rYdSwxYw)Nrr{z-pT)r6r7)r:rbr;r<r>rr=)r:rQrrz_Processor.from_subprocess.s       **$!))+eg     44 667    DD s 8/A AA A#"A#N)__name__ __module__ __qualname__ classmethodr rrrrJrrrrsX000;;;rrcs|dkrdS|S)NrrrJ)ZvalrQr_unknown_as_blankr@s !!2*s*rcsjeZdZ ejdZfdZedZdZ dZ dZ xZ S) uname_resultcsDttjSrK)rrr selfrQr processorzuname_result.processorRs !122rcs|tjtj|jfSrK) itertoolsZchainZsuper__iter__r)r __class__s rrzuname_result.__iter__Vs, G    ^^   rcst|j}|j|g|R}t||dzkr d|dt|}t||S)Nrz Expected z arguments, got )r_fieldsZ__new__Z TypeError)rZiterableZ num_fieldsr Zmsgrr_makezuname_result._make\sh% S,8,,, v;*q. ( (GjGG#f+GGCC.  rcs(t||SrK)r)rrhrr __getitem__zuname_result.__getitem__fsT{3rcsHttt|SrK)rrZiterrrQr__len__zuname_result.__len__is5d$%%rcsZtt|dt|jfSrK)rrrrrrQr __reduce__zuname_result.__reduce__ls"U4[);#dll*;<<L C w&((('G sD++/EEc0 tjSrK)r{rArJrrrArAs 7>>rcrrK)r{rrJrrrrs 7<<rcrrK)r{rBrJrrrBrB 7??rcrrK)r{r rJrrr r rrcrrK)r{r|rJrrr|r|rrcrrK)r{rrJrrrrs 7  rzL([\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 [^\]]+\]?cs* |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)NZ IronPythonz*failed to parse IronPython sys.version: %srrZJythonz&failed to parse Jython sys.version: %sZPyPyz$failed to parse PyPy sys.version: %sz'failed to parse CPython sys.version: %sZCPythonr_git _mercurialr)rrj)rr _sys_version_cacher Z startswith_ironpython_sys_version_parserr@ _ironpython26_sys_version_parserrZreprr$r9_sys_version_parser_pypy_sys_version_parserZhasattrrrrrr+r.)Z sys_versionr rr@r Z alt_versionZcompilerZbuildnoZ builddateZ buildtimerZbranchZrevisionr0s 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&,{# Mrc( tdSrrrJrrpython_implementationr >! rcr)NrrrJrrpython_versionrs >! rcs^ ttdjdS)Nrr))rrrrJrrpython_version_tuplers& "((- ..rcr)NrrrJrr python_branchrs >! rcr)Nr*rrJrrpython_revisionrrrcs" tddS)NrUrTrrJrr python_buildrs >!A rcr)NrTrrJrrpython_compilerrs >! rc s 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) NrZDarwinrZmacOSr)LinuxZwithrZon) _platform_cacher r{rrrwrr(rrrr )aliasedterser rArrBr r|rZ macos_releaseZrelZversrnror9ZlibcnameZ libcversionrsr rrrrrrs rr9r9s" '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$% OrzA^(?P[a-zA-Z0-9_]+)=(?P["']?)(?P.*)(?P=quote)$z\\([\\\$\"\'`]))z/etc/os-releasez/usr/lib/os-releasecsdddd}|D]W}tj|}|tjd|j d||j d<Y|S)NrZlinux)ZNAMEZIDZ PRETTY_NAMEz\1rr)_os_release_liner@_os_release_unescapeZsubZgroup)ZlinesrCZlineZmor r_parse_os_releaser6sv  D   # #D ) >%9%=%=rxx(&D&! " " Krcs| tpd}tD]?} t|d5}t|adddtjSt |ddj ttjS#1swY\xYw#t$r}|j }Yd}~d}~wwxYw)Nzutf-8)ZencodingzUnable to read files r)_os_release_cache_os_release_candidatesr"rrerrnor.Zcopy)rZ candidater&Zer rfreedesktop_os_releaserIs /  I )g66=!(9!(<%=====  ! ! ## K 2H(IKK   ! ! ##=========    s-BB BB B B;% B66B;Z__main__rz--terseZ nonaliasedz --nonaliased)Nrrr)r)rrrr2)rrrr)rrxr)rrrxrxrK)rr)OZ __copyright__Z __version__Z collectionsrZrerrrrZcompilerrZASCIIr#r(r1r?rDrMrPrbrurvr_r^rrrwr~rrrrrrrrrr rrrrZ namedtuplerrr{rArrBr r|rrrrrrrrrrrrrrrr9rrrrrrrZargvrrZprintZexitrJrrrsr *    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>