HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //opt/osm/venv/lib/python3.10/site-packages/psutil/__pycache__/_common.cpython-310.pyc
o

=i�o�
@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddlm
Z
ddlmZddlmZddlm
Z
zddlmZWneyQdZYnwzddlmZWneyedZYnwee�d	��Ze�Zgd
�ZejdkZejdkZej�d
�Zej�d�ZeZej�d�Zej�d�Z ej�d�Z!ep�e p�e!Z"ej�d�Z#ej�d�Z$dZ%dZ&dZ'dZ(dZ)dZ*dZ+dZ,dZ-dZ.dZ/dZ0d Z1d!Z2d"Z3d#Z4d$Z5d%Z6d&Z7d'Z8d(Z9d)Z:d*Z;d+Z<d,Z=d-Z>Gd.d/�d/ej?�Z@eA��Be@jC�Gd0d1�d1ej?�ZDeA��BeDjC�e�E�ZFe�G�ZHe
d2gd3��ZIe
d4gd5��ZJe
d6gd7��ZKe
d8gd9��ZLe
d:gd;��ZMe
d<gd=��ZNe
d>gd?��ZOe
d@gdA��ZPe
dBgdC��ZQe
dDgdE��ZRe
dFgdG��ZSe
dHgdI��ZTe
dJgdK��ZUe
dLdMdNg�ZVe
dOgdP��ZWe
dQdRdSg�ZXe
dTgdU��ZYe
dVgdW��ZZe
dXgdW��Z[e
dYgdZ��Z\e
d[d\d]g�Z]e
d^d_d`g�Z^e
dagdb��Z_e
dcdddeg�Z`eeege
egfeege
gfege
gfeegegfegegfeege
egfege
egfege
egfdf�Zaedu�r�ea�Bege
gfegegfdg��edu�re#�sea�Bdhege
egfi�Gdidj�djeb�ZcGdkdl�dlec�ZdGdmdn�dned�ZeGdodp�dpec�ZfGdqdr�drec�Zgd�dsdt�Zhdudv�Zidwdx�Zjdydz�Zkd{d|�Zld}d~�Zmdd��Znd�d��Zod�d��Zpd�d�d��Zqd�d��Zrd�d��ZsGd�d��d��Ztd�d��Zuet�Zvevjweu_wevjxeu_xd�Zyd�d��Zzd�d��Z{ee{fd�d��Z|efd�d��Z}d�d�d��Z~d�d��Zd�d��Z�eiej�fd�d���Z�d�d�d��Z�dd�ej�fd�d��Z�d�d��Z�dS)�z�Common objects shared by __init__.py and _ps*.py modules.

Note: this module is imported by setup.py, so it should not import
psutil or third-party modules.
�N)�
namedtuple)�AF_INET)�
SOCK_DGRAM)�SOCK_STREAM)�AF_INET6)�AF_UNIX�PSUTIL_DEBUG)R�FREEBSD�BSD�LINUX�NETBSD�OPENBSD�MACOS�OSX�POSIX�SUNOS�WINDOWS�
CONN_CLOSE�CONN_CLOSE_WAIT�CONN_CLOSING�CONN_ESTABLISHED�CONN_FIN_WAIT1�CONN_FIN_WAIT2�
CONN_LAST_ACK�CONN_LISTEN�	CONN_NONE�
CONN_SYN_RECV�
CONN_SYN_SENT�CONN_TIME_WAIT�NIC_DUPLEX_FULL�NIC_DUPLEX_HALF�NIC_DUPLEX_UNKNOWN�STATUS_DEAD�STATUS_DISK_SLEEP�STATUS_IDLE�
STATUS_LOCKED�STATUS_RUNNING�STATUS_SLEEPING�STATUS_STOPPED�STATUS_SUSPENDED�STATUS_TRACING_STOP�STATUS_WAITING�STATUS_WAKE_KILL�
STATUS_WAKING�
STATUS_ZOMBIE�
STATUS_PARKED�ENCODING�
ENCODING_ERRSr�pconn�	pcputimes�pctxsw�pgids�pio�pionice�	popenfile�pthread�puids�sconn�	scpustats�sdiskio�	sdiskpart�
sdiskusage�snetio�snicaddr�	snicstats�sswap�suser�	conn_tmap�deprecated_method�
isfile_strict�memoize�parse_environ_block�path_exists_strict�
usage_percent�
supports_ipv6�sockfam_to_enum�socktype_to_enum�wrap_numbers�	open_text�open_binary�cat�bcat�bytes2human�conn_to_ntuple�debug�hilite�term_supports_colors�print_color�posix�nt�linux�darwin)�freebsdZmidnightbsd�openbsd�netbsd)�sunos�solaris�aix�running�sleepingz
disk-sleep�stoppedztracing-stop�zombieZdeadz	wake-killZwakingZidle�lockedZwaitingZ	suspendedZparkedZESTABLISHEDZSYN_SENTZSYN_RECVZ	FIN_WAIT1Z	FIN_WAIT2Z	TIME_WAITZCLOSEZ
CLOSE_WAITZLAST_ACKZLISTENZCLOSING�NONEc@seZdZdZdZdZdS)�	NicDuplex��rN)�__name__�
__module__�__qualname__rr r!�rprp�</opt/osm/venv/lib/python3.10/site-packages/psutil/_common.pyrjsrjc@seZdZdZdZdS)�BatteryTime������N)rmrnroZPOWER_TIME_UNKNOWNZPOWER_TIME_UNLIMITEDrprprprqrr�srrrC)�total�used�free�percent�sinZsoutr?)rurvrwrxr=)�
read_count�write_count�
read_bytes�write_bytesZ	read_timeZ
write_timer>)ZdeviceZ
mountpointZfstype�optsr@)Z
bytes_sentZ
bytes_recvZpackets_sentZpackets_recvZerrinZerroutZdropinZdropoutrD)�nameZterminal�host�started�pidr;)�fd�family�type�laddr�raddr�statusr�rA)r��address�netmask�	broadcastZptprB)ZisupZduplex�speedZmtu�flagsr<)Zctx_switchesZ
interruptsZsoft_interruptsZsyscalls�scpufreq)�current�min�max�shwtemp)�labelr��high�critical�sbattery)rxZsecsleftZ
power_plugged�sfanr�r�r3)�user�system�
children_user�children_systemr8�pathr�r9)�idZ	user_timeZsystem_timer:)�realZ	effective�savedr5r6)rzr{r|r}r7Zioclass�valuer4Z	voluntaryZinvoluntaryr2)r�r�r�r�r�r��addr�ip�port)�allZtcpZtcp4ZudpZudp4ZinetZinet4Zinet6)Ztcp6Zudp6�unixc@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
�ErrorzQBase exception class. All other psutil exceptions inherit
    from this one.
    �psutilcCs>t��}|D]}t||d�}|s|dkr|dkr|||<q|S)Nr�r)�collections�OrderedDict�getattr)�self�attrs�inforr�rprprq�	_infodicts�zError._infodictcCsR|�d�}|rd�d�dd�|��D���}nd}d�dd�t|dd	�|fD��S)
N)r��ppidrz({})�, cS�g|]\}}|�d|���qS��=rp��.0�k�vrprprq�
<listcomp>�z!Error.__str__.<locals>.<listcomp>� cSsg|]}|r|�qSrprp)r��xrprprqr�s�msg�)r��format�join�itemsr��r�r��detailsrprprq�__str__s
� z
Error.__str__cCs8|�d�}d�dd�|��D��}d|jj�d|�d�S)N)r�r�r�secondsr�r�cSr�r�rpr�rprprqr�!r�z"Error.__repr__.<locals>.<listcomp>zpsutil.�(�))r�r�r��	__class__rmr�rprprq�__repr__s
zError.__repr__N)rmrnro�__doc__r�r�r�rprprprqr�sr�c@�&eZdZdZdZddd�Zdd�ZdS)	�
NoSuchProcesszXException raised when a process with a certain PID doesn't
    or no longer exists.
    r�NcC�$t�|�||_||_|pd|_dS)Nzprocess no longer exists�r��__init__r�rr��r�r�rr�rprprqr�,�
zNoSuchProcess.__init__cC�|j|j|j|jffS�N�r�r�rr��r�rprprq�
__reduce__2�zNoSuchProcess.__reduce__�NN�rmrnror�r�r�rprprprqr�%s

r�c@r�)	�
ZombieProcessa1Exception raised when querying a zombie process. This is
    raised on macOS, BSD and Solaris only, and not always: depending
    on the query the OS may be able to succeed anyway.
    On Linux all zombie processes are querable (hence this is never
    raised). Windows doesn't have zombie processes.
    r�NcCs$t�||||�||_|pd|_dS)Nz"PID still exists but it's a zombie)r�r�r�r�)r�r�rr�r�rprprqr�@szZombieProcess.__init__cCs|j|j|j|j|jffSr�)r�r�rr�r�r�rprprqr�EszZombieProcess.__reduce__�NNNr�rprprprqr�6s

r�c@r�)	�AccessDeniedz@Exception raised when permission to perform an action is denied.r�NcCr�)Nr�r�r�rprprqr�Nr�zAccessDenied.__init__cCr�r�r�r�rprprqr�Tr�zAccessDenied.__reduce__r�r�rprprprqr�Is

r�c@r�)	�TimeoutExpiredzWRaised on Process.wait(timeout) if timeout expires and process
    is still alive.
    r�NcCs.t�|�||_||_||_d|�d�|_dS)Nztimeout after z seconds)r�r�r�r�rr�)r�r�r�rrprprqr�_s

zTimeoutExpired.__init__cCr�r�)r�r�r�rr�rprprqr�fr�zTimeoutExpired.__reduce__r�r�rprprprqr�Xs

r�cCs@z
t|�|d}Wn
tyYdSw|durt||�}|S)z5Calculate percentage usage of 'used' against 'total'.�dgN)�float�ZeroDivisionError�round)rvruZround_�retrprprqrKos�
rKcs2t�����fdd��}�fdd�}i�||_|S)a�A simple memoize decorator for functions supporting (hashable)
    positional arguments.
    It also provides a cache_clear() function for clearing the cache:

    >>> @memoize
    ... def foo()
    ...     return 1
        ...
    >>> foo()
    1
    >>> foo.cache_clear()
    >>>

    It supports:
     - functions
     - classes (acts as a @singleton)
     - staticmethods
     - classmethods

    It does NOT support:
     - methods
    c
sn|tt|����f}z�|WSty6z�|i|��}�|<W|YSty5}z|d�d}~wwwr�)�	frozenset�sortedr��KeyError�	Exception)�args�kwargs�keyr��err��cache�funrprq�wrapper�s
����zmemoize.<locals>.wrappercs���dS)zClear cache.N)�clearrp)r�rprq�cache_clear��zmemoize.<locals>.cache_clear)�	functools�wrapsr�)r�r�r�rpr�rqrH{srHcs6t����fdd��}dd�}dd�}||_||_|S)a�A memoize decorator which is disabled by default. It can be
    activated and deactivated on request.
    For efficiency reasons it can be used only against class methods
    accepting no arguments.

    >>> class Foo:
    ...     @memoize
    ...     def foo()
    ...         print(1)
    ...
    >>> f = Foo()
    >>> # deactivated (default)
    >>> foo()
    1
    >>> foo()
    1
    >>>
    >>> # activated
    >>> foo.cache_activate(self)
    >>> foo()
    1
    >>> foo()
    >>> foo()
    >>>
    c
s�z|j�}W|Sty&z�|�WYSty%}z|d�d}~wwtyWz�|�}WntyA}z|d�d}~wwz	||j�<WY|StyVYY|Swwr�)�_cache�AttributeErrorr�r�)r�r�r��r�rprqr��s2��������z'memoize_when_activated.<locals>.wrappercSs
i|_dS)zsActivate cache. Expects a Process instance. Cache will be
        stored as a "_cache" instance attribute.
        N)r���procrprprq�cache_activate�s
z.memoize_when_activated.<locals>.cache_activatecSs z|`WdStyYdSw)zDeactivate and clear cache.N)r�r�r�rprprq�cache_deactivate�s

�z0memoize_when_activated.<locals>.cache_deactivate)r�r�r�r�)r�r�r�r�rpr�rq�memoize_when_activated�sr�cCs>zt�|�}Wnty�tyYdSwt�|j�S)z�Same as os.path.isfile() but does not swallow EACCES / EPERM
    exceptions, see:
    http://mail.python.org/pipermail/python-dev/2012-June/120787.html.
    F)�os�stat�PermissionError�OSError�S_ISREG�st_mode)r��strprprqrG�s�rGcCs4zt�|�WdSty�tyYdSw)z�Same as os.path.exists() but does not swallow EACCES / EPERM
    exceptions. See:
    http://mail.python.org/pipermail/python-dev/2012-June/120787.html.
    FT)r�r�r�r�)r�rprprqrJ�s��rJcCsjtjrtdur	dSz!t�ttj��}|�d�Wd�WdS1s#wYWdSty4YdSw)z2Return True if IPv6 is supported on this platform.NF)z::1rT)�socket�has_ipv6rr�bindr�)�sockrprprqrL
s
���rLcCsxi}d}t}	|�d|�}||kr	|S|�d||�}||kr7|||�}||d|�}|r3|��}|||<|d}q)zCParse a C environ block of environment variables into a dictionary.rT�r�rl)r�find�upper)�datar��posZWINDOWS_Znext_posZ	equal_posr�r�rprprqrIs"��rIcC�$zt�|�WSty|YSw)z�Convert a numeric socket family value to an IntEnum member.
    If it's not a known member, return the numeric value itself.
    )r�
AddressFamily�
ValueError��numrprprqrM5�
�rMcCr)zConvert a numeric socket type value to an IntEnum member.
    If it's not a known member, return the numeric value itself.
    )r�
SocketKindr
rrprprqrN?rrNcCs�|tjthvr|r
t|�}|rt|�}|tjkr%|tthvr%|�|t�}nt}t|�}t|�}|dur<t	||||||�St
|||||||�S)z2Convert a raw connection tuple to a proper ntuple.N)rrrr�r�getrrMrNr2r;)r�Zfam�type_r�r�r�Z
status_mapr�rprprqrUIsrUcCsxddl}|jr
|jsdS|jtjkr#t|j|j�d|j��dd�j�S|jtj	kr:t|j
|j�d|j��dd�j�SdS)zbGiven the address ntuple returned by ``net_if_addrs()``
    calculates the broadcast address.
    rN�/F)�strict)�	ipaddressr�r�r�rr�str�IPv4Network�broadcast_addressr�IPv6Network)r�rrprprq�broadcast_addr\s$�����rcs�fdd�}|S)z�A decorator which can be used to mark a method as deprecated
    'replcement' is the method name which will be called instead.
    cs>|j�d��d��|jdur�|_t�|���fdd��}|S)Nz*() is deprecated and will be removed; use z
() insteadcs$tj�tdd�t|��|i|��S)Nrk)�category�
stacklevel)�warnings�warn�DeprecationWarningr�)r�r�r�)r��replacementrprq�innersz/deprecated_method.<locals>.outer.<locals>.inner)rmr�r�r�)r�r"�r!)r�rq�outerws��
z deprecated_method.<locals>.outerrp)r!r$rpr#rqrFrsrFc@sBeZdZdZdd�Zdd�Zdd�Zdd	�Zddd�Zd
d�Z	d
S)�_WrapNumberszNWatches numbers so that they don't overflow and wrap
    (reset to zero).
    cCs t��|_i|_i|_i|_dSr�)�	threading�Lock�lockr��	reminders�
reminder_keysr�rprprqr��s

z_WrapNumbers.__init__cCsX||jvsJ�||jvsJ�||jvsJ�||j|<t�t�|j|<t�t�|j|<dSr�)r�r)r*r��defaultdict�int�set)r��
input_dictrrprprq�	_add_dict�s
z_WrapNumbers._add_dictcCs\|j|}t|���t|���}|D]}|j||D]}|j||=q|j||=qdS)z�In case the number of keys changed between calls (e.g. a
        disk disappears) this removes the entry from self.reminders.
        N)r�r-�keysr*r))r�r.r�old_dictZ	gone_keysZgone_key�remkeyrprprq�_remove_dead_reminders�s
�z#_WrapNumbers._remove_dead_remindersc
	Cs||jvr
|�||�|S|�||�|j|}i}|D]\}||}z||}Wn
ty5|||<Yqwg}tt|��D]3}	||	}
||	}||	f}|
|kre|j|||7<|j||�|�|�	|
|j||�q>t
|�||<q||j|<|S)zlCache dict and sum numbers which overflow and wrap.
        Return an updated copy of `input_dict`.
        )r�r/r3r��range�lenr)r*�add�append�tuple)
r�r.rr1Znew_dictr�Zinput_tupleZ	old_tuple�bits�iZinput_value�	old_valuer2rprprq�run�s4

�
z_WrapNumbers.runNcCs�|j�:|dur|j��|j��|j��n|j�|d�|j�|d�|j�|d�Wd�dSWd�dS1s@wYdS)z>Clear the internal cache, optionally only for function 'name'.N)r(r�r�r)r*�pop)r�rrprprqr��s

�"�z_WrapNumbers.cache_clearcCs:|j�|j|j|jfWd�S1swYdS)z5Return internal cache dicts as a tuple of 3 elements.N)r(r�r)r*r�rprprq�
cache_info�s$�z_WrapNumbers.cache_infor�)
rmrnror�r�r/r3r<r�r>rprprprqr%�s
'r%cCs6tj�t�||�Wd�S1swYdS)z�Given an `input_dict` and a function `name`, adjust the numbers
    which "wrap" (restart from zero) across different calls by adding
    "old value" to "new value" and return an updated dict.
    N)�_wnr(r<)r.rrprprqrO�s
$�rOi�cCst|dtd�S)N�rb)�	buffering)�open�FILE_READ_BUFFER_SIZE)�fnamerprprqrQ��rQcCsHt|tttd�}zt|_W|StyY|Sty#|���w)zaOpen a file in text mode by using the proper FS encoding and
    en/decoding error handlers.
    )rA�encoding�errors)rBrCr0r1�_CHUNK_SIZEr�r��close)rDZfobjrprprqrP�s ����rPcCs�|tur||��}|��Wd�S1swYdSz||��
}|��Wd�WS1s3wYWdStyE|YSw)z�Read entire file content and return it as a string. File is
    opened in text mode. If specified, `fallback` is the value
    returned in case of error, either if the file does not exist or
    it can't be read().
    N)�_DEFAULT�readr�)rD�fallback�_open�frprprqrRs
$�
(��rRcCst||td�S)z,Same as above but opens file in binary mode.)rLrM)rRrQ)rDrLrprprqrS*srS�%(value).1f%(symbol)scCs�d}i}t|dd��D]\}}d|dd>||<qt|dd��D]}t|�||kr<t|�||}|t�Sq#|t|d|d�S)z�Used by various scripts. See: https://code.activestate.com/recipes/578019-bytes-to-human-human-to-bytes-converter/?in=user-4178764.

    >>> bytes2human(10000)
    '9.8K'
    >>> bytes2human(100001221)
    '95.4M'
    )	�B�K�M�G�T�P�E�Z�YrlN�
r)�symbolr�)�	enumerate�reversed�absr��locals�dict)�nr��symbols�prefixr:�srZr�rprprqrT/s�rTcCstjdjS)z+Return updated psutil.PROCFS_PATH constant.r�)�sys�modulesZPROCFS_PATHrprprprq�get_procfs_pathBr�rfcCs|jttd�S)N)rFrG)�decoder0r1)rcrprprqrgGrErgcCsXtjdkrdSzddl}|��sJ�|��|�d�dksJ�WdSty+YdSw)Nr[Tr�colorsF)r�r�curses�isattyZ	setuptermZtigetnumr�)�filerirprprqrXPs
��rXFcCs�t�s|Sg}tddddddddd	d
�	}d|d<z||}Wnty6d
|�dt|�����}t|�d�w|�|�|rC|�d�dd�|��d|�d�S)z*Return an highlighted version of 'string'.Z34Z33Z30Z32Z37Z36Z91Z35Z93)	�blue�brownZdarkgrey�greenZgreyZ	lightblue�red�violet�yellowZ29N�invalid color z; choose amongst �1z[�;�mz)rXr_r��listr0r
r7r�)rc�color�bold�attrrhr�rprprqrW`s2�
�

rWc	Cst�st||d�dStrtt|||�|d�dSddl}d}|jjj}|jjj}t	ddddd�}||d<z||}Wnt
ySd	|�d
t|�����}	t
|	�d�w|r^|dkr^|d7}|tjurednd
}
|j|_||
�}|||�zt||d�W|||�dS|||�w)z$Print a colorized version of string.�rkrN�rk��)rnrormrqrrz; choose between �i�i����)rX�printrrW�ctypesZwindllZKernel32�GetStdHandle�SetConsoleTextAttributer_r�rvr0r
rd�stderrZc_ulong�restype)rcrwrxrkr�Z
DEFAULT_COLORr�r�rhr�Z	handle_id�handlerprprqrY|s:
�
��
�
rYcCsxtr:ddl}|�|��j�\}}}}}t|t�r(t|t�r#d|��}nd|��}td|�d|�d|��t	j
d�dSdS)z@If PSUTIL_DEBUG env var is set, print a debug message to stderr.rNz	ignoring zpsutil-debug [�:z]> rz)r�inspect�getframeinfo�currentframe�f_back�
isinstancer�r�rrdr�)r�r�rD�lineno�_�_lines�_indexrprprqrV�s�



��rVr�)rO)NF)�r�r��enumr�r�rr�rdr&rrrrrr�ImportErrorr�bool�getenvr�objectrJ�__all__rrr�platform�
startswithrrrr	r
rr
rZAIXr&r'r#r(r*r.r"r,r-r$r%r+r)r/rrrrrrrrrrrr�IntEnumrj�globals�update�__members__rr�getfilesystemencodingr0�getfilesystemencodeerrorsr1rCr?r=r>r@rDr;rArBr<r�r�r�r�r3r8r9r:r5r6r7r4r2r�rEr�r�r�r�r�r�rKrHr�rGrJrLrIrMrNrUrrFr%rOr?r�r>rCrQrPrRrSrTrfrg�stdoutrXrWrYrVrprprprq�<module>s@��
&
	�������	

�


�!
-G


W	

	

�(