Your IP : 3.141.25.100


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

�

��bg�?��L�dZddlZddlZddlZddlmZddlmZddlmZddlm	Z
ddlmZdd	lm
Z
dd
lmZddlmZddlmZdd
lmZddlmZddlmZddlmZddlmZddlmZddlmZgZej��ZejZe
jeje
jej e
j!ej"e
j#ej$e
j%ej&e
j'ej(e
j)ej*e
j+ej,e
j-ej.e
j/ej0e
j1ej2e
j3ej4iZ5e
j6ej7e
j8ej9e
j:ej;e
j<ej=e
j>ej?iZ@eAddddddddddd���ZBeAdddddddd���ZCedgd ���ZDed!gd"���ZEed#gd$���ZFed%eFjGd&z��ZHd'�ZId(�ZJd)�ZKd*�ZLd+�ZMd,�ZNd-�ZOd.�ZPejQZQe
jRZRd<d0�ZSd1�ZTe
jUZUejVZVd=d3�ZWd4�ZXd5�ZYd6�ZZd7�Z[ej\Z\d8�Z]d9�Z^Gd:�d;e_��Z`dS)>zmacOS platform implementation.�N)�
namedtuple�)�_common)�_psposix)�_psutil_osx)�
_psutil_posix)�AccessDenied)�
NoSuchProcess)�
ZombieProcess)�	conn_tmap)�conn_to_ntuple)�
isfile_strict)�memoize_when_activated)�parse_environ_block)�
usage_percent)�PermissionError)�ProcessLookupError��������	�
)�ppid�ruid�euid�suid�rgid�egid�sgid�ttynr�ctime�status�name)�cpuutime�cpustime�rss�vms�pfaults�pageins�
numthreads�volctxsw�	scputimes��user�nice�system�idle�svmem)�total�	available�percent�used�free�active�inactive�wired�pmem)r*r+r,r-�pfullmem)�ussc
��tj��\}}}}}}||z}||z}||z}t||z
|d���}t||||||||��S)z&System virtual memory as a namedtuple.r��round_)�cext�virtual_memrr6)	r7r<r=r>r;�speculative�availr:r9s	         �`/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib64/python3.11/site-packages/psutil/_psosx.py�virtual_memoryrJosx��8<�8H�8J�8J�5�E�6�8�U�D�+�

�t�O�E��E�>�D�	�K��D��U�U�]�U�1�=�=�=�G����w��d���5�*�*�*�c��tj��\}}}}}t||d���}tj||||||��S)z=Swap system memory as a (total, used, free, sin, sout) tuple.rrC)rE�swap_memrr�sswap)r7r:r;�sin�soutr9s      rI�swap_memoryrQ�sF��#'�=�?�?� �E�4��s�D��D�%��2�2�2�G��=���d�G�S�$�?�?�?rKc�V�tj��\}}}}t||||��S)z(Return system CPU times as a namedtuple.)rE�	cpu_timesr0r1s    rIrSrS�s,��#�~�/�/��D�$����T�4���.�.�.rKc��g}tj��D]0}|\}}}}t||||��}|�|���1|S)z(Return system CPU times as a named tuple)rE�
per_cpu_timesr0�append)�ret�cpu_tr2r3r4r5�items       rIrUrU�sZ��
�C��#�%�%����#(� ��d�F�D���t�V�T�2�2���
�
�4������JrKc�(�tj��S)z0Return the number of logical CPUs in the system.)rE�cpu_count_logical�rKrIr[r[�s���!�#�#�#rKc�(�tj��S)z-Return the number of CPU cores in the system.)rE�cpu_count_coresr\rKrIr^r^�s����!�!�!rKc�b�tj��\}}}}}tj||||��S�N)rE�	cpu_statsr�	scpustats)�ctx_switches�
interrupts�soft_interrupts�syscalls�trapss     rIrara�s:������?�L�*�o�x�����j�/�8�=�=�=rKc�^�tj��\}}}tj|||��gS)z�Return CPU frequency.
    On macOS per-cpu frequency is not supported.
    Also, the returned frequency never changes, see:
    https://arstechnica.com/civis/viewtopic.php?f=19&t=465002
    )rE�cpu_freqr�scpufreq)�curr�min_�max_s   rIriri�s.���}����D�$����T�4��.�.�/�/rKFc	�>�g}tj��}|D]�}|\}}}}|dkrd}|s?tj�|��rtj�|��s�Rdx}}	t
