+
     ho  c                   s
   R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RIH
t
 ^ RIHt ^ RIHt ^ RIHt  ^ RIHt  ^ RIHt ]! ]P$                  ! R4      4      t]! 4       t. R	NR
NRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNR NR!NR"NR#NR$NR%NR&NR'NR(NR)NR*NR+NR,NR-NR.NR/NR0NR1NR2NR3NR4NR5NR6NR7NR8NR9NR:NR;NR<NR=NR>NR?NR@NRANRBNRCNRDNRENRFNRGNRHNRINRJNRKNRLNRMNRNNRONRPNRQNRRNRSNRTNRUNRVNRWNRXNRYNRZNt]P.                  R[8H  t]P.                  R\8H  t]P4                  P7                  R]4      t]P4                  P7                  R^4      t]t]P4                  P7                  R4      t]P4                  P7                  R_4      t ]P4                  P7                  R`4      t!];'       g    ] ;'       g    ]!t"]P4                  P7                  R4      t#]P4                  P7                  Ra4      t$Rbt%Rct&Rdt'Ret(Rft)Rgt*Rht+Rit,Rjt-Rkt.Rlt/Rmt0Rnt1Rot2Rpt3Rqt4Rrt5Rst6Rtt7Rut8Rvt9Rwt:Rxt;Ryt<Rzt=R{t> ! R| R}]P~                  4      t@]A! 4       P                  ]@P                  4        ! R~ R]P~                  4      tD]A! 4       P                  ]DP                  4       ]P                  ! 4       tF]P                  ! 4       tH]
! RD. RO4      tI]
! R@. RO4      tJ]
! R>. RO4      tK]
! R?. RO4      tL]
! RA. RO4      tM]
! RE. RO4      tN]
! R<. RO4      tO]
! RB. RO4      tP]
! RC. RO4      tQ]
! R=. RO4      tR]
! R. RO4      tS]
! R. RO4      tT]
! R. RO4      tU]
! RRR.4      tV]
! R4. RO4      tW]
! R9RR.4      tX]
! R:. RO4      tY]
! R;. RO4      tZ]
! R6. RO4      t[]
! R7. RO4      t\]
! R8RR.4      t]]
! R5RR.4      t^]
! R3. RO4      t_]
! RRR.4      t`R]]].]].3R]].].3R].].3R]].].3R].].3R]].]].3R].]].3R].]].3/ta]e   ]aP                  R].].3R].].3/4       ]e!   ]#'       g   ]aP                  R].]].3/4        ! R R]b4      tc ! R R]c4      td ! R R]d4      te ! R R]c4      tf ! R R]c4      tgRR lthR tiR tjR tkR tl]iR 4       tmR tnR toR tpRR ltqR trR ts ! R R4      ttR tu]t! 4       tv]vP                  ]unw        ]vP                  ]unx        RtyR tzR t{]]{3R lt|]3R lt}RR lt~R tR t]i]EP                  3R l4       tRR ltRR]EP                  3R ltR tR#   ] d    Rt EL i ; i  ] d    Rt EL	i ; i)zCommon objects shared by __init__.py and _ps*.py modules.

Note: this module is imported by setup.py, so it should not import
psutil or third-party modules.
N)
namedtuple)AF_INET)
SOCK_DGRAM)SOCK_STREAM)AF_INET6)AF_UNIXPSUTIL_DEBUGFREEBSDBSDLINUXNETBSDOPENBSDMACOSOSXPOSIXSUNOSWINDOWS
CONN_CLOSECONN_CLOSE_WAITCONN_CLOSINGCONN_ESTABLISHEDCONN_FIN_WAIT1CONN_FIN_WAIT2CONN_LAST_ACKCONN_LISTEN	CONN_NONECONN_SYN_RECVCONN_SYN_SENTCONN_TIME_WAITNIC_DUPLEX_FULLNIC_DUPLEX_HALFNIC_DUPLEX_UNKNOWNSTATUS_DEADSTATUS_DISK_SLEEPSTATUS_IDLESTATUS_LOCKEDSTATUS_RUNNINGSTATUS_SLEEPINGSTATUS_STOPPEDSTATUS_SUSPENDEDSTATUS_TRACING_STOPSTATUS_WAITINGSTATUS_WAKE_KILLSTATUS_WAKINGSTATUS_ZOMBIESTATUS_PARKEDENCODINGENCODING_ERRSr   pconn	pcputimespctxswpgidspiopionice	popenfilepthreadpuidssconn	scpustatssdiskio	sdiskpart
sdiskusagesnetiosnicaddr	snicstatssswapsuser	conn_tmapdeprecated_methodisfile_strictmemoizeparse_environ_blockpath_exists_strictusage_percentsupports_ipv6sockfam_to_enumsocktype_to_enumwrap_numbers	open_textopen_binarycatbcatbytes2humanconn_to_ntupledebughiliteterm_supports_colorsprint_colorZposixntZlinuxZdarwinZopenbsdZnetbsdZaixZrunningZsleepingz
disk-sleepZstoppedztracing-stopZzombieZdeadz	wake-killZwakingZidleZlockedZwaitingZ	suspendedZparkedZESTABLISHEDZSYN_SENTZSYN_RECVZ	FIN_WAIT1Z	FIN_WAIT2Z	TIME_WAITZCLOSEZ
CLOSE_WAITZLAST_ACKZLISTENZCLOSINGZNONEc                   s"    ] tR t^t^t^t^ tRtR# )	NicDuplex N)__name__
__module____qualname____firstlineno__r   r   r   __static_attributes__rZ       5/usr/lib64/python3.14/site-packages/psutil/_common.pyrY   rY      s    OOr`   rY   c                   s    ] tR t^tRtRtRtR# )BatteryTimerZ   Nii)r[   r\   r]   r^   ZPOWER_TIME_UNKNOWNZPOWER_TIME_UNLIMITEDr_   rZ   r`   ra   rb   rb      s    r`   rb   fdscpufreqcurrentshwtemplabelsbatterysfanpathZioclassvalueZ	voluntaryZinvoluntaryaddrZipZportZallZtcpZtcp4ZudpZudp4ZinetZinet4Zinet6Ztcp6Zudp6Zunixc                   s:   a  ] tR tRt o RtRtR tR tR tRtV t	R# )	Errori  zIBase exception class. All other psutil exceptions inherit
from this one.
psutilc                s    \         P                  ! 4       pV F-  p\        WR 4      pV'       g   VR8X  g   K   V^ 8X  g   K)  WBV&   K/  	  V# )Npid)collectionsZOrderedDictgetattr)selfZattrsinfonamerk   s   &&   ra   	_infodictZError._infodict  sC    &&(DD-E5A:"T
  r`   c                sN   V P                  R4      pV'       dJ   RP                  RP                  VP                  4        UUu. uF  w  r#V RV: 2NK  	  upp4      4      pMRpRP                  \	        V RR4      V3 Uu. uF  qU'       g   K  VNK  	  up4      # u uppi u upi )	ro   z({}), =NZ msg )ro   ppidrt   )ru   formatjoinitemsrq   )rr   rs   kvdetailsZxs   &     ra   __str__ZError.__str__  s    ~~56mm		DJJLALDAaS!<LABG GxxWT5"%=w$GM$Gq1$GMNN	 B Ns   B	B"B"c           	     s    V P                  R4      pRP                  VP                  4        UUu. uF  w  r#V RV: 2NK  	  upp4      pRV P                  P                   RV R2# u uppi )ro   rv   rw   zpsutil.Z(Z))ro   rz   rt   secondsrx   )ru   r|   r}   	__class__r[   )rr   rs   r~   r   r   s   &    ra   __repr__ZError.__repr__  sf    ~~GH))djjlCldas!A5\lCD0017)1== Ds   A(
rZ   N)
r[   r\   r]   r^   __doc__ru   r   r   r_   __classdictcell__Z__classdict__   @ra   rm   rm     s&      J	O> >r`   rm   c                   8   a  ] tR tRt o RtRtRR ltR tRtV tR# )	NoSuchProcessi&  zPException raised when a process with a certain PID doesn't
or no longer exists.
rn   Nc                j    \         P                  V 4       Wn        W n        T;'       g    R V n        R# )zprocess no longer existsNrm   __init__ro   rt   rx   rr   ro   rt   rx      &&&&ra   r   ZNoSuchProcess.__init__-  s(    t	444r`   c                `    V P                   V P                  V P                  V P                  33# Nr   ro   rt   rx   rr      &ra   
__reduce__ZNoSuchProcess.__reduce__3  $    499dhh ?@@r`   rx   rt   ro   NN	r[   r\   r]   r^   r   r   r   r_   r   r   r   ra   r   r   &  s"      J5A Ar`   r   c                   r   )	ZombieProcessi7  a  Exception raised when querying a zombie process. This is
raised on macOS, BSD and Solaris only, and not always: depending
on the query the OS may be able to succeed anyway.
On Linux all zombie processes are querable (hence this is never
raised). Windows doesn't have zombie processes.
rn   Nc                s`    \         P                  WW$4       W0n        T;'       g    R V n        R# )z"PID still exists but it's a zombieN)r   r   rz   rx   )rr   ro   rt   rz   rx   s   &&&&&ra   r   ZZombieProcess.__init__A  s'    t$4	>>>r`   c                sv    V P                   V P                  V P                  V P                  V P                  33# r   )r   ro   rt   rz   rx   r   r   ra   r   ZZombieProcess.__reduce__F  s*    499dii JKKr`   )rx   rz   NNNr   r   r   ra   r   r   7  s"      J?
L Lr`   r   c                   r   )	AccessDeniediJ  z@Exception raised when permission to perform an action is denied.rn   Nc                r   )ry   Nr   r   r   ra   r   ZAccessDenied.__init__O  s%    t	99"r`   c                r   r   r   r   r   ra   r   ZAccessDenied.__reduce__U  r   r`   r   r   r   r   r   ra   r   r   J  s     JJA Ar`   r   c                   r   )	TimeoutExpirediY  zORaised on Process.wait(timeout) if timeout expires and process
is still alive.
rn   Nc                sj    \         P                  V 4       Wn        W n        W0n        R V R2V n        R# )ztimeout after z secondsN)rm   r   r   ro   rt   rx   )rr   r   ro   rt   r   ra   r   ZTimeoutExpired.__init__`  s-    t	#G9H5r`   c                r   r   )r   r   ro   rt   r   r   ra   r   ZTimeoutExpired.__reduce__g  s$    txx CDDr`   )rx   rt   ro   r   r   r   r   r   ra   r   r   Y  s"      J6E Er`   r   c                s|     \        V 4      V,          ^d,          pVe   \        W24      pV#   \         d     R# i ; i)z5Calculate percentage usage of 'used' against 'total'.g        )floatZroundZZeroDivisionError)usedtotalZround_ret   &&& ra   rI   rI   p  sE    T{U"c) $C
  s   , ;;c                sf   a a \         P                  ! S 4      VV 3R l4       pV3R lp/ oW!n        V# )aq  A simple memoize decorator for functions supporting (hashable)
