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/lib64/python3.10/site-packages/psutil/__pycache__/_pswindows.cpython-310.pyc
o

=iƎ�@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddlmZddlm
Z
ddlmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZzddlmZ Wn-e!y�Z"z!e#e"��$��%d�r�e�&�ddkr�dZ'e'd7Z'e'd7Z'e(e'�e"��dZ"["wwgd�Z)dZ*d Z+d!ej,vZ-e�.d"d#d$i�Z/e/j0Z0e j1ej2e j3ej4e j5ej6e j7ej8e j9ej:e j;ej<e j=ej>e j?ej@e jAejBe jCejDe jEejFe jGe*e jHejIi
ZJGd%d&�d&ej.�ZKeL��MeKjN�Gd'd(�d(ej.�ZOeL��MeOjN�ePd�id)d�d*d�d+d,�d-d.�d/d0�d1d2�d3d�d4d5�d6d7�d8d9�d:d;�d<d=�d>d?�d@dA�dBdC�dDdE�dFdG�dHdI�dJdK�dLdM�dNdO�dPdQ��ZQe
dRgdS��ZRe
dTgdU��ZSe
dVgdW��ZTe
dXeTjUdY�ZVe
dZd[d\g�ZWe
d]d^d_�XeWjU��ZYe
d`gda��ZZej[dbdc�ddde��Z\edfdg��Z]dhdi�Z^djdk�Z_e j`Z`dldm�Zadndo�Zbdpdq�Zcdrds�Zddtdu�Zedvdw�Zfdxdy�Zgdzd{�Zhd|aie�j�Zkd}d~�Zldd��Zmd�d�d��Znd�d��Zod�d��Zpd�d��Zqd�d��Zrdasd�d��Ztd�d��Zud�d��Zvd�d��ZwGd�d��d��Zxe jyZye jzZze j{Z{d�d��Z|d�d�d��Z}d�d��Z~d�d��ZGd�d��d��Z�dS)�z Windows platform implementation.�N)�
namedtuple�)�_common)�ENCODING)�AccessDenied)�
NoSuchProcess)�TimeoutExpired)�	conn_tmap)�conn_to_ntuple)�debug)�
isfile_strict)�memoize)�memoize_when_activated)�parse_environ_block)�
usage_percent)�ABOVE_NORMAL_PRIORITY_CLASS)�BELOW_NORMAL_PRIORITY_CLASS)�HIGH_PRIORITY_CLASS)�IDLE_PRIORITY_CLASS)�NORMAL_PRIORITY_CLASS)�REALTIME_PRIORITY_CLASS)�_psutil_windowszdll load failed�z3this Windows version is too old (< Windows Vista); z:psutil 3.4.2 is the latest version which supports Windows z2000, XP and 2003 server)�win_service_iter�win_service_getrrrrrr�IOPRIO_VERYLOW�
IOPRIO_LOW�
IOPRIO_NORMAL�IOPRIO_HIGH�CONN_DELETE_TCB�AF_LINKZ
DELETE_TCBi+Z__pypy__�
AddressFamilyr ���c@s$eZdZeZeZeZeZeZeZdS)�PriorityN)	�__name__�
__module__�__qualname__rrrrrr�r'r'�?/opt/osm/venv/lib/python3.10/site-packages/psutil/_pswindows.pyr#esr#c@seZdZdZdZdZdZdS)�
IOPriorityrr��N)r$r%r&rrrrr'r'r'r(r)qs
r)�num_handles�ctx_switches�	user_timer*�kernel_timer+�create_time��num_threads��	io_rcount�	io_wcount��	io_rbytes��	io_wbytes�	�io_count_others�
�io_bytes_others��num_page_faults��	peak_wset�
�wset��peak_paged_pool��
paged_pool��peak_non_paged_pool��non_paged_pool��pagefile��
peak_pagefile��mem_private��	scputimes)�user�system�idle�	interrupt�dpc�svmem)�total�	available�percent�used�free�pmem)�rss�vmsr?rArCrErGZpeak_nonpaged_poolZ
nonpaged_poolrMrO�private�pfullmem)�uss�
pmmap_grouped�pathr`�	pmmap_extzaddr perms � �pio)Z
read_countZwrite_count�
read_bytes�write_bytes�other_countZother_bytesi)�maxsizecCs�|�d�r|Sd�|�d�dd��}|dvr2d�|�d�dd��}dd�|�d�dd��}n|�d�r?|�d�d}nt�|�}|t|�d�}tj�||�S)	z�Convert paths using native DOS format like:
        "\Device\HarddiskVolume1\Windows\systemew\file.txt" or
        "\??\C:\Windows\systemew\file.txt"
    into:
        "C:\Windows\systemew\file.txt".
    z\\�\Nr+>z\??\UNCz\Device\Mupr3z\??\r*)�
