Your IP : 3.145.1.49


Current Path : /opt/alt/python37/lib64/python3.7/site-packages/psutil/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/site-packages/psutil/__pycache__/_compat.cpython-37.pyc

B

xe�_�8�@s�dZddlZddlZddlZddlZddlZddlZddddddd	d
ddd
ddddddgZejddkZ	e
�Ze	r�eZ
eZeZeZeZdd	�Zdd
�Zn e
Z
eZeZeZdd	�Zdd
�Ze	r�eZneZeedfdd�Ze	r�eZeZeZeZeZeZn�ddlZefdd�Zee �dd��Zee �dd��Zee �dd��Zee �d d��Zee �d!d��Zee �d"d��Ze�!�d#k�r�ye"ej#d$��Wn2ek
�r�Yne"k
�r�e$d%��YnXydd&lm%Z%Wn�e&k
�rlydd'l'm(Z(Wn"e&k
�rdd'l)m(Z(YnXe�*d(d)d*d+d,g�Z+Gd-d.�d.e,�Z-e
�fe.eee/e0d�f�e1e2e0e3fd/d0�Z4d9d3d�Z%YnXydd4l5m6Z6Wn,e&k
�r�ej7ej8Bdfd5d�Z6YnXydd6l5m9Z9Wn e&k
�r�d:d8d
�Z9YnXdS);z�Module 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�PY3�long�range�super�unicode�
basestring�u�b�	lru_cache�which�get_terminal_size�FileNotFoundError�PermissionError�ProcessLookupError�InterruptedError�ChildProcessError�FileExistsError�cCs|S)N�)�srr�A/opt/alt/python37/lib64/python3.7/site-packages/psutil/_compat.pyr+scCs
|�d�S)Nzlatin-1)�encode)rrrrr	.scCs
t|d�S)NZunicode_escape)r)rrrrr6scCs|S)Nr)rrrrr	9s�cCsh|tk�rLt�|�}y|j|jjd}Wn ttfk
rJtd��YnXy
|j	}WnBt
tfk
r�y|jj	}Wnt
k
r�td��YnXYnXx�|D]�}x�|j�
�D]�}yXxRt|tj��st|t�r�|j}q�y
|j}Wq�t
k
�r|�||�}Yq�Xq�WWnt
tfk
�r(w�YnX|j|jkr�Pq�Wq�Pq�Wtd��|tk	�r`t||�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)�	_SENTINEL�sys�	_getframe�f_locals�f_code�co_varnames�
IndexError�KeyError�RuntimeError�__mro__�AttributeError�	__class__�__dict__�values�
isinstance�types�FunctionType�property�fget�__func__�__get__�	TypeError�	func_code�_builtin_super)�type_Ztype_or_objZ
framedepth�f�mro�methrrrrHsB







cs�fdd�}|S)Ncs*G��fdd�d����j�_�j�_�S)Ncs2eZdZ��fdd�ZG�fdd�de�Z�ZS)zE_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClasscsht|�dkrRt|d��rR|d}x@t|�D] }|�d�s,t||t||��q,Wnt�|�j||�dS)Nrr�__)�lenr'�dir�
startswith�setattr�getattrr�__init__)�self�args�kwargsZ	unwrap_me�attr)�TemporaryClassr$rrr;�s
zN_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClass.__init__cs eZdZ�fdd�Zdd�ZdS)zS_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClass.__metaclass__cs�|�S)Nr)�cls�inst)�instance_checkerrr�__instancecheck__�sze_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClass.__metaclass__.__instancecheck__cSst��d}t||�S)Nr)r�exc_infor')rAZ	classinfo�valuerrr�__subclasscheck__�sze_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClass.__metaclass__.__subclasscheck__N)�__name__�
__module__�__qualname__rDrGr)rCrr�
__metaclass__�srK)rHrIrJr;�typerK�
__classcell__r)r@rC)r$rr@�s	r@)rH�__doc__)rC)�base_exception)r@rCr�wrapped�sz-_instance_checking_exception.<locals>.wrappedr)rOrPr)rOr�_instance_checking_exception�srQcCst|dt�tjkS)N�errno)r:rrR�ENOENT)rBrrrr
�scCst|dt�tjkS)NrR)r:rrRZESRCH)rBrrrr�scCst|dt�tjtjfkS)NrR)r:rrR�EACCES�EPERM)rBrrrr�s
cCst|dt�tjkS)NrR)r:rrRZEINTR)rBrrrr�scCst|dt�tjkS)NrR)r:rrRZECHILD)rBrrrr�scCst|dt�tjkS)NrR)r:rrR�EEXIST)rBrrrr�s�CPythonZpermzbbroken or incompatible Python implementation, see: https://github.com/giampaolo/psutil/issues/1659)r
)�RLock�	CacheInfo�hits�misses�maxsize�currsizec@s$eZdZdZefdd�Zdd�ZdS)�
_HashedSeq�	hashvaluecCs||dd�<||�|_dS)N)r_)r<�tup�hashrrrr;�sz_HashedSeq.__init__cCs|jS)N)r_)r<rrr�__hash__�sz_HashedSeq.__hash__N)rHrIrJ�	__slots__rar;rbrrrrr^�sr^c	s�|}	|r2||���}
|	|7}	x|
D]}|	|7}	q"W|rp|	|�fdd�|D��7}	|r�|	|�fdd�|
D��7}	n$||	�dkr��|	d�|kr�|	dSt|	�S)Nc3s|]}�|�VqdS)Nr)�.0�v)rLrr�	<genexpr>�sz_make_key.<locals>.<genexpr>c3s|]\}}�|�VqdS)Nr)rd�kre)rLrrrf�srr)�itemsr^)r=�kwds�typed�kwd_mark�	fasttypes�sorted�tuplerLr6�keyZsorted_items�itemr)rLr�	_make_key�s
rq�dFcs��fdd�}|S)z~Least-recently-used cache decorator, see:
        http://docs.python.org/3/library/functools.html#functools.lru_cache
        cst��ddg�
d\��t�
�j�t�t��	g���ddg�dd�<�g�d\�����dkrn��
�fdd�}nP�dkr������
��
��f	dd�}n*����������	�
���
��fdd�}����	��
fdd	�}��	��
fd
d�}�|_||_||_t�	|��S)Nr)rr)rr�rcs�||�}��d7<|S)Nrr)r=ri�result)�MISSES�stats�
user_functionrr�wrapper	s
z7lru_cache.<locals>.decorating_function.<locals>.wrappercsX�||��}�|��}|�k	r2��d7<|S�||�}|�|<��d7<|S)Nrr)r=rirort)	�HITSru�cache�	cache_get�make_key�rootrvrjrwrrrxs

csl|s�r�
||��}n|}�	��zr�|�}|dk	r��\}|\}}}}||�<||�<|�}||�<|�<||�<||�<�
�d7<|SWd�	��X�||�}�	��z��\}|�kr�n�����k�r|}	||	�<||	�<|	�}�d<|�}
d|�<|�<�|
=|	�|<n,|�}||||g}||�<|�<�|<�
�d7<Wd�	��X|S)Nrr)�acquire�release)r=riro�linkr}Z	link_prevZ	link_nextrt�lastZoldrootZoldkey)ry�KEYru�NEXT�PREV�RESULT�_lenrzr{�lockr|r\�
nonlocal_rootrvrjrwrrrxsN



cs2���zt�����t���S���XdS)zReport cache statisticsN)r~�
_CacheInfor6rr)ryrurzr�r\rvrr�
cache_infoFs

z:lru_cache.<locals>.decorating_function.<locals>.cache_infocsP���z8����d}||ddg|dd�<ddg�dd�<Wd���XdS)z$Clear the cache and cache statisticsrN)r~�clearr)r})rzr�r�rvrr�cache_clearOsz;lru_cache.<locals>.decorating_function.<locals>.cache_clear)
�dictrq�getr6rX�__wrapped__r�r��	functools�update_wrapper)rwrxr�r�)r\rj)ryr�rur�r�r�r�rzr{r�r|r�r}rvrwr�decorating_function�s,*-	z&lru_cache.<locals>.decorating_functionr)r\rjr�r)r\rjrr
�sc)rcs"dd�}tj���r&|�|�r"�SdS|dkr>tj�dtj�}|sFdS|�tj�}tj	dkr�tj
|krt|�dtj
�tj�dd��tj�}t�fd	d
�|D��r��g}q‡fdd�|D�}n�g}t
�}xT|D]L}tj�|�}||kr�|�|�x(|D] }	tj�||	�}
||
|�r�|
Sq�Wq�WdS)
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�|�S)N)�os�path�exists�access�isdir)�fn�moderrr�
_access_checkoszwhich.<locals>._access_checkN�PATH�win32r�PATHEXT�c3s |]}����|���VqdS)N)�lower�endswith)rd�ext)�cmdrrrf�szwhich.<locals>.<genexpr>csg|]}�|�qSrr)rdr�)r�rr�
<listcomp>�szwhich.<locals>.<listcomp>)r�r��dirname�environr��defpath�split�pathsepr�platform�curdir�insert�any�set�normcase�add�join)r�r�r�r��pathext�files�seenr7�normdir�thefile�namer)r�rrfs8	






)r��P�cCstyddl}ddl}ddl}Wntk
r0|SXy(|�d|�d|jd��}|d|dfStk
rn|SXdS)NrZhhrZ1234)�fcntl�termios�struct�ImportError�unpackZioctlZ
TIOCGWINSZ�	Exception)�fallbackr�r�r��resrrrr�s)rrF)r�):rN�collectionsrRr�r�rr(�__all__�version_infor�objectr�intrr�xrange�strrrrr	rr0r
rrrrrr�r�rQ�EnvironmentError�python_implementation�OSErrorrVr!r
r��	threadingrXZdummy_threading�
namedtupler��listr^r��	frozensetrLrmrnr6rq�shutilr�F_OK�X_OKrrrrr�<module>s�



8
k1

?>