HEX
Server: LiteSpeed
System: Linux atali.colombiahosting.com.co 5.14.0-570.12.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 13 06:11:55 EDT 2025 x86_64
User: coopserp (1713)
PHP: 8.2.29
Disabled: dl,exec,passthru,proc_open,proc_close,shell_exec,memory_limit,system,popen,curl_multi_exec,show_source,symlink,link,leak,listen,diskfreespace,tmpfile,ignore_user_abord,highlight_file,source,show_source,fpaththru,virtual,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,posix_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setid,posix_times,posix_ttyname,posix_uname,proc_get_status,proc_nice,proc_terminate
Upload Files
File: //usr/local/lib64/python3.9/site-packages/psutil/__pycache__/_pswindows.cpython-39.pyc
a

��?h��@s�dZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddlmZddlm
Z
ddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlm Z ddlm!Z!ddlm"Z"ddlm#Z#ddlm$Z$ddlm%Z%zddl
mZ&Wnle'�y�Z(zRe)e(��*��+d��r�e�,�dd k�r�d!Z-e-d"7Z-e-d#7Z-e.e-��n�WYdZ([(n
dZ([(00e�rddl/Z/ndZ/gd$�Z0d%Z1d&Z2d'ej3vZ4e/du�r0d(Z5ne/�6d)d*d(i�Z7e7j5Z5e&j8ej9e&j:ej;e&j<ej=e&j>ej?e&j@ejAe&jBejCe&jDejEe&jFejGe&jHejIe&jJejKe&jLejMe&jNe1e&jOejPi
ZQe/du�r�Gd+d,�d,e/j6�ZReS��TeRjU�e/du�r�dZVdZWd-ZXd.ZYn Gd/d0�d0e/j6�ZZeS��TeZjU�e[ddd-d.d1d2d d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdB�Z\e	dCgdD��Z]e	dEgdF��Z^e	dGgdH��Z_e	dIe_j`dJ�Zae	dKdLdMg�Zbe	dNdOdP�cebj`��Zde	dQgdR��ZeedSdT�dUdV��ZfdWdX�ZgedYdZ��Zhd[d\�Zid]d^�Zje&jkZkd_d`�Zldadb�Zmdcdd�Zndedf�Zodgdh�Zpdidj�Zqdkdl�Zrdmdn�Zsdoatdpdq�Zud�drds�Zvdtdu�Zwdvdw�Zxdxdy�Zydzd{�Zzda{d|d}�Z|d~d�Z}d�d��Z~d�d��ZGd�d��d��Z�e&j�Z�e&j�Z�e&j�Z�d�d��Z�d�d�d��Z�d�d��Z�d�d��Z�Gd�d��d��Z�dS)�z Windows platform implementation.�N)�
namedtuple�)�_common)�ENCODING)�
ENCODING_ERRS)�AccessDenied)�
NoSuchProcess)�TimeoutExpired)�	conn_tmap)�conn_to_ntuple)�debug)�
isfile_strict)�memoize)�memoize_when_activated)�parse_environ_block)�
usage_percent)�PY3)�long)�	lru_cache��range)�unicode)�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.�=/usr/local/lib64/python3.9/site-packages/psutil/_pswindows.pyr*ssr*��c@seZdZdZdZdZdZdS)�
IOPriorityrrr0r1N)r+r,r-r"r#r$r%r.r.r.r/r2�sr2�����	�
���
��������)�num_handles�ctx_switches�	user_time�kernel_time�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�vmsrPrQrRrSrTZpeak_nonpaged_poolZ
nonpaged_poolrWrX�private�pfullmem)�uss�
pmmap_grouped�pathrg�	pmmap_extzaddr perms � �pio)Z
read_countZwrite_count�
read_bytes�write_bytes�other_countZother_bytesi)�maxsizecCs@d�|�d�dd��}t�|�}|t|�d�}tj�||�S)z�Convert paths using native DOS format like:
        "\Device\HarddiskVolume1\Windows\systemew\file.txt"
    into:
        "C:\Windows\systemew\file.txt".
    �\Nr1)�join�split�cextZQueryDosDevice�len�osrm)�sZrawdriveZdriveletter�	remainderr.r.r/�convert_dos_path�s
r}cCs&tr|St|t�r|S|�tt�SdS)zmEncode a unicode string to a byte string by using the default fs
    encoding + "replace" error handler.
    N)r�
isinstance�str�encoderr)r{r.r.r/�
py2_strencode�s

r�cCst��S�N)rx�getpagesizer.r.r.r/r��sr�c
CsJt��}|\}}}}|}|}|}||}t|||dd�}	t|||	||�S)z&System virtual memory as a namedtuple.r�Zround_)rx�virtual_memrr`)
�memZtotphysZ	availphysZ_totsysZ	_availsysraZavailrerdrcr.r.r/�virtual_memory�sr�cCspt��}|d}|d}||}|dkrBt��}td||�}nd}d}||}t|d�}t�||||dd�S)z=Swap system memory as a (total, used, free, sin, sout) tuple.rr0g{�G�z�?�r)rxr�Zswap_percent�int�roundrZsswap)r�Z
total_physZtotal_systemraZpercentswaprdrercr.r.r/�swap_memory�s
r�cCsPtrt|t�r|jtdd�}t�|�\}}||}t||dd�}t�	||||�S)z'Return disk usage associated with path.�strict)�errorsrr�)
rr~�bytes�decoderrx�
disk_usagerrZ
sdiskusage)rmrarerdrcr.r.r/r�sr�cCst�|�}dd�|D�S)zReturn disk partitions.cSsg|]}tj|��qSr.)rZ	sdiskpart��.0�xr.r.r/�
<listcomp>+�z#disk_partitions.<locals>.<listcomp>)rx�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�9r�zcpu_times.<locals>.<listcomp>)rx�	cpu_timesrZ�zip�
per_cpu_timesr^r_)r[r\r]Z
percpu_summedr.r.r/r�3s
�r�cCs:g}t��D](\}}}}}t|||||�}|�|�q|S)z6Return system per-CPU times as a list of named tuples.)rxr�rZ�append)�retr[r\r]r^r_�itemr.r.r/r�?s
r�cCst��S)z0Return the number of logical CPUs in the system.)rx�cpu_count_logicalr.r.r.r/r�Hsr�cCst��S)z-Return the number of CPU cores in the system.)rx�cpu_count_coresr.r.r.r/r�Msr�cCs$t��\}}}}d}t�||||�S)zReturn CPU statistics.r)rx�	cpu_statsrZ	scpustats)rEZ
interruptsZ_dpcsZsyscallsZsoft_interruptsr.r.r/r�Rs
�r�cCs(t��\}}d}t�t|�|t|��gS)zMReturn CPU frequency.
    On Windows per-cpu frequency is not supported.
    r�)rx�cpu_freqrZscpufreq�float)�currZmax_Zmin_r.r.r/r�[sr�FcCs*tst��dat��}tdd�|D��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.
    TcSsg|]}t|d��qS)r0)r�)r��loadr.r.r/r�sr�zgetloadavg.<locals>.<listcomp>)�_loadavg_inititializedrxZinit_loadavg_counter�
getloadavg�tuple)Z	raw_loadsr.r.r/r�gs
r�cCs�|tvr(td|d�dd�tD��f��t|\}}t�|||�}t�}|D]D}|\}}}	}
}}}
t|||	|
||t|dkr~|
ndd�}|�|�qLt	|�S)z�Return socket connections.  If pid == -1 return system-wide
    connections (as opposed to connections opened by one process only).
    z+invalid %r kind argument; choose between %sz, cSsg|]}t|��qSr.)�reprr�r.r.r/r��r�z#net_connections.<locals>.<listcomp>r(N)�pid)
r
�
ValueErrorrvrx�net_connections�setr�TCP_STATUSES�add�list)�kind�_pidZfamilies�typesr�r�r��fd�fam�type�laddr�raddr�statusr��ntr.r.r/r�{s.���
r�cCszi}t��}|��D]`\}}ts>t|t�s6Jt|���t|�}|\}}}}tt	d�r^t	�
|�}t	�||||d�||<q|S)z)Get NIC stats (isup, duplex, speed, mtu).�	NicDuplex�)rx�net_if_stats�itemsrr~rr�r��hasattrrr�Z	snicstats)r�Zrawdict�namer�ZisupZduplex�speedZmtur.r.r/r��s

r�cCst��}tdd�|��D��S)zsReturn network I/O statistics for every network interface
    installed on the system as a dict of raw tuples.
    cSsg|]\}}t|�|f�qSr.�r�)r��k�vr.r.r/r��r�z#net_io_counters.<locals>.<listcomp>)rx�net_io_counters�dictr��r�r.r.r/r��sr�cCs8g}t��D]&}t|�}t|d�|d<|�|�q|S)z,Return the addresses associated to each NIC.r)rx�net_if_addrsr�r�r�)r�r�r.r.r/r��sr�cCsdt��\}}}}|dk}t|d@�}t|d@�}|r8dS|s@|rHtj}n|dkrVtj}t�|||�S)zReturn battery information.r�r6Nr()rx�sensors_battery�boolrZPOWER_TIME_UNLIMITEDZPOWER_TIME_UNKNOWNZsbattery)Z
acline_status�flagsrcZsecsleftZ
power_pluggedZ
no_batteryZchargingr.r.r/r��sr�cCs,tt���}t|t�dkr tS|a|SdS)z:The system boot time expressed in seconds since the epoch.rN)r�rx�	boot_time�abs�_last_btimer�r.r.r/r��s
r�cCsHg}t��}|D]2}|\}}}t|�}t�|d||d�}|�|�q|S)z:Return currently connected users as a list of namedtuples.N)rx�usersr�rZsuserr�)�retlistr�r�r[�hostnameZtstampr�r.r.r/r��s
r�ccs*t��D]\}}tt|�t|��VqdS)z*Yields a list of WindowsService instances.N)rxZwinservice_enumerate�WindowsServicer�)r��display_namer.r.r/r �sr cCst|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
r!c@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||_||_dSr�)�_namer�)�selfr�r�r.r.r/�__init__szWindowsService.__init__cCs d|j|jf}d|jj|fS)Nz(name=%r, display_name=%r)z%s%s)r�r��	__class__r+)r��detailsr.r.r/�__str__s
�zWindowsService.__str__cCsd|��t|�fS)Nz
<%s at %s>)r��id�r�r.r.r/�__repr__szWindowsService.__repr__cCst|t�stS|j|jkSr�)r~r��NotImplementedr��r��otherr.r.r/�__eq__s
zWindowsService.__eq__cCs
||kSr�r.r�r.r.r/�__ne__szWindowsService.__ne__cCs\|���$t�|j�\}}}}Wd�n1s20Ytt|�t|�t|�t|�d�S)N)r��binpath�username�
start_type)�_wrap_exceptionsrxZwinservice_query_configr�r�r�)r�r�r�r�r�r.r.r/r� s

�(�zWindowsService._query_configcCsP|��� t�|j�\}}Wd�n1s.0Y|dkrDd}t||d�S)Nr)r�r�)r�rxZwinservice_query_statusr�r�)r�r�r�r.r.r/�
_query_status-s

.zWindowsService._query_statusc
cs�z
dVWnxty�}z`t|�r>d|j}td|j|d��n0|jtjtjfvrld|j}td|j|d��n�WYd}~n
d}~00dS)z{Ctx manager which translates bare OSError and WindowsError
        exceptions into NoSuchProcess and AccessDenied.
        Nz2service %r is not querable (not enough privileges)�r�r��msgzservice %r does not exist)	�OSError�is_permission_errr�r�winerrorrxZERROR_INVALID_NAMEZERROR_SERVICE_DOES_NOT_EXISTr)r��errr�r.r.r/r�4s 