startswith�join�split�cextZQueryDosDevice�len�osrf)�sZrawdriveZdriveletter�	remainderr'r'r(�convert_dos_path�s


rwcC�t��S�N)rr�getpagesizer'r'r'r(rz��rzc
CsJt��}|\}}}}|}|}|}||}t|||dd�}	t|||	||�S)z&System virtual memory as a namedtuple.r�Zround_)rr�virtual_memrrY)
�memZtotphysZ	availphysZ_totsysZ	_availsysrZZavailr^r]r\r'r'r(�virtual_memory�srcCspt��}|d}|d}||}|dkr!t��}td||�}nd}d}||}t|d�}t�||||dd�S)z=Swap system memory as a (total, used, free, sin, sout) tuple.rr*g{�G�z�?�r)rrr}Zswap_percent�int�roundrZsswap)r~Z
total_physZtotal_systemrZZpercentswapr]r^r\r'r'r(�swap_memory�s
r�cCsLt|t�r|jtdd�}t�|�\}}||}t||dd�}t�||||�S)z'Return disk usage associated with path.�strict)�errorsrr|)	�
isinstance�bytes�decoderrr�
disk_usagerrZ
sdiskusage)rfrZr^r]r\r'r'r(r�s
r�cCst�|�}dd�|D�S)zReturn disk partitions.cSsg|]}tj|��qSr')rZ	sdiskpart)�.0�xr'r'r(�
<listcomp>sz#disk_partitions.<locals>.<listcomp>)rr�disk_partitions)�all�rawlistr'r'r(r�s
r�cCs<t��\}}}tdd�tt���D��}t||||j|j�S)z)Return system CPU times as a named tuple.cSsg|]}t|��qSr')�sum)r��nr'r'r(r�#szcpu_times.<locals>.<listcomp>)rr�	cpu_timesrS�zip�
per_cpu_timesrWrX)rTrUrVZ
percpu_summedr'r'r(r�s
�r�cCs:g}t��D]\}}}}}t|||||�}|�|�q|S)z6Return system per-CPU times as a list of named tuples.)rrr�rS�append)�retrTrUrVrWrX�itemr'r'r(r�)s
r�cCrx)z0Return the number of logical CPUs in the system.)rr�cpu_count_logicalr'r'r'r(r�2r{r�cCrx)z-Return the number of CPU cores in the system.)rr�cpu_count_coresr'r'r'r(r�7r{r�cCs$t��\}}}}d}t�||||�S)zReturn CPU statistics.r)rr�	cpu_statsrZ	scpustats)r-Z
interruptsZ_dpcsZsyscallsZsoft_interruptsr'r'r(r�<s
�r�cCs(t��\}}d}t�t|�|t|��gS)zMReturn CPU frequency.
    On Windows per-cpu frequency is not supported.
    r�)rr�cpu_freqrZscpufreq�float)�currZmax_Zmin_r'r'r(r�Esr�FcCst��}tdd�|D��S)Ncss�|]}t|d�VqdS)r*N)r�)r��loadr'r'r(�	<genexpr>Us�z#_getloadavg_impl.<locals>.<genexpr>)rr�
getloadavg�tuple)Z	raw_loadsr'r'r(�_getloadavg_implRsr�cCsZtrt�St�tst��daWd�t�SWd�t�S1s%wYt�S)z�Return the number of processes in the system run queue averaged
    over the last 1, 5, and 15 minutes respectively as a tuple.
    TN)�_loadavg_initializedr��_lockrrZinit_loadavg_counterr'r'r'r(r�Xs
