
    g+t              
       
   d Z ddlmZ ddlmZ ddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddlZddlmZ ddl	mZ ddl	mZ ddl	mZ 	 dd	l	mZ 	 dd
l	mZ ej*                  d   dk\  ZerddlZndZ e ej2                  d            Z e       Zg dZej<                  dk(  Zej<                  dk(  Z ejB                  jE                  d      Z#ejB                  jE                  d      Z$e$Z%ejB                  jE                  d      Z&ejB                  jE                  d      Z'ejB                  jE                  d      Z(e&xs e'xs e(Z)ejB                  jE                  d      Z*ejB                  jE                  d      Z+dZ,dZ-dZ.dZ/dZ0dZ1dZ2dZ3dZ4d Z5d!Z6d"Z7d#Z8d$Z9d%Z:d&Z;d'Z<d(Z=d)Z>d*Z?d+Z@d,ZAd-ZBd.ZCd/ZDd0ZEed1ZFd2ZGdZHn5 G d3 d4ej                        ZJ eK       j                  eJj                         ed5ZNd6ZOn5 G d7 d8ej                        ZP eK       j                  ePj                          ej                         ZResd9ZSn	  ej                         ZS ed;g d<      ZV ed=g d>      ZW ed?g d@      ZX edAg dB      ZY edCg dD      ZZ edEg dF      Z[ edGg dH      Z\ edIg dJ      Z] edKg dL      Z^ edMg dN      Z_ edOg dP      Z` edQg dR      Za edSg dT      Zb edUdVdWg      Zc edXg dY      Zd edZd[d\g      Ze ed]g d^      Zf ed_g d`      Zg edag d`      Zh edbg dc      Zi edddedfg      Zj edgdhdig      Zk edjg dk      Zl edldmdng      ZmeeegeegfeegegfegegfeegegfegegfeegeegfegeegfegeegfdoZneenj                  egegfegegfdp       eenj                  dqegeegfi        G dr dseo      Zp G dt duep      Zq G dv dweq      Zr G dx dyep      Zs G dz d{ep      Zter! euevew      revd|   Zxn	 eyevd|      Zx exd}       nd~ ZzddZ{d Z|d Z}d Z~d Ze|d        Zd Zd Zd ZddZd Z G d d      Zd Z e       Zej                  e_        ej                  e_        dZd Zd ZeefdZefdZddZd Zerd Znd Ze|ej&                  fd       ZddZddej&                  fdZd Zy# e$ r dZY w xY w# e$ r dZY w xY w# eU$ r
 erd:nd9ZSY w xY w)z9Common objects shared by __init__.py and _ps*.py modules.    )division)print_functionN)
