Viewing File: /opt/alt/python38/lib64/python3.8/site-packages/psutil/__pycache__/_compat.cpython-38.opt-1.pyc

U

xe_8@sdZddlZddlZddlZddlZddlZddlZddddddd	d
ddd
ddddddgZejddkZ	e
Ze	reZ
eZeZeZeZdd	Zdd
Zn e
Z
eZeZeZdd	Zdd
Ze	reZneZeedfddZe	reZeZeZeZeZeZnddlZefddZee ddZee ddZee ddZee d dZee d!dZee d"dZe!d#krze"ej#d$Wn2ek
rYne"k
re$d%YnXzdd&lm%Z%Wne&k
rlzdd'l'm(Z(Wn"e&k
rdd'l)m(Z(YnXe*d(d)d*d+d,gZ+Gd-d.d.e,Z-e
fe.eee/e0dfe1e2e0e3fd/d0Z4d9d3dZ%YnXzdd4l5m6Z6Wn,e&k
rej7ej8Bdfd5dZ6YnXzdd6l5m9Z9Wn e&k
rd:d8d
Z9YnXdS);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).
NPY3longrangesuperunicode
basestringub	lru_cachewhichget_terminal_sizeFileNotFoundErrorPermissionErrorProcessLookupErrorInterruptedErrorChildProcessErrorFileExistsErrorcCs|SNsrrA/opt/alt/python38/lib64/python3.8/site-packages/psutil/_compat.pyr+scCs
|dS)Nzlatin-1)encoderrrrr	.scCs
t|dS)NZunicode_escape)rrrrrr6scCs|Srrrrrrr	9scCsb|tkrFt|}z|j|jjd}Wn ttfk
rJtdYnXz
|j	}WnBt
tfk
rz|jj	}Wnt
k
rtdYnXYnX|D]}|j
D]}zPt|tjst|tr|j}qz
|j}Wqt
k
r|||}YqXqWnt
tfk
rYqYnX|j|jkrq6qqqFqtd|tk	rZt||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__	TypeErrorZ	func_code_builtin_super)Ztype_Ztype_or_objZ
framedepthfmroZmethrrrrHsB