��
��r�cCsrt|\}}t�|||�}t�}|D]"}|\}}}	}
}}}
t|||	|
||t|dkr+|
ndd�}|�|�qt|�S)z�Return socket connections.  If pid == -1 return system-wide
    connections (as opposed to connections opened by one process only).
    r"N)�pid)r	rr�net_connections�setr
�TCP_STATUSES�add�list)�kind�_pidZfamilies�typesr�r�r��fdZfam�type�laddr�raddr�statusr��ntr'r'r(r�ns"�
r�cCsXi}t��}|��D]\}}|\}}}}ttd�rt�|�}t�||||d�||<q
|S)z)Get NIC stats (isup, duplex, speed, mtu).�	NicDuplex�)rr�net_if_stats�items�hasattrrr�Z	snicstats)r�Zrawdict�namer�ZisupZduplex�speedZmtur'r'r(r��s

r�cCrx)zsReturn network I/O statistics for every network interface
    installed on the system as a dict of raw tuples.
    )rr�net_io_countersr'r'r'r(r��sr�cCrx)z,Return the addresses associated to each NIC.)rr�net_if_addrsr'r'r'r(r��r{r�cCsdt��\}}}}|dk}t|d@�}t|d@�}|rdS|s |r$tj}n|dkr+tj}t�|||�S)zReturn battery information.r�r8Nr")rr�sensors_battery�boolrZPOWER_TIME_UNLIMITEDZPOWER_TIME_UNKNOWNZsbattery)Z