j||||||	��}
|�|
����|S)z8Return mounted disk partitions as a list of namedtuples.�none�N)	rE�disk_partitions�os�path�isabs�existsr�	sdiskpartrV)�all�retlist�
partitions�	partition�device�
mountpoint�fstype�opts�maxfile�maxpath�ntuples           rIrqrq�s����G��%�'�'�J��
�
�	�+4�(��
�F�D��V����F��	��7�=�=��(�(�
�����v�0F�0F�
�� � ��'��"�6�:�v�t�#*�G�5�5�����v������NrKc���	tj��\}}}n#t$rYdSwxYw|dk}|r
tj}n|dkr
tj}n|dz}tj|||��S)zReturn battery information.Nr����<)rE�sensors_battery�NotImplementedErrorr�POWER_TIME_UNLIMITED�POWER_TIME_UNKNOWN�sbattery)r9�minsleft�
power_plugged�secslefts    rIr�r��s����+/�+?�+A�+A�(���=�=�������t�t�����"�Q�&�M��!��/���	�R����-����b�=����G�X�}�=�=�=s��
(�(�inetc��g}t��D]p}	t|���|��}|r9|D]6}t|��|gz}|�tj|����7�a#t$rY�mwxYw|S)z System-wide network connections.)�pids�Process�connections�listrVr�sconnr
)�kindrW�pid�cons�cs     rI�net_connectionsr��s���
�C��v�v�	2�	2��	2��3�<�<�+�+�D�1�1�D��
2��2�2�A��Q���3�%��A��J�J�w�}�a�0�1�1�1�1���
�	�	�	��H�	�����Js�"A2�2
A?�>A?c���t�����}i}|D]�}	tj|��}tj|��}tj|��\}}t
td��rtj|��}d�	|��}d|v}tj
|||||��||<��#t$r }	|	jtj
kr�Yd}	~	��d}	~	wwxYw|S)z)Get NIC stats (isup, duplex, speed, mtu).�	NicDuplex�,�runningN)�net_io_counters�keys�
cext_posix�
net_if_mtu�net_if_flags�net_if_duplex_speed�hasattrrr��join�	snicstats�OSError�errno�ENODEV)
�namesrWr'�mtu�flags�duplex�speed�output_flags�isup�errs
          rI�net_if_statsr�s�����"�"�$�$�E�
�C��8�8��	8��'��-�-�C��+�D�1�1�E�&�:�4�@�@�M�F�E��w��,�,�
3� �*�6�2�2���8�8�E�?�?�L���%�D��)�$���s�*6�8�8�C��I�I���	�	�	��y�E�L�(�(��)�(�(�(�(�����	�����Js�?C�
C/�C*�*C/c�(�tj��S)z:The system boot time expressed in seconds since the epoch.)rE�	boot_timer\rKrIr�r�s���>���rKc��g}tj��}|D]E}|\}}}}}|dkr�|s�tj||pd|pd||��}|�|���F|S)z:Return currently connected users as a list of namedtuples.�~N)rE�usersr�suserrV)	rx�rawlistrYr2�tty�hostname�tstampr��nts	         rIr�r�$s����G��j�l�l�G�����+/�(��c�8�V�S��#�:�:���	��
�]�4����h�.>�$���
L�
L�����r������NrKc��tj��}d|vrj	td�����|�dd��n1#t
$rYn%t$r|�dd��YnwxYw|S�Nr)rEr�r��create_time�insertr
r	)�lss rIr�r�8s���	
����B���{�{�	��A�J�J�"�"�$�$�$��I�I�a��O�O�O�O���	�	�	��D��	�	�	��I�I�a��O�O�O�O�O�	����
�Is�7A�
A?�A?�>A?c��	tj|��td}|tjkS#t$rYdSwxYw)Nr&F)rE�proc_kinfo_oneshot�kinfo_proc_map�SZOMB�	Exception)r��sts  rI�	is_zombier�KsP���
�
$�S�
)�
)�.��*B�
C���T�Z���������u�u����s�47�
A�Ac�F��tj����fd���}|S)z`Decorator which translates bare OSError exceptions into
    NoSuchProcess and AccessDenied.
    c�x��	�|g|�Ri|��S#t$rOt|j��r t|j|j|j���t
|j|j���t$rt|j|j���tj
$r!t|j|j|j���wxYwr`)rr�r�r�_name�_ppidr
rr	rE�ZombieProcessError)�self�args�kwargs�funs   �rI�wrapperz wrap_exceptions.<locals>.wrapperWs����
	B��3�t�-�d�-�-�-�f�-�-�-��!�	:�	:�	:����"�"�
:�#�D�H�d�j�$�*�E�E�E�#�D�H�d�j�9�9�9��	5�	5�	5��t�x���4�4�4��&�	B�	B�	B����$�*�d�j�A�A�A�	B���s
��B*B9)�	functools�wraps)r�r�s` rI�wrap_exceptionsr�Ss?����_�S���B�B�B�B���B��NrKc�v�eZdZdZgd�Zd�Zeed�����Zeed�����Z	d�Z
d�Zed���Zed	���Z
ed
���Zed���Zed���Zed
���Zed���Zed���Zed���Zed���Zed���Zed���Zed���Zed���Zed���Zed���Zed!d���Zed���Zed"d���Zed���Zed���Z ed���Z!ed ���Z"dS)#r�z1Wrapper class around underlying C implementation.)r�r�r��_cachec�0�||_d|_d|_dSr`)r�r�r�)r�r�s  rI�__init__zProcess.__init__ls�������
���
�
�
rKc��tj|j��}t|��tt��ksJ�|Sr`)rEr�r��lenr��r�rWs  rI�_get_kinfo_proczProcess._get_kinfo_procqs:���%�d�h�/�/���3�x�x�3�~�.�.�.�.�.�.��
rKc��tj|j��}t|��tt��ksJ�|Sr`)rE�proc_pidtaskinfo_oneshotr�r��pidtaskinfo_mapr�s  rI�_get_pidtaskinfozProcess._get_pidtaskinfoys:���+�D�H�5�5���3�x�x�3��/�/�/�/�/�/��
rKc�n�|j�|��|j�|��dSr`)r��cache_activater��r�s rI�
oneshot_enterzProcess.oneshot_enter�s6����+�+�D�1�1�1���,�,�T�2�2�2�2�2rKc�n�|j�|��|j�|��dSr`)r��cache_deactivater�r�s rI�oneshot_exitzProcess.oneshot_exit�s6����-�-�d�3�3�3���.�.�t�4�4�4�4�4rKc��|���td}|�|ntj|j��S)Nr')r�r�rE�	proc_namer�)r�r's  rIr'zProcess.name�s8���#�#�%�%�n�V�&<�=���'�t�t�T�^�D�H�-E�-E�ErKc�4�tj|j��Sr`)rE�proc_exer�r�s rI�exezProcess.exe�����}�T�X�&�&�&rKc�4�tj|j��Sr`)rE�proc_cmdliner�r�s rI�cmdlinezProcess.cmdline�s��� ���*�*�*rKc�N�ttj|j����Sr`)rrE�proc_environr�r�s rI�environzProcess.environ�s��"�4�#4�T�X�#>�#>�?�?�?rKc�d�|���td|_|jS)Nr)r�r�r�r�s rIrzProcess.ppid�s'���)�)�+�+�N�6�,B�C��
��z�rKc�4�tj|j��Sr`)rE�proc_cwdr�r�s rI�cwdzProcess.cwd�r�rKc��|���}tj|td|td|td��S)Nrrr �r�r�puidsr��r��rawtuples  rI�uidszProcess.uids��N���'�'�)�)���}��^�F�+�,��^�F�+�,��^�F�+�,�.�.�	.rKc��|���}tj|td|td|td��S)Nr!r"r#r�r�s  rI�gidszProcess.gids�r�rKc��|���td}tj��}	||S#t$rYdSwxYw)Nr$)r�r�r�get_terminal_map�KeyError)r��tty_nr�tmaps   rI�terminalzProcess.terminal�s\���%�%�'�'��w�(?�@���(�*�*��	���<����	�	�	��4�4�	���s�A�
A�Ac���|���}t|td|td|td|td��S)Nr*r+r,r-)r�r?r�r�s  rI�memory_infozProcess.memory_info�sY���(�(�*�*����_�U�+�,��_�U�+�,��_�Y�/�0��_�Y�/�0�	
�
�	
rKc�v�|���}tj|j��}t	||fz�Sr`)r	rE�proc_memory_ussr�r@)r��	basic_memrAs   rI�memory_full_infozProcess.memory_full_info�s7���$�$�&�&�	��"�4�8�,�,����c�W�,�-�-rKc��|���}tj|td|tddd��S)Nr(r)g)r�r�	pcputimesr�r�s  rIrSzProcess.cpu_times�sG���(�(�*�*��� ��_�Z�0�1��_�Z�0�1���	��	rKc�L�|���tdS)Nr%)r�r�r�s rIr�zProcess.create_time�s���#�#�%�%�n�W�&=�>�>rKc�v�|���td}tj|d��S)Nr/r)r�r�r�pctxsw)r��vols  rI�num_ctx_switcheszProcess.num_ctx_switches�s1��
�#�#�%�%�o�j�&A�B���~�c�1�%�%�%rKc�L�|���tdS)Nr.)r�r�r�s rI�num_threadszProcess.num_threads�s���$�$�&�&��|�'D�E�ErKc���|jdkrgSg}tj|j��}|D]>\}}t|��r*t	j||��}|�|���?|Sr�)r�rE�proc_open_filesrr�	popenfilerV)r��filesr�rs�fdr�s      rI�
open_fileszProcess.open_files�sv���8�q�=�=��I����&�t�x�0�0���	%�	%�H�D�"��T�"�"�
%� �*�4��4�4�����V�$�$�$���rKr�c
�Z�|tvr7td|�dd�d�tD���������t|\}}tj|j||��}g}|D]:}|\}}}	}
}}t
|||	|
||t��}
|�|
���;|S)Nzinvalid z kind argument; choose between z, c�,�g|]}t|����Sr\)�repr)�.0�xs  rI�
<listcomp>z'Process.connections.<locals>.<listcomp>�s��0L�0L�0L�Q��a���0L�0L�0LrK)	r�
ValueErrorr�rE�proc_connectionsr�r
�TCP_STATUSESrV)r�r��families�typesr�rWrYr�fam�type�laddr�raddrr&r�s              rIr�zProcess.connections�s����y� � ��*� $���d�i�i�0L�0L�)�0L�0L�0L�&M�&M�&M�O�P�P�
P�#�D�/���%��'���(�E�B�B�����	�	�D�26�/�B��T�5�%����C��u�e�V� ,�.�.�B��J�J�r�N�N�N�N��
rKc�N�|jdkrdStj|j��Sr�)r�rE�proc_num_fdsr�s rI�num_fdszProcess.num_fdss%���8�q�=�=��1�� ���*�*�*rKNc�B�tj|j||j��Sr`)r�wait_pidr�r�)r��timeouts  rI�waitzProcess.waits��� ���7�D�J�?�?�?rKc�4�tj|j��Sr`)r��getpriorityr�r�s rI�nice_getzProcess.nice_get
s���%�d�h�/�/�/rKc�6�tj|j|��Sr`)r��setpriorityr�)r��values  rI�nice_setzProcess.nice_sets���%�d�h��6�6�6rKc��|���td}t�|d��S)Nr&�?)r�r��
PROC_STATUSES�get)r��codes  rIr&zProcess.statuss3���#�#�%�%�n�X�&>�?��� � ��s�+�+�+rKc��tj|j��}g}|D]1\}}}tj|||��}|�|���2|Sr`)rE�proc_threadsr�r�pthreadrV)r�r�rx�	thread_id�utime�stimer�s       rI�threadszProcess.threadss\���#�D�H�-�-����'.�	#�	#�#�I�u�e��_�Y��u�=�=�F��N�N�6�"�"�"�"��rK�r�r`)#�__name__�
__module__�__qualname__�__doc__�	__slots__r�r�rr�r�r�r�r'r�r�r�rr�r�rrr	r
rSr�rrrr�r.r2r5r9r&rEr\rKrIr�r�gs"������;�;�3�3�3�I����
�������_���������_��3�3�3�5�5�5��F�F��_�F��'�'��_�'��+�+��_�+��@�@��_�@�����_���'�'��_�'��.�.��_�.��.�.��_�.�����_���
�
��_�
��.�.��_�.�
����_���?�?��_�?��&�&��_�&��F�F��_�F��	�	��_�	������_���+�+��_�+�
�@�@�@��_�@��0�0��_�0��7�7��_�7��,�,��_�,�
����_���rKr�)FrF)arJr�r�rr�collectionsrrprrrrErr�r	r
rrr
rrrr�_compatrr�__extra__all__�getpagesize�PAGESIZE�AF_LINK�TCPS_ESTABLISHED�CONN_ESTABLISHED�
TCPS_SYN_SENT�
CONN_SYN_SENT�TCPS_SYN_RECEIVED�
CONN_SYN_RECV�TCPS_FIN_WAIT_1�CONN_FIN_WAIT1�TCPS_FIN_WAIT_2�CONN_FIN_WAIT2�TCPS_TIME_WAIT�CONN_TIME_WAIT�TCPS_CLOSED�
CONN_CLOSE�TCPS_CLOSE_WAIT�CONN_CLOSE_WAIT�
TCPS_LAST_ACK�
CONN_LAST_ACK�TCPS_LISTEN�CONN_LISTEN�TCPS_CLOSING�CONN_CLOSING�PSUTIL_CONN_NONE�	CONN_NONEr%�SIDL�STATUS_IDLE�SRUN�STATUS_RUNNING�SSLEEP�STATUS_SLEEPING�SSTOP�STATUS_STOPPEDr��
STATUS_ZOMBIEr<�dictr�r�r0r6r?�_fieldsr@rJrQrSrUr[r^rari�
disk_usage�disk_io_countersrqr�r��net_if_addrsr�r�r�r�r��
pid_existsr�r��objectr�r\rKrI�<module>rzs���
%�$���������	�	�	�	�"�"�"�"�"�"�������������!�!�!�!�!�!�)�)�)�)�)�)�!�!�!�!�!�!�"�"�"�"�"�"�"�"�"�"�"�"�������#�#�#�#�#�#�"�"�"�"�"�"�+�+�+�+�+�+�(�(�(�(�(�(�"�"�"�"�"�"�$�$�$�$�$�$�'�'�'�'�'�'���"�:�!�#�#��
�
��	��7�3����-���G�1���'�0���'�0����/���g�(���'�1����-���g�)���w�+���7�,�
�� 	�I�w�"��I�w�%��K��(��J��&��J��%��
���	
�	
�	
�	
�	
�	
�	
�
�
��	������$�
�
�	�	�
�
��
�	�	�	��$
�J�{�$F�$F�$F�G�G�	��
��-�-�-�	.�	.���z�&�>�>�>�?�?���:�j�$�,��":�;�;��*�*�*�"@�@�@�/�/�/����$�$�$�
"�"�"�
=�=�=�0�0�0��
 �
��(������.>�>�>�,�&���&������$���8���
���(
�
�
� �
 �
�������(x�x�x�x�x�f�x�x�x�x�xrK

?>