���
zWindowsService._wrap_exceptionscCs|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�MszWindowsService.namecCs|jS)z_The service display name. The value is cached when this class
        is instantiated.
        )r�r�r.r.r/r�TszWindowsService.display_namecCs|��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�ZszWindowsService.binpathcCs|��dS)z,The name of the user that owns this service.r�r�r�r.r.r/r�`szWindowsService.usernamecCs|��dS)zRA string which can either be "automatic", "manual" or
        "disabled".
        r�r�r�r.r.r/r�dszWindowsService.start_typecCs|��dS)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�lszWindowsService.pidcCs|��dS)zService status as a string.r�r�r�r.r.r/r�rszWindowsService.statuscCstt�|����S)zService long description.)r�rxZwinservice_query_descrr�r�r.r.r/�descriptionvszWindowsService.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�sJ|��|jtjtjfvr(dSt|dd�tjtjfvS)z*Return True if this is a permission error.Tr�r()	r~r��errno�EPERM�EACCES�getattrrxZERROR_ACCESS_DENIEDZERROR_PRIVILEGE_NOT_HELD)�excr.r.r/r��s
�r�cCsFt|t�sJ|��t|�r&t||d�S|jtjkr>t||d�S|�dS)z3Convert OSError into NoSuchProcess or AccessDenied.�r�r�N)r~r�r�rr�ZESRCHr)r�r�r�r.r.r/�convert_oserror�srcst����fdd��}|S)zDDecorator which converts OSError into NoSuchProcess or AccessDenied.c
sTz�|g|�Ri|��WStyN}zt||j|jd��WYd}~n
d}~00dS)Nr)r�rr�r�)r��args�kwargsr���funr.r/�wrapper�sz wrap_exceptions.<locals>.wrapper��	functools�wraps�rrr.rr/�wrap_exceptions�srcst����fdd��}|S)z�Workaround for https://github.com/giampaolo/psutil/issues/875.
    See: https://stackoverflow.com/questions/4457745#4457745.
    cs�d}d}t|�D]z}z�|g|�Ri|��WSty�}z@|}|jtkrrt�|�t|dd�}WYd}~q�WYd}~qd}~00qd��||�}t|j	|j
|d��dS)N�-C��6?�!r0�{�G�z�?zH{} retried {} times, converted to AccessDenied as it's stillreturning {}r�)r�WindowsErrorr��ERROR_PARTIAL_COPY�time�sleep�min�formatrr�r�)r�rr�delay�times�_r�r�rr.r/r�s"

��z)retry_error_partial_copy.<locals>.wrapperrr
r.rr/�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|_dSr�)r�r�r)r�r�r.r.r/r��szProcess.__init__cCs|j�|�|j�|�dSr�)�
_proc_infoZcache_activate�exer�r.r.r/�
oneshot_enterszProcess.oneshot_entercCs|j�|�|j�|�dSr�)rZcache_deactivaterr�r.r.r/�oneshot_exit
szProcess.oneshot_exitcCs$t�|j�}t|�tt�ks J�|S)zOReturn multiple information about this process as a
        raw tuple.
        )rxZ	proc_infor�ry�	pinfo_map�r�r�r.r.r/rszProcess._proc_infocCs,|jdkrdS|jdkrdStj�|���S)zbReturn process name, which on Windows is always the final
        part of the executable.
        rzSystem Idle Processr3�System)r�rzrm�basenamerr�r.r.r/r�s


zProcess.namec
Cs�trbzt�|j�}Wqnty^}z2|jdkrHtd|�t|j|j���WYd}~qnd}~00nt�|j�}t	szt
|�}|�d�r�t|�S|S)N�z%r translated into AccessDeniedru)
�PYPYrxZproc_exer�rr�rrr�rr��
startswithr})r�rr�r.r.r/r#s

zProcess.exec
Cs�tjtjkrdztj|jdd�}Wqtty`}z(t|�rJtj|jdd�}n�WYd}~qtd}~00ntj|jdd�}tr||Sdd�|D�SdS)NT)Zuse_pebFcSsg|]}t|��qSr.r�)r�r{r.r.r/r�Jr�z#Process.cmdline.<locals>.<listcomp>)rxZWINVERZWINDOWS_8_1Zproc_cmdliner�r�r�r)r�r�r�r.r.r/�cmdline8szProcess.cmdlinecCs6t�|j�}|r*ts*t|t�s*Jt|���tt|��Sr�)	rxZproc_environr�rr~rr�rr�)r�Zustrr.r.r/�environLszProcess.environcCs4zt�|jWSty.t|j|j��Yn0dSr�)�ppid_mapr��KeyErrorrr�r�r.r.r/�ppidTszProcess.ppidcCs�zt�|j�WSty�}z�t|�r�td�|��}|td|td|td|td|td|td|td|td	|td
|tdf
WYd}~S�WYd}~n
d}~00dS)Nz*attempting memory_info() fallback (slower)rPrQrRrSrTrUrVrWrXrY)rxZproc_memory_infor�r�r�rrr )r�r��infor.r.r/�_get_raw_meminfoZs$