namedtuple)AF_INET)
SOCK_DGRAM)SOCK_STREAM)AF_INET6)AF_UNIX   PSUTIL_DEBUG)R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_colorposixntlinuxdarwin)freebsdmidnightbsdopenbsdnetbsd)sunossolarisaixrunningsleepingz
disk-sleepstoppedztracing-stopzombiedeadz	wake-killwakingidlelockedwaiting	suspendedparkedESTABLISHEDSYN_SENTSYN_RECV	FIN_WAIT1	FIN_WAIT2	TIME_WAITCLOSE
CLOSE_WAITLAST_ACKLISTENCLOSINGNONE      c                       e Zd ZdZdZdZy)	NicDuplexr   r   r   N)__name__
__module____qualname__r#   r$   r%        C/var/www/openai/venv/lib/python3.12/site-packages/psutil/_common.pyr   r      s    r   r   c                       e Zd ZdZdZy)BatteryTimer   r   N)r   r   r   POWER_TIME_UNKNOWNPOWER_TIME_UNLIMITEDr   r   r   r   r      s    !r   r   replacesurrogateescaperG   )totalusedfreepercentsinsoutrC   )r   r   r   r   rA   )
read_countwrite_count
read_byteswrite_bytes	read_time
write_timerB   )device
mountpointfstypeoptsrD   )
bytes_sent
bytes_recvpackets_sentpackets_recverrinerroutdropindropoutrH   )nameterminalhoststartedpidr?   )fdfamilytypeladdrraddrstatusr   rE   )r   addressnetmask	broadcastptprF   )isupduplexspeedmtuflagsr@   )ctx_switches
interruptssoft_interruptssyscallsscpufreq)currentminmaxshwtemp)labelr   highcriticalsbattery)r   secsleftpower_pluggedsfanr   r   r7   )usersystemchildren_userchildren_systemr<   pathr   r=   )id	user_timesystem_timer>   )real	effectivesavedr9   r:   )r   r   r   r   r;   ioclassvaluer8   	voluntaryinvoluntaryr6   )r   r   r   r   r   r   addripport)alltcptcp4udpudp4inetinet4inet6)tcp6udp6unixc                   &    e Zd ZdZdZd Zd Zd Zy)ErrorzQBase exception class. All other psutil exceptions inherit
    from this one.
    psutilc                     t        j                         }|D ](  }t        | |d       }|r|||<   |dk(  s|dk(  s$|||<   * |S )Nr   r   )collectionsOrderedDictgetattr)selfattrsinfor   r   s        r   	_infodictzError._infodict$  sQ    &&(DD$-E"T
5A:"T
  r   c           
         | j                  d      }|r;ddj                  |j                         D cg c]  \  }}|d| c}}      z  }nd }dj                  t        | dd      |fD cg c]  }|s|	 c}      S c c}}w c c}w )N)r   ppidr   z(%s), = msg )r   joinitemsr   )r   r   kvdetailsxs         r   __str__zError.__str__.  s    ~~56tyy.2jjl;ldaAq!l;  G GxxWT5"%=w$GM$Gq1$GMNN	 < Ns   B -B5Bc           	          | j                  d      }dj                  |j                         D cg c]  \  }}|d| c}}      }d| j                  j                  d|dS c c}}w )N)r   r   r   secondsr   r   r   zpsutil.())r   r   r   	__class__r   )r   r   r   r   r  s        r   __repr__zError.__repr__9  sX    ~~GH))$**,G,$!Q1-,GH"&.."9"97CC Hs   A&
N)r   r   r   __doc__r   r  r	  r   r   r   r   r     s     J	ODr   r   c                   "    e Zd ZdZdZddZd Zy)NoSuchProcesszXException raised when a process with a certain PID doesn't
    or no longer exists.
    r   Nc                 `    t         j                  |        || _        || _        |xs d| _        y )Nzprocess no longer existsr   __init__r   r   r   r   r   r   r   s       r   r  zNoSuchProcess.__init__G  s)    t	44r   c                 `    | j                   | j                  | j                  | j                  ffS Nr  r   r   r   r   s    r   
__reduce__zNoSuchProcess.__reduce__M  $    499dhh ?@@r   NNr   r   r   r
  r  r  r   r   r   r  r  @  s     J5Ar   r  c                   "    e Zd ZdZdZddZd Zy)ZombieProcessa1  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.
    r   Nc                 X    t         j                  | |||       || _        |xs d| _        y )Nz"PID still exists but it's a zombie)r  r  r   r   )r   r   r   r   r   s        r   r  zZombieProcess.__init__[  s*    tS$4	>>r   c                 v    | j                   | j                  | j                  | j                  | j                  ffS r  )r  r   r   r   r   r  s    r   r  zZombieProcess.__reduce__`  s*    499dii JKKr   NNNr  r   r   r   r  r  Q  s     J?
Lr   r  c                   "    e Zd ZdZdZddZd Zy)AccessDeniedz@Exception raised when permission to perform an action is denied.r   Nc                 `    t         j                  |        || _        || _        |xs d| _        y )Nr   r  r  s       r   r  zAccessDenied.__init__i  s'    t	9"r   c                 `    | j                   | j                  | j                  | j                  ffS r  r  r  s    r   r  zAccessDenied.__reduce__o  r  r   r  r  r   r   r   r  r  d  s    JJAr   r  c                   "    e Zd ZdZdZddZd Zy)TimeoutExpiredzWRaised on Process.wait(timeout) if timeout expires and process
    is still alive.
    r   Nc                 l    t         j                  |        || _        || _        || _        d|z  | _        y )Nztimeout after %s seconds)r   r  r  r   r   r   )r   r  r   r   s       r   r  zTimeoutExpired.__init__z  s/    t	-7r   c                 `    | j                   | j                  | j                  | j                  ffS r  )r  r  r   r   r  s    r   r  zTimeoutExpired.__reduce__  s$    txx CDDr   r  r  r   r   r   r#  r#  s  s     J8Er   r#  execzvdef raise_from(value, from_value):
    try:
        raise value from from_value
    finally:
        value = None
    c                     | r  r   )r   