positional arguments.
It also provides a cache_clear() function for clearing the cache:

>>> @memoize
... def foo()
...     return 1
    ...
>>> foo()
1
>>> foo.cache_clear()
>>>

It supports:
 - functions
 - classes (acts as a @singleton)
 - staticmethods
 - classmethods

It does NOT support:
 - methods
c                  s   < V \        \        VP                  4       4      4      3p SV,          #   \         d+     S! T / TB ;pST&   M  \         d	   pTR hR p?ii ; iTu # i ; ir   )Z	frozensetZsortedr}   KeyError	Exception)argskwargskeyr   errcachefuns   *,   ra   wrapperZmemoize.<locals>.wrapper  su    Yvflln567	: 	$#&#7#77eCj $t#$J	s2   0 A%A
	A%
AAAA%$A%c                 s(   < S P                  4        R# )zClear cache.N)clear)r   s   ra   cache_clearZmemoize.<locals>.cache_clear  s    r`   )	functoolswrapsr   )r   r   r   r   s   f  @ra   rF   rF   |  s7    0 __S	 	 E%Nr`   c                sj   a  \         P                  ! S 4      V 3R l4       pR pR pW!n        W1n        V# )a  A memoize decorator which is disabled by default. It can be
activated and deactivated on request.
For efficiency reasons it can be used only against class methods
accepting no arguments.

>>> class Foo:
...     @memoize
...     def foo()
...         print(1)
...
>>> f = Foo()
>>> # deactivated (default)
>>> foo()
1
>>> foo()
1
>>>
>>> # activated
>>> foo.cache_activate(self)
>>> foo()
1
>>> foo()
>>> foo()
>>>
c                 s.  <  V P                   S,          pV#   \         d#     S! T 4      u #   \         d	   pTR hR p?ii ; i\         dG     S! T 4      pM  \         d	   pTR hR p?ii ; i YP                   S&    T#   \         d      T# i ; ii ; ir   )_cacheAttributeErrorr   r   )rr   r   r   r   s   &  ra   r   Z'memoize_when_activated.<locals>.wrapper  s    	++c"C( 
'  	$$4y  $t#$ 	$$i $t#$#&C 
 
	 "  
		sn    B.BA<ABBABA+#A&&A++B/B  BBBBc                s    / V n         R# )zcActivate cache. Expects a Process instance. Cache will be
stored as a "_cache" instance attribute.
N)r   Zprocr   ra   cache_activateZ.memoize_when_activated.<locals>.cache_activate  s     r`   c                s0     V = R#   \         d     R# i ; i)zDeactivate and clear cache.N)r   r   r   r   ra   cache_deactivateZ0memoize_when_activated.<locals>.cache_deactivate  s    	 		s    )r   r   r   r   )r   r   r   r   s   f   ra   memoize_when_activatedr     s=    6 __S 2 ,/Nr`   c                s     \         P                  ! V 4      p\        P                  ! VP                  4      #   \         d    h \
         d     R# i ; i)zSame as os.path.isfile() but does not swallow EACCES / EPERM