acline_status�flagsr\ZsecsleftZ
power_pluggedZ
no_batteryZchargingr'r'r(r��sr�cCs,t��t��}t|t�dkrtS|a|S)z�The system boot time expressed in seconds since the epoch. This
    also includes the time spent during hybernate / suspend.
    r)�timerrZuptime�abs�_last_btime)r�r'r'r(�	boot_time�s
r�cCs@g}t��}|D]}|\}}}t�|d||d�}|�|�q|S)z:Return currently connected users as a list of namedtuples.N)rr�usersrZsuserr�)�retlistr�r�rT�hostnameZtstampr�r'r'r(r��s
r�ccs$�t��D]
\}}t||�VqdS)z*Yields a list of WindowsService instances.N)rrZwinservice_enumerate�WindowsService)r��display_namer'r'r(r�s��rcCst|d�}|��d|_|S)zBOpen a Windows service and return it as a WindowsService instance.Nr�)r��
_query_config�
_display_name)r�Zservicer'r'r(r�s
rc@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
ejdd��Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$S)%r�z(Represents an installed Windows service.cCs||_||_dSry)�_namer�)�selfr�r�r'r'r(�__init__�s
zWindowsService.__init__cCs&d|j�d|j�d�}|jj�|��S)Nz(name=z, display_name=�))r�r��	__class__r$)r��detailsr'r'r(�__str__�szWindowsService.__str__cCsd|���dt|��d�S)N�<z at �>)r��id�r�r'r'r(�__repr__�szWindowsService.__repr__cCst|t�stS|j|jkSry)r�r��NotImplementedr��r��otherr'r'r(�__eq__�s
zWindowsService.__eq__cCs
||kSryr'r�r'r'r(�__ne__s
zWindowsService.__ne__cCsL|���t�|j�\}}}}Wd�n1swYt||||d�S)N)r��binpath�username�
start_type)�_wrap_exceptionsrrZwinservice_query_configr��dict)r�r�r�r�r�r'r'r(r�s

���zWindowsService._query_configcCsP|���t�|j�\}}Wd�n1swY|dkr"d}t||d�S)Nr)r�r�)r�rrZwinservice_query_statusr�r�)r�r�r�r'r'r(�
_query_statuss
�zWindowsService._query_statusc
cs��zdVWdSty@}z-|j}t|�r$d|�d�}td||d�|�|jtjtjhvr;d|�d�}td||d�|��d}~ww)z{Ctx manager which translates bare OSError and WindowsError
        exceptions into NoSuchProcess and AccessDenied.
        Nzservice z( is not querable (not enough privileges)�r�r��msgz does not exist)	�OSErrorr��is_permission_errr�winerrorrrZERROR_INVALID_NAMEZERROR_SERVICE_DOES_NOT_EXISTr)r��errr�r�r'r'r(r�s$�
����zWindowsService._wrap_exceptionscC�|jS)z�The service name. This string is how a service is referenced
        and can be passed to win_service_get() to get a new
        WindowsService instance.
        )r�r�r'r'r(r�0szWindowsService.namecCr�)z_The service display name. The value is cached when this class
        is instantiated.
        )r�r�r'r'r(r�7szWindowsService.display_namecC�|��dS)zwThe fully qualified path to the service binary/exe file as
        a string, including command line arguments.
        r��r�r�r'r'r(r�=�zWindowsService.binpathcCr�)z,The name of the user that owns this service.r�r�r�r'r'r(r�C�zWindowsService.usernamecCr�)zRA string which can either be "automatic", "manual" or
        "disabled".
        r�r�r�r'r'r(r�Gr�zWindowsService.start_typecCr�)zzThe process PID, if any, else None. This can be passed
        to Process class to control the service's process.
        r��r�r�r'r'r(r�Or�zWindowsService.pidcCr�)zService status as a string.r�r�r�r'r'r(r�Ur�zWindowsService.statuscCst�|���S)zService long description.)rrZwinservice_query_descrr�r�r'r'r(�descriptionY�zWindowsService.descriptioncCs>|��}|�|���|��|d<|��|d<|��|d<|S)zUUtility method retrieving all the information above as a
        dictionary.
        r�r�r�)r��updater�r�r�r�)r��dr'r'r(�as_dict_szWindowsService.as_dictN)r$r%r&�__doc__r�r�r�r�r�r�r��
contextlib�contextmanagerr�r�r�r�r�r�r�r�r�r�r'r'r'r(r��s(

r�cCs.t|t�s	J|��t|t�p|jtjtjhvS)z*Return True if this is a permission error.)r�r��PermissionErrorr�rrZERROR_ACCESS_DENIEDZERROR_PRIVILEGE_NOT_HELD)�excr'r'r(r��s
�r�cCs@t|t�s	J|��t|�rt||d�St|t�rt||d�S|�)z3Convert OSError into NoSuchProcess or AccessDenied.�r�r�)r�r�r�r�ProcessLookupErrorr)r�r�r�r'r'r(�convert_oserror�s
r�c�t����fdd��}|S)zDDecorator which converts OSError into NoSuchProcess or AccessDenied.c
sFz�|g|�Ri|��WSty"}z
t||j|jd�|�d}~ww)Nr�)r�r�r�r�)r��args�kwargsr���funr'r(�wrapper�s��z wrap_exceptions.<locals>.wrapper��	functools�wraps�rrr'r�r(�wrap_exceptions�srcr�)z�Workaround for https://github.com/giampaolo/psutil/issues/875.
    See: https://stackoverflow.com/questions/4457745#4457745.
    cs�d}d}t|�D]6}z�|g|�Ri|��WSty>}z|}|jtkr9t�|�t|dd�}WYd}~q�d}~ww��d|�d|��}t|j|j	|d��)N�-C��6?�!r*�{�G�z�?z	 retried z: times, converted to AccessDenied as it's still returning r�)
�ranger�r��ERROR_PARTIAL_COPYr��sleep�minrr�r�)r�r�r��delay�times�_r�r�r�r'r(r�s&