�zProcess._get_raw_meminfocCs(|��}|d}|d}t||f|�S)Nr0r5)r-rf)r��trgrhr.r.r/�memory_infoqszProcess.memory_infocCs,|��}t�|j�}|t�9}t||f�Sr�)r/rxZproc_memory_ussr�r�rj)r�Z	basic_memrkr.r.r/�memory_full_info{s
zProcess.memory_full_infoc
cs�zt�|j�}Wn4tyD}zt||j|j��WYd}~nFd}~00|D]6\}}}}t|�}tsjt|�}t	|�}||||fVqJdSr�)
rxZproc_memory_mapsr�r�rr�r}rr��hex)r��rawr��addr�permrmrgr.r.r/�memory_maps�s&zProcess.memory_mapscCst�|j�Sr�)rx�	proc_killr�r�r.r.r/�kill�szProcess.killcCsX|tjkrt�|j�n<|ttdt��ttdt��fvrHt�|j|�nd}t	|��dS)NZCTRL_C_EVENTZCTRL_BREAK_EVENTzPonly SIGTERM, CTRL_C_EVENT and CTRL_BREAK_EVENT signals are supported on Windows)
�signal�SIGTERMrxr6r�r��objectrzr7r�)r��sigr�r.r.r/�send_signal�s
��zProcess.send_signalNcCs�|durtj}nt|d�}ttdtj�}|dur<|�|nd}zt�|j|�}Wn:tjyvt||j|j��Yntj	y�d}Yn0d}t
|j�s�|S|r�|�|kr�t||j|jd��t�|�t|dd�}q�dS)Ni��	monotonicrrr0r)
rxZINFINITEr�r�rZ	proc_waitr�r	r�ZTimeoutAbandoned�
pid_existsrr)r��timeoutZcext_timeout�timerZstop_atZ	exit_coderr.r.r/�wait�s$	