csfdd}|S)Ncs*Gfdddj_j_S)Ncs2eZdZfddZGfdddeZZS)zE_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClasscsdt|dkrNt|drN|d}t|D] }|ds*t||t||q*nt|j||dS)Nrr__)lenr)dir
startswithsetattrgetattrr__init__)selfargskwargsZ	unwrap_meattr)TemporaryClassr&rrr:s
zN_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClass.__init__cs eZdZfddZddZdS)zS_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClass.__metaclass__cs|Srr)clsinstinstance_checkerrr__instancecheck__sze_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClass.__metaclass__.__instancecheck__cSstd}t||SNr)rexc_infor))r@Z	classinfovaluerrr__subclasscheck__sze_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClass.__metaclass__.__subclasscheck__N)__name__
__module____qualname__rDrHrrBrr
__metaclass__srL)rIrJrKr:typerL
__classcell__rr?rC)r&rr?s	r?)rI__doc__rBbase_exceptionrOrwrappedsz-_instance_checking_exception.<locals>.wrappedr)rRrSrrQr_instance_checking_exceptionsrTcCst|dttjkSNerrno)r9rrVZENOENTrArrrr
scCst|dttjkSrU)r9rrVZESRCHrWrrrrscCst|dttjtjfkSrU)r9rrVZEACCESZEPERMrWrrrrs
cCst|dttjkSrU)r9rrVZEINTRrWrrrrscCst|dttjkSrU)r9rrVZECHILDrWrrrrscCst|dttjkSrU)r9rrVEEXISTrWrrrrsZCPythonZpermzbbroken or incompatible Python implementation, see: https://github.com/giampaolo/psutil/issues/1659)r
)RLock	CacheInfohitsmissesmaxsizecurrsizec@s$eZdZdZefddZddZdS)
_HashedSeq	hashvaluecCs||dd<|||_dSrr`)r;tuphashrrrr:sz_HashedSeq.__init__cCs|jSrra)r;rrr__hash__sz_HashedSeq.__hash__N)rIrJrK	__slots__rcr:rdrrrrr_sr_c	s|}	|r.||}
|	|7}	|
D]}|	|7}	q |rl|	|fdd|D7}	|r|	|fdd|
D7}	n$||	dkr|	d|kr|	dSt|	S)Nc3s|]}|VqdSrr).0vrMrr	<genexpr>sz_make_key.<locals>.<genexpr>c3s|]\}}|VqdSrr)rfkrgrhrrrisrr)itemsr_)r<kwdstypedkwd_mark	fasttypessortedtuplerMr5keyZsorted_itemsitemrrhr	_make_keys
rtdFcsfdd}|S)z~Least-recently-used cache decorator, see:
        http://docs.python.org/3/library/functools.html#functools.lru_cache
        cstddg
d\t
jtt	gddgdd<gd\dkrn
fdd}nPdkr

f	dd}n*	

fdd}	
fdd	}	
fd
d}|_||_||_t	|S)Nr)rr)rrrcs||}d7<|SrEr)r<rlresult)MISSESstats
user_functionrrwrapper	s
z7lru_cache.<locals>.decorating_function.<locals>.wrappercsX||}|}|k	r2d7<|S||}||<d7<|SrEr)r<rlrrrw)	HITSrxcache	cache_getmake_keyrootryrmrzrrr{s

csp|sr
||}n|}	zv|}|dk	r\}|\}}}}||<||<|}||<|<||<||<
d7<|WSW5	X||}	z\}|krnkr"|}	||	<||	<|	}d<|}
d|<|<|
=|	|<n,|}||||g}||<|<|<
d7<W5	X|S)Nrr)acquirerelease)r<rlrrlinkrZ	link_prevZ	link_nextrwZlastZoldrootZoldkey)r|KEYrxNEXTPREVRESULT_lenr}r~lockrr]
nonlocal_rootryrmrzrrr{sN



cs6zttWSXdS)zReport cache statisticsN)rr
_CacheInfor5r)r|rxr}rr]ryrr
cache_infoFsz:lru_cache.<locals>.decorating_function.<locals>.cache_infocsPz8d}||ddg|dd<ddgdd<W5XdS)z$Clear the cache and cache statisticsrN)rrclear)r)r}rrryrrcache_clearOsz;lru_cache.<locals>.decorating_function.<locals>.cache_clear)
dictrtgetr5rY__wrapped__rr	functoolsupdate_wrapper)rzr{rrr]rm)r|rrxrrrrr}r~rrrrryrzrdecorating_functions,*-	z&lru_cache.<locals>.decorating_functionr)r]rmrrrrr
sc)rcs"dd}tjr&||r"SdS|dkr>tjdtj}|sFdS|tj}tj	dkrtj
|krt|dtj
tjddtj}tfd	d
|Drg}q‡fdd|D}ng}t
}|D]P}tj|}||kr|||D](}	tj||	}
||
|r|
SqqdS)
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.
        cSs&tj|o$t||o$tj|Sr)ospathexistsaccessisdir)fnmoderrr
_access_checkoszwhich.<locals>._access_checkNPATHZwin32rZPATHEXTc3s |]}|VqdSr)lowerendswithrfZextcmdrrriszwhich.<locals>.<genexpr>csg|]}|qSrrrrrr
<listcomp>szwhich.<locals>.<listcomp>)rrdirnameenvironrdefpathsplitpathseprplatformcurdirinsertanysetnormcaseaddjoin)rrrrZpathextfilesseenr6ZnormdirZthefilenamerrrrfs8	




)rPcCs~zddl}ddl}ddl}Wntk
r4|YSXz*|d|d|jd}|d|dfWStk
rx|YSXdS)NrZhhrZ1234)fcntltermiosstructImportErrorunpackZioctlZ
TIOCGWINSZ	Exception)Zfallbackrrrresrrrrs
)ruF)r):rPcollectionsrVrrrr*__all__version_inforobjectrintrrZxrangestrrrrr	rr1r
rrrrrrrrTEnvironmentErrorZpython_implementationOSErrorrXr#r
rZ	threadingrYZdummy_threading
namedtuplerlistr_r	frozensetrMrprqr5rtZshutilrF_OKX_OKrrrrr<module>s

8








k1
Back to Directory File Manager