Your IP : 3.129.22.34


Current Path : /opt/imunify360/venv/lib64/python3.11/site-packages/psutil/__pycache__/
Upload File :
Current File : //opt/imunify360/venv/lib64/python3.11/site-packages/psutil/__pycache__/_common.cpython-311.pyc

�

]�Dgjf�
�:
�dZddlmZmZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
mZddl
mZddlmZddlmZddlmZ	dd	lmZn
#e$rdZYnwxYw	dd
lmZn
#e$rdZYnwxYwe
jdkrddlZndZe
jddkZgd
�ZejdkZejdkZe
j�d��Ze
j�d��Z e Z!e
j�d��Z"e
j�d��Z#e
j�d��Z$e"pe#pe$Z%e
j�d��Z&e
j�d��Z'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>d.Z?d/Z@d0ZAe�d1ZBd2ZCdZDn5Gd3�d4ejE��ZFeG���HeFjI��e�d5ZJd6ZKn5Gd7�d8ejE��ZLeG���HeLjI��e
jM��ZNesd9ZOn"	e
jP��ZOn#eQ$r	erd:nd9ZOYnwxYwed;gd<���ZRed=gd>���ZSed?gd@���ZTedAgdB���ZUedCgdD���ZVedEgdF���ZWedGgdH���ZXedIgdJ���ZYedKgdL���ZZedMgdN���Z[edOgdP���Z\edQgdR���Z]edSgdT���Z^edUdVdWg��Z_edXgdY���Z`edZd[d\g��Zaed]gd^���Zbed_gd`���Zcedagd`���Zdedbgdc���Zeedddedfg��Zfedgdhdig��Zgedjgdk���Zhedldmdng��Zieeegeegfeegegfegegfeegegfegegfeegeegfegeegfegeegfdo�Zje� ej�Hegegfegegfdp���e�ej�Hdqegeegfi��Gdr�dsek��ZlGdt�duel��ZmGdv�dwem��ZnGdx�dyel��ZoGdz�d{el��Zpd�d|�Zqd}�Zrd~�Zsd�Ztd��Zuerd����Zvd��Zwd��Zxd��Zyd�d��Zzd��Z{Gd��d���Z|d��Z}e|��Z~e~je}_e~j�e}_�d��Z�d��Z�d�d��Z�d��Z�erd��Z�nd��Z�ere
j�fd����Z�d�d��Z�dd�e
j�fd��Z�e�ej�d�d����r	ddl�Z�d��Z�dSd��Z�dS)�z9Common objects shared by __init__.py and _ps*.py modules.�)�division�print_functionN)�defaultdict)�
namedtuple)�AF_INET)�
SOCK_DGRAM)�SOCK_STREAM)�AF_INET6)�AF_UNIX)��r)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�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��eZdZdZdZdZdS)�	NicDuplexr|r}rN)�__name__�
__module__�__qualname__r$r%r&���E/opt/imunify360/venv/lib64/python3.11/site-packages/psutil/_common.pyrr�s �������������r�r������c��eZdZdZdZdS)�BatteryTimer�r�N)r�r�r��POWER_TIME_UNKNOWN�POWER_TIME_UNLIMITEDr�r�r�r�r��s��������!���r�r��replace�surrogateescaperH)�total�used�free�percent�sin�soutrD)r�r�r�r�rB)�
read_count�write_count�
read_bytes�write_bytes�	read_time�
write_timerC)�device�
mountpoint�fstype�opts�maxfile�maxpathrE)�
bytes_sent�
bytes_recv�packets_sent�packets_recv�errin�errout�dropin�dropoutrI)�name�terminal�host�started�pidr@)�fd�family�type�laddr�raddr�statusr�rF)r��address�netmask�	broadcast�ptprG)�isup�duplex�speed�mturA)�ctx_switches�
interrupts�soft_interrupts�syscalls�scpufreq)�current�min�max�shwtemp)�labelr��high�critical�sbattery)r��secsleft�
power_plugged�sfanr�r�r8)�user�system�
children_user�children_systemr=�pathr�r>)�id�	user_time�system_timer?)�real�	effective�savedr:r;)r�r�r�r�r<�ioclass�valuer9�	voluntary�involuntaryr7)r�r�r�r�r�r��addr�ip�port)�all�tcp�tcp4�udp�udp4�inet�inet4�inet6)�tcp6�udp6�unixc�(�eZdZdZdZdd�Zd�ZeZdS)�ErrorzQBase exception class. All other psutil exceptions inherit
    from this one.
    �psutil�c�J�t�||��||_dS�N)�	Exception�__init__�msg)�selfr�s  r�r�zError.__init__s#�����4��%�%�%�����r�c�X�d|jj�d|j��}|���S)Nzpsutil.� )�	__class__r�r��strip)r��rets  r��__repr__zError.__repr__s+��� $�� 7� 7� 7����B���y�y�{�{�r�N)r�)r�r�r��__doc__r�r��__str__r�r�r�r�r�sI���������J���������G�G�Gr�r�c��eZdZdZdZdd�ZdS)�
NoSuchProcesszXException raised when a process with a certain PID doesn't
    or no longer exists.
    r�Nc���t�||��||_||_||_|�9|r!d|j�dt|j���d�}n
d|jz}d|z|_dSdS)N�(pid=�, name=�)�(pid=%s)zprocess no longer exists �r�r�r�r�r��repr)r�r�r�r��detailss     r�r�zNoSuchProcess.__init__'s~��
���t�S�!�!�!������	�����;��
0�
0�15����4��	�?�?�?�?�K���$�t�x�/��2�W�<�D�H�H�H��;r��NN�r�r�r�r�r�r�r�r�r�r�!s9���������J�
=�
=�
=�
=�
=�
=r�r�c��eZdZdZdZdd�ZdS)�
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�Nc�b�t�||��||_||_||_||_|�ud|zg}|r*|�dt|j��z��|r|�d|jz��dd�|��z}d|z|_dSdS)Nzpid=%szname=%szppid=%sz(%s)z, z'process still exists but it's a zombie )	r�r�r��ppidr�r��appendr�join)r�r�r�r	r��argsrs       r�r�zZombieProcess.__init__=s������t�S�)�)�)������	���	�����;��s�N�#�D��
9����I��T�Y���7�8�8�8��
3����I��	�1�2�2�2��t�y�y����.�G�@�7�J�D�H�H�H��;r��NNNrr�r�r�rr4s?���������J�
K�
K�
K�
K�
K�
Kr�rc��eZdZdZdZdd�ZdS)�AccessDeniedz@Exception raised when permission to perform an action is denied.r�Nc���t�||��||_||_||_|�=|�|�d|�dt|���d�|_dS|�d|jz|_dSd|_dSdS)Nr�r�r�rr�r)r�r�r�r�s    r�r�zAccessDenied.__init__Qs���
���t�S�!�!�!������	�����;���d�&6�&6�25�#�#�t�D�z�z�z�z�B������/�%���0����������
�;r�r
rr�r�r�rrMs3������J�J��J������r�rc��eZdZdZdZdd�ZdS)�TimeoutExpiredzWRaised on Process.wait(timeout) if timeout expires and process
    is still alive.
    r�Nc��t�|d|z��||_||_||_|�(|�&|xjd|�dt
|���d�z
c_dS|�|xjd|jzz
c_dSdS)Nztimeout after %s secondsz (pid=r�r�z	 (pid=%s))r�r��secondsr�r�r�r)r�rr�r�s    r�r�zTimeoutExpired.__init__es���
���t�7�'�A�B�B�B���������	��O�$�"2��H�H�H����T�$�Z�Z�Z�Z�@�@�H�H�H�H��o��H�H��d�h�.�.�H�H�H�H��or�rrr�r�r�rr_s9���������J�/�/�/�/�/�/r�rc�x�	t|��|zdz}|�t||��}|S#t$rYdSwxYw)z5Calculate percentage usage of 'used' against 'total'.�dNg)�float�round�ZeroDivisionError)r�r��round_r�s    r�rPrPus\����T�{�{�U�"�c�)������V�$�$�C��
�������s�s����s�+�
9�9c�f���tj�����fd���}�fd�}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()
    >>>
    c���|tt|�������f}	�|S#t$r�|i|��x}�|<|cYSwxYwr�)�	frozenset�sorted�items�KeyError)r�kwargs�keyr��cache�funs    ��r��wrapperzmemoize.<locals>.wrapper�su����Y�v�f�l�l�n�n�5�5�6�6�7��	���:����	�	�	�"�s�D�3�F�3�3�3�C�%��*��J�J�J�	���s�;�A�Ac�0������dS)zClear cache.N)�clear)r#s�r��cache_clearzmemoize.<locals>.cache_clear�s���
���
�
�
�
�
r�)�	functools�wrapsr()r$r%r(r#s`  @r�rMrM�sf�����_�S����������������
�E�%�G���Nr�c�n��tj����fd���}d�}d�}||_||_|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���	|j�}n;#t$r�|��cYSt$r�|��x}|j�<YnwxYw|Sr�)�_cache�AttributeErrorr )r�r�r$s  �r�r%z'memoize_when_activated.<locals>.wrapper�s���		/��+�c�"�C�C���	�	�	��3�t�9�9�����	/�	/�	/�&)�S��Y�Y�.�C�$�+�c�"�"�"�	/�����
s�
�A	�A	�A	c��i|_dS)zjActivate cache. Expects a Process instance. Cache will be
        stored as a "_cache" instance attribute.N)r-��procs r��cache_activatez.memoize_when_activated.<locals>.cache_activate�s������r�c�.�	|`dS#t$rYdSwxYw)zDeactivate and clear cache.N)r-r.r0s r��cache_deactivatez0memoize_when_activated.<locals>.cache_deactivate�s2��	�������	�	�	��D�D�	���s��
�)r)r*r2r4)r$r%r2r4s`   r��memoize_when_activatedr5�sh���4�_�S�������������
���,�G��/�G���Nr�c���	tj|��}tj|j��S#t$r+}|jt
jt
jfvr�Yd}~dSd}~wwxYw)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�S_ISREG�st_mode�OSError�errno�EPERM�EACCES)r��st�errs   r�rLrL�so��
(�
�W�T�]�]���|�B�J�'�'�'�������9���e�l�3�3�3���u�u�u�u�u��������s�/�
A$� A�A$c��	tj|��dS#t$r+}|jtjtjfvr�Yd}~dSd}~wwxYw)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
    TNF)r7r8r;r<r=r>)r�r@s  r�rOrO�sb��
�
���
�
�
��t�������9���e�l�3�3�3���u�u�u�u�u��������s��
A
� A�A
c�(�tjrt�dS	tjttj��}t	j|��5|�d��ddd��n#1swxYwYdS#tj$rYdSwxYw)z2Return True if IPv6 is supported on this platform.NF)z::1rT)�socket�has_ipv6r
r	�
contextlib�closing�bind�error)�socks r�rQrQ�s����?��h�.��u���}�X�v�'9�:�:��
�
��
%�
%�	"�	"��I�I�j�!�!�!�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"����	"�	"�	"�	"��t���<�����u�u����s5�8A>�A1�%A>�1A5�5A>�8A5�9A>�>B�Bc��i}d}t}	|�d|��}||krnU|�d||��}||kr2|||�}||dz|�}|r|���}|||<|dz}�r|S)zCParse a C environ block of environment variables into a dictionary.rT��=r})r�find�upper)�datar��pos�WINDOWS_�next_pos�	equal_posr"r�s        r�rNrNs���
�C�
�C��H���9�9�T�3�'�'���s�?�?���I�I�c�3��1�1�	��s�?�?��s�9�}�%�C���Q��x�/�0�E��
"��i�i�k�k���C��H���l��� �Jr�c�b�t�|S	tj|��S#t$r|cYSwxYw)z�Convert a numeric socket family value to an IntEnum member.
    If it's not a known member, return the numeric value itself.
    )�enumrC�
AddressFamily�
ValueError��nums r�rRrR"sH���|��
�	��'��,�,�,���	�	�	��J�J�J�	������.�.c�b�t�|S	tj|��S#t$r|cYSwxYw)zConvert a numeric socket type value to an IntEnum member.
    If it's not a known member, return the numeric value itself.
    )rUrC�
SocketKindrWrXs r�rSrS/sH���|��
�	��$�S�)�)�)���	�	�	��J�J�J�	���rZc	�p�|tjtfvr|r	t|�}|r	t|�}|tjkr,|ttfvr|�|t��}nt}t|��}t|��}|�t||||||��St|||||||��S)z2Convert a raw connection tuple to a proper ntuple.)rCrr
r�r	�getr rRrSr7r@)r��fam�type_r�r�r��
status_mapr�s        r�rVrV<s���
�v�~�x�(�(�(��	!��%�L�E��	!��%�L�E���"�"�"�s�w��.A�'A�'A�����	�2�2�����
�#�
�
�C��U�#�#�E�
�{��R��e�U�E�6�:�:�:��R��e�U�E�6�3�?�?�?r�c����fd�}|S)z�A decorator which can be used to mark a method as deprecated
    'replcement' is the method name which will be called instead.
    c����|j�d��d��|j��|_tj|����fd���}|S)Nz*() is deprecated and will be removed; use z
() insteadc�h��tj�td���t|���|i|��S)Nr|)�category�
stacklevel)�warnings�warn�DeprecationWarning�getattr)r�rr!r��replacements   ��r��innerz/deprecated_method.<locals>.outer.<locals>.innerYs:����M�#�(:�q�I�I�I�I�-�7�4��-�-�t�>�v�>�>�>r�)r�r�r)r*)r$rlr�rks  @�r��outerz deprecated_method.<locals>.outerSsc�����L�L�L�+�+�+�'���;���C�K�	���	�	�	?�	?�	?�	?�	?�
�	�	?��r�r�)rkrms` r�rKrKOs#���
�
�
�
�
��Lr�c�8�eZdZdZd�Zd�Zd�Zd�Zd	d�Zd�Z	dS)
�_WrapNumberszNWatches numbers so that they don't overflow and wrap
    (reset to zero).
    c�`�tj��|_i|_i|_i|_dSr�)�	threading�Lock�lockr#�	reminders�
reminder_keys�r�s r�r�z_WrapNumbers.__init__fs-���N�$�$��	���
��������r�c���||jvsJ�||jvsJ�||jvsJ�||j|<tt��|j|<tt
��|j|<dSr�)r#rtrur�int�set)r��
input_dictr�s   r��	_add_dictz_WrapNumbers._add_dictlsw���4�:�%�%�%�%��4�>�)�)�)�)��4�-�-�-�-�-�%��
�4��*�3�/�/���t��#.�s�#3�#3���4� � � r�c��|j|}t|�����t|�����z
}|D]4}|j||D]}|j||=�|j||=�5dS)z�In case the number of keys changed between calls (e.g. a
        disk disappears) this removes the entry from self.reminders.
        N)r#ry�keysrurt)r�rzr��old_dict�	gone_keys�gone_key�remkeys       r��_remove_dead_remindersz#_WrapNumbers._remove_dead_remindersts����:�d�#����
�
���(�(�3�z���/@�/@�+A�+A�A�	�!�	3�	3�H��,�T�2�8�<�
1�
1���N�4�(��0�0��"�4�(��2�2�	3�	3r�c��||jvr|�||��|S|�||��|j|}i}|���D]�}||}	||}n#t$r|||<Y�%wxYwg}tt
|����D]�}	||	}
||	}||	f}|
|krA|j||xx|z
cc<|j||�	|��|�
|
|j||z����t|��||<��||j|<|S)zkCache dict and sum numbers which overflow and wrap.
        Return an updated copy of `input_dict`
        )r#r{r�r}r �range�lenrtru�addr
�tuple)
r�rzr�r~�new_dictr"�input_tuple�	old_tuple�bits�i�input_value�	old_valuer�s
             r��runz_WrapNumbers.runs����t�z�!�!��N�N�:�t�,�,�,����#�#�J��5�5�5��:�d�#�����?�?�$�$�	(�	(�C�$�S�/�K�
�$�S�M�	�	���
�
�
�!,���
���	
�����D��3�{�+�+�,�,�
H�
H��)�!�n��%�a�L�	��q�����*�*��N�4�(��0�0�0�I�=�0�0�0��&�t�,�S�1�5�5�f�=�=�=����K�$�.��*>�v�*F�F�G�G�G�G�!�$�K�K�H�S�M�M�%��
�4���s�&A/�/B�BNc��|j5|�L|j���|j���|j���nQ|j�|d��|j�|d��|j�|d��ddd��dS#1swxYwYdS)z>Clear the internal cache, optionally only for function 'name'.N)rsr#r'rtru�pop)r�r�s  r�r(z_WrapNumbers.cache_clear�s���
�Y�	3�	3��|��
� � �"�"�"���$�$�&�&�&��"�(�(�*�*�*�*��
���t�T�*�*�*���"�"�4��.�.�.��"�&�&�t�T�2�2�2�	3�	3�	3�	3�	3�	3�	3�	3�	3�	3�	3�	3����	3�	3�	3�	3�	3�	3s�B B5�5B9�<B9c�l�|j5|j|j|jfcddd��S#1swxYwYdS)z5Return internal cache dicts as a tuple of 3 elements.N)rsr#rtrurvs r��
cache_infoz_WrapNumbers.cache_info�s���
�Y�	D�	D��J����0B�C�	D�	D�	D�	D�	D�	D�	D�	D�	D�	D�	D�	D����	D�	D�	D�	D�	D�	Ds�)�-�-r�)
r�r�r�r�r�r{r�r�r(r�r�r�r�roroas��������� � � �4�4�4�	3�	3�	3�%�%�%�N
3�
3�
3�
3�D�D�D�D�Dr�roc��tj5t�||��cddd��S#1swxYwYdS)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)�_wnrsr�)rzr�s  r�rTrT�s���


��)�)��w�w�z�4�(�(�)�)�)�)�)�)�)�)�)�)�)�)����)�)�)�)�)�)s�5�9�9c��t|dfi|��S)N�rb)�open��fnamer!s  r��open_binaryr��s����t�&�&�v�&�&�&r�c��tr6|�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�
setdefaultr5r6r�r�s  r��	open_textr��sR��
�3�	���*�h�/�/�/����(�M�2�2�2���t�&�&�v�&�&�&r��%(value).1f%(symbol)sc�6�d}i}t|dd���D]\}}d|dzdzz||<�t|dd���D]9}|||kr+t|��||z}|t��zcS�:|t	|d|���zS)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�s        r�rUrU�s���<�G�
�F��'�!�"�"�+�&�&�&�&���1��!�a�%�2��%��q�	�	��7�1�2�2�;�'�'�%�%����v�����!�H�H�v�f�~�-�E��F�H�H�$�$�$�$���D���
�!�4�4�4�4�4r�c�0�tjdjS)z+Return updated psutil.PROCFS_PATH constant.r�)�sys�modules�PROCFS_PATHr�r�r��get_procfs_pathr��s���;�x� �,�,r�c�D�|�tt���S)N)r�r�)�decoder5r6�r�s r�r�r��s���x�x��-�x�@�@�@r�c��|Sr�r�r�s r�r�r��s���r�c���tjdkrdS	ddl}|���sJ�|���|�d��dksJ�	dS#t$rYdSwxYw)Nr\Tr�colorsF)r7r��curses�isatty�	setupterm�tigetnumr�)�filer�s  r�rYrY�s���	�w�$����t���
�
�
��{�{�}�}���}����������x�(�(�1�,�,�,�,�,��t�������u�u����s�A	A � 
A.�-A.Fc��t��s|Sg}tddddddddd	�
�	�	}d|d<	||}n?#t$r2td
t	|�����z���wxYw|�|��|r|�d��dd�|���d|�d�S)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[�;�mz)rYr�r rW�listr}r
r)r��color�bold�attrr�s     r�rXrX
s����!�!����
�D�
��$�d�4�d���D�4�I�I�I�F��F�4�L�"��u�
�����"�"�"��>���������!�"�"�	"�"����	�K�K����������C�����"%�(�(�4�.�.�.�.�!�!�!�4�4s	�:�<A6c
��t��st||���dStr"tt|||��|���dSddl}d}|jjj}|jjj}tdddd���}||d<	||}nB#t$r5td	|�d
t|�
���������wxYw|r|dkr|dz
}|tjurdnd
}	|j|_||	��}
||
|��	t||���||
|��dS#||
|��wxYw)z$Print a colorized version of string.�r�rN�r|r
�)r�r�r�r�zinvalid color z; choose between �i�i����)rY�printrrX�ctypes�windll�Kernel32�GetStdHandle�SetConsoleTextAttributer�r rWr�r}r��stderr�c_ulong�restype)r�r�r�r�r��
DEFAULT_COLORr�r�r��	handle_id�handles           r�rZrZ s��� �!�!�;�
�a�d�������	�;�
�f�Q��t�$�$�4�0�0�0�0�0�0��
�
�
��
��}�-�:���M�"�:�	 ��A�1�A�a�8�8�8��$��t��	-��5�M�E�E���	-�	-�	-��*����t�F�K�K�M�M�*�*�*�,�-�-�
-�	-�����	�E�Q�J�J��Q�J�E��3�:�-�-�C�C�3�	�%�~�����i�(�(������.�.�.�	;��!�$�����#�#�F�M�:�:�:�:�:��#�#�F�M�:�:�:�:���s�B�?C�D9�9E�PSUTIL_DEBUGc��tjtj��j��\}}}}}t	d|�d|�d|��t
j���dS)z@If PSUTIL_DEBUG env var is set, print a debug message to stderr.zpsutil-debug [�:z]> r�N)�inspect�getframeinfo�currentframe�f_backr�r�r�)r�r��lineno�	func_name�lines�indexs      r�rWrWFsi��18�1E�� �"�"�)�2+�2+�.��v�y�%��
��E�E�E�6�6�6�3�3�?��:�	�	�	�	�	�	r�c��dSr�r�)r�s r�rWrWMs���r�r�)r�)NF)�r��
__future__rrrEr<r)r7rCr8r�rqrg�collectionsrrrrr	r
�ImportErrorr�version_inforUr��__all__r�rr�platform�
startswithrrrrrrrr�AIXr+r,r(r-r/r3r'r1r2r)r*r0r.r4rr"r!rrr#rrrrrr r$r%r&�IntEnumr�globals�update�__members__r�r�r��getfilesystemencodingr5r6�getfilesystemencodeerrorsr.rHrDrBrCrErIr@rFrGrAr�r�r�r�r8r=r>r?r:r;r<r9r7r�rJr�r�r�rrrrPrMr5rLrOrQrNrRrSrVrKrorTr�r(r�r�r�rUr�r��stdoutrYrXrZ�bool�getenvr�rWr�r�r��<module>rs�
��
@�?�
0�/�/�/�/�/�/�/�������������	�	�	�	�
�
�
�
�����
�
�
�
���������#�#�#�#�#�#�"�"�"�"�"�"���������������������������������H�H�H�������������������G�G�G�������v����K�K�K�K��D�
��q��Q�������H	��7���
�'�T�/�������(�(�������)�)����

�,�
!�
!�)�
,�
,��

�,�
!�
!�)�
,�
,��	��	 �	 ��	*�	*��
�"��"�F������ 4�5�5��	�l���e�$�$������ ����$���
������
����
������
�!���
��
�������
�
����
������	��<��O��O���������D�L����
�G�I�I���Y�*�+�+�+��<������"�"�"�"�"�d�l�"�"�"��G�I�I���[�,�-�-�-�%�3�$�&�&��
�B��M�M�B�5��5�7�7�
�
���B�B�B�-2�A�)�)�	�
�
�
�B����	�
�7�%�%�%�	&�	&���Z��&J�&J�&J�
K�
K�
�
�*�Y�!<�!<�!<�=�=��
�J�{�%;�%;�%;�
<�
<�	�
��H�4�4�4�
5�
5��
	�
�7�J�J�J�K�K���
�7�.�.�.�	/�	/���:�j�J�J�J�L�L��
�J�{�$F�$F�$F�G�G�	��J��N�N�N�
P�
P�	��:�j�";�";�";�<�<��
�*�
�7�7�7�9�9���:�j�"J�"J�"J�K�K���z�&�7�I�.�/�/��

�J�{�M�M�M�
O�
O�	�
�J�{�V�T�N�3�3�	�
�*�Y� B� B� B�
C�
C���
�7�:�:�:�;�;���
�7�:�:�:�;�;���j��6�6�6�7�7���*�Y��G� 4�
5�
5��	��H�{�M�:�	;�	;���
�7�'�'�'�	(�	(���z�&�4��.�)�)���h��(�;�
�*C�D�
�h��+��/��Y��
�&�
�h��*��.��Y���%��x�
 �;�
�";�<��i�+�z�2�
3��j�;�
�3�
4�	
�	
�	���
�����k�]�+���j�\�*������
��
����'��[�*�5�6����������I����"=�=�=�=�=�E�=�=�=�&K�K�K�K�K�M�K�K�K�2�����5����$/�/�/�/�/�U�/�/�/�,	�	�	�	����@6�6�6�r(�(�(����	�
�
�	��
����8
�
�
�
�
�
�@�@�@�@�&���$TD�TD�TD�TD�TD�TD�TD�TD�n)�)�)��l�n�n���?����.���'�'�'�'�'�'�5�5�5�5�(-�-�-�
��A�A�A�A����	�!�j����	���5�5�5�5�(�E��
� ;� ;� ;� ;�F�4�	��	�.�!�$�$�%�%�
��N�N�N������
�
�
�
�
s6�A�A�A�#A*�*A4�3A4�5I�I�I

?>