zProcess.waitcCs2|jdvrdSt�|j�\}}t|�dt|�S)N�rr3zNT AUTHORITY\SYSTEMru)r�rxZ
proc_usernamer�)r��domainr[r.r.r/r��s
zProcess.usernameFc
Csvzt�|j�\}}}|WStyp}z@t|�rZ|r6�td�|��tdWYd}~S�WYd}~n
d}~00dS)Nz*attempting create_time() fallback (slower)rH)rx�
proc_timesr�r�r�rrr )r�Z	fast_only�_userZ_system�createdr�r.r.r/rH�szProcess.create_timecCs|��tdS)NrI)rr r�r.r.r/rI�szProcess.num_threadscCs<t�|j�}g}|D]"\}}}t�|||�}|�|�q|Sr�)rxZproc_threadsr�rZpthreadr�)r�r�r��	thread_id�utimeZstime�ntupler.r.r/�threads�szProcess.threadsc
Cs~zt�|j�\}}}WnVtyl}z>t|�s0�td�|��}|td}|td}WYd}~n
d}~00t�	||dd�S)Nz(attempting cpu_times() fallback (slower)rFrGr�)
rxrDr�r�r�rrr rZ	pcputimes)r�r[r\Z_createdr�r,r.r.r/r��s"zProcess.cpu_timescCst�|jd�dS)NT�rxZproc_suspend_or_resumer�r�r.r.r/�suspendszProcess.suspendcCst�|jd�dS)NFrKr�r.r.r/�resumeszProcess.resumecCs4|jdvrt|j|j��t�|j�}ttj�|��S)NrB)	r�rr�rxZproc_cwdr�rzrm�normpath)r�rmr.r.r/�cwd
s
zProcess.cwdcCsd|jdvrgSt�}t�|j�}|D]6}t|�}t|�r$tsDt|�}t�	|d�}|�
|�q$t|�S)NrBr()r�r�rxZproc_open_filesr}r
rr�rZ	popenfiler�r�)r�r�Zraw_file_names�_filerIr.r.r/�
open_filess
zProcess.open_files�inetcCst||jd�S)N)r�)r�r�)r�r�r.r.r/r�'szProcess.net_connectionscCs t�|j�}tdurt|�}|Sr�)rxZproc_priority_getr��enumr*�r��valuer.r.r/�nice_get+szProcess.nice_getcCst�|j|�Sr�)rxZproc_priority_setr�rTr.r.r/�nice_set2szProcess.nice_setcCs t�|j�}tdurt|�}|Sr�)rxZproc_io_priority_getr�rSr2r!r.r.r/�
ionice_get6szProcess.ionice_getcCs>|rd}t|��|ttttfvr,td|��t�|j|�dS)Nz&value argument not accepted on Windowsz%s is not a valid priority)	�	TypeErrorr"r#r$r%r�rxZproc_io_priority_setr�)r�ZioclassrUr�r.r.r/�
ionice_set=s�zProcess.ionice_setcCs�zt�|j�}Wn~ty�}zft|�s*�td�|��}|td|td|td|td|td|tdf}WYd}~n
d}~00t|�S)Nz*attempting io_counters() fallback (slower)rJrKrLrMrNrO)	rxZproc_io_countersr�r�r�rrr rp)r�r�r�r,r.r.r/�io_countersKs