����z)retry_error_partial_copy.<locals>.wrapperrrr'r�r(�retry_error_partial_copy�src@s�eZdZdZgd�Zdd�Zdd�Zdd�Zed	d
��Z	dd�Z
eed
d���Zee
dd���Zee
dd���Zdd�Zdd�Zedd��Zedd��Zdd�Zedd��Zedd ��ZedNd"d#��Zed$d%��ZedOd'd(��Zed)d*��Zed+d,��Zed-d.��Zed/d0��Zed1d2��Zee
d3d4���Zed5d6��Z edPd8d9��Z!ed:d;��Z"ed<d=��Z#ed>d?��Z$ed@dA��Z%edBdC��Z&edDdE��Z'edFdG��Z(edHdI��Z)edJdK��Z*edLdM��Z+d!S)Q�Processz1Wrapper class around underlying C implementation.)�_cacher��_ppidr�cCs||_d|_d|_dSry)r�r�r)r�r�r'r'r(r��s
zProcess.__init__cC�|j�|�|j�|�dSry)�
_proc_infoZcache_activate�exer�r'r'r(�
oneshot_enter��zProcess.oneshot_entercCrry)rZcache_deactivaterr�r'r'r(�oneshot_exit�rzProcess.oneshot_exitcCs$t�|j�}t|�tt�ksJ�|S)zOReturn multiple information about this process as a
        raw tuple.
        )rrZ	proc_infor�rs�	pinfo_map�r�r�r'r'r(r�szProcess._proc_infocCs,|jdkrdS|jdkrdStj�|���S)zbReturn process name, which on Windows is always the final
        part of the executable.
        rzSystem Idle Processr1�System)r�rtrf�basenamerr�r'r'r(r��s


zProcess.namec
Csztr,zt�|j�}Wn'ty+}z|jdkr&t|�d��t|j|j�|��d}~wwt�|j�}|�	d�r;t
|�S|S)N�z translated into AccessDeniedrn)�PYPYrrZproc_exer�r��errnorrr�rorw)r�rr�r'r'r(rs
��
zProcess.exec
Csntjtjkr/z	tj|jdd�WSty.}zt|�r)tj|jdd�WYd}~S�d}~wwtj|jdd�S)NT)Zuse_pebF)rrZWINVERZWINDOWS_8_1Zproc_cmdliner�r�r��r�r�r'r'r(�cmdlines��zProcess.cmdlinecCst�|j�}t|�Sry)rrZproc_environr�r)r�rur'r'r(�environ$szProcess.environcCs.zt�|jWStyt|j|j�d�wry)�ppid_mapr��KeyErrorrr�r�r'r'r(�ppid*s
�zProcess.ppidcCs�zt�|j�WStyZ}zGt|�rUtd�|��}|td|td|td|td|td|td|td|td	|td
|tdf
WYd}~S�d}~ww)Nz*attempting memory_info() fallback (slower)r?rArCrErGrIrKrMrOrQ)rrZproc_memory_infor�r�r�rrr)r�r��infor'r'r(�_get_raw_meminfo0s(









���zProcess._get_raw_meminfocCs(|��}|d}|d}t||f|�S)Nr*r6)r)r_)r��tr`rar'r'r(�memory_infoGszProcess.memory_infocCs,|��}t�|j�}|t�9}t||f�Sry)r+rrZproc_memory_ussr�rzrc)r�Z	basic_memrdr'r'r(�memory_full_infoQs
zProcess.memory_full_infoc
csr�zt�|j�}Wnty}z	t||j|j�|�d}~ww|D]\}}}}t|�}t|�}||||fVq!dSry)rrZproc_memory_mapsr�r�r�r�rw�hex)r��rawr��addr�permrfr`r'r'r(�memory_mapsXs����zProcess.memory_mapscCst�|j�Sry)rr�	proc_killr�r�r'r'r(�killer�zProcess.killcCsH|tjkr
t�|j�dS|tjtjhvrt�|j|�dSd}t	|��)NzPonly SIGTERM, CTRL_C_EVENT and CTRL_BREAK_EVENT signals are supported on Windows)
�signal�SIGTERMrrr2r�ZCTRL_C_EVENTZCTRL_BREAK_EVENTrtr3�
ValueError)r��sigr�r'r'r(�send_signalis
�zProcess.send_signalNc
Cs�|durtj}nt|d�}ttdtj�}|dur|�|nd}z	t�|j|�}Wn!tjy?}z	t||j|j�|�d}~wtj	yJd}Ynwd}	t
|j�sU|S|re|�|kret||j|jd��t�|�t|dd�}qN)Ni��	monotonicrTr�r*r	)
rrZINFINITEr��getattrr�Z	proc_waitr�rr�ZTimeoutAbandoned�
pid_existsrr
)r��timeoutZcext_timeoutZtimerZstop_at�	exit_coder�rr'r'r(�waitvs,�	�

�zProcess.waitcCs,|jdvrdSt�|j�\}}|�d|��S)N�rr1zNT AUTHORITY\SYSTEMrn)r�rrZ
proc_username)r��domainrTr'r'r(r��s
zProcess.usernameFc
Csfzt�|j�\}}}|WSty2}zt|�r-|r�td�|��tdWYd}~S�d}~ww)Nz*attempting create_time() fallback (slower)r0)rr�
proc_timesr�r�r�rrr)r�Z	fast_only�_userZ_system�createdr�r'r'r(r0�s��zProcess.create_timecCs|��tdS)Nr2)rrr�r'r'r(r2�szProcess.num_threadscCs<t�|j�}g}|D]\}}}t�|||�}|�|�q
|Sry)rrZproc_threadsr�rZpthreadr�)r�r�r�Z	thread_id�utimeZstime�ntupler'r'r(�threads�szProcess.threadsc
Cs~zt�|j�\}}}Wn+ty6}zt|�s�td�|��}|td}|td}WYd}~nd}~wwt�	||dd�S)Nz(attempting cpu_times() fallback (slower)r.r/r�)
rrrAr�r�r�rrrrZ	pcputimes)r�rTrUZ_createdr�r(r'r'r(r��s��zProcess.cpu_timescC�t�|jd�dS)NT�rrZproc_suspend_or_resumer�r�r'r'r(�suspend��zProcess.suspendcCrG)NFrHr�r'r'r(�resume�rJzProcess.resumecCs0|jdvrt|j|j��t�|j�}tj�|�S)Nr?)r�rr�rrZproc_cwdrtrf�normpath)r�rfr'r'r(�cwd�s
zProcess.cwdcCsX|jdvrgSt�}t�|j�}|D]}t|�}t|�r't�|d�}|�|�qt	|�S)Nr?r")
r�r�rrZproc_open_filesrwrrZ	popenfiler�r�)r�r�Zraw_file_names�filerEr'r'r(�
open_files�s

�zProcess.open_files�inetcCst||jd�S)N)r�)r�r�)r�r�r'r'r(r��r�zProcess.net_connectionscC�t�|j�}t|�}|Sry)rrZproc_priority_getr�r#�r��valuer'r'r(�nice_get��zProcess.nice_getcCst�|j|�Sry)rrZproc_priority_setr�rRr'r'r(�nice_set�r�zProcess.nice_setcCrQry)rrZproc_io_priority_getr�r)rr'r'r(�
ionice_getrUzProcess.ionice_getcCsL|rd}t|��|tjtjtjtjhvr|�d�}t|��t�|j	|�dS)Nz&value argument not accepted on Windowsz is not a valid priority)
�	TypeErrorr)rrrrr6rrZproc_io_priority_setr�)r�ZioclassrSr�r'r'r(�
ionice_set	s�
zProcess.ionice_setcCs�zt�|j�}Wt|�StyM}z6t|�s�td�|��}|td|td|td|td|td|tdf}WYd}~t|�Sd}~ww)Nz*attempting io_counters() fallback (slower)r4r5r7r9r;r=)	rrZproc_io_countersr�r�r�rrrri)r�r�r�r(r'r'r(�io_counterss$�





���zProcess.io_counterscCst�|j�}|rtjStjSry)rrZproc_is_suspendedr�rZSTATUS_STOPPEDZSTATUS_RUNNING)r�Z	suspendedr'r'r(r�+szProcess.statuscCsdd�}t�|j�}||�S)Ncs�fdd�td�D�S)Ncsg|]
}d|>�@r|�qS)rr')r��i�r�r'r(r�6szBProcess.cpu_affinity_get.<locals>.from_bitmask.<locals>.<listcomp>�@)r
r\r'r\r(�from_bitmask5sz.Process.cpu_affinity_get.<locals>.from_bitmask)rrZproc_cpu_affinity_getr�)r�r^�bitmaskr'r'r(�cpu_affinity_get3szProcess.cpu_affinity_getcCsvdd�}tttt����}|D]}||vr-t|t�s$d|�d�}t|��d|��}t|��q||�}t�	|j
|�dS)NcSs4|sd|��}t|��d}|D]}|d|O}q|S)Nzinvalid argument rr*)r6)Zlsr��out�br'r'r(�
to_bitmask=s
z,Process.cpu_affinity_set.<locals>.to_bitmaskzinvalid CPU z; an integer is required)r�r
rsr�r�r�rXr6rrZproc_cpu_affinity_setr�)r�rSrcZallcpus�cpur�r_r'r'r(�cpu_affinity_set;s

�zProcess.cpu_affinity_setc
CsVzt�|j�WSty*}zt|�r%td�|��tdWYd}~S�d}~ww)Nz*attempting num_handles() fallback (slower)r,)rrZproc_num_handlesr�r�r�rrrr"r'r'r(r,Us��zProcess.num_handlescCs|��td}t�|d�S)Nr-r)rrrZpctxsw)r�r-r'r'r(�num_ctx_switches_szProcess.num_ctx_switchesry)F)rP),r$r%r&r��	__slots__r�rrrrr�rrrr#r$r'r)r+r,r1r3r8r>r�r0r2rFr�rIrKrMrOr�rTrVrWrYrZr�r`rer,rfr'r'r'r(r�s�

	


