HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.60.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 5 05:00:59 EST 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //lib/fm-agent/dependencies/linux/python3.9/psutil/__pycache__/_compat.cpython-39.pyc
a

��i�:�@s$dZddlZddlZddlZddlZddlZddlZddlZgd�Zej	ddkZ
e�Ze
r�e
ZeZeZeZeZdd�Zdd�Zn eZeZeZeZd	d�Zd
d�Ze
r�eZneZeedfdd
�Ze
r�eZeZeZeZeZeZn�ddlZefdd�Z e e!�dd��Ze e!�dd��Ze e!�dd��Ze e!�dd��Ze e!�dd��Ze e!�dd��Ze�"�dk�r�ze#ej$d��Wn.e�y�Yne#�y�e%d��Yn0zddlm&Z&Wn�e'�yJzdd l(m)Z)Wn e'�y�dd l*m)Z)Yn0e�+d!gd"��Z,Gd#d$�d$e-�Z.e�fe/e
ee0e1d�f�e2e3e1e4fd%d&�Z5d8d)d*�Z&Yn0zdd+l6m7Z7Wn*e'�y�ej8ej9Bdfd,d-�Z7Yn0zdd.l6m:Z:Wne'�y�d9d0d1�Z:Yn0zdd2l;m<Z=Wn"e'�y�Gd3d4�d4�Z=Yn0zdd5lm>Z>Wn"e'�yej?d6d7��Z>Yn0dS):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�redirect_stderr�FileNotFoundError�PermissionError�ProcessLookupError�InterruptedError�ChildProcessError�FileExistsError�cCs|S�N���srr�@/usr/lib/fm-agent/dependencies/linux/python3.9/psutil/_compat.pyr/srcCs
|�d�S)Nzlatin-1)�encoderrrrr	2sr	cCs
t|d�S)NZunicode_escape)rrrrrr:scCs|Srrrrrrr	=s�cCsX|tu�r<t�|�}z|j|jjd}WnttfyHtd��Yn0z
|j	}Wn>t
tfy�z|jj	}Wnt
y�td��Yn0Yn0|D]�}|j�
�D]�}zNt|tj�s�t|t�r�|j}q�z
|j}Wq�t
y�|�||�}Yq�0q�Wnt
tf�yYq�Yn0|j|jur��q,q�q��q<q�td��|tu�rPt||�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__�	TypeErrorZ	func_code�_builtin_super)�type_Ztype_or_objZ
framedepth�f�mro�methrrrrLsB







rcs�fdd�}|S)Ncs*G��fdd�d����j�_�j�_�S)Ncs2eZdZ��fdd�ZG�fdd�de�Z�ZS)zE_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClasscsht|�dkrNt|d��rN|d}t|�D] }|�d�s*t||t||��q*nt�|�j|i|��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�|�Srr)�cls�inst��instance_checkerrr�__instancecheck__�sze_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClass.__metaclass__.__instancecheck__cSst��d}t||�S�Nr)r�exc_infor*)rCZ	classinfo�valuerrr�__subclasscheck__�sze_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClass.__metaclass__.__subclasscheck__N)�__name__�
__module__�__qualname__rGrKrrErr�
__metaclass__�srO)rLrMrNr=�typerO�
__classcell__r�rBrF)r'rrB�s	rB)rL�__doc__rE��base_exceptionrRr�wrapped�sz-_instance_checking_exception.<locals>.wrappedr)rUrVrrTr�_instance_checking_exception�srWcCst|dt�tjkS�N�errno)r<rrYZENOENT�rDrrrr�srcCst|dt�tjkSrX)r<rrYZESRCHrZrrrr�srcCst|dt�tjtjfvSrX)r<rrY�EACCES�EPERMrZrrrr�s
�rcCst|dt�tjkSrX)r<rrYZEINTRrZrrrr�srcCst|dt�tjkSrX)r<rrYZECHILDrZrrrr�srcCst|dt�tjkSrX)r<rrY�EEXISTrZrrrr�sr�CPython�permzbbroken 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�<||�|_dSr�rg)r>�tup�hashrrrr=�sz_HashedSeq.__init__cCs|jSrrh)r>rrr�__hash__�sz_HashedSeq.__hash__N)rLrMrN�	__slots__rjr=rkrrrrrf�srfc	s�|}	|r.||���}
|	|7}	|
D]}|	|7}	q |rl|	|�fdd�|D��7}	|r�|	|�fdd�|
D��7}	n$||	�dkr��|	d�|vr�|	dSt|	�S)Nc3s|]}�|�VqdSrr)�.0�v�rPrr�	<genexpr>��z_make_key.<locals>.<genexpr>c3s|]\}}�|�VqdSrr)rm�krnrorrrp�rqrr)�itemsrf)r?�kwds�typed�kwd_mark�	fasttypes�sorted�tuplerPr8�keyZsorted_items�itemrror�	_make_key�s
r|�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�dur������
��
��f	dd�}n*����������	�
���
��fdd�}����	��
fdd	�}��	��
fd
d�}�|_||_||_t�	|��S)Nr)rr)rr�rcs"�|i|��}��d7<|SrHr)r?rt�result)�MISSES�stats�
user_functionrr�wrapper
sz7lru_cache.<locals>.decorating_function.<locals>.wrappercs\�||��}�|��}|�ur2��d7<|S�|i|��}|�|<��d7<|SrHr)r?rtrzr)	�HITSr��cache�	cache_get�make_key�rootr�rur�rrr�s
cs�|s�r�
||��}n|}�	��z��|�}|dur��\}|\}}}}||�<||�<|�}||�<|�<||�<||�<�
�d7<|W�	��SW�	��n
�	��0�|i|��}�	��z��\}|�vr�n�����k�r4|}	||	�<||	�<|	�}�d<|�}
d|�<|�<�|
=|	�|<n,|�}||||g}||�<|�<�|<�
�d7<W�	��n
�	��0|S)Nrr)�acquire�release)r?rtrz�linkr�Z	link_prevZ	link_nextr�lastZoldrootZoldkey)r��KEYr��NEXT�PREV�RESULT�_lenr�r��lockr�rd�
nonlocal_rootr�rur�rrr�sR�
cs<���z$t�����t���W���S���0dS)zReport cache statisticsN)r��
_CacheInfor8r�r)r�r�r�r�rdr�rr�
cache_infoJs��z:lru_cache.<locals>.decorating_function.<locals>.cache_infocsX���z@����d}||ddg|dd�<ddg�dd�<W���n
���0dS)z$Clear the cache and cache statisticsrN)r��clearr�)r�)r�r�r�r�rr�cache_clearSsz;lru_cache.<locals>.decorating_function.<locals>.cache_clear)
�dictr|�getr8r`�__wrapped__r�r��	functools�update_wrapper)r�r�r�r��rdru)r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�decorating_functions,*-	z&lru_cache.<locals>.decorating_functionr)rdrur�rr�rr
�scr
)rcs"dd�}tj���r&|�|�r"�SdS|dur>tj�dtj�}|sFdS|�tj�}tj	dkr�tj
|vrt|�dtj
�tj�dd��tj�}t�fd	d
�|D��r��g}q‡fdd�|D�}n�g}t
�}|D]P}tj�|�}||vr�|�|�|D](}	tj�||	�}
||
|�r�|
Sq�q�dS)
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)�os�path�exists�access�isdir)�fn�moderrr�
_access_checkss�zwhich.<locals>._access_checkN�PATH�win32rZPATHEXT�c3s |]}����|���VqdSr)�lower�endswith�rmZext��cmdrrrp�rqzwhich.<locals>.<genexpr>csg|]}�|�qSrrr�r�rr�
<listcomp>�rqzwhich.<locals>.<listcomp>)r�r��dirname�environr��defpath�split�pathsepr�platform�curdir�insert�any�set�normcase�add�join)r�r�r�r�Zpathext�files�seenr9ZnormdirZthefile�namerr�rrjs8	




r)r��P�cCszzddl}ddl}ddl}Wnty2|YS0z*|�d|�d|jd��}|d|dfWStyt|YS0dS)NrZhhrZ1234)�fcntl�struct�termios�ImportError�unpackZioctlZ
TIOCGWINSZ�	Exception)�fallbackr�r�r��resrrrr�s
�r)�TimeoutExpiredc@seZdZdS)�SubprocessTimeoutExpiredN)rLrMrNrrrrr��sr�)r
c
cs@ttd�}z"ttd|�|VWttd|�nttd|�0dS)N�stderr)r<rr;)�
new_target�originalrrrr
�s

r
)r}F)r�)@rS�collections�
contextlibrYr�r�rr+�__all__�version_infor�objectr�intrr�xrange�strrrrr	rr2rrrrrrr�r�rW�EnvironmentError�python_implementation�OSErrorr]r$r
r��	threadingr`Zdummy_threading�
namedtupler��listrfr��	frozensetrPrxryr8r|�shutilr�F_OK�X_OKr�
subprocessr�r�r
�contextmanagerrrrr�<module>s�

8





�
��
k1