�zProcess.io_counterscCs t�|j�}|rtjStjSdSr�)rxZproc_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�ir�zBProcess.cpu_affinity_get.<locals>.from_bitmask.<locals>.<listcomp>�@rr]r.r]r/�from_bitmaskhsz.Process.cpu_affinity_get.<locals>.from_bitmask)rxZproc_cpu_affinity_getr�)r�r_�bitmaskr.r.r/�cpu_affinity_getfszProcess.cpu_affinity_getcCsndd�}tttt����}|D]4}||vrt|ttf�sFtd|��qtd|��q||�}t	�
|j|�dS)NcSs.|std|��d}|D]}|d|O}q|S)Nzinvalid argument %rrr0)r�)Zls�out�br.r.r/�
to_bitmaskpsz,Process.cpu_affinity_set.<locals>.to_bitmaskz&invalid CPU %r; an integer is requiredzinvalid CPU %r)r�rryr�r~r�rrYr�rxZproc_cpu_affinity_setr�)r�rUrdZallcpus�cpur`r.r.r/�cpu_affinity_setns�zProcess.cpu_affinity_setc
Csfzt�|j�WSty`}z:t|�rJtd�|��tdWYd}~S�WYd}~n
d}~00dS)Nz*attempting num_handles() fallback (slower)rD)rxZproc_num_handlesr�r�r�rrr )r�r�r.r.r/rD�szProcess.num_handlescCs|��td}t�|d�S)NrEr)rr rZpctxsw)r�rEr.r.r/�num_ctx_switches�szProcess.num_ctx_switches)N)F)rR),r+r,r-r��	__slots__r�rrrrr�rrrr'r(r+r-r/r0r5r7r<rAr�rHrIrJr�rLrMrOrQr�rVrWrXrZr[r�rarfrDrgr.r.r.r/r�s�

	


*

















	r)r()NN)�r�r�r�rrzr8�sysr�collectionsrr�rrrrrr	r
rrr
rrrrZ_compatrrrrrrrrrrrrrx�ImportErrorr�r�lowerr&�getwindowsversionr��RuntimeErrorrSZ__extra__all__r&r�builtin_module_namesr%r'�IntEnumr)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#r$r%r2r�r rZr`rf�_fieldsrjrlrvrnrpr}r�r�r�r�Zdisk_io_countersr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r r!r�Zpidsr>r)r�rrrrr.r.r.r/�<module>s6��



�

�!���


				
0