403Webshell
Server IP : 93.86.61.54  /  Your IP : 216.73.216.206
Web Server : Apache/2.4.62 (Ubuntu)
System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64
User : www-data ( 33)
PHP Version : 8.4.22
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/psutil/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/psutil/__pycache__/_common.cpython-310.pyc
o

�3�aMg�
@sdZddlmZddlmZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlmZddl	mZddl	mZddl	mZzdd	l	mZWneyadZYnwzdd
l	mZWneyudZYnwejdkr�ddlZndZejddkZee�d
d��Zgd�ZejdkZejdkZej� d�Z!ej� d�Z"e"Z#ej� d�Z$ej� d�Z%ej� d�Z&e$p�e%p�e&Z'ej� d�Z(ej� d�Z)dZ*dZ+dZ,dZ-dZ.dZ/dZ0dZ1d Z2d!Z3d"Z4d#Z5d$Z6d%Z7d&Z8d'Z9d(Z:d)Z;d*Z<d+Z=d,Z>d-Z?d.Z@d/ZAd0ZBd1ZCedu�rd2ZDd3ZEdZFnGd4d5�d5ejG�ZHeI��JeHjK�edu�r+d6ZLd7ZMnGd8d9�d9ejG�ZNeI��JeNjK�e�O�ZPe�sEd:ZQnze�R�ZQWneS�y\e�rXd;nd:ZQYnwed<gd=��ZTed>gd?��ZUed@gdA��ZVedBgdC��ZWedDgdE��ZXedFgdG��ZYedHgdI��ZZedJgdK��Z[edLgdM��Z\edNgdO��Z]edPgdQ��Z^edRgdS��Z_edTgdU��Z`edVdWdXg�ZaedYgdZ��Zbed[d\d]g�Zced^gd_��Zded`gda��Zeedbgda��Zfedcgdd��Zgededfdgg�Zhedhdidjg�Ziedkgdl��Zjedmdndog�Zkeeegeegfeegegfegegfeegegfegegfeegeegfegeegfegeegfdp�Zledu�rNel�Jegegfegegfdq��edu�r_el�Jdregeegfi�Gdsdt�dtem�ZnGdudv�dven�ZoGdwdx�dxeo�ZpGdydz�dzen�ZqGd{d|�d|en�Zrd�d}d~�Zsdd��Ztd�d��Zud�d��Zvd�d��Zwetd�d���Zxd�d��Zyd�d��Zzd�d��Z{d�d�d��Z|d�d��Z}Gd�d��d��Z~d�d��Ze~�Z�e�j�e_�e�j�e_�d�d��Z�d�d��Z�d�d�d��Z�d�d��Z�e�r�d�d��Z�nd�d��Z�etej�fd�d���Z�d�d�d��Z�dd�ej�fd�d��Z�d�d��Z�dS)�z9Common objects shared by __init__.py and _ps*.py modules.�)�division)�print_functionN)�
namedtuple)�AF_INET)�
SOCK_DGRAM)�SOCK_STREAM)�AF_INET6)�AF_UNIX)��r
�PSUTIL_DEBUG)N�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�bytes2human�conn_to_ntuple�debug�hilite�term_supports_colors�print_color�posix�nt�linux�darwin)�freebsd�midnightbsd�openbsd�netbsd)�sunos�solaris�aix�running�sleepingz
disk-sleep�stoppedztracing-stop�zombie�deadz	wake-kill�waking�idle�locked�waiting�	suspended�parked�ESTABLISHED�SYN_SENT�SYN_RECV�	FIN_WAIT1�	FIN_WAIT2�	TIME_WAIT�CLOSE�
CLOSE_WAIT�LAST_ACK�LISTEN�CLOSING�NONE��c@seZdZdZdZdZdS)�	NicDuplexr|r}rN)�__name__�
__module__�__qualname__r#r$r%�r�r��0/usr/lib/python3/dist-packages/psutil/_common.pyr~�sr~������c@seZdZdZdZdS)�BatteryTimer�r�N)rr�r��POWER_TIME_UNKNOWN�POWER_TIME_UNLIMITEDr�r�r�r�r��sr��replace�surrogateescaperG)�total�used�free�percent�sin�soutrC)r�r�r�r�rA)�
read_count�write_count�
read_bytes�write_bytes�	read_time�
write_timerB)�device�
mountpoint�fstype�opts�maxfile�maxpathrD)�
bytes_sent�
bytes_recv�packets_sent�packets_recv�errin�errout�dropin�dropoutrH)�name�terminal�host�started�pidr?)�fd�family�type�laddr�raddr�statusr�rE)r��address�netmask�	broadcast�ptprF)�isup�duplex�speed�mtur@)�ctx_switches�
interrupts�soft_interrupts�syscalls�scpufreq)�current�min�max�shwtemp)�labelr��high�critical�sbattery)r��secsleft�
power_plugged�sfanr�r�r7)�user�system�
children_user�children_systemr<�pathr�r=)�id�	user_time�system_timer>)�real�	effective�savedr9r:)r�r�r�r�r;�ioclass�valuer8�	voluntary�involuntaryr6)r�r�r�r�r�r��addr�ip�port)�all�tcp�tcp4�udp�udp4�inet�inet4�inet6)�tcp6�udp6�unixc@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
�ErrorzQBase exception class. All other psutil exceptions inherit
    from this one.
    �psutilcCsJzt��}Wntyi}Ynw|D]}t||d�}|r"|||<q|S�N)�collections�OrderedDict�AttributeError�getattr)�self�attrs�infor�r�r�r�r��	_infodicts��zError._infodictcCsJ|�d�}|rdd�dd�|��D��}nd}d�dd�|j|fD��S)N)r��ppidr�z(%s)�, cS�g|]
\}}d||f�qS�z%s=%rr���.0�k�vr�r�r��
<listcomp>)�z!Error.__str__.<locals>.<listcomp>� cSsg|]}|r|�qSr�r�)r��xr�r�r�r�,s)r��join�items�msg�r�r��detailsr�r�r��__str__$s
�z
Error.__str__cCs2|�d�}d�dd�|��D��}d|jj|fS)N)r�r�r��secondsr�r�cSr�r�r�r�r�r�r�r�1r�z"Error.__repr__.<locals>.<listcomp>z
psutil.%s(%s))r�r�r��	__class__rr�r�r�r��__repr__.s
zError.__repr__N)rr�r��__doc__r�rrr�r�r�r�r�s
r�c@�eZdZdZdZddd�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�r�r��r�r�r�r�r�r�r�r
;�
zNoSuchProcess.__init__�NN�rr�r�rr
r�r�r�r�r5�rc@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)rr
r�r�)r�r�r�r�r�r�r�r�r
KszZombieProcess.__init__�NNNrr�r�r�r�rBsrc@r)�AccessDeniedz@Exception raised when permission to perform an action is denied.r�NcCr)N�r	rr�r�r�r
UrzAccessDenied.__init__rrr�r�r�r�rQsrc@r)�TimeoutExpiredzWRaised on Process.wait(timeout) if timeout expires and process
    is still alive.
    r�NcCs*t�|�||_||_||_d||_dS)Nztimeout after %s seconds)r�r
rr�r�r�)r�rr�r�r�r�r�r
bs

zTimeoutExpired.__init__r
rr�r�r�r�r\rrcCs@z
t|�|d}Wn
tyYdSw|durt||�}|S)z5Calculate percentage usage of 'used' against 'total'.�dgN)�float�ZeroDivisionError�round)r�r��round_�retr�r�r�rOos�
rOcs2t�����fdd��}�fdd�}i�||_|S)aA 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()
    >>>
    csL|tt|����f}z�|WSty%�|i|��}�|<|YSwr�)�	frozenset�sortedr��KeyError)�args�kwargs�keyr��cache�funr�r��wrapper�s
�zmemoize.<locals>.wrappercs���dS)zClear cache.N)�clearr�)r"r�r��cache_clear��zmemoize.<locals>.cache_clear)�	functools�wrapsr&)r#r$r&r�r!r�rL{srLcs6t����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()
    >>>
    csjz|j�}W|Sty�|�YSty4�|�}z	||j�<WY|Sty3YY|Swwr�)�_cacher�r)r�r�r#r�r�r$�s����z'memoize_when_activated.<locals>.wrappercSs
i|_dS)zjActivate cache. Expects a Process instance. Cache will be
        stored as a "_cache" instance attribute.N)r*��procr�r�r��cache_activate�s
z.memoize_when_activated.<locals>.cache_activatecSs z|`WdStyYdSw)zDeactivate and clear cache.N)r*r�r,r�r�r��cache_deactivate�s

�z0memoize_when_activated.<locals>.cache_deactivate)r(r)r.r/)r#r$r.r/r�r+r��memoize_when_activated�sr0c
CsVzt�|�}Wnty$}z|jtjtjfvr�WYd}~dSd}~wwt�|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
    NF)�os�stat�OSError�errno�EPERM�EACCES�S_ISREG�st_mode)r��st�errr�r�r�rK�s��rKc
CsLzt�|�WdSty%}z|jtjtjfvr�WYd}~dSd}~ww)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
    NFT)r1r2r3r4r5r6)r�r:r�r�r�rN�s���rNcCsvtjrtdur	dSz&t�ttj�}t�|��|�d�Wd�WdS1s(wYWdStjy:YdSw)z2Return True if IPv6 is supported on this platform.NF)z::1rT)�socket�has_ipv6rr�
contextlib�closing�bind�error)�sockr�r�r�rP�s
���rPcCsxi}d}t}	|�d|�}||kr	|S|�d||�}||kr7|||�}||d|�}|r3|��}|||<|d}q)zCParse a C environ block of environment variables into a dictionary.rT��=r})r�find�upper)�datar�pos�WINDOWS_�next_pos�	equal_posr r�r�r�r�rMs"��rMcC�0tdur|Szt�|�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.
    N)�enumr;�
AddressFamily�
ValueError��numr�r�r�rQ"��rQcCrK)zConvert a numeric socket type value to an IntEnum member.
    If it's not a known member, return the numeric value itself.
    N)rLr;�
SocketKindrNrOr�r�r�rR/rQrRcCs�|tjtfvr|r
t|�}|rt|�}|tjkr%|ttfvr%|�|t�}nt}t|�}t|�}|dur<t	||||||�St
|||||||�S)z2Convert a raw connection tuple to a proper ntuple.N)r;rrr�r�getrrQrRr6r?)r��fam�type_r�r�r��
status_mapr�r�r�r�rU<srUcs�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:d|j�f�|jdur�|_t�|���fdd��}|S)Nz8%s() is deprecated and will be removed; use %s() insteadcs$tj�tdd�t|��|i|��S)Nr|)�category�
stacklevel)�warnings�warn�DeprecationWarningr�)r�rr)r��replacementr�r��innerYsz/deprecated_method.<locals>.outer.<locals>.inner)rrr(r))r#r]�r\)r�r��outerSs�
z deprecated_method.<locals>.outerr�)r\r_r�r^r�rJOsrJc@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_keys�r�r�r�r�r
fs

z_WrapNumbers.__init__cCsX||jvsJ�||jvsJ�||jvsJ�||j|<t�t�|j|<t�t�|j|<dSr�)r"rdrer��defaultdict�int�set)r��
input_dictr�r�r�r��	_add_dictls
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"ri�keysrerd)r�rjr��old_dict�	gone_keys�gone_key�remkeyr�r�r��_remove_dead_remindersts
�z#_WrapNumbers._remove_dead_remindersc
	Cs||jvr
|�||�|S|�||�|j|}i}|��D]\}||}z||}Wn
ty7|||<Yqwg}tt|��D]3}	||	}
||	}||	f}|
|krg|j|||7<|j||�	|�|�
|
|j||�q@t|�||<q||j|<|S)zkCache dict and sum numbers which overflow and wrap.
        Return an updated copy of `input_dict`
        )r"rkrqrlr�range�lenrdre�add�append�tuple)
r�rjr�rm�new_dictr �input_tuple�	old_tuple�bits�i�input_value�	old_valuerpr�r�r��runs4

�
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)rcr"r%rdre�pop)r�r�r�r�r�r&�s

�"�z_WrapNumbers.cache_clearcCs:|j�|j|j|jfWd�S1swYdS)z5Return internal cache dicts as a tuple of 3 elements.N)rcr"rdrerfr�r�r��
cache_info�s$�z_WrapNumbers.cache_infor�)
rr�r�rr
rkrqr~r&r�r�r�r�r�r`as
'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)�_wnrcr~)rjr�r�r�r�rS�s
$�rScKst|dfi|��S)N�rb)�open��fnamerr�r�r��open_binary�sr�cKs.tr|�dt�|�dt�t|dfi|��S)z�On Python 3 opens a file in text mode by using fs encoding and
    a proper en/decoding errors handler.
    On Python 2 this is just an alias for open(name, 'rt').
    �encoding�errors�rt)�PY3�
setdefaultr4r5r�r�r�r�r��	open_text�sr��%(value).1f%(symbol)scCs�d}i}t|dd��D]\}}d|dd>||<qt|dd��D]}|||kr:t|�||}|t�Sq#|t|d|d�S)z�Used by various scripts. See:
    http://goo.gl/zeJZl

    >>> bytes2human(10000)
    '9.8K'
    >>> bytes2human(100001221)
    '95.4M'
    )	�B�K�M�G�T�P�E�Z�Yr}N�
r)�symbolr�)�	enumerate�reversedr�locals�dict)�n�format�symbols�prefixr{�sr�r�r�r�r�rT�s	�rTcCstjdjS)z+Return updated psutil.PROCFS_PATH constant.r�)�sys�modules�PROCFS_PATHr�r�r�r��get_procfs_path�r'r�cCs|jttd�S)N)r�r�)�decoder4r5�r�r�r�r�r��sr�cCs|Sr�r�r�r�r�r�r��scCsXtjdkrdSzddl}|��sJ�|��|�d�dksJ�WdSty+YdSw)Nr[Tr�colorsF)r1r��curses�isatty�	setupterm�tigetnum�	Exception)�filer�r�r�r�rX�s
��rXFcCs�t�s|Sg}tddddddddd	d
�	}d|d<z||}Wnty/td
t|�����w|�|�|r<|�d�dd�|�|fS)z*Return an highlighted version of 'string'.�32�91�33�93�34�35�36�37�30)	�green�red�brown�yellow�blue�violet�	lightblue�grey�darkgrey�29Nz#invalid color %r; choose between %s�1z[%sm%s�;)rXr�rrN�listrlrur�)r��color�bold�attrr�r�r�r�rW
s$�
��

rWc	Cst�st||d�dStrtt|||�|d�dSddl}d}|jjj}|jjj}t	ddddd�}||d<z||}Wnt
yNtd	|t|�
��f��w|rY|dkrY|d
7}|tjur`dnd}	|j|_||	�}
||
|�zt||d�W||
|�dS||
|�w)
z$Print a colorized version of string.�r�rN�r|r�)r�r�r�r�z#invalid color %r; choose between %r�i�i����)rX�printrrW�ctypes�windll�Kernel32�GetStdHandle�SetConsoleTextAttributer�rrNr�rlr��stderr�c_ulong�restype)r�r�r�r�r��
DEFAULT_COLORr�r�r��	handle_id�handler�r�r�rY s6
���
rYcCsrtr7ddl}|�|��j�\}}}}}t|t�r)t|ttt	f�r%d|}nd|}t
d|||ftjd�dSdS)z@If PSUTIL_DEBUG env var is set, print a debug message to stderr.rNzignoring %szignoring %rzpsutil-debug [%s:%s]> %sr�)
r�inspect�getframeinfo�currentframe�f_back�
isinstancer�r3�IOError�EnvironmentErrorr�r�r�)r�r�r��lineno�	func_name�lines�indexr�r�r�rVCs�


��rVr�)r�)NF)�r�
__future__rrr�r=r4r(r1r;r2r�rarYrrrrr�ImportErrorr	�version_inforLr��bool�getenvr�__all__r�rr�platform�
startswithrrrr
rrrr�AIXr*r+r'r,r.r2r&r0r1r(r)r/r-r3rr!r rrr"rrrrrrr#r$r%�IntEnumr~�globals�update�__members__r�r�r��getfilesystemencodingr4r5�getfilesystemencodeerrorsr�rGrCrArBrDrHr?rErFr@r�r�r�r�r7r<r=r>r9r:r;r8r6r�rIr�r�rrrrrOrLr0rKrNrPrMrQrRrUrJr`rSr�r&r�r�r�rTr�r��stdoutrXrWrYrVr�r�r�r��<module>s\��


$
	

�����	

�


�
�
"

 ?



W	

	

�#

Youez - 2016 - github.com/yon3zu
LinuXploit