exceptions, see:
http://mail.python.org/pipermail/python-dev/2012-June/120787.html.
F)osstatZS_ISREGZst_modePermissionErrorOSError)rj   Zst   & ra   rE   rE     sH    
(WWT] ||BJJ''   s   8 AAAc                sn     \         P                  ! V 4       R#   \         d    h \         d     R# i ; i)zSame as os.path.exists() but does not swallow EACCES / EPERM
exceptions. See:
http://mail.python.org/pipermail/python-dev/2012-June/120787.html.
TF)r   r   r   r   )rj   r   ra   rH   rH     s6    

    s    444c                 s*   \         P                  '       d	   \        f   R#  \         P                   ! \        \         P                  4      ;_uu_ 4       p V P	                  R4       RRR4       R#   + '       g   i     R# ; i  \
         d     R# i ; i)z2Return True if IPv6 is supported on this platform.NFT)z::1i    )socketZhas_ipv6r   r   Zbindr   )Zsocks    ra   rJ   rJ     sd     ???h.]]8V%7%788DIIj! 9 98 s/   1B A/%B /B 	:B  B BBc                s    / p^ p\         p V P                  RV4      pWB8:  d    V# V P                  RW$4      pWR8  d,   WV pW^,           V pV'       d   VP                  4       pWqV&   V^,           pKj  )zCParse a C environ block of environment variables into a dictionary.Z rw   )r   ZfindZupper)Zdatar   ZposZWINDOWS_Znext_posZ	equal_posr   rk   s   &       ra   rG   rG     s     C
