Viewing File: /opt/imunify360/venv/lib/python3.11/site-packages/psutil/__pycache__/_compat.cpython-311.pyc



]j8
dZddlZddlZddlZddlZddlZddlZgdZejddkZ	e
Ze	reZ
eZeZeZeZdZdZne
Z
eZeZeZdZdZe	reZn	eZeed	fd
Ze	r
eZeZeZeZeZeZnddlZefdZee dZee d
Zee dZee dZee dZee dZej!dkr,	e"ej#d#e$rYne"$re$dwxYw	ddlm%Z%nr#e&$rj	ddl'm(Z(n#e&$r	ddl)m(Z(YnwxYwej*dgdZ+Gdde,Z-e
fe.eee/e0dfe1e2e0e3fdZ4d$dZ%YnwxYw	ddl5m6Z6n#e&$rej7ej8zdfd Z6YnwxYw	dd!l5m9Z9dS#e&$rd%d#Z9YdSwxYw)&zModule which provides compatibility with older Python versions.
This is more future-compatible rather than the opposite (prefer latest
Python 3 way of doing things).
N)PY3longrangesuperunicode
basestringub	lru_cachewhichget_terminal_sizeFileNotFoundErrorPermissionErrorProcessLookupErrorInterruptedErrorChildProcessErrorFileExistsErrorc|SNss E/opt/imunify360/venv/lib64/python3.11/site-packages/psutil/_compat.pyr	r	+c,|dS)Nzlatin-1)encoders rr
r
.sxx	"""rc"t|dS)Nunicode_escape)rrs rr	r	6sq*+++rc|Srrrs rr
r
9rrc`|tur}tj|}	|j|jjd}n$#ttf$rtdwxYw	|j	}nB#ttf$r.	|jj	}n#t$rtdwxYwYnwxYw|D]}|j
D]}	t|tjsft|t"r|j}n/	|j}n&#t$r|||}YnwxYwt|tjfn#tt*f$rYwxYw|j|jurnntd|turt/||St/|S)zuLike Python 3 builtin super(). If called without any arguments
        it attempts to infer them at runtime.
        rz'super() used in a function with no argsz$super() used in a non-newstyle classzsuper() called outside a method)	_SENTINELsys	_getframef_localsf_codeco_varnames
IndexErrorKeyErrorRuntimeError__mro__AttributeError	__class____dict__values
isinstancetypesFunctionTypepropertyfget__func____get__	TypeError	func_code_builtin_super)type_type_or_obj
framedepthfmromeths      rrrHs6I
j))A
Nj)=a)@A)
N
N
N"#LMMM
N
O!)"L1
O
O
OO%/7CC%OOO&'MNNNOC
O

F
F!N1133D
!",T53E"F"F
L)$99	L(,y!L+/=DD'5!L!L!L+/<<U+K+KDDD!L#-T53E"F"F
L+I6!!! !~112"#DEEEi''!%555e$$$si>!A#A++B*=B
	B*
B$$B*)B*
7ED
E
 D0-E/D00EE"!E"cfd}|S)Nc^Gfddj_j_S)NcBeZdZfdZGfddeZxZS)E_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClassc	0t|dkrft|drP|d}t|D]6}|dst	||t||7dSt
|j|i|dS)Nr"r__)lenr2dir
startswithsetattrgetattrr__init__)selfargskwargs	unwrap_meattrTemporaryClassr/s     rrMzN_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClass.__init__s4yyA~~*T!Wn*M*M~$(G	$'	NNNND#'??4#8#8N 'dGIt4L4L M M MNN=nd33<dMfMMMMMrc eZdZfdZdZdS)S_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClass.__metaclass__c|Srr)clsinstinstance_checkers  r__instancecheck__ze_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClass.__metaclass__.__instancecheck__s//555rcTtjd}t||SNr")r%exc_infor2)rW	classinfovalues   r__subclasscheck__ze_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClass.__metaclass__.__subclasscheck__s" #q 1)%555rN)__name__
__module____qualname__rZr`)rYsr
__metaclass__rUs=6666666666rrd)rarbrcrMtyperd
__classcell__)r/rSrYs@rrSrEsxNNNNNN6666666D6666666rrS)ra__doc__)rYrSbase_exceptions`@rwrappedz-_instance_checking_exception.<locals>.wrappeds\
6
6
6
6
6
6
6
6
6
6
6&'7&?N#%5%=N"!!rr)rhris` r_instance_checking_exceptionrjs#	"	"	"	"	"0rcJt|dttjkSNerrno)rLr$rmENOENTrXs rrrtWi00EL@@rcJt|dttjkSrl)rLr$rmESRCHros rrrtWi00EK??rc^t|dttjtjfvSrl)rLr$rmEACCESEPERMros rrrs)tWi00L%+5''	'rcJt|dttjkSrl)rLr$rmEINTRros rrrrsrcJt|dttjkSrl)rLr$rmECHILDros rrrrprcJt|dttjkSrl)rLr$rmEEXISTros rrrrprCPythonpermzbbroken or incompatible Python implementation, see: https://github.com/giampaolo/psutil/issues/1659)r)RLock	CacheInfo)hitsmissesmaxsizecurrsizec"eZdZdZefdZdZdS)
_HashedSeq	hashvaluec4||dd<|||_dSrr)rNtuphashs   rrMz_HashedSeq.__init__s"DG!T#YYDNNNrc|jSrr)rNs r__hash__z_HashedSeq.__hash__s
>!rN)rarbrc	__slots__rrMrrrrrrs?	%)	'	'	'	'	"	"	"	"	"rrc	H|}	|r,||}
|	|z
}	|
D]}|	|z
}	|r7|	|fd|Dz
}	|r|	|fd|
Dz
}	n*||	dkr|	d|vr|	dSt|	S)Nc3.K|]}|VdSrr).0vres  r	<genexpr>z_make_key.<locals>.<genexpr>s+//Qa//////rc34K|]\}}|VdSrr)rkrres   rrz_make_key.<locals>.<genexpr>s/>>ATT!WW>>>>>>rr"r)itemsr)rOkwdstypedkwd_mark	fasttypessortedtuplererHkeysorted_itemsitems       `    r	_make_keyrs	!6$**,,//L8OC$

t	55////$//////C
?uu>>>>>>>>>>
SXX]]ttCF||y88q6M#rdFcfd}|S)z~Least-recently-used cache decorator, see:
        http://docs.python.org/3/library/functools.html#functools.lru_cache
        c	

tddgd\tjt
t	
gddgdd<gd\	dkrfd}n$f	d}n	

fd}
fd}
fd}|_||_||_tj	|S)	Nr)rr")rr"rc8|i|}xxdz
cc<|Sr\r)rOrresultMISSESstats
user_functions   rwrapperz7lru_cache.<locals>.decorating_function.<locals>.wrapper	s2*]D9D99F&MMMQ&MMM!Mrc	||}|	}|	ur
xxdz
cc<|S|i|}||<
xxdz
cc<|Sr\r)
rOrrrHITSrcache	cache_getmake_keyrootrrrs
    rrz7lru_cache.<locals>.decorating_function.<locals>.wrappers"(4u55C&YsD11FT))dq(%
*]D9D99F!'E#J&MMMQ&MMM!Mrc|sr||}n|}	|}|W\}|\}}}}||<||<|}|x|<|<||<||<xxdz
cc<|S	n#wxYw|i|}	\}|vrn`kr4|}	||	<||	<|	x}d<|}
dx|<|<|
=|	|<n|}||||g}|x|<x|<|<
xxdz
cc<n#wxYw|S)Nr"r)acquirerelease)rOrrlinkr	link_prev	link_nextrlastoldrootoldkeyrKEYrNEXTPREVRESULT_lenrrlockrr
nonlocal_rootrrrs           rrz7lru_cache.<locals>.decorating_function.<locals>.wrappers#u#&htT599"LLNNN'(y~~+$1ED@D=Iy#v.7IdO.7IdO#':D6::DJd)-DJ)-DJ!$KKK1,KKK#),*]D9D99FLLNNN' -%<< !T%[[G33&*G+.GCL.4GFO6=dmCD=#3%)#YF7;;DIV %f
)0E#JJ#':D$($V#<DCGGDJGdeCjf


*


!MsAB%%B;A9E))E?c	ttS#wxYw)zReport cache statistics)r
_CacheInforHr)rrrrrrsr
cache_infoz:lru_cache.<locals>.decorating_function.<locals>.cache_infoFs\#%eDk5='&)%jj22LLNNNNDLLNNNNs*AA,c	d}||ddg|dd<ddgdd<dS#wxYw)z$Clear the cache and cache statisticsrN)rclearr)rrrrrs rcache_clearz;lru_cache.<locals>.decorating_function.<locals>.cache_clearOsv#KKMMM(+D#T46DG !1vE!!!HLLNNNNNDLLNNNNs0AA3)
dictrgetrHr__wrapped__rr	functoolsupdate_wrapper)rrrrrrrrrrrrrrrrrrrrs`   @@@@@@@@@@@@@@rdecorating_functionz&lru_cache.<locals>.decorating_functionsFFEFELD& H	ID77DDT4.DG!FM&0#D$V!||""""""""	"	"	"	"	"	"	"	"	"	"	"	"	"	"+"+"+"+"+"+"+"+"+"+"+"+"+"+"+"+"+"+"+"+"Z
#
#
#
#
#
#
#
#
#
#	
#	
#	
#	
#	
#	
#	
#	
##0G!+G"-G+G]CCCrr)rrrs`` rrrs7a	Da	Da	Da	Da	Da	DF#"r)rcfd}tjr||rSdS|*tjdtj}|sdS|tj}tj	dkrtj
|vr |dtj
tjddtj}tfd|Drg}nfd	|D}ng}t}|D]q}tj|}||vrL|||D]4}	tj||	}
||
|r|
ccS5rdS)
aJGiven a command, mode, and a PATH string, return the path which
        conforms to the given mode on the PATH, or None if there is no such
        file.

        `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result
        of os.environ.get("PATH"), or can be overridden with a custom search
        path.
        ctj|o4tj||otj|Sr)ospathexistsaccessisdir)fnmodes  r
_access_checkzwhich.<locals>._access_checkosDGNN2&&*29R+>+>*

b)))
+rNPATHwin32rPATHEXTc3K|]=}|V>dSr)lowerendswithrextcmds  rrzwhich.<locals>.<genexpr>sAHH399;;''		44HHHHHHrcg|]}|zSrrrs  r
<listcomp>zwhich.<locals>.<listcomp>s666ss666r)rrdirnameenvironrdefpathsplitpathsepr%platformcurdirinsertanysetnormcaseaddjoin)rrrrpathextfilesseenrInormdirthefilenames`          rrrfs	+	+	+7??3	}S$''

4<:>>&"*55D	4zz"*%%<7""y$$Ary)))jnnY3399"*EEGHHHHHHHHH
76666g666EEuu	$	$Cg&&s++Gd""!!!$$$G7<<W55D$}T400$#$tr)r
Pc	ddl}ddl}ddl}	|d|d|jd}|d|dfS#t$r|cYSwxYw#t$r|cYSwxYw)Nrhhr"1234)fcntltermiosstructunpackioctl
TIOCGWINSZ	ExceptionImportError)fallbackrrrress     rr
r
s
	 LLLNNNMMM
 mm%++a);VDDFFAA''
 
 
 
 			OOO	s"A!?AAA!A0/A0)rF)r):rgcollectionsrmrrr%r3__all__version_inforobjectr$intrrxrangestrrrr	r
rr;rrrrrrrrrjEnvironmentErrorpython_implementationOSErrorr|r,rr	threadingrdummy_threading
namedtuplerlistrr	frozensetrerrrHrshutilrF_OKX_OKr
rrr<module>rs

				




@
@
@ 
qQFHH	D
FGJE####DEGJ,,,7%EEN92%2%2%2%pHC)%O+')%OOOOO4=6"!"233AA43A"!"233@@43@"!"233''43'"!"233@@43@"!"233AA43A"!"233AA43A&x%''944	C'%,///			D	C	C	C,BCC
C	CN########L#L#L#*#######***))))))))*('>>>@@J"""""T"""#FHH<Cc9dd4jj ABBu4S$g#g#g#g#g#g#KL#`0..."')------.d ((((((((           sm
DD5%D59EF/E
F/
EF/EAF/.F/3F::GGG!!	G.-G.
Back to Directory File Manager