from_values     r   
raise_fromr)    s    r   c                 d    	 t        |       |z  dz  }|t        ||      }|S # t        $ r Y yw xY w)z5Calculate percentage usage of 'used' against 'total'.d   g        )floatroundZeroDivisionError)r   r   round_rets       r   rO   rO     sG    T{U"c) V$C
  s   # 	//c                 b     t        j                          fd       }fd}i ||_        |S )a  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                      | t        t        |j                                     f}	 |   S # t        $ r1 	  | i |x}|<   n# t        $ r}t        |d       d }~ww xY w|cY S w xY wr  )	frozensetsortedr   KeyError	Exceptionr)  )argskwargskeyr0  errcachefuns        r   wrapperzmemoize.<locals>.wrapper  sz    Yvflln567	: 	,#&#7#77eCj , d++,J	s2   , 	A&AA&	AAAA&%A&c                  &     j                          y)zClear cache.N)clear)r;  s   r   cache_clearzmemoize.<locals>.cache_clear  s    r   )	functoolswrapsr@  )r<  r=  r@  r;  s   `  @r   rL   rL     s9    0 __S	 	 E%GNr   c                 j     t        j                          fd       }d }d }||_        ||_        |S )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                 8   	 | j                      }|S # t        $ r) 	  |       cY S # t        $ r}t        |d       d }~ww xY wt        $ rL 	  |       }n# t        $ r}t        |d       d }~ww xY w	 || j                   <   Y |S # t        $ r Y Y |S w xY ww xY wr  )_cacheAttributeErrorr6  r)  r5  )r   r0  r:  r<  s      r   r=  z'memoize_when_activated.<locals>.wrapper  s    	++c"C( 
'  	,,4y  , d++, 	,$i , d++,#&C 
 
	 "  
		sh    	B(B	A=ABAB	A1 A,,A11B5B	BBBBc                     i | _         y)zsActivate cache. Expects a Process instance. Cache will be
        stored as a "_cache" instance attribute.
        N)rE  procs    r   cache_activatez.memoize_when_activated.<locals>.cache_activate  s     r   c                 (    	 | ` y# t        $ r Y yw xY w)zDeactivate and clear cache.N)rE  rF  rH  s    r   cache_deactivatez0memoize_when_activated.<locals>.cache_deactivate  s    	 		s    	)rA  rB  rJ  rL  )r<  r=  rJ  rL  s   `   r   memoize_when_activatedrM    sA    6 __S 2 ,G/GNr   c                     	 t        j                  |       }t        j                  |j                        S # t        $ r7}|j
                  t
        j                  t
        j                  hv r Y d}~yd}~ww xY w)zSame as os.path.isfile() but does not swallow EACCES / EPERM
    exceptions, see:
    http://mail.python.org/pipermail/python-dev/2012-June/120787.html.
    NF)osstatS_ISREGst_modeOSErrorerrnoEPERMEACCES)r   str:  s      r   rK   rK     sZ    
(WWT] ||BJJ''  99ell33s   6 	A6-A11A6c                     	 t        j                  |        y# t        $ r7}|j                  t        j                  t        j
                  hv r Y d}~yd}~ww xY w)zSame as os.path.exists() but does not swallow EACCES / EPERM
    exceptions. See:
    http://mail.python.org/pipermail/python-dev/2012-June/120787.html.
    TNF)rO  rP  rS  rT  rU  rV  )r   r:  s     r   rN   rN   -  sH    

   99ell33s    	A-AAc                  ,   t         j                  rt        y	 t        j                   t        t         j                        } t	        j
                  |       5  | j                  d       ddd       y# 1 sw Y   yxY w# t         j                  $ r Y yw xY w)z2Return True if IPv6 is supported on this platform.NF)z::1r   T)sockethas_ipv6r	   r   
contextlibclosingbinderror)socks    r   rP   rP   <  sn     ??h.}}Xv'9'9:%IIj! & &<< s/   =A= A1(A= 1A:6A= :A= =BBc                     i }d}t         }	 | j                  d|      }||k  r	 |S | j                  d||      }||kD  r$| || }| |dz   | }|r|j                         }|||<   |dz   }\)zCParse a C environ block of environment variables into a dictionary.r    r   r   )r   findupper)datar0  posWINDOWS_next_pos	equal_posr9  r   s           r   rM   rM   J  s     C
C H
99T3's? J IIc31	s?s9%CQ2EiikCHl r   c                 `    t         | S 	 t        j                  |       S # t        $ r | cY S w xY w)zConvert a numeric socket family value to an IntEnum member.
    If it's not a known member, return the numeric value itself.
    )enumrZ  AddressFamily
ValueErrornums    r   rQ   rQ   f  s8     |
	'',, 	J	    --c                 `    t         | S 	 t        j                  |       S # t        $ r | cY S w xY w)zConvert a numeric socket type value to an IntEnum member.
    If it's not a known member, return the numeric value itself.
    )rk  rZ  
SocketKindrm  rn  s    r   rR   rR   s  s8     |
	$$S)) 	J	rp  c           	      H   |t         j                  t        hv r|rt        | }|rt        | }|t         j                  k(  r%|t        t        hv r|j                  |t              }nt        }t        |      }t        |      }|t        | |||||      S t        | ||||||      S )z2Convert a raw connection tuple to a proper ntuple.)rZ  r   r	   r   r   getr   rQ   rR   r6   r?   )r   famtype_r   r   r   
status_mapr   s           r   rY   rY     s    
v~~x((%LE%LE"""sw.A'A	2
#
CU#E
{ReUE6::ReUE63??r   c                       fd}|S )zA decorator which can be used to mark a method as deprecated
    'replcement' is the method name which will be called instead.
    c                     | j                   dd| j                  | _        t        j                  |       fd       }|S )Nz*() is deprecated and will be removed; use z
() insteadc                 `    t        j                  t        d        t        |       |i |S )Nr   )category
stacklevel)warningswarnDeprecationWarningr   )r   r7  r8  r   replacements      r   innerz/deprecated_method.<locals>.outer.<locals>.inner  s-    MM#(:qI-74-t>v>>r   )r   r
  rA  rB  )r<  r  r   r  s     @r   outerz deprecated_method.<locals>.outer  sI    LL
 ;;CK			? 
	? r   r   )r  r  s   ` r   rJ   rJ     s    
 Lr   c                   6    e Zd ZdZd Zd Zd Zd Zd	dZd Z	y)
_WrapNumberszNWatches numbers so that they don't overflow and wrap
    (reset to zero).
    c                 `    t        j                         | _        i | _        i | _        i | _        y r  )	threadingLocklockr;  	remindersreminder_keysr  s    r   r  z_WrapNumbers.__init__  s&    NN$	
r   c                    || j                   vsJ || j                  vsJ || j                  vsJ || j                   |<   t        j                  t
              | j                  |<   t        j                  t              | j                  |<   y r  )r;  r  r  r   defaultdictintset)r   
input_dictr   s      r   	_add_dictz_WrapNumbers._add_dict  s|    4::%%%4>>)))4-----%

4*66s;t#.#:#:3#?4 r   c                    | j                   |   }t        |j                               t        |j                               z
  }|D ]9  }| j                  |   |   D ]  }| j                  |   |=  | j                  |   |= ; y)zIn 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  )r   r  r   old_dict	gone_keysgone_keyremkeys          r   _remove_dead_remindersz#_WrapNumbers._remove_dead_reminders  s{     ::d#(3z/@+AA	!H,,T28<NN4(0 =""4(2 "r   c                 0   || j                   vr| j                  ||       |S | j                  ||       | j                   |   }i }|D ]  }||   }	 ||   }g }t	        t        |            D ]t  }	||	   }
||	   }||	f}|
|k  r;| j                  |   |xx   |z  cc<   | j                  |   |   j                  |       |j                  |
| j                  |   |   z          v t        |      ||<    || j                   |<   |S # t        $ r |||<   Y w xY w)zlCache dict and sum numbers which overflow and wrap.
        Return an updated copy of `input_dict`.
        )r;  r  r  r5  rangelenr  r  addappendtuple)r   r  r   r  new_dictr9  input_tuple	old_tuplebitsiinput_value	old_valuer  s                r   runz_WrapNumbers.run  s?    tzz!NN:t,##J5::d#C$S/K$SM	 D3{+,)!n%aL	q*NN4(0I=0&&t,S155f=K$..*>v*FFG - "$KHSM+ . &