C H
99T3'? J IIc31	?9%CQ2EiikHlr`   c                V     \         P                  ! V 4      #   \         d    T u # i ; i)zyConvert a numeric socket family value to an IntEnum member.
If it's not a known member, return the numeric value itself.
)r   ZAddressFamily
ValueErrorZnumr   ra   rK   rK   7  s,    ##C(( 
    ((c                r   )zwConvert a numeric socket type value to an IntEnum member.
If it's not a known member, return the numeric value itself.
)r   Z
SocketKindr   r   r   ra   rL   rL   A  s,      %% 
r   c           	     sl   V\         P                  \        09   d#   V'       d
   \        V!  pV'       d
   \        V!  pV\         P                  8X  d)   V\        \        09   d   VP                  V\        4      pM\        p\        V4      p\        V4      pVf   \        WW#WE4      # \        WW#WEV4      # )z2Convert a raw connection tuple to a proper ntuple.)r   r   r   rl   r   Zgetr   rK   rL   r0   r9   )rc   ZfamZtype_laddrraddrstatusZ
status_mapro   s   &&&&&&&&ra   rS   rS   K  s    
v~~x((%LE%LE"""sw.A'A	2
#
CU#E
{ReE::ReE3??r`   c                s   ^ RI pV P                  '       d   V P                  '       g   R# V P                  \        P
                  8X  d@   \        VP                  V P                   RV P                   2RR7      P                  4      # V P                  \        P                  8X  d@   \        VP                  V P                   RV P                   2RR7      P                  4      # R# )zZGiven the address ntuple returned by ``net_if_addrs()``
calculates the broadcast address.
NZ/F)Zstrict)	ipaddressaddressnetmaskfamilyr   r   ZstrZIPv4NetworkZbroadcast_addressr   ZIPv6Network)rl   r   r   ra   broadcast_addrr   ^  s     <<<t|||{{fnn$!!<<.$,,0 " 
 	

 {{foo%!!<<.$,,0 " 
 	
 &r`   c                s   a  V 3R lpV# )z{A decorator which can be used to mark a method as deprecated
'replcement' is the method name which will be called instead.
c                 s   <a V P                    R S R2oV P                  f   SV n        \        P                  ! V 4      VV3R l4       pV# )z*() is deprecated and will be removed; use z
() insteadc                 sb   < \         P                  ! S\        ^R7       \        V S4      ! V/ VB # )i   )ZcategoryZ
stacklevel)warningsZwarnZDeprecationWarningrq   )rr   r   r   rx   replacements   &*,ra   innerZ/deprecated_method.<locals>.outer.<locals>.inner  s+    MM#(:qI4-t>v>>r`   )r[   r   r   r   )r   r   rx   r   s   & @ra   outerZ deprecated_method.<locals>.outery  sW    ||n }J( 	 ;;CK			? 
	? r`   rZ   )r   r   s   f ra   rD   rD   t  s    
 Lr`   c                   sL   a  ] tR tRt o RtR tR tR tR tRR lt	R	 t
R
tV tR# )_WrapNumbersi  zFWatches numbers so that they don't overflow and wrap
(reset to zero).
c                sd    \         P                  ! 4       V n        / V n        / V n        / V n        R # r   )	threadingZLocklockr   	remindersreminder_keysr   r   ra   r   Z_WrapNumbers.__init__  s&    NN$	
r`   c                s*   W P                   9  g   Q hW P                  9  g   Q hW P                  9  g   Q hWP                   V&   \        P                  ! \
        4      V P                  V&   \        P                  ! \        4      V P                  V&   R # r   )r   r   r   rp   ZdefaultdictZintset)rr   
input_dictrt   s   &&&ra   	_add_dictZ_WrapNumbers._add_dict  st    ::%%%>>)))-----%

4*66s;t#.#:#:3#?4 r`   c                s>   V P                   V,          p\        VP                  4       4      \        VP                  4       4      ,
          pV FL  pV P                  V,          V,           F  pV P                  V,          V K  	  V P                  V,          V KN  	  R# )zvIn case the number of keys changed between calls (e.g. a
disk disappears) this removes the entry from self.reminders.
N)r   r   keysr   r   )rr   r   rt   old_dictZ	gone_keysZgone_keyremkeys   &&&    ra   _remove_dead_remindersZ#_WrapNumbers._remove_dead_reminders  s~     ::d#(3z/@+AA	!H,,T28<<NN4(0 =""4(2 "r`   c                s   W P                   9  d   V P                  W4       V# V P                  W4       V P                   V,          p/ pV F  pW,          p W5,          p. p\	        \        T4      4       F  p	Yi,          p
Yy,          pYY3pY8  dP   T P                  T,          T;;,          T,          uu&   T P                  T,          T,          P                  T4       TP                  YP                  T,          T,          ,           4       K  	  \        T4      YE&   K  	  WP                   V&   V#   \         d	    YdT&    K  i ; i)z\Cache dict and sum numbers which overflow and wrap.
Return an updated copy of `input_dict`.
)r   r   r   r   ZrangeZlenr   r   ZaddappendZtuple)rr   r   rt   r   Znew_dictr   Zinput_tupleZ	old_tupleZbitsiZinput_valueZ	old_valuer   s   &&&          ra   runZ_WrapNumbers.run  s%    zz!NN:,##J5::d#C$/K$M	 D3{+,)n%L	*NN4(0I=0&&t,S155f=K..*>v*FFG - "$KHM+ . &

4)   !,	s   D55EENc                s   V P                   ;_uu_ 4        VfP   V P                  P                  4        V P                  P                  4        V P                  P                  4        MTV P                  P                  VR4       V P                  P                  VR4       V P                  P                  VR4       RRR4       R#   + '       g   i     R# ; i)z>Clear the internal cache, optionally only for function 'name'.N)r   r   r   r   r   Zpop)rr   rt      &&ra   r   Z_WrapNumbers.cache_clear  s    YYY|

  "$$&""((*

tT*""4.""&&tT2 YYYs   B(CC	c                s    V P                   ;_uu_ 4        V P                  V P                  V P                  3uuRRR4       #   + '       g   i     R# ; i)z5Return internal cache dicts as a tuple of 3 elements.N)r   r   r   r   r   r   ra   
cache_infoZ_WrapNumbers.cache_info  s/    YYYJJ0B0BC YYYs   #AA	)r   r   r   r   r   )r[   r\   r]   r^   r   r   r   r   r   r   r   r_   r   r   r   ra   r   r     s1      @	3%N
3D Dr`   r   c                s    \         P                  ;_uu_ 4        \         P                  W4      uuRRR4       #   + '       g   i     R# ; i)zGiven an `input_dict` and a function `name`, adjust the numbers
which "wrap" (restart from zero) across different calls by adding
"old value" to "new value" and return an updated dict.
N)_wnr   r   )r   rt   r   ra   rM   rM     s%    
 
wwz( 
s	   9A
	c                 s&    \        V R \        R7      # )Zrb)	buffering)openFILE_READ_BUFFER_SIZE)fnamer   ra   rO   rO     s    t'<==r`   c                s    \        V \        \        \        R7      p \        Vn        V#   \
         d     T# \         d    TP                  4        h i ; i)zYOpen a file in text mode by using the proper FS encoding and
en/decoding error handlers.
)r   encodingerrors)r   r   r.   r/   Z_CHUNK_SIZEr   r   Zclose)r   Zfobjr   ra   rN   rN     sa     '	D 1 K  
 K	  

s   * AAAc                s:   V\         J d,   V! V 4      ;_uu_ 4       pVP                  4       uuRRR4       #  V! V 4      ;_uu_ 4       pVP                  4       uuRRR4       #   + '       g   i     R# ; i  + '       g   i     R# ; i  \         d    Tu # i ; i)zRead entire file content and return it as a string. File is
opened in text mode. If specified, `fallback` is the value
returned in case of error, either if the file does not exist or
it can't be read().
N)_DEFAULTZreadr   )r   fallback_openZfr   ra   rP   rP     sn     85\\Q668 \	uvvx 	 \\  	O	s:   A"B
 A6
B
 "A3	6B	B
 B
 
BBc                s$    \        W\        R7      # )z,Same as above but opens file in binary mode.)r   r   )rP   rO   )r   r   r   ra   rQ   rQ   ,  s    u{;;r`   c                s\   Rp/ p\        VR,          4       F  w  rE^V^,           ^
,          ,          W5&   K   	  \        VR,          4       FD  p\        V 4      W6,          8  g   K  \        V 4      W6,          ,          pV\	        4       ,          u # 	  V\        V^ ,          V R7      ,          # )zUsed by various scripts. See: https://code.activestate.com/recipes/578019-bytes-to-human-human-to-bytes-converter/?in=user-4178764.

>>> bytes2human(10000)
'9.8K'
>>> bytes2human(100001221)
'95.4M'
:i   NN)symbolrk   )	ZBZKZMZGZTZPZEZZZY)Z	enumerateZreversedZabsr   Zlocalsdict)Znr{   ZsymbolsZprefixr   sr   rk   s   &&      ra   rR   rR   1  s     <GF'"+&!a%2%	 '72;'q6V^#!Hv~-EFH$$ ( D
!444r`   c                 sD    \         P                  R,          P                  # )z+Return updated psutil.PROCFS_PATH constant.rn   )sysZmodulesZPROCFS_PATHrZ   r`   ra   get_procfs_pathr   D  s    ;;x ,,,r`   c                 s8    V P                  \        \        R 7      # ))r   r   )decoder.   r/   )r   r   ra   r   r   I  s    88Xm8<<r`   c                 s    \         P                  R 8X  d   R#  ^ RIpV P                  4       '       g   Q hVP	                  4        VP                  R4      ^ 8  g   Q h R#   \         d     R# i ; i)rX   TNcolorsF)r   rt   cursesZisattyZ	setuptermZtigetnumr   )filer   r   ra   rV   rV   R  sd    	ww$	{{}}}x(1,,,   s   A  *A   A/.A/Fc                sh   \        4       '       g   V # . p\        RRRRRRRRR	R
7	      pRVR&    WA,          pTP                  T4       T'       d   TP                  R4       RRP                  T4       RT  R2#   \         d.    RT: R\        TP	                  4       4       2p\        T4      Rhi ; i)z*Return an highlighted version of 'string'.Z34Z33Z30Z32Z37Z36Z91Z35Z93)	ZbluebrownZdarkgreygreenZgreyZ	lightblueredZvioletyellowZ29Ninvalid color z; choose amongst Z1z[Z;Zmz[0m)rV   r   r   listr   r   r   r|   )r   colorboldZattrr   rx   s   &&&   ra   rU   rU   b  s    !!D
F F4L( 	KKC388D>"!A3g..  (ui'8fkkm9L8MNo4'(s   A9 98B1c                s   \        4       '       g   \        WR7       R# \        '       d   \        \        WV4      VR7       R# ^ RIp^pVP
                  P                  P                  pVP
                  P                  P                  p\        ^^^^R7      pWXR&    W,          pT'       d   T^8:  d
   T^,          pT\        P                  J d   RMRp
TP                   Tn        T! T
4      pT! Y4        \        YR7       T! Y4       R#   \         d/    RT: R\        TP                  4       4      : 2p	\        T	4      Rhi ; i  T! Y4       i ; i)z$Print a colorized version of string.r   N)r   r   r   r   r   z; choose between ii)rV   printr   rU   ctypesZwindllZKernel32GetStdHandleSetConsoleTextAttributer   r   r   r   r   r   stderrZc_ulongZrestype)r   r   r   r   r   ZDEFAULT_COLORr   r   r   rx   Z	handle_idZhandles   &&&&        ra   rW   rW   ~  s/     !!a	fQt$40}}--::MM"":: 	  A1Aa8$t	,ME EQJQJE3::-C3	%~~i(.	;!#F:!  	, 	 *'*,  S/t+	,  $F:s   D 8E
 9E

Ec                s<   \         '       d   ^ RIpVP                  VP                  4       P                  4      w  r#rEp\        V \        4      '       d#   \        V \        4      '       d   RV  2p MRV : 2p \        RV RV RV  2\        P                  R7       R# R# )z@If PSUTIL_DEBUG env var is set, print a debug message to stderr.Nz	ignoring zpsutil-debug [Z:z]> r   )r   inspectZgetframeinfoZcurrentframeZf_backZ
isinstancer   r   r   r   r   )rx   r   r   ZlinenoZ_Z_linesZ_indexs   &      ra   rT   rT     s    |+2+?+?  ")),
(q& c9%%#w''!#'!#)UG1VHCu5CJJ	
 r`   )ZfreebsdZmidnightbsd)ZsunosZsolaris)r   r   freepercentZsinZsout)r   r   r   r   )
read_countwrite_count
read_byteswrite_bytesZ	read_timeZ
write_time)ZdeviceZ
mountpointZfstypeZopts)Z
bytes_sentZ
bytes_recvZpackets_sentZpackets_recvZerrinZerroutZdropinZdropout)rt   ZterminalZhostZstartedro   )rc   r   typer   r   r   ro   )r   r   r   Z	broadcastZptp)ZisupZduplexZspeedZmtuZflags)Zctx_switchesZ
interruptsZsoft_interruptsZsyscalls)re   ZminZmax)rg   re   ZhighZcritical)r   ZsecsleftZpower_plugged)ZuserZsystemZchildren_userZchildren_system)ZidZ	user_timeZsystem_time)ZrealZ	effectiveZsaved)r  r  r  r  )rc   r   r  r   r   r   r   i   )z%(value).1f%(symbol)s)NF)r   rp   Zenumr   r   r   r   r   r   r   r    r   r   r   r   ZImportErrorr   ZboolZgetenvr   Zobjectr   Z__all__rt   r   r   ZplatformZ
startswithr	   r   r   r   r   r
   r   r   ZAIXr$   r%   r!   r&   r(   r,   r    r*   r+   r"   r#   r)   r'   r-   r   r   r   r   r   r   r   r   r   r   r   r   ZIntEnumrY   ZglobalsZupdateZ__members__rb   Zgetfilesystemencodingr.   Zgetfilesystemencodeerrorsr/   rA   r=   r;   r<   r>   rB   r9   r?   r@   r:   rd   rf   rh   ri   r1   r6   r7   r8   r3   r4   r5   r2   r0   rl   rC   r   rm   r   r   r   r   rI   rF   r   rE   rH   rJ   rG   rK   rL   rS   r   rD   r   rM   r   r   r   r   rO   rN   rP   rQ   rR   r   r   ZstdoutrV   rU   rW   rT   rZ   r`   ra   <module>r     s7	  
    	   
   "   
 BIIn-.8')24;=BDK  
 
 $
 &4
 6H  ' )8 :G  ! #2 4D  ) +?  ' )6 8G  ( *: <N  , .@  % '6  !   !  ",!$ %$ %$ #%$ %,%$ .3%$ 5>%$ @K%& '& '&  '& "-'& /8'& :E'( )( )( ')( )4)( 6=)( ?F), -, %-, '6-, 8A-. /. 0/. 2A/0 10 '10 );10 =K12 32 32 !&32 (.34 54 $54 &-58 98 %98 '49L 	7
''T/()
,,
!
!"<
=
,,
!
!)
,		 	 	*""""F 45	lle$   $    ! 
	  	  && '$,, 
 	  (( ) $$&--/ 	7 % 	& &JK

Y !< = {$NO		H 4 
5
 	7JK7 . 	/ jJL {BD	 NP	 j";<
79 j"JK&7I./ G	 {VTN3	
Y B
C7:;7:;	E YG 4
5	H{M:	;A	
 &4.) 
Wh(;
*CD	Wh+/
gY&	Wh*.
gY%
gx ;
";<wi+z23xj;
34		 (k]+(j\* 
 ufy;
*CDEF>I >BAE A"LM L&A5 AEU E.	*ZDN( 		 		8@&
,.TD TDn) n?? ..  " >4 !	 " " <
5&-
= 	!jj  	/: CJJ%;P
U  H  Gs$    T: U
 :	UU
	UU