*















	rr')r")NN)�r�r��enumrrtr4�sys�	threadingr��collectionsrr�rrrrrr	r
rrr
rrrrrrrrrrrr�ImportErrorr��str�lowerro�getwindowsversionr��RuntimeErrorZ__extra__all__rr�builtin_module_namesr �IntEnumr!r ZMIB_TCP_STATE_ESTABZCONN_ESTABLISHEDZMIB_TCP_STATE_SYN_SENTZ
CONN_SYN_SENTZMIB_TCP_STATE_SYN_RCVDZ
CONN_SYN_RECVZMIB_TCP_STATE_FIN_WAIT1ZCONN_FIN_WAIT1ZMIB_TCP_STATE_FIN_WAIT2ZCONN_FIN_WAIT2ZMIB_TCP_STATE_TIME_WAITZCONN_TIME_WAITZMIB_TCP_STATE_CLOSEDZ
CONN_CLOSEZMIB_TCP_STATE_CLOSE_WAITZCONN_CLOSE_WAITZMIB_TCP_STATE_LAST_ACKZ
CONN_LAST_ACKZMIB_TCP_STATE_LISTENZCONN_LISTENZMIB_TCP_STATE_CLOSINGZCONN_CLOSINGZMIB_TCP_STATE_DELETE_TCBZPSUTIL_CONN_NONEZ	CONN_NONEr�r#�globalsr��__members__r)r�rrSrYr_�_fieldsrcrerprgri�	lru_cacherwrzrr�Zdisk_io_countersr�r�r�r�r�r�r�r�r��Lockr�r�r�r�r�r�r�r�r�r�r�rrr�Zpidsr;r%r�r�rrrr'r'r'r(�<module>sF�
��
�	��������	�
���
����������!���


				

-