4)   !,	s   DDDNc                    | j                   5  |O| j                  j                          | j                  j                          | j                  j                          nT| j                  j                  |d       | j                  j                  |d       | j                  j                  |d       ddd       y# 1 sw Y   yxY w)z>Clear the internal cache, optionally only for function 'name'.N)r  r;  r?  r  r  pop)r   r   s     r   r@  z_WrapNumbers.cache_clear  s    YY|

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

tT*""4.""&&tT2 YYs   B&B<<Cc                     | j                   5  | j                  | j                  | j                  fcddd       S # 1 sw Y   yxY w)z5Return internal cache dicts as a tuple of 3 elements.N)r  r;  r  r  r  s    r   
cache_infoz_WrapNumbers.cache_info  s+    YYJJ0B0BC YYs	   #:Ar  )
r   r   r   r
  r  r  r  r  r@  r  r   r   r   r  r    s(     @	3%N
3Dr   r  c                 z    t         j                  5  t         j                  | |      cddd       S # 1 sw Y   yxY w)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  r   s     r   rS   rS     s#    
 
wwz4( 
s   1:i   c                 &    t        | dt              S )Nrb	buffering)openFILE_READ_BUFFER_SIZE)fnames    r   rU   rU     s    t'<==r   c                     t         st        | t              S t        | t        t        t              }	 t        |_        |S # t        $ r Y |S t        $ r |j                           w xY w)zOn Python 3 opens a file in text mode by using fs encoding and
    a proper en/decoding errors handler.
    On Python 2 this is just an alias for open(name, 'rt').
    r  )r  encodingerrors)	PY3r  r  r4   r5   _CHUNK_SIZErF  r6  close)r  fobjs     r   rT   rT   "  st    
 E%:;;
 '	D 1 K  
 K	  

s   A 	A'A'c                     |t         u r" ||       5 }|j                         cddd       S 	  ||       5 }|j                         cddd       S # 1 sw Y   yxY w# 1 sw Y   yxY w# t        t        f$ r |cY S w xY w)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)_DEFAULTreadIOErrorrS  )r  fallback_openfs       r   rV   rV   @  sk     85\Q668 \	uvvx 	 \ ! 	O	s9   AA& A	A& AA#A& #A& &A:9A:c                 &    t        | |t              S )z,Same as above but opens file in binary mode.)r  r  )rV   rU   )r  r  s     r   rW   rW   Q  s    ux{;;r   c                     d}i }t        |dd       D ]  \  }}d|dz   dz  z  ||<    t        |dd       D ]3  }t        |       ||   k\  st        |       ||   z  }|t	               z  c S  |t        |d   |       z  S )zUsed by various scripts. See: http://goo.gl/zeJZl.

    >>> bytes2human(10000)
    '9.8K'
    >>> bytes2human(100001221)
    '95.4M'
    )	BKMGTPEZYr   N
   r   )symbolr   )	enumeratereversedabsr,  localsdict)nformatsymbolsprefixr  sr  r   s           r   rX   rX   V  s     <GF'!"+&1!a%2%q	 '712;'q6VF^#!Hvf~-EFH$$ ( D
!444r   c                  <    t         j                  d   j                  S )z+Return updated psutil.PROCFS_PATH constant.r   )sysmodulesPROCFS_PATHr   r   r   get_procfs_pathr  i  s    ;;x ,,,r   c                 8    | j                  t        t              S )N)r  r  )decoder4   r5   r  s    r   r  r  p  s    xx-x@@r   c                     | S r  r   r  s    r   r  r  u  s    r   c                     t         j                  dk(  ry	 dd l}| j                         sJ |j	                          |j                  d      dkD  sJ 	 y# t        $ r Y yw xY w)Nr_   Tr   colorsF)rO  r   cursesisatty	setuptermtigetnumr6  )filer  s     r   r\   r\   ~  sb    	ww$	{{}}x(1,,,   s   <A 	A A Fc                 8   t               s| S g }t        ddddddddd	
	      }d|d<   	 ||   }|j                  |       |r|j                  d       ddj                  |      d| dS # t        $ r& t        dt	        |j                               z        w xY w)z*Return an highlighted version of 'string'.343330323736913593)	bluebrowndarkgreygreengrey	lightblueredvioletyellow29Nz#invalid color %r; choose between %s1z[;mz[0m)r\   r  r5  rm  listr  r  r   )r  colorboldattrr  s        r   r[   r[     s    !D
F F4L
u
 	KKC"%((4.!44  
1T&++-5HI
 	

s   A* */Bc           
      n   t               st        | |       yt        rt        t        | ||      |       yddl}d}|j
                  j                  j                  }|j
                  j                  j                  }t        dddd      }||d<   	 ||   }|r
|dk  r|dz  }|t        j                  u rdnd}	|j                   |_         ||	      }
 ||
|       	 t        | |        ||
|       y# t        $ r) t        d	|d
t        |j                                     w xY w#  ||
|       w xY w)z$Print a colorized version of string.r  r   N   r         )r  r  r  r  zinvalid color z; choose between    ii)r\   printr   r[   ctypeswindllKernel32GetStdHandleSetConsoleTextAttributer  r5  rm  r  r  r  stderrc_ulongrestype)r  r   r  r  r
  DEFAULT_COLORr  r  r  	handle_idhandles              r   r]   r]     s'     !ad	fQt$40}}--::MM"":: 	  A1Aa8$t	5ME EQJQJE3::-C3	%~~i(.	;!$#FM:  	$v{{}-/ 	 $FM:s   C4 D) 42D&)D4c                 ,   t         rddl}|j                  |j                         j                        \  }}}}}t        | t              r&t        | t        t        t        f      rd| z  } nd| z  } t        d|d|d| t        j                         yy)	z@If PSUTIL_DEBUG env var is set, print a debug message to stderr.r   Nzignoring %szignoring %rzpsutil-debug [:z]> r  )r   inspectgetframeinfocurrentframef_back
isinstancer6  rS  r  EnvironmentErrorr	  r  r  )r   r  r  lineno__lines_indexs          r   rZ   rZ     s    +2+?+?  ")),
(vq&& c9%#2BCD#c)#c)*/=CJJ	
 r   r  )z%(value).1f%(symbol)s)NF)r
  
__future__r   r   r   r\  rT  rA  rO  rZ  rP  r  r  r}  r   r   r   r   r	   ImportErrorr
   version_infor  rk  boolgetenvr   objectr  __all__r   r   r   platform
startswithr   r   r   r   r   r   r   r   AIXr*   r+   r'   r,   r.   r2   r&   r0   r1   r(   r)   r/   r-   r3   r   r!   r    r   r   r"   r   r   r   r   r   r   r#   r$   r%   IntEnumr   globalsupdate__members__r   r   r   getfilesystemencodingr4   r5   getfilesystemencodeerrorsrF  rG   rC   rA   rB   rD   rH   r?   rE   rF   r@   r   r   r   r   r7   r<   r=   r>   r9   r:   r;   r8   r6   r   rI   r6  r   r  r  r  r#  r  __builtins__r  exec_r   r)  rO   rL   rM  rK   rN   rP   rM   rQ   rR   rY   rJ   r  rS   r  r@  r  r  rU   rT   rV   rW   rX   r  r  stdoutr\   r[   r]   rZ   r   r   r   <module>r4     s  
 @
   %     	   
   "    
qQD IBIIn-.8L 	7
''T/()
,,
!
!"<
=
,,
!
!)
,		 	 	*""F 45	lle$   $    ! 
	 <OODLL 
 IY**+ <"dll " I[,,- %3$$&
MB5557 	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.) h(;
*CDh+/Y&h*.Y%x ;
";<i+z23j;
34		 k]+j\* 
 fy;
*CDEF DI  DFAE A"LM L&A5 AEU E2 ,%V$f-	  		*ZDN( 	
 	
8

@&.TD TDn) n?? ..  " >< !	 " " <
5&-
 A
 	!jj  	5< CJJ$;N
g  H  GP  B-2)	Bs6   S S) S7 S&%S&)S43S47TT