
    ;^hh                     P   S r SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK	r	SSK
r
SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKJr  SSKJr  SSKJr   SSKrSSK!r!SSK!J"r"  SSK!J#r#  SSK!J$r$  SS	K!J%r%  SS
K!J&r&  SSK!J'r'  SSK!J(r(  SSK!J)r)  SSK*J+r+  SSK*J,r,  SSK*J-r-  SSK*J.r.  SSK*J/r/  \'(       a  SSK0J1r1  / SQr2S\Rf                  ;   r4S\
Rj                  ;   =(       d    S\
Rj                  ;   r6\6r7S\
Rj                  ;   r8S\
Rj                  ;   r9\Rt                  S:  r;\Rx                  " 5       S:H  r=\-S 5       r>\$(       a  \>" 5       S:  r?\>" 5       S:  r@OSr?Sr@S rAS!rBS"rCS#rD\7(       a  \AS$-  rA\DS$-  rD\BS%-  rB\CS$-  rC\
R                  S&:X  a  S'\
R                  " 5        S(3rGOS)\
R                  " 5        S(3rGS*rHS+R                  S,S-5      rJ\R                  " 5       R                  5       S.;   rM\
R                  R                  \
R                  R                  \
R                  R                  \R5      S/S/5      5      rS\
Rj                  R                  S0\
R                  R                  \SS15      5      rU\
R                  R                  \
R                  R                  \R5      5      rV\W" \!R                  S25      rY\W" \!S35      rZ\W" \!R                  S45      r[\W" \!S55      r\\W" \!R                  S65      r]\W" \!R                  S75      r^\'=(       a    \((       + r_\W" \!S85      r`\W" \!R                  S95      ra\W" \!R                  S:5      rb\W" \!R                  S;5      rc\W" \!S<5      rd \d=(       a    \e" \!R                  " 5       5      rg\W" \!S=5      ri\W" \!S>5      rj\W" \!R                  S?5      rk\$=(       d    \"=(       a    \
R                  " 5       S:g  rmS@ rn\n" 5       u  rorp\q" \
R                  SA5      rs\R                  " \sR                  5        \v" \!5       V s/ s H#  o R                  SB5      (       d  M  \x" \!U 5      PM%     sn ry\x" \SC\z" 5       5      r{\|" 5       r}\|" 5       r~ " SD SE\R                  5      rSF r\SSG j5       r\SH 5       rSI r\SJ 5       r\SK 5       r\GR                  \D4SL jrSSM jrSN rSO r " SP SQ5      r\" \!GR                  S\DSRSS9ST 5       r\" \\4S\DSRSS9SSU j5       r\" \S\DSRSS9SV 5       rSW rSX r\GR*                  SY 5       rSZ rSS[ jrSS\ jr " S] S^5      r\c  \r " S_ S`\GR6                  5      r\GR:                  GR=                  \4SaSb9 " Sc Sd\5      5       rSe rSf rSg r " Sh Si5      r " Sj Sk5      r\A4Sl jrSSm jrSSn jrSSo jr\\S4Sp jr\R<                  4Sq jrSSr jrSs r\GR*                  St 5       rSu rSv rSw rSx rSy rSz rS{ r\'(       a  \GR*                  SS| j5       rO\GR*                  SS} j5       r\R                  S~ 5       r\'(       a   \R"                  " \GR                  S 5        gg! \  a    Sr GN
f = f! \h a    Srg GNf = fs  sn f )zTest utilities.    N)AF_INET)AF_INET6)SOCK_STREAM)AIX)LINUX)MACOS)NETBSD)OPENBSD)POSIX)SUNOS)WINDOWS)bytes2human)debug)memoize)print_color)supports_ipv6)wait_pid)KDEVNULLGLOBAL_TIMEOUTTOLERANCE_SYS_MEM
NO_RETRIESPYPY
PYTHON_EXEPYTHON_EXE_ENVROOT_DIRSCRIPTS_DIRTESTFN_PREFIXUNICODE_SUFFIXINVALID_UNICODE_SUFFIX
CI_TESTINGVALID_PROC_STATUSESTOLERANCE_DISK_USAGEIS_64BITHAS_CPU_AFFINITYHAS_CPU_FREQHAS_ENVIRONHAS_PROC_IO_COUNTERS
HAS_IONICEHAS_MEMORY_MAPSHAS_PROC_CPU_NUM
HAS_RLIMITHAS_SENSORS_BATTERYHAS_BATTERYHAS_SENSORS_FANSHAS_SENSORS_TEMPERATURESHAS_NET_CONNECTIONS_UNIXMACOS_11PLUSMACOS_12PLUSCOVERAGEAARCH64PYTEST_PARALLELpyrun	terminatereap_childrenspawn_testprocspawn_zombiespawn_children_pair
ThreadTaskunittestskip_on_access_deniedskip_on_not_implementedretry_on_failureTestMemoryLeakPsutilTestCaseprocess_namespacesystem_namespaceprint_sysinfois_win_secure_system_procfake_pytestchdirsafe_rmpathcreate_py_execreate_c_exe
get_testfn
get_winverkernel_version
call_untilwait_for_pidwait_for_filecheck_net_addressfilter_proc_net_connectionsget_free_portbind_socketbind_unix_sockettcp_socketpairunix_socketpaircreate_socketsreload_moduleimport_module_by_pathwarncopyload_shared_libis_namedtuple__pypy__GITHUB_ACTIONSCIBUILDWHEELCOVERAGE_RUNPYTEST_XDIST_WORKERl        aarch64c                  B   [         R                  " 5       S   n [        [        [        U R                  S5      S S 5      5      nUS:X  aU  [        R                  " [        R                  SSS/SS	0S
S9n [        [        [        U R                  S5      S S 5      5      nU$ )Nr   .   )
      z-sS-cz-import platform; print(platform.mac_ver()[0])SYSTEM_VERSION_COMPAT0T)envuniversal_newlines)
platformmac_vertuplemapintsplit
subprocesscheck_outputsys
executable)version_strversions     G/var/www/html/env/lib/python3.13/site-packages/psutil/tests/__init__.pymacos_versionr|   z   s    ""$Q'KC[..s3BQ789G( !--?	 )#.#	
 C!2!23!7!;<=N    )rh      )   r   Frh   i  P i            javaz$psutil--z@psutil-u   -ƒőős   futf8surrogateescape>   asciius-asciiz..PSUTIL_SCRIPTS_DIRscriptscpu_affinitycpu_freqenviron
getloadavgionicememory_mapsnet_io_counterscpu_numio_countersrlimitsensors_batterysensors_fanssensors_temperaturesthreadsc            	         S n [         R                  R                  5       n[        [        SS 5      n[
        (       a-  [        R                  S:  a  Ub  [        R                  US'   X!4$ [        (       a  [        R                  U4$ [        (       a  U " [        R                  5      =(       d    U " [         R                  R                  [        R                  5      5      =(       dj    U " [        R                  " SR                  " [        R                  S S 6 5      5      =(       d)    U " [        R                   " 5       R#                  5       5      nU(       d  [%        S5      eX14$ [         R                  R                  [        R                  5      n[         R                  R'                  U5      (       d   U5       eX14$ )Nc                      [         R                  " U S/[         R                  [         R                  S9  U $ ! [         R                   a     g f = f)Nz-V)stdoutstderr)ru   
check_callPIPECalledProcessError)exes    r{   attempt_get_py_exe.<locals>.attempt   sI    	!!dJOOJOO J ,, 		s   48 AA_base_executable)r      __PYVENV_LAUNCHER__zpython{}.{}rg   z"can't find python exe real abspath)osr   copygetattrrw   r   version_inforx   r`   r   pathrealpathshutilwhichformatpsutilProcessr   
ValueErrorexists)r   rm   baser   s       r{   _get_py_exer      sI    **//
C 3*D1Dw3##v-$2B &)^^!"y	~~s""	CNN# /rww''78/]1133C3CBQ3GHI/
 v~~'++-. 	 ABBxggs~~.ww~~c""'C'"xr}   zr+STATUS_AF_UNIXc                   P   ^  \ rS rSrSrU 4S jrS rS rS rS r	S r
S	 rS
rU =r$ )r<   i  z6A thread task which does nothing expect staying alive.c                 r   > [         TU ]  5         SU l        SU l        [        R
                  " 5       U l        g )NFMbP?)super__init___running	_interval	threadingEvent_flag)self	__class__s    r{   r   ThreadTask.__init__  s*    __&
r}   c                 n    U R                   R                  nSU SU R                   S[        U 5      S S3$ )N<z	 running=z at z#x>)r   __name__r   idr   names     r{   __repr__ThreadTask.__repr__  s6    ~~&&4&	$--RXbMCCr}   c                 &    U R                  5         U $ N)startr   s    r{   	__enter__ThreadTask.__enter__#  s    

r}   c                 $    U R                  5         g r   )stop)r   argskwargss      r{   __exit__ThreadTask.__exit__'  s    		r}   c                     U R                   (       a  [        S5      e[        R                  R	                  U 5        U R
                  R                  5         g)zoStart thread and keep it running until an explicit
stop() request. Polls for shutdown every 'timeout' seconds.
zalready startedN)r   r   r   Threadr   r   waitr   s    r{   r   ThreadTask.start*  s9     ==.//t$

r}   c                     SU l         U R                  R                  5         U R                   (       a4  [        R                  " U R
                  5        U R                   (       a  M3  g g )NT)r   r   settimesleepr   r   s    r{   runThreadTask.run3  s9    

mmJJt~~& mmmr}   c                 j    U R                   (       d  [        S5      eSU l         U R                  5         g)z8Stop thread execution and and waits until it is stopped.zalready stoppedFN)r   r   joinr   s    r{   r   ThreadTask.stop9  s%    }}.//		r}   )r   r   r   )r   
__module____qualname____firstlineno____doc__r   r   r   r   r   r   r   __static_attributes____classcell__)r   s   @r{   r<   r<     s/    @'D' r}   r<   c                 F   ^  [         R                  " T 5      U 4S j5       nU$ )Nc                  H   >  T" U 0 UD6$ ! [          a    [        5         e f = fr   )	Exceptionr8   )r   r   funs     r{   wrapper&_reap_children_on_err.<locals>.wrapperG  s/    	''' 	O	s    !	functoolswraps)r   r   s   ` r{   _reap_children_on_errr   F  s%    __S  Nr}   c                    UR                  S[        5        UR                  S[        5        UR                  S[        R                  " 5       5        UR                  S[        5        [
        (       a  SnUR                  SU5        U c{  [        [        R                  " 5       S9n [        U5        SU S	3n[        S
U/n [        R                  " U 40 UD6n[        R                  U5        [        USSS9  [        U5        U$ [        R                  " U 40 UD6n[        R                  U5        [        UR                  5        U$ ! [        U5        f = f)ac  Create a python subprocess which does nothing for some secs and
return it as a subprocess.Popen instance.
If "cmd" is specified that is used instead of python.
By default stdin and stdout are redirected to /dev/null.
It also attempts to make sure the process is in a reasonably
initialized state.
The process is registered for cleanup on reap_children().
stdinr   cwdrm      creationflagsdirzimport time;open(r'z6', 'w').close();[time.sleep(0.1) for x in range(100)];rj   Tdeleteempty)
setdefaultr   r   getcwdr   r   rL   rI   r   ru   Popen_subprocesses_startedaddrQ   rP   pid)cmdkwdsCREATE_NO_WINDOWtestfnpylinesprocs         r{   r9   r9   R  s'    	OOGW%OOHg&OOE299;'OOE>*w %)9:
{		,	   "99 
 tV,C$$S1D1E!%%e,&T:
 L   --!!%(UYYL s   'AE Ec                  <   Sn [        [        R                  " 5       S9n [        R                  " S[        R
                  R                  U5       S[         S35      n[        (       a  [        USS9u  p0O[        U5      u  p0[        R                  " UR                  5      n[        [        USS	S
95      n[        R!                  U5        [        R                  " U5      nXF4[#        U5        U b  [#        U 5        $ $ ! [#        U5        U b  [#        U 5        f f = f)zCreate a subprocess which creates another one as in:
A (us) -> B (child) -> C (grandchild).
Return a (child, grandchild) tuple.
The 2 processes are fully initialized and will live for 60 secs
and are registered for cleanup on reap_children().
Nr   zl            import subprocess, os, sys, time
            s = "import os, time;"
            s += "f = open('z', 'w');"
            s += "f.write(str(os.getpid()));"
            s += "f.close();"
            s += "[time.sleep(0.1) for x in range(100 * 6)];"
            p = subprocess.Popen([r'z.', '-c', s])
            p.wait()
            r   )r   TFr   )rL   r   r  textwrapdedentr   basenamer   r   r6   r   r   r  rs   rQ   _pids_startedr  rI   )tfiler	  ssubpchildgrandchild_pid
grandchilds          r{   r;   r;   |  s    EBIIK(FOO !  WW--f56 7% &0L 1	 	 73KD%(KDtxx(]6$eLM.)^^N3
"F  	F s   CC? ?Dc                    ^ [         R                  (       d   e[        5       n [        R                  " SU  S35      nSn[        U 5      n UR                  [        5        [        U5      u  pBUR                  5       u  pV [        R                  " UR                  5       // / [        5        [        UR                  S5      5      n[        R                  U5        [         R                   " U5      m[#        U4S j5        UT4UR%                  5         UR%                  5         ['        U 5        Ub  ['        U5        $ $ ! UR%                  5         f = f! UR%                  5         ['        U 5        Ub  ['        U5        f f = f)zCreate a zombie process and return a (parent, zombie) process tuple.
In order to kill the zombie parent must be terminate()d first, then
zombie must be wait()ed on.
a          import os, sys, time, socket, contextlib
        child_pid = os.fork()
        if child_pid > 0:
            time.sleep(3000)
        else:
            # this is the zombie process
            with socket.socket(socket.AF_UNIX) as s:
                s.connect('za')
                pid = bytes(str(os.getpid()), 'ascii')
                s.sendall(pid)
        N   c                  F   > T R                  5       [        R                  :H  $ r   )statusr   STATUS_ZOMBIE)zombies   r{   <lambda>spawn_zombie.<locals>.<lambda>  s    v}}&2F2FFr}   )r   r   rL   r  r  rV   
settimeoutr   r6   acceptselectfilenors   recvr  r  r   rO   closerI   )		unix_filesrcr  sockparentconn_zpidr  s	           @r{   r:   r:     s3   
 <<<I
//  &; '	 C EI&D'c
++-	MM4;;=/2r>Btyy'Dd#^^D)FFGF#JJL

I 	 JJL

I s%   4E  BD> E >EE ,E?c                 j   UR                  SS5        UR                  SS5        [        5       n [        US5       nUR                  U 5        SSS5        [	        [
        WR                  /40 UD6n[        UR                  5        XB4$ ! , (       d  f       NB= f! [         a    [        U5        e f = f)zRun python 'src' code string in a separate interpreter.
Returns a subprocess.Popen instance and the test file where the source
code was written.
r   Nr   w)r   rL   openwriter9   r   r   rP   r  r   rI   )r&  r  srcfilefr  s        r{   r6   r6     s     	OOHd#OOHd#lG'31GGCL  z1662;d;TXX	  
  Gs"   B B
;B 

BB B2c                 X   [         (       a  SOSnUR                  S[        R                  5        UR                  S[        R                  5        UR                  SS5        UR                  SU5        [	        U [
        5      (       a  [        R                  " U 5      n [        R                  " U 40 UD6n[        R                  U5        UR                  [        S9u  pEUR                  S:w  a  [        XE-   5      eU(       a  [        U5        UR!                  S	5      (       a  US
S nU$ )zMRun cmd in a subprocess and return its output.
raises RuntimeError on error.
r   r   r   r   rn   Tr   timeout
N)r   r   ru   r   
isinstancestrshlexrt   r  r  r  communicater   
returncodeRuntimeErrorr\   endswith)r  r  flagspr   r   s         r{   shr@    s     !IaEOOHjoo.OOHjoo.OO($/OOOU+#skk#%%Aa ]]>]:NF||q6?++VtMr}   c                 L  ^^^	^
 S m
S mUUU
4S jnUUU
4S jm	U	4S jnS nU n [        U[        5      (       a  U" Xb5      [        U[        R                  [        R                  45      (       a  U" U5        [        U[        5      (       a  UOUR
                  n[        R                  " U5      (       a   U5       e$ [        U[        R                  [        R                  45      (       a  T	" Xb5      [        U[        R                  [        R                  45      (       a  U" U5        [        U[        5      (       a  UOUR
                  n[        R                  " U5      (       a   U5       e$ [        U[        R                  5      (       a  U" Xb5      [        U[        R                  [        R                  45      (       a  U" U5        [        U[        5      (       a  UOUR
                  n[        R                  " U5      (       a   U5       e$ [        SU< 35      e! [        U[        R                  [        R                  45      (       a  U" U5        [        U[        5      (       a  UOUR
                  n[        R                  " U5      (       a   U5       ef = f)ax  Terminate a process and wait() for it.
Process can be a PID or an instance of psutil.Process(),
subprocess.Popen() or psutil.Popen().
If it's a subprocess.Popen() or psutil.Popen() instance also closes
its stdin / stdout / stderr fds.
PID is wait()ed even if the process is already gone (kills zombies).
Does nothing if the process does not exist.
Return process exit status.
c                    U R                  U5        [        (       aP  [        U [        R                  5      (       a0   [
        R                  " U R                  5      R                  U5      $ g g ! [
        R                   a     g f = fr   )	r   r   r7  ru   r  r   r   r  NoSuchProcess)procr4  s     r{   r   terminate.<locals>.wait  si    		'7z$
(8(899~~dhh/44W== :7 '' s   .A. .BBc                     [         (       a  [        (       a  [        R                  n[        (       a3  U[        R                  :w  a  U R                  [        R                  5        U R                  U5        g r   )r   r`   signalSIGKILLr   send_signalSIGCONT)rD  sigs     r{   sendsigterminate.<locals>.sendsig  sF    5^^..C 5SFNN*V^^,r}   c                    >  T" U T5        T" X5      $ ! [          a     N[         a"  n[        (       a  UR                  S:X  a   e S nAff = f)N   )ProcessLookupErrorOSErrorr   winerror)rD  r4  errrL  rK  r   s      r{   term_subprocess_proc'terminate.<locals>.term_subprocess_proc  sR    	D# D"" " 	 	w3<<1,	s   	 
A	AAAc                 \   >  T" U T5        T" X5      $ ! [         R                   a     Nf = fr   )r   rC  )rD  r4  rL  rK  r   s     r{   term_psutil_proc#terminate.<locals>.term_psutil_proc"  s9    	D# D"" ## 		s   	 ++c                    >  [         R                  " U 5      nT" X!5      $ ! [         R                   a    [        (       a  [	        X5      s $  g f = fr   )r   r   rC  r   r   )r  r4  rD  rW  s      r{   term_pidterminate.<locals>.term_pid)  sO    	3>>#&D $D22 ## 	.u-- 	.s   ! *AAc                    U R                   (       a  U R                   R                  5         U R                  (       a  U R                  R                  5         U R                  (       a  U R                  R                  5         g g r   )r   r$  r   r   )rD  s    r{   flush_popenterminate.<locals>.flush_popen3  sL    ;;KK;;KK::JJ r}   zwrong type )	r7  rs   ru   r  r   r  
pid_existsr   	TypeError)proc_or_pidrK  wait_timeoutrT  rZ  r]  r?  r  rL  rW  r   s    `      @@@r{   r7   r7     s   	##3 	A/aA, a***FLL9::Na%%a155$$S)).3.)) FNNFLL9::#A4 a***FLL9::Na%%a155$$S)).3.)) :++,,'8 a***FLL9::Na%%a155$$S)).3.)) k!/00a***FLL9::Na%%a155$$S)).3.))s   H%  6H% 3&H% H% %A>J#c                    [         R                  " 5       R                  U S9n[        (       a,  [        R	                  5       n[        U5        [        (       a  M,  [        (       a,  [        R	                  5       n[        U5        [        (       a  M,  U(       a`  U H  n[        USS9  M     [         R                  " U[        S9u  pVU H+  n[        SU< S35        [        U[        R                  S9  M-     gg)a  Terminate and wait() any subprocess started by this test suite
and any children currently running, ensuring that no processes stick
around to hog resources.
If recursive is True it also tries to terminate and wait()
all grandchildren started by this process.
	recursiveN)rb  r3  zcouldn't terminate process z; attempting kill())rK  )r   r   childrenr  popr7   r  
wait_procsr   r\   rG  rH  )re  rf  r  r  r?  r*  alives          r{   r8   r8   M  s     ~~((9(=H  
$((*$  

 -!# -
 Aad+ $$X~FA.qe3FGHaV^^, 	 r}   c                     [         (       d  [        S5      eSn [        R                  " 5       S   nU H$  nUR	                  5       (       d  US:X  a  X-  n M$    O   U (       d  [        SU< 35      eSnSnU R                  S5      n[        US   5      n[        U5      S:  a  [        US   5      n[        U5      S:  a  [        US   5      nXcU4$ )	z"Return a tuple such as (2, 6, 36).z	not POSIX rg   rf   zcan't parse r      r   )	r   NotImplementedErrorr   unameisdigitr   rt   rs   len)r  rn  cminormicronumsmajors          r{   rN   rN   r  s    5!+..
AHHJqME99;;!s(FA	 
 <y122EE773<DQLE
4yA~DG
4yA~DG%  r}   c                      [         (       d  [        S5      e[        R                  " 5       n U R                  =(       d    SnU S   U S   U4$ )Nznot WINDOWSr   rl  )r   rm  rw   getwindowsversionservice_pack_major)wvsps     r{   rM   rM     sE    7!-00				 B				#!BqE2a5"r}   c                   >    \ rS rSrSr\SSSS4S jrS rS rS r	S	r
g)
retryi  zA retry decorator.Nr   c                 r    U(       a  U(       a  [        S5      eXl        X l        X0l        X@l        XPl        g )Nz/timeout and retries args are mutually exclusive)r   	exceptionr4  retriesintervallogfun)r   r~  r4  r  r  r  s         r{   r   retry.__init__  s.     wNOO" r}   c              #   V  #    U R                   (       a\  [        R                  " 5       U R                   -   n[        R                  " 5       U:  a   S v   [        R                  " 5       U:  a  M  g g U R                  (       a!  [        U R                  5       H  nS v   M	     g  S v   M  7fr   )r4  r   r  range)r   stop_atr*  s      r{   __iter__retry.__iter__  sk     <<iikDLL0G))+' ))+'\\4<<( )  s   A*B).;B)c                 `    U R                   b!  [        R                  " U R                   5        g g r   )r  r   r   r   s    r{   r   retry.sleep  s!    ==$JJt}}% %r}   c                 X   ^ ^ [         R                  " T5      UU 4S j5       nT Ul        U$ )Nc                     > S nT H  n T" U 0 UD6s  $    Ue! TR                    a;  nUnTR                  b  TR                  U5        TR                  5          S nAMX  S nAff = fr   )r~  r  r   )r   r   excr*  r   r   s       r{   r   retry.__call__.<locals>.wrapper  sk    C///  I ~~ C{{.C(JJLs   A#0AA#)r   r   	decorator)r   r   r   s   `` r{   __call__retry.__call__  s-    			 
	  !r}   )r~  r  r  r  r4  )r   r   r   r   r   r   r   r  r   r  r    r}   r{   r|  r|    s*      
&r}   r|  r   )r~  r  r4  r  c                     U [         R                  " 5       ;  a  [         R                  " U 5      e[         R                  " U 5        g)z|Wait for pid to show up in the process list then return.
Used in the test suite to give time the sub process to initialize.
N)r   pidsrC  r   )r  s    r{   rP   rP     s/     &++-""3''
NN3r}   c                     [        U S5       nUR                  5       nSSS5        U(       d	  W(       d   eU(       a  [        U 5        W$ ! , (       d  f       N2= f)z8Wait for a file to be written on disk with some content.rbN)r.  readrI   )fnamer   r   r1  datas        r{   rQ   rQ     sC     
eT	avvx 
tEK 
	s   A


Ac                 &    U " 5       nU(       d   eU$ )z1Keep calling function until it evaluates to True.r  )r   rets     r{   rO   rO     s     %CJ3Jr}   c                 n   S n [         R                  " U 5      n[        R                  " UR                  5      (       a&  [        R
                  " [        R                  U 5      nO%[        R
                  " [         R                  U 5      n[        (       a  U" 5         gU" U5        g! [         a     gf = f)z?Convenience function for removing temporary test files or dirs.c                 H   [         R                   " 5       [        -   n[         R                   " 5       U:  a   U " 5       $ We! [         a     O&[         a  nUn[	        SU 35         S nAOS nAff = f[         R
                  " S5        [         R                   " 5       U:  a  Mm  Nf)Nz	ignoring g{Gz?)r   r   FileNotFoundErrorrQ  r\   r   )r   r  r*  rS  s       r{   	retry_funsafe_rmpath.<locals>.retry_fun  s    
 ))+.iikG#(u 	 %  (y&''( JJt iikG#s   A   
A/	A/A**A/N)r   statS_ISDIRst_moder   partialr   rmtreeremover   r  )r   r  str   s       r{   rI   rI     s{    "WWT]<<

####FMM48C##BIIt4C5EcN s   BB' B' '
B43B4c                 R     [         R                  " U 5        g! [         a     gf = f)z.Convenience function for creating a directory.N)r   mkdirFileExistsErrorr   s    r{   
safe_mkdirr  $  s$    
 s    
&&c              #      #    [         R                  " 5       n [         R                  " U 5        Sv   [         R                  " U5        g! [         R                  " U5        f = f7f)z@Context manager which temporarily changes the current directory.N)r   r  rH   )dirnamecurdirs     r{   rH   rH   ,  s>      YY[F

s   A%A
 A%
A""A%c                 l   [         R                  R                  U 5      (       a   U 5       e[        R                  " [
        U 5        [        R                  " [        U 5        [        (       aG  [         R                  " U 5      n[         R                  " XR                  [        R                  -  5        U $ )z6Create a Python executable file in the given location.)r   r   r   atexitregisterrI   r   copyfiler   r   r  chmodr  S_IEXEC)r   r  s     r{   rJ   rJ   7  sl    ww~~d##)T)#
OOK&
OOJ%uWWT]
zzDLL01Kr}   c                    [         R                  R                  U 5      (       a   U 5       e[        R                  " S5      (       d  [
        R                  " S5      eUc  [        R                  " S5      nO[        U[        5      (       d   U5       e[        R                  " [        U 5        [        [        SS9S5       nUR!                  U5        SSS5         ["        R$                  " SWR&                  SU /5        [        UR&                  5        U $ ! , (       d  f       NJ= f! [        WR&                  5        f = f)	z5Create a compiled C executable in the given location.gcczgcc is not installedNz
            #include <unistd.h>
            int main() {
                pause();
                return 1;
            }
            z.csuffixr-  z-o)r   r   r   r   r   pytestskipr  r  r7  r8  r  r  rI   r.  rL   r/  ru   r   r   )r   c_coder1  s      r{   rK   rK   B  s    ww~~d##)T)#<<kk011~ "  &#&&..&
OOK&	j%s	+q	 
,uaffdD9:AFFK 
,	+
 	AFFs   D$D( 
D%(D?c                      [         R                  " [        XS9n[        R                  R                  U5      (       d<  [        R                  R                  U5      n[        R                  " [        U5        U$ M{  )zReturn an absolute pathname of a file or dir that did not
exist at the time this call is made. Also schedule it for safe
deletion at interpreter exit. It's technically racy but probably
not really due to the time variant.
)prefixr  r   )
tempfilemktempr   r   r   r   r   r  r  rI   )r  r   r   r   s       r{   rL   rL   \  sV     mFLww~~d##77##D)DOOK.K r}   c                   x    \ rS rSrSr\S 5       r\SS j5       r\SS j5       r\SS j5       r	 " S S	5      r
S
rg)rG   io  zA class that mimics some basic pytest APIs. This is meant for
when unit tests are run in production, where pytest may not be
installed. Still, the user can test psutil installation via:

    $ python3 -m psutil.tests
c                      [         R                  " 5       R                  [        5      n[         R                  " SS9R                  U5        [        R                  " S[        SS9  U$ )zrMimics pytest.main(). It has the same effect as running
`python3 -m unittest -v` from the project root directory.
rg   )	verbosityz<Fake pytest module was used. Test results may be inaccurate.rl  
stacklevel)	r=   
TestLoaderdiscoverHERETextTestRunnerr   warningsr\   UserWarning)r   kwsuites      r{   mainfake_pytest.mainw  sR    
 ##%..t4!,007J	

 r}   Nc                 Z   ^  " S S5      m[         R                  SU4S jj5       nU" XS9$ )zMimics `pytest.raises`.c                   (    \ rS rSrSr\S 5       rSrg))fake_pytest.raises.<locals>.ExceptionInfoi  Nc                     U R                   $ r   )_excr   s    r{   value/fake_pytest.raises.<locals>.ExceptionInfo.value  s    yy r}   r  )r   r   r   r   r  propertyr  r   r  r}   r{   ExceptionInfor    s    D! !r}   r  c              3      >#    T" 5       n Uv   [        U < S35      e! U  aP  nU(       a9  [        R                  " U[        U5      5      (       d  SU SU S3n[        U5      eX2l         S nAg S nAff = f7f)Nz not raised"z" does not match ")AssertionErrorresearchr8  r  )r  matcheinforS  msgr  s        r{   context#fake_pytest.raises.<locals>.context  sz     !OE< %wk%:;;  !5#c(!;!;eW$6se1=C(-- 

	!s+   A8 A8A5AA0+A80A55A8)r  r   )
contextlibcontextmanager)r  r  r  r  s      @r{   raisesfake_pytest.raises  s4    	! 	! 
	"	"
	< 
#
	< s((r}   c                     U(       a$  [         R                  " 5       R                  X5      $ [         R                  " 5       R                  U 5      $ )zMimics `pytest.warns`.)r=   TestCaseassertWarnsRegexassertWarns)warningr  s     r{   warnsfake_pytest.warns  s;     $$&77GG  "..w77r}   c                 .    [         R                  " U 5      e)zMimics `unittest.SkipTest`.)r=   SkipTestreasons    r{   r  fake_pytest.skip  s     ''r}   c                   <    \ rS rSr\SS j5       r " S S5      rSrg)fake_pytest.marki  c                 .    [         R                  " X5      $ )z'Mimics `@pytest.mark.skipif` decorator.)r=   skipIf)	conditionr  s     r{   skipiffake_pytest.mark.skipif  s     ??955r}   c                   (    \ rS rSrSrSS jrS rSrg)fake_pytest.mark.xdist_groupi  z4Mimics `@pytest.mark.xdist_group` decorator (no-op).Nc                     g r   r  r   s     r{   r   %fake_pytest.mark.xdist_group.__init__  s    r}   c                     U$ r   r  )r   cls_or_meths     r{   r  %fake_pytest.mark.xdist_group.__call__  s    ""r}   r  r   )r   r   r   r   r   r   r  r   r  r}   r{   xdist_groupr    s    F#r}   r  r  Nrk  )r   r   r   r   staticmethodr  r  r   r  r}   r{   markr    s    		6 
	6	# 	#r}   r  r  r   r   )r   r   r   r   r   r  r  r  r  r  r  r   r  r}   r{   rG   rG   o  sa       ) )2 8 8 ( (# #r}   rG   c                   R    \ rS rSrSrSS jrS rS rS rS r	S	 r
S
 rS rS rSrg)rB   i  zTest class providing auto-cleanup wrappers on top of process
test utilities. All test classes should derive from this one, even
if we use pytest.
Nc                 D    [        XS9nU R                  [        U5        U$ )N)r  r   )rL   
addCleanuprI   )r   r  r   r  s       r{   rL   PsutilTestCase.get_testfn  s    &2U+r}   c                 H    [        U0 UD6nU R                  [        U5        U$ r   )r9   r  r7   )r   r   r  r  s       r{   r9   PsutilTestCase.spawn_testproc  s$    --	5)r}   c                 x    [        5       u  pU R                  [        U5        U R                  [        U5        X4$ r   )r;   r  r7   )r   child1child2s      r{   r;   "PsutilTestCase.spawn_children_pair  s1    ,.	6*	6*r}   c                 x    [        5       u  pU R                  [        U5        U R                  [        U5        X4$ r   )r:   r  r7   )r   r(  r  s      r{   r:   PsutilTestCase.spawn_zombie  s0    %	6*	6*r}   c                 x    [        U0 UD6u  p4U R                  [        U5        U R                  [        U5        U$ r   )r6   r  rI   r7   )r   r   r  r  r0  s        r{   r6   PsutilTestCase.pyrun  s4    --W-	5)r}   c                    [        U[        R                  5      (       d   eUR                  UR                  :X  d   eUR                  UR
                  :X  d   eUR                  (       a  UR                  (       d   e[        U[        R                  5      (       a;  UR                  UR                  :X  d   eUR                  b  UR                  S:  d   e[        U5        [        U5        g Nr   )r7  r   Errorr  r   _nameZombieProcessppid_ppidr8  repr)r   rD  r  s      r{   _check_proc_excPsutilTestCase._check_proc_exc  s    #v||,,,,ww$(("""xx4::%%%8888O8c6//0088tzz)))xx#xx1}$}CS	r}   c                 N   [         R                  " [        R                  5       n [        R                  " U5         S S S 5        WR                  R                  U:X  d   eUR                  R                  b   e[        R                  " U5      (       a   U5       eU[        R                  " 5       ;  d   eU[        R                  " 5        Vs/ s H  o3R                  PM     sn;  d   eg ! [        R
                   a    [        S5      ef = f! , (       d  f       N= fs  snf )Nz&wasn't supposed to raise ZombieProcess)r  r  r   rC  r   r  r  r  r  r   r_  r  process_iter)r   r  cmxs       r{   assertPidGonePsutilTestCase.assertPidGone  s    ]]6//0BOs# 1
 xx||s"""xx}}$$$$$S)).3.)&++-'''&*=*=*?@*?Q55*?@@@@ '' O$%MNNO 10 As"   DC.D". DD
Dc                    U R                  UR                  5        [        U5      nUR                  UR                  SS9 H/  u  p4U R                  XS9    U" 5       nSU SU< 3n[        U5      e   UR                  SS9  g ! [        R                   a    e [        R                   a  nU R                  X5         S nAOS nAff = f S S S 5        M  ! , (       d  f       M  = f)NTclear_cacherD  r   zProcess.z!() didn't raise NSP and returned r   r3  )r  r  rC   iterallsubTestr  r   r  rC  r  r   )r   rD  nsr   r   r  r  r  s           r{   assertProcessGone PsutilTestCase.assertProcessGone  s    488$t$T:IC43.%C #4& )7$  )-- ; 			!	 ++ ++ 4((3343 4333s6   CBC(C,C=CCC
C$	c                 P	   [         R                  " UR                  5      nX:X  d   e[        (       d%  [        (       d  [        U5      [        U5      :X  d   eUR                  5       [         R                  :X  d   eUR                  5       (       d   e[         R                  " UR                  5      (       d   eUR                  5         UR                  [         R                  " 5       ;   d   eUR                  [         R                  " 5        Vs/ s H  o3R                  PM     sn;   d   e0 [         l        UR                  [         R                  " 5        Vs/ s H  o3R                  PM     sn;   d   e[        U5      nUR                  UR                   SS9 H%  u  pVU R#                  XS9    U" 5         S S S 5        M'     [*        (       Ga	  [,        R.                  " [         R$                  5       nUR1                  5         S S S 5        U R)                  UWR2                  5        [,        R.                  " [         R$                  5       nUR5                  5         S S S 5        U R)                  XR2                  5        [,        R.                  " [         R$                  5       nUR7                  5         S S S 5        U R)                  XR2                  5        UR9                  5         UR;                  5         UR=                  5         UR?                  5         UR                  5       (       d   e[         R                  " UR                  5      (       d   eUR                  [         R                  " 5       ;   d   eUR                  [         R                  " 5        Vs/ s H  o3R                  PM     sn;   d   e0 [         l        UR                  [         R                  " 5        Vs/ s H  o3R                  PM     sn;   d   eg s  snf s  snf ! [         R$                  [         R&                  4 a  nU R)                  X5         S nAGNS nAff = f! , (       d  f       GM  = f! , (       d  f       GNh= f! , (       d  f       GN!= f! , (       d  f       GN= fs  snf s  snf )NTr"  r$  ) r   r   r  r
   r	   hashr  r  
is_runningr_  as_dictr  r  _pmaprC   r%  r&  r'  r  AccessDeniedr  r   r  r  cmdliner  r   r   suspendresumer7   kill)	r   rD  cloner  r(  r   r   r  r  s	            r{   assertProcessZombie"PsutilTestCase.assertProcessZombie  s2   txx( }}66:e,,,{{} 4 4444      ****xx6;;=(((xx6+>+>+@A+@aEE+@AAAAxx6+>+>+@A+@aEE+@AAAAt$T:IC434E 43 ; 5v334 5  rxx0v334
 5  xx0v334  " 5  xx0		      ****xx6;;=(((xx6+>+>+@A+@aEE+@AAAAxx6+>+>+@A+@aEE+@AAAAA BA ,,f.A.AB 4((334 43 54 54 54 BAsl   PP1Q3P6Q(Q:'R R*R#$Q6QQQQ
Q%	(
Q7:
R	
Rr  rk  N)r   r   r   r   r   rL   r9   r;   r:   r6   r  r  r)  r6  r   r  r}   r{   rB   rB     s6    


  
A&1Br}   rB   zunreliable on PYPYr  c                       \ rS rSrSrSrSrSr\(       a  SOSr	Sr
\R                  " 5       r\" \R                   " S5      5      r\S	 5       r\S
 5       rS rS rS rS rS rS rS r SS jrS rSrg)rA   iP  a  Test framework class for detecting function memory leaks,
typically functions implemented in C which forgot to free() memory
from the heap. It does so by checking whether the process memory
usage increased before and after calling the function many times.

Note that this is hard (probably impossible) to do reliably, due
to how the OS handles memory, the GC and so on (memory can even
decrease!). In order to avoid false positives, in case of failure
(mem > 0) we retry the test for up to 5 times, increasing call
repetitions each time. If the memory keeps increasing then it's a
failure.

If available (Linux, OSX, Windows), USS memory is used for comparison,
since it's supposed to be more precise, see:
https://gmpy.dev/blog/2016/real-process-memory-and-environ-in-python
If not, RSS memory is used. mallinfo() on Linux and _heapwalk() on
Windows may give even more precision, but at the moment are not
implemented.

PyPy appears to be completely unstable for this framework, probably
because of its JIT, so tests on PYPY are skipped.

Usage:

    class TestLeaks(psutil.tests.TestMemoryLeak):

        def test_fun(self):
            self.execute(some_function)
   rh   r   r   TPSUTIL_DEBUGc                 0    [         R                  " S5        g )NF)r   
_set_debugclss    r{   
setUpClassTestMemoryLeak.setUpClassy  s    % r}   c                 D    [         R                  " U R                  5        g r   )r   r=  _psutil_debug_origr>  s    r{   tearDownClassTestMemoryLeak.tearDownClass}  s    #001r}   c                 d    U R                   R                  5       n[        USUR                  5      $ )Nuss)	_thisprocmemory_full_infor   rss)r   mems     r{   _get_memTestMemoryLeak._get_mem  s)     nn--/sE377++r}   c                     [         (       a  U R                  R                  5       $ U R                  R                  5       $ r   )r   rH  num_fdsnum_handlesr   s    r{   _get_num_fdsTestMemoryLeak._get_num_fds  s-    5>>))++>>--//r}   c                 Z    U R                   (       a  [        US[        R                  S9  g g )Nyellow)colorfile)verboser   rw   r   )r   r  s     r{   _logTestMemoryLeak._log  s    <<8#**= r}   c                 "   U R                  5       nU R                  U5        U R                  5       nX2-
  nUS:  a  SU< S3nU R                  U5      eUS:  a6  [        (       a  SOSnUS:  a  US-  nU SU S	U< 3nU R                  U5      eg
)zMakes sure num_fds() (POSIX) or num_handles() (Windows) does
not increase after calling a function.  Used to discover forgotten
close(2) and CloseHandle syscalls.
r   znegative diff z8 (gc probably collected a resource from a previous test)fdhandlerl  r  z
 unclosed z after calling N)rQ  callfailr   )r   r   beforeafterdiffr  type_s          r{   
_check_fdsTestMemoryLeak._check_fds  s    
 ""$		#!!#~!8  )2 2  ))C. !8!EDxEaxF*UG?3'BC))C.  r}   c                    [         R                  " SS9  U R                  5       n[        U5       H  nU R	                  U5      nAAM     [         R                  " SS9  U R                  5       n[         R
                  / :X  d   eXc-
  nU$ )zpGet 2 distinct memory samples, before and after having
called fun repeatedly, and return the memory difference.
rl  )
generation)gccollectrL  r  r]  garbage)r   r   timesmem1r  r  mem2ra  s           r{   _call_ntimesTestMemoryLeak._call_ntimes  sr     	

a }}uA))C.C3  	

a }}zzR{r}   c           	         / nSnUn[        SUS-   5       H  nU R                  X5      n	SR                  U[        U	5      [        X-  5      U5      n
UR	                  U
5        X:*  =(       d    X:*  nU(       a  US:  a  U R                  U
5          g US:X  a
  [        5         U R                  U
5        X'-  nU	nM     U R                  SR                  U5      5      e)Nr   rl  z,Run #{}: extra-mem={}, per-call={}, calls={}z. )	r  rm  r   r   appendrX  printr^  r   )r   r   rj  r  	tolerancemessagesprev_memincreaseidxrK  r  successs               r{   
_check_memTestMemoryLeak._check_mem  s    GaK(C##C/C@GGC CK(	C OOC &9#/G7IIcN!8G		#!' )( ii		(+,,r}   c                     U" 5       $ r   r  )r   r   s     r{   r]  TestMemoryLeak.call  s	    ur}   Nc                    Ub  UOU R                   nUb  UOU R                  nUb  UOU R                  nUb  UOU R                  n US:  d   S5       eUS:  d   S5       eUS:  d   S5       eUS:  d   S5       e U R                  X5        U R                  U5        U R                  XXES9  g! [         a  n[        [        U5      5      eSnAff = f)	zTest a callable.Nrl  ztimes must be >= 1r   zwarmup_times must be >= 0zretries must be >= 0ztolerance must be >= 0)rj  r  rr  )
rj  warmup_timesr  rr  r  r   r8  rm  rc  rx  )r   r   rj  r}  r  rr  rS  s          r{   executeTestMemoryLeak.execute  s     *

(4L$:K:K 	 %0'dll!*!6IDNN		'A:333:1$A&AA$a<7!77<>;#;;> 	#,'O  	'SX&&	's   4B. .
C8CCc                 @   ^ ^^ UUU 4S jnT R                   " U40 UD6  g)z^Convenience method to test a callable while making sure it
raises an exception on every call.
c                  *   > TR                  T T5        g r   )assertRaises)r  r   r   s   r{   r]  *TestMemoryLeak.execute_w_exc.<locals>.call  s    c3'r}   N)r~  )r   r  r   r   r]  s   ```  r{   execute_w_excTestMemoryLeak.execute_w_exc  s    
	( 	T$V$r}   r  )NNNN)r   r   r   r   r   rj  r}  rr  r    r  rW  r   r   rH  boolr   getenvrC  classmethodr@  rD  rL  rQ  rX  rc  rm  rx  r]  r~  r  r   r  r}   r{   rA   rA   P  s    > ELIbAGG Ibii78! ! 2 2,0>!,-8 KOP,%r}   rA   c                     SS K n SS KnSS KnSS KnSS Kn SS Kn SS KnU R                  5       n[        R                  (       a*  [        R                  " S5      (       a  [        S5      US'   O[        R                  (       a  S[        R                   " 5       S    3US'   O[        R"                  (       aq  SSR%                  ['        [(        [        R*                  " 5       5      5      -   US'   [-        [        S5      (       a#  US==   S	[        R.                  " 5       -   -  ss'   O0[        R0                  " 5        S[        R2                  " 5        3US'   S	R%                  [5        [        R6                  " 5       5      [        R8                  " 5       /-   5      US
'   [        R:                  (       a  [        R<                  " 5       S   US'   S	R%                  [        R>                  " 5       [        R@                  " 5       [        RB                  " 5       /5      US'   [E        USS5      US'   Ub  US==   SURF                   S3-  ss'   [        R:                  (       aq  [        R                  " S5      (       a.  [        SS/5      n[)        U5      RI                  S5      S   US'   OSUS'   [        RJ                  " 5       S   n	U	(       a  XS'   [L        RN                  " 5       US'   URQ                  5       n
U
S    S	U
S    3US'   UR                  RS                  [        RT                  " 5       5      RW                  S5      US'   UR                  RY                  5       RW                  S5      US'   UR[                  5       US'   [\        R^                  Ra                  S5      US'   [\        Rb                  " 5       US '   [d        US!'   [        Rf                  " 5       US"'   [\        Rh                  " 5       US#'   [        Rj                  " 5       US$'   S%Rl                  " [o        S& [        Rp                  " 5        5       5      6 US''   [        Rr                  " 5       nS(Rm                  [u        URv                  5      [y        URz                  5      [y        UR|                  5      5      US)'   [        R~                  " 5       nS(Rm                  [u        URv                  5      [y        URz                  5      [y        UR|                  5      5      US*'   [        [        R                  " 5       5      US+'   [        R                  " 5       R                  5       nUR                  S,S 5        UR                  U5      US-'   [        S.[L        R                  S/9  UR                  5        H0  u  p[        S0Rm                  US1-   U5      [L        R                  S/9  M2     [        S.[L        R                  S/9  [L        R                  R                  5         [L        R                  R                  5         g ! [         a    S n GN"f = f! [         a    S n GN0f = f)2Nr   lsb_releasezlsb_release -d -sOSzDarwin zWindows  win32_editionz, archrg   kernelpython__version__znot installedpipz (wheel=)r  z	--versionr5  rl  glibczfs-encodinglangz%Y-%m-%d %H:%M:%Sz	boot-timer   user~homer   pyexehostnamePIDcpusz{:.1f}%, {:.1f}%, {:.1f}%c              3   V   #    U  H  o[         R                  " 5       -  S -  v   M!     g7f)d   N)r   	cpu_count).0r  s     r{   	<genexpr> print_sysinfo.<locals>.<genexpr>@  s#     I5H6##%%+5Hs   ')loadavgz{}%%, used={}, total={}memoryswapr  r   rD  zF======================================================================rV  z	{:<17} {}:)Kcollectionsdatetimegetpasslocalepprintr  ImportErrorwheelOrderedDictr   r   r   r   r@  OSXro   rp   r   r   rr   r8  	win32_verhasattrr  systemrz   listarchitecturemachiner   rn  python_implementationpython_versionpython_compilerr   r  rt   libc_verrw   getfilesystemencoding	getlocalefromtimestamp	boot_timestrftimenowgetuserr   r   
expanduserr  r   nodegetpidr  r   rq   r   virtual_memoryrs   percentr   usedtotalswap_memoryrp  r  r   r.  rg  pformatrq  r   itemsr   flush)r  r  r  r  r  r  r  infooutr  r  rK  r  pinfokvs                   r{   rE   rE     s    ""$D ||]33+,T
	x//1!456T
	#((3sH4F4F4H+I"JJT
8_--J$!7!7!999J )*!H,<,<,>+?@T
99X""$%)9)9);(<<DL ||!)!,X YY&&(!  "  DN
 #}o>DKU%"3"3!4A66 ||<<e[)*Cc(...q1DK)DK"M 335DD1gYba	*DL ))77h"# 	 $$((*334GHDL??$DL77%%c*DL))+DKDM}}D))+DK ##%DL188	IV5F5F5HI	IDO 


!C.55CKKCHHCIIDN
 D,33DLLDIIDJJDL
 v{{}%DLNN$$&E	IImT">>%(DL	($

k  S!,3::> 	($JJ JJA    s"   X- Y  -X=<X= YYc                 V    [         S 5       n U" 5       U    S:H  $ ! [         a     gf = f)Nc                      0 n [        S5      nUR                  5       SS   HI  nUR                  S5       Vs/ s H  o3R                  SS5      PM     nnUS   [	        US   5      peXPU'   MK     U $ s  snf )Nztasklist.exe /NH /FO csvrl  ,r  rk  r   )r@  
splitlinesrt   replacers   )r  r  liner  bitsr   r  s          r{   	get_procs,is_win_secure_system_proc.<locals>.get_procsd  sv    +,NN$QR(D04

3@1IIc2&D@QT!W#H ) 
 As   A0zSecure SystemF)r   KeyError)r  r  s     r{   rF   rF   b  s=     {3?22 s    
((c                      [         R                  " 5       n [        U S5      (       a  U R                  5       $ [        U S5      (       a$  [        R
                  " U R                  5       5      $ g)Nr   r   r   )r   r   r  r   randomchoicer   )r?  s    r{   _get_eligible_cpur  t  sM    Aq)yy{	N	#	#}}Q^^-..r}   c                      \ rS rSrSrSS0 4SS0 4/rSS0 4SSSS	04S
S0 4SS0 4SS0 4SS0 4SS0 4SS0 4SS0 4/	rSS0 4SS0 4SS0 4SS0 4SS0 4SS0 4SS0 4SS0 4SSSS04SS0 4SS0 4SS0 4S S0 4S!S0 4S"S0 4S#S0 4S$S0 4/r\(       a$  \S%S0 4/-  r\S&S0 4/-  r\S'S0 4/-  r\S(S0 4/-  r\	(       a	  \S)S0 4/-  r\
(       a	  \S*S0 4/-  r\(       a  \S+\R                  40 4/-  r\(       a	  \S,S0 4/-  r\(       a	  \S-S0 4/-  r\(       a	  \S.S0 4/-  r\(       a	  \S/S0 4/-  r\(       a  \S0SS1S204/-  r/ r\(       a
  \SS0 4/-  rO\S\R(                  40 4/-  r\(       a  \S+\R                  S340 4/-  r\
(       a1  \(       a  \S*\R,                  S440 4/-  rO\S*\R.                  40 4/-  r\(       a  \S,\" 5       /40 4/-  rS5\R4                  40 4S6S0 4S7S0 4S8S0 4S9S0 4/r\(       a(  \S5\R8                  40 4/-  r\S5\R:                  40 4/-  r\\-   \-   \-   rS: rSAS; jr S< r!\"S= 5       r#\"S> 5       r$S?r%g@)BrC   i}  a  A container that lists all Process class method names + some
reasonable parameters to be called with. Utility methods (parent(),
children(), ...) are excluded.

>>> ns = process_namespace(psutil.Process())
>>> for fun, name in ns.iter(ns.getters):
...    fun()
cpu_percentr  memory_percentr.  rf  re  Tconnectionsr-  oneshotr(  parentsr  r   )r   r1  	cpu_timescreate_timer   r   rI  memory_infor   net_connectionskindr&  nicenum_ctx_switchesnum_threads
open_filesr  r  r   usernameuidsgidsterminalrO  r   r   r   r   r   r   rP  r   groupedF)r  i   r   rI  r2  r3  r7   r4  c                     Xl         g r   _proc)r   rD  s     r{   r   process_namespace.__init__  s    
r}   c              #      #    [        U5      n[        R                  " U5        U HR  u  p4nU(       a  U R                  5         [	        U R
                  U5      n[        R                  " U/UQ70 UD6nXc4v   MT     g7fzOGiven a list of tuples yields a set of (fun, fun_name) tuples
in random order.
N)r  r  shuffler#  r   r  r   r  )r   lsr#  fun_namer   r  r   s          r{   r%  process_namespace.iter  sl      "Xr$& HD  "$**h/C##C7$7$7C/! %'s   A;A=c                 `    U R                   R                  U R                   R                  SS9  g)z&Clear the cache of a Process instance.T)_ignore_nspN)r  _initr  r   s    r{   r#  process_namespace.clear_cache  s!    

T:r}   c                     U HE  u  n  nSU-   n[        X5      (       a  M  UR                  R                  < SU< S3n[        U5      e   g)zmGiven a TestCase instance and a list of tuples checks that
the class defines the required test method names.
test_z class should define a z methodN)r  r   r   AttributeError)r?  
test_classr  r  r*  	meth_namer  s          r{   test_class_coverage%process_namespace.test_class_coverage  s^    
 !NHa(*I:11!++447 8!}G-  %S)) !r}   c                 :   U R                    Vs1 s H  oS   iM	     nnU R                   Vs1 s H  oS   iM	     nn[        [        R                  5       Vs1 s H  oS   S:w  d  M  UiM     nnX#-  U-  nU(       a  [        SU< 35      eg s  snf s  snf s  snf )Nr   r*  zuncovered Process class names: )r&  ignoredr   r   r   r   )r?  r  thisr
  klassleftouts         r{   testprocess_namespace.test  s    !gg&g!g&!$-AQ4-/?/qQ43;/?>U*>wkJKK 	 '-?s   BBB(Br  N)T)&r   r   r   r   r   utilsr
  gettersr   r'   r(   r+   r   RLIMIT_NOFILEr$   r*   r&   r   r)   settersNORMAL_PRIORITY_CLASSr   IOPRIO_CLASS_NONEIOPRIO_NORMALr  rG  SIGTERMkillersCTRL_C_EVENTCTRL_BREAK_EVENTr&  r   r%  r#  r  r  r  r   r  r}   r{   rC   rC   }  s    R$'7R&@AE 
B	R+t,-	B	r2	B	2r	B	B	r
G 
B	b"	B	B	B	R$	B	R	B0	R	R$	B	r2	R	2r	B	R#G& VR$%%VR$%%ZR())YB'((]B+,,Xr2&''X 4 46;<<^R,--YB'((YB'((]B+,,]BE(:;<<GVT2&''Vf::<bABBX 4 4lCRHIIF$<$<a#@"EFFGF$8$8#:B?@@G^'8':&;%=rBCC 
)2.	B	2r	b"	RG ]V%8%8$:B?@@]V%<%<$>CDD
'/G
#g
-C"; * * L Lr}   rC   c                      \ rS rSrSrSS0 4SSSS04SSSS04S	S0 4S
SSS04S
SSS04SSSS04SSSS04S\R                  " 5       40 4SSSS04SS0 4SS0 4SSSS04S\R                  " 5       40 4SS0 4SS0 4SS0 4SS0 4/r\	(       a(  \
(       a  \R                  " 5       S:X  a  O\SSSS04/-  r\(       a	  \SS0 4/-  r\(       a	  \SS0 4/-  r\(       a	  \S S0 4/-  r\(       a	  \S!S0 4/-  r\(       a  \S"S0 4/-  r\S#S$0 4/-  rS%S0 4S&\R&                  " 5       /40 4S'S0 4S(S0 4/r\r\S) 5       r\R2                  rSrg*)+rD   i  zA container that lists all the module-level, system-related APIs.
Utilities such as cpu_percent() are excluded. Usage:

>>> ns = system_namespace
>>> for fun, name in ns.iter(ns.getters):
...    fun()
r  r  r  logicalFT	cpu_statsr  percpudisk_io_countersperdiskdisk_partitionsr&  
disk_usager  r  net_if_addrsnet_if_statsr   pernicr_  r  r  usersr  arm64r   r   r   r   r   win_service_iterwin_service_get)algr  rh  r  cpu_times_percentc              #      #    [        U 5      n [        R                  " U 5        U  H5  u  pn[        [        U5      n[
        R                  " U/UQ70 UD6nXA4v   M7     g7fr  )r  r  r  r   r   r   r  )r  r  r   r  r   s        r{   r%  system_namespace.iter=  sY     
 "Xr$& HD&(+C##C7$7$7C/! %'s   AA N)r   r   r   r   r   r   r  r  r  r%   r   ro   r  HAS_GETLOADAVGr/   r.   r,   r   r   r   r
  r&  r  r%  rC   r  r   r  r}   r{   rD   rD     s    
b"	b9e,-	b9d+,	b"	b8U+,	b8T*+	R)T!23	B.			~r*	B0	R 	R 	B4 01			~r*	R	B	"b	2r"%G( X%%'72R(D)9:;;G\2r*+++R455^R,--&B/00'R011&"566 
R 	)*,b1	B	b"%	G C	" 	" ,??r}   rD   c                 &    S n[        [        SXS9$ )zRDecorator which runs a test function and retries N times before
actually failing.
c                 <    [        U < S3[        R                  S9  g )Nz
, retryingr  )rq  rw   r   )r  s    r{   r   retry_on_failure.<locals>.logfunQ  s    z"4r}   N)r~  r4  r  r  )r|  r  )r  r  s     r{   r@   r@   L  s    
5  $ r}   c                    ^  U 4S jnU$ )z,Decorator to Ignore AccessDenied exceptions.c                 J   >^  [         R                  " T 5      U U4S j5       nU$ )Nc                     >  T" U 0 UD6$ ! [         R                   a"    Tb  T(       d  e [        R                  " S5      ef = f)Nzraises AccessDenied)r   r0  r  r  )r   r   r   only_ifs     r{   r   9skip_on_access_denied.<locals>.decorator.<locals>.wrapper]  sI    9D+F++&& 9&"kk"788	9s	    6Ar   r   r   r5  s   ` r{   r  (skip_on_access_denied.<locals>.decorator\  s%    			9 
	9 r}   r  r5  r  s   ` r{   r>   r>   Y  s     r}   c                    ^  U 4S jnU$ )z3Decorator to Ignore NotImplementedError exceptions.c                 J   >^  [         R                  " T 5      U U4S j5       nU$ )Nc                     >  T" U 0 UD6$ ! [          a2    Tb  T(       d  e TR                  < S3n[        R                  " U5      ef = f)Nz2 was skipped because it raised NotImplementedError)rm  r   r  r  )r   r   r  r   r5  s      r{   r   ;skip_on_not_implemented.<locals>.decorator.<locals>.wrapperp  s]    
'D+F++& '&"||& '+ +  kk#&&'s	    <Ar   r7  s   ` r{   r  *skip_on_not_implemented.<locals>.decoratoro  s%    			' 
	' r}   r  r9  s   ` r{   r?   r?   l  s    " r}   c                     [         R                   " 5        nUR                  U S45        UR                  5       S   sSSS5        $ ! , (       d  f       g= f)z6Return an unused TCP port. Subject to race conditions.r   rl  N)socketbindgetsockname)hostr'  s     r{   rT   rT     s8    	D		4)!!$ 
s   &A
Ac                    Uc  U [         [        1;   a  Sn[        R                  " X5      n [        R                  S;  a/  UR                  [        R                  [        R                  S5        UR                  U5        U[        R                  :X  a  UR                  S5        U$ ! [         a    UR                  5         e f = f)zBinds a generic socket.rk  r   >   ntcygwinrl  r   )r   r   r@  r   r   
setsockopt
SOL_SOCKETSO_REUSEADDRrA  r   listenr   r$  )familytypeaddrr'  s       r{   rU   rU     s    |7H"55==&D	77**OOF--v/B/BAF		$6%%%KKN 

s   A:B( (Cc                    [         R                  (       d   e[        R                  R	                  U 5      (       a   U 5       e[
        R
                  " [
        R                  U5      n UR                  U 5        U[
        R                  :X  a  UR                  S5        U$ ! [         a    UR                  5         e f = f)zBind a UNIX socket.r   )r   r   r   r   r   r@  r   rA  r   rK  r   r$  )r   rM  r'  s      r{   rV   rV     s    <<<ww~~d##)T)#==.D		$6%%%KKN K  

s   )6B! !B=c                    [         R                   " U [        5       nUR                  U5        UR                  S5        UR	                  5       n[         R                   " U [        5      n UR                  U5        UR	                  5       n UR                  5       u  pQX:X  a  XS4sSSS5        $ UR                  5         M5  ! [         a    UR                  5         e f = f! , (       d  f       g= f)zVBuild a pair of TCP sockets connected to each other.
Return a (server, client) tuple.
r   N)	r@  r   rA  rK  rB  connectr   r$  rQ  )rL  rN  llrq  caddras         r{   rW   rW     s     
v{	+r

		!~~MM&+.	IIdOMMOE))+=6 
,	+ 	   	GGI	 
,	+s$   AC!+;C0CCC!!
C/c                    [         R                  (       d   eS=p [        U [        R                  S9nUR                  S5        [        R                  " [        R                  [        R                  5      nUR                  S5        UR                  U 5        X4$ ! [         a(    Ub  UR                  5         Ub  UR                  5         e f = f)zwBuild a pair of UNIX sockets connected to each other through
the same UNIX file name.
Return a (server, client) tuple.
NrM  r   )
r   r   rV   r@  r   setblockingr   rQ  r   r$  )r   serverclients      r{   rX   rX     s    
 <<<F!$V-?-?@1v~~v/A/AB1t   LLNLLNs   A>B 2Cc               #   f  #    / n S=p U R                  [        [        R                  [        R                  5      [        [        R                  [        R
                  5      45        [        5       (       a_  U R                  [        [        R                  [        R                  5      [        [        R                  [        R
                  5      45        [        (       a`  [        (       aU  [        5       n[        5       n[        U5      u  p4[        U[        R
                  S9nX4U4 H  nU R                  U5        M     U v   U  H  nUR                  5         M     X4 H  nUc  M  [        U5        M     g! U  H  nUR                  5         M     X4 H  nUc  M  [        U5        M     f = f7f)z1Open as many socket families / types as possible.NrV  )extendrU   r@  r   r   
SOCK_DGRAMr   r   r   r0   rL   rX   rV   rp  r$  rI   )socksfname1fname2s1s2s3r  r  s           r{   rY   rY     sJ     EF#(:(:;(9(9:
 	 ??LLFOOV-?-?@FOOV->->?  5--\F\F$V,FB!&v/@/@ABb\Q "AGGI %E E" & AGGI %E E" &s)   F1D<E9  F1)F19!F.F..F1c                    [        U[        R                  5      (       d   U5       eU[        R                  :X  a|  U R                  S5       Vs/ s H  n[        U5      PM     nn[        U5      S:X  d   U 5       eU H  nSUs=::  a  S::  a  M   U 5       e   U 5       e   [        R                  " U 5        gU[        R                  :X  a3  [        U [        5      (       d   U 5       e[        R                  " U 5        gU[        R                  :X  a   [        R                   " SU 5      c   U 5       eg[#        SU< 35      es  snf )zSCheck a net address validity. Supported families are IPv4,
IPv6 and MAC addresses.
rf   r   r      z([a-fA-F0-9]{2}[:|\-]?){6}Nzunknown family )r7  enumIntEnumr@  r   rt   rs   rp  	ipaddressIPv4Addressr   r8  IPv6Addressr   AF_LINKr  r  r   )rN  rL  r  octsnums        r{   rR   rR     s
    fdll++3V3+ $

301A04yA~#t#~C?s?(D(?(D(? d#	6??	"$$$*d*$d#	6>>	!xx5t<HN$NH?6*566 1s   Ec                 r    S nS nS nS nS nU" U 5        U" U 5        U" U 5        U" U 5        U" U 5        g)z*Check validity of a connection namedtuple.c                 f   [        U 5      S:H  n[        U 5      S;   d   [        U 5      5       eU S   U R                  :X  d   U R                  5       eU S   U R                  :X  d   U R                  5       eU S   U R                  :X  d   U R                  5       eU S   U R                  :X  d   U R                  5       eU S   U R
                  :X  d   U R
                  5       eU S   U R                  :X  d   U R                  5       eU(       a%  U S	   U R                  :X  d   U R                  5       eg g )
Nr   >   rO  r   r   rl  rg   r   r   r   rO  )rp  r[  rL  rM  laddrraddrr  r  )r)  has_pids     r{   check_ntuple-check_connection_ntuple.<locals>.check_ntuple  s   d)q.4yF"-CI-"Aw$''!*477*!Aw$++%2t{{2%Aw$))#.TYY.#Aw$**$0djj0$Aw$**$0djj0$Aw$++%2t{{2%7dhh&00& r}   c                    U R                   [        [        [        1;   d   U R                   5       e[	        U R                   [
        R                  5      (       d   U 5       eU R                   [        :X  aV  [        R                  " U R                   U R                  5       n UR                  U R                  S   S45        S S S 5        g U R                   [        :X  a0  U R                  [        R                   :X  d   U R                  5       eg g ! [         a)  nUR                  [        R                  :w  a  e  S nAN|S nAff = f! , (       d  f       g = fr  )rL  r   r   r   r7  re  rf  r@  rM  rA  ro  rQ  errnoEADDRNOTAVAILr  r   	CONN_NONE)r)  r  rS  s      r{   check_family-check_connection_ntuple.<locals>.check_family   s    {{w'::GDKKG:$++t||44:d:4;;'!
 t{{DII6!FFDJJqM1-. 76 [[G#;;&"2"22?DKK?2 $  yyE$7$77 8 76s0    E" D
ED>9E>EE
Ec                    [        [        S[        5       5      nU R                  [        R                  [        R
                  U1;   d   U R                  5       e[        U R                  [        R                  5      (       d   U 5       eU R                  [        R
                  :X  a0  U R                  [        R                  :X  d   U R                  5       eg g )NSOCK_SEQPACKET)r   r@  objectrM  r   r\  r7  re  rf  r  r   rw  )r)  r{  s     r{   
check_type+check_connection_ntuple.<locals>.check_type1  s     )968Dyy
 
 	 99		 

 $))T\\228D8299)));;&"2"22?DKK?2 *r}   c                 T   U R                   U R                  4 GH  nU R                  [        [        1;   a  [        U[        5      (       d   [        U5      5       eU(       d  ML  [        UR                  [        5      (       d   [        UR                  5      5       eSUR                  s=::  a  S::  d  O   UR                  5       e[        UR                  U R                  5        M  U R                  [        :X  d  M  [        U[        5      (       a  M   [        U5      5       e   g )Nr   i  )ro  rp  rL  r   r   r7  rq   rM  portrs   rR   ipr   r8  )r)  rN  s     r{   check_addrs,check_connection_ntuple.<locals>.check_addrs=  s    ZZ,D{{w11!$..:T
:.!$))S11B4		?B1DII..9		9.!$''4;;7'!$,,8d4j8, -r}   c                 R   [        U R                  [        5      (       d   U R                  5       e[        [        5       Vs/ s H*  oR                  S5      (       d  M  [        [        U5      PM,     nnU R                  U;   d   U R                  5       eU R                  [        [        1;   aD  U R                  [        :X  a0  U R                  [        R                  :w  d   U R                  5       eg U R                  [        R                  :X  d   U R                  5       eg s  snf )NCONN_)r7  r  r8  r   r   
startswithr   rL  r   r   rM  r   rw  )r)  r  validss      r{   check_status-check_connection_ntuple.<locals>.check_statusJ  s    $++s++8T[[8+(+F
(31||G7LGFA 	 
 {{f$1dkk1$;;7H--$)){2J;;&"2"22?DKK?2;;&"2"22?DKK?2
s   D$D$Nr  )r)  rr  rx  r}  r  r  s         r{   check_connection_ntupler    sH    
1@"
@9	@ tr}   c                     / nU  Hh  n[         (       aI  UR                  [        R                  :X  a+  [        (       a   SUR
                  ;   a  [        SU 35        MW  UR                  U5        Mj     U$ )zlOur process may start with some open UNIX sockets which are not
initialized by us, invalidating unit tests.
z/syslogz	skipping )r   rL  r@  r   r   rp  r   rp  )consnewr)  s      r{   rS   rS   \  s\     C5T[[FNN2udjj0	$()

4  Jr}   c                 .    [         R                  " U 5      $ r   )	importlibreload)modules    r{   rZ   rZ   o  s    F##r}   c                 6   [         R                  R                  [         R                  R                  U 5      5      S   n[        R
                  R                  X5      n[        R
                  R                  U5      nUR                  R                  U5        U$ r  )
r   r   splitextr  r  utilspec_from_file_locationmodule_from_specloaderexec_module)r   r   specmods       r{   r[   r[   s  si    77BGG,,T23A6D>>11$=D
..
)
)$
/CKKC Jr}   c                 8    [         R                  " U [        SS9  g)zRaise a warning msg.rg   r  N)r  r\   r  )r  s    r{   r\   r\     s    MM#{q1r}   c                     [        U 5      nUR                  n[        U5      S:w  d  US   [        La  g[	        USS5      n[        U[        5      (       d  g[        S U 5       5      $ )z-Check if object is an instance of namedtuple.rl  r   F_fieldsNc              3   B   #    U  H  n[        U[        5      v   M     g 7fr   )r7  r8  )r  ns     r{   r   is_namedtuple.<locals>.<genexpr>  s     -1az!S!!1s   )rM  	__bases__rp  rq   r   r7  r&  )r  tbr1  s       r{   r^   r^     s\    QA	A
1v{ad%'9d#Aa-1---r}   c              #   .  #    [         (       a  SOSnSn[        X-   S9n[        R                  " 5       R	                  5        Vs/ s H`  n[
        R                  R                  UR                  5      S   U:X  d  M5  XR                  R                  5       ;   d  MT  UR                  PMb     nn[        R                  " U5      n[        R                  " Xc5         [        R                  " U5        Uv   [        U5        gs  snf ! [        U5        f = f7f)zCtx manager which picks up a random shared CO lib used
by this process, copies it in another location and loads it
in memory via ctypes. Return the new absolutized path.
pypyr  z.sor  rl  N)r   rL   r   r   r   r   r   r  lowerr  r  r   r  ctypesCDLLrI   )r  r   extdstr  libsr&  s          r{   r]   r]     s      f(- ^^%113
3ww'*c1 69VV\\^6K AFF3 	 

 mmD!!	KKI
 s6   AD4D <D D +.DD 4DDDc              #   &  #    SSK Jn  SSK Jn  Sn[        X-   S9n[        R
                  " 5       R                  5        Vs/ s H  nUR                  R                  5       R                  U5      (       d  M3  S[        R                  R                  UR                  5      R                  5       ;   d  Mp  SUR                  R                  5       ;  d  M  UR                  PM     nn[        (       a  U(       dz  [        R
                  " 5       R                  5        Vs/ s HL  nS[        R                  R                  UR                  5      R                  5       ;   d  M@  UR                  PMN     nn[        R                  " U5      n[        R                   " Xt5        S	n [         R"                  " U5      nUv   UbU  [         R$                  R&                  R(                  n	UR*                  /U	l        U	" UR.                  5      n
U
S:X  a  U" 5       e[1        U5        g	s  snf s  snf ! UbU  [         R$                  R&                  R(                  n	UR*                  /U	l        U	" UR.                  5      n
U
S:X  a  U" 5       e[1        U5        f = f7f)
zCtx manager which picks up a random shared DLL lib used
by this process, copies it in another location and loads it
in memory via ctypes.
Return the new absolutized, normcased path.
r   )WinError)wintypesz.dllr  r  wow64r  N)r  r  r  rL   r   r   r   r   r  r=  r   r  r   r  r  r   r  WinDLLwindllkernel32FreeLibraryHMODULEargtypes_handlerI   )r  r  r  r  r  r  r  r&  cfiler  r  s              r{   r]   r]     s     	$#- ^^%113
3vv||~&&s+  BGG,,QVV4::<<  qvv||~-	 AFF3 	 
 4  )5577ARWW--aff5;;== 7  
 mmD!!	MM#&EI  $mm44@@(0(8(8'9$!%--0!8"*$?
"  $mm44@@(0(8(8'9$!%--0!8"*$sO   ?J2H79H4HH$9J?H$ H$00J!H) ;A.J)A%JJc                      [        SS9  g )NTrd  )r8   r  r}   r{   cleanup_test_procsr    s
    D!r}   c                 .    [         R                  " U 5      $ r   )rw   exit)rK  r*  s     r{   r  r    s    #r}   r   )F)TFr8  )z	127.0.0.1)rE  r   )r   r  r  r  re  ru  r   rg  r  rg  r   ro   r  r  r!  r9  r   rG  r@  r  ru   rw   r  r  r   r   r=   r  r   r   r   r  r  r   r   r   r   r	   r
   r   r   r   psutil._commonr   r   r   r   r   psutil._psposixr   __all__builtin_module_namesr   r   r`   r    r3   r5   maxsizer#   r  r4   r|   r1   r2   r   r   r"   r   r   r  r   r   decoder   r  r  ASCII_FSr   r   r   r  __file__r   getr   r  r  r   r$   r%   r&   r.  r(   r)   r0   HAS_NET_IO_COUNTERSr*   r'   r+   r,   r  r   r-   r   r.   r/   HAS_THREADSgetuidSKIP_SYSCONSr   r   r   r.  devnullr   r  r$  r   r  r   r!   r|  r   r   r  r  r   r<   r   r9   r;   r:   r6   r@  r  r7   r8   rN   rM   r|  rC  rP   r  r  rQ   rO   rI   r  r  rH   rJ   rK   rL   rG   r  rB   r  r  rA   rE   rF   r  rC   rD   r@   r>   r?   rT   rU   rV   rW   rX   rY   rR   r  rS   rZ   r[   r\   r^   r]   r  )r  s   0r{   <module>r     s%  
        	   	   	        
                   &   " & ( 	(#Z S---!RZZ/O>RZZ3O
RZZ''2::5;;



	
) 	 	( 	 ?X-L ?g-LLL 
# ' !OJaNA
 77fryy{m1-Mryy{m1-M%,,V5FG $$&,,.2GG 77GGLL*D$7 jjnn"'',,x; 
ww12 6>>>: vz*fnni0.V^^X.
&..-8 .Y f&78 6>>95 v~~}= V^^X.
f&78 %H$v/E/E/G*HK 6>2 "6+AB fnni02"))+"2
)X )] 
N
rzz4
    !$F +1||I/FGFA  &)VX
. (!! (`	 & &R # #L&R  &  0  &~~N Q/h-J!06 6r ""	  .1	 	D  4&J# J#Z 
>FBX&& B` D!56b%^ b% 7b%JiX$FL FLRC@ C@L ( 
&:% [t " !' 2 2 .. # #<7(HV&$2
	. 	 . * *f " " 	
MM&..">? 	}=  FH  Kts0   Z  Z  Z#Z#ZZZ Z 