HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //usr/local/lib/python3.9/site-packages/billiard/__pycache__/context.cpython-39.pyc
a

X>hb3�@s�ddlZddlZddlZddlZddlmZgZdZddlm	Z	m
Z
mZmZm
Z
mZmZGdd�d�ZGdd	�d	ej�ZGd
d�de�Zedd
�ee�D��e_ejdk�r2Gdd�dej�ZGdd�dej�ZGdd�dej�ZGdd�de�ZGdd�de�ZGdd�de�Ze�e�e�d�Zeed�Zn8Gdd�dej�ZGdd�de�Zde�iZeed�Zd d!�Ze� �Z!d"d#�Z"d$d%�Z#d&d'�Z$dS)(�N�)�processzIforce_execv is not supported as the billiard C extension is not installed)�ProcessError�BufferTooShort�TimeoutError�AuthenticationError�TimeLimitExceeded�SoftTimeLimitExceeded�WorkerLostErrorc@sXeZdZeZeZeZeZeZeZe	Z	e
ej�Ze
ej
�Z
eed�rLdd�Zndd�Zdd�ZdEd	d
�Zdd�Zd
d�ZdFdd�ZdGdd�ZdHdd�Zdd�ZdIdd�ZdJdd�ZdKdd�Zd d!�ZdLd#d$�Zd%d&�Zd'd(�Zd)d*�Z d+d,�Z!d-d.�Z"d/d0�Z#dMd1d2�Z$d3d4�Z%d5d6�Z&d7d8�Z'dNd9d:�Z(dOd;d<�Z)dPd=d>�Z*d?d@�Z+dAdB�Z,dCdD�Z-dS)Q�BaseContext�	cpu_countcCs"t��}|durtd��n|SdS)z(Returns the number of CPUs in the systemN�cannot determine number of cpus)�osr�NotImplementedError)�self�num�r�:/usr/local/lib/python3.9/site-packages/billiard/context.pyr2s
zBaseContext.cpu_countc
Cs�tjdkr:zttjd�}Wq�ttfy6d}Yq�0n�dtjvsNtjdkr�d}tjdkrdd|}z:t�|��}t|���}Wd�n1s�0YWq�ty�d}Yq�0n,zt�	d�}Wntt
tfy�d}Yn0|d	kr�|Std
��dS)N�win32ZNUMBER_OF_PROCESSORSrZbsd�darwinz/sbin/sysctl -n hw.ncpuz/usr�SC_NPROCESSORS_ONLNrr
)
�sys�platform�intr�environ�
ValueError�KeyError�popen�read�sysconf�OSError�AttributeErrorr)rrZcomm�prrrr:s*

.
cCs&ddlm}||��d�}|��|S)z�Returns a manager associated with a running server process

        The managers methods such as `Lock()`, `Condition()` and `Queue()`
        can be used to create shared objects.
        r)�SyncManager��ctx)Zmanagersr#�get_context�start)rr#�mrrr�ManagerTszBaseContext.ManagerTFcCsddlm}||||�S)z1Returns two connection object connected by a piper)�Pipe)�
connectionr*)rZduplexZ	rnonblockZ	wnonblockr*rrrr*_szBaseContext.PipecCsddlm}||��d�S)z#Returns a non-recursive lock objectr)�Lockr$)�synchronizer,r&)rr,rrrr,dszBaseContext.LockcCsddlm}||��d�S)zReturns a recursive lock objectr)�RLockr$)r-r.r&)rr.rrrr.iszBaseContext.RLockNcCsddlm}|||��d�S)zReturns a condition objectr)�	Conditionr$)r-r/r&)r�lockr/rrrr/nszBaseContext.ConditionrcCsddlm}|||��d�S)zReturns a semaphore objectr)�	Semaphorer$)r-r1r&)r�valuer1rrrr1sszBaseContext.SemaphorecCsddlm}|||��d�S)z"Returns a bounded semaphore objectr)�BoundedSemaphorer$)r-r3r&)rr2r3rrrr3xszBaseContext.BoundedSemaphorecCsddlm}||��d�S)zReturns an event objectr)�Eventr$)r-r4r&)rr4rrrr4}szBaseContext.EventcCs ddlm}|||||��d�S)zReturns a barrier objectr)�Barrierr$)r-r5r&)r�parties�action�timeoutr5rrrr5�szBaseContext.BarrierrcCsddlm}|||��d�S)�Returns a queue objectr)�Queuer$)�queuesr:r&)r�maxsizer:rrrr:�szBaseContext.QueuecCsddlm}|||��d�S)r9r)�
JoinableQueuer$)r;r=r&)rr<r=rrrr=�szBaseContext.JoinableQueuecCsddlm}||��d�S)r9r)�SimpleQueuer$)r;r>r&)rr>rrrr>�szBaseContext.SimpleQueuercCs<ddlm}||||||||||	|
|||
|||||��d�S)zReturns a process pool objectr)�Pool)�context)�poolr?r&)rZ	processesZinitializerZinitargsZmaxtasksperchildr8Zsoft_timeoutZlost_worker_timeoutZmax_restartsZmax_restart_freqZ
on_process_upZon_process_downZon_timeout_setZon_timeout_cancel�threadsZ	semaphoreZputlocksZ
allow_restartr?rrrr?�s
�zBaseContext.PoolcGsddlm}||g|�R�S)zReturns a shared objectr)�RawValue)�sharedctypesrC)r�typecode_or_type�argsrCrrrrC�szBaseContext.RawValuecCsddlm}|||�S)zReturns a shared arrayr)�RawArray)rDrG)rrE�size_or_initializerrGrrrrG�szBaseContext.RawArraycOs4ddlm}|�dd�}||g|�R||��d��S)z$Returns a synchronized shared objectr)�Valuer0T�r0r%)rDrI�getr&)rrErF�kwargsrIr0rrrrI�s
�zBaseContext.ValuecOs,ddlm}|�dd�}|||||��d�S)z#Returns a synchronized shared arrayr)�Arrayr0TrJ)rDrMrKr&)rrErHrFrLrMr0rrrrM�s
�zBaseContext.ArraycCs,tjdkr(ttdd�r(ddlm}|�dS)z�Check whether this is a fake forked process in a frozen executable.
        If so then run code specified by commandline and exit.
        r�frozenFr)�freeze_supportN)rr�getattr�spawnrO)rrOrrrrO�szBaseContext.freeze_supportcCsddlm}|�S)zZReturn package logger -- if it does not already exist then
        it is created.
        r)�
get_logger)�utilrR)rrRrrrrR�szBaseContext.get_loggercCsddlm}||�S)z8Turn on logging and add a handler which prints to stderrr)�
log_to_stderr)rSrT)r�levelrTrrrrT�szBaseContext.log_to_stderrcCsddlm}dS)zVInstall support for sending connections and sockets
        between processes
        r)r+N)�r+)rr+rrr�allow_connection_pickling�sz%BaseContext.allow_connection_picklingcCsddlm}||�dS)z�Sets the path to a python.exe or pythonw.exe binary used to run
        child processes instead of sys.executable when using the 'spawn'
        start method.  Useful for people embedding Python.
        r)�set_executableN)rQrX)r�
executablerXrrrrX�szBaseContext.set_executablecCsddlm}||�dS)zkSet list of module names to try to load in forkserver process.
        This is really just a hint.
        r)�set_forkserver_preloadN)�
forkserverrZ)rZmodule_namesrZrrrrZ�sz"BaseContext.set_forkserver_preloadcCsD|dur|Szt|}Wnty6td|��Yn0|��|S)Nzcannot find context for %r)�_concrete_contextsrr�_check_available)r�methodr%rrrr&�szBaseContext.get_contextcCs|jS�N)�_name�r�
allow_nonerrr�get_start_method�szBaseContext.get_start_methodcCstd��dS)Nz+cannot set start method of concrete context)r�rr^rrr�set_start_method�szBaseContext.set_start_methodcCs|��p
ddkS)N�fork)rc�rrrr�forking_is_enabled�szBaseContext.forking_is_enabledcCs6|s2ddlm}|r$|jddd�nt�tt��dS)Nr)�
supports_execrQT)�force)Z_extrire�warnings�warn�RuntimeWarning�
W_NO_EXECV)rr2rirrr�forking_enable�s
zBaseContext.forking_enablecCsdSr_rrgrrrr]szBaseContext._check_available)TFF)N)r)r)NN)r)r)NNrNNNNNrNNNNTNFF)N)N)F)N).�__name__�
__module__�__qualname__rrrrrr	r
�staticmethodr�current_process�active_children�hasattrrrr)r*r,r.r/r1r3r4r5r:r=r>r?rCrGrIrMrOrRrTrWrXrZr&rcrerhror]rrrrr$s^










�





	rc@seZdZdZedd��ZdS)�ProcessNcCst��j�|�Sr_)�_default_contextr&rw�_Popen)�process_objrrrryszProcess._Popen�rprqrrZ
_start_methodrsryrrrrrw
srwcsFeZdZeZdd�Zd
�fdd�	Zddd�Zdd	d
�Zdd�Z�Z	S)�DefaultContextcCs||_d|_dSr_)rx�_actual_context)rr@rrr�__init__szDefaultContext.__init__Ncs4|dur |jdur|j|_|jStt|��|�SdSr_)r}rx�superr|r&rd��	__class__rrr&s

zDefaultContext.get_contextFcCs<|jdur|std��|dur,|r,d|_dS|�|�|_dS)Nzcontext has already been set)r}�RuntimeErrorr&)rr^rjrrrre$szDefaultContext.set_start_methodcCs"|jdur|rdS|j|_|jjSr_)r}rxr`rarrrrc,s

zDefaultContext.get_start_methodcCs6tjdkrdgSddlm}|jr*gd�SddgSdS)NrrQr��	reduction�rfrQr[rf)rrrVr��HAVE_SEND_HANDLE�rr�rrr�get_all_start_methods3s
z$DefaultContext.get_all_start_methods)N)F)F)
rprqrrrwr~r&rercr��
__classcell__rrr�rr|s

r|ccs|]}|ddkr|VqdS)r�_Nr)�.0�xrrr�	<genexpr>=�r�rc@seZdZdZedd��ZdS)�ForkProcessrfcCsddlm}||�S�Nr)�Popen)Z
popen_forkr��rzr�rrrryHszForkProcess._PopenNr{rrrrr�Esr�c@seZdZdZedd��ZdS)�SpawnProcessrQcCsddlm}||�Sr�)Zpopen_spawn_posixr�r�rrrryPs�SpawnProcess._PopenNr{rrrrr�Msr�c@seZdZdZedd��ZdS)�ForkServerProcessr[cCsddlm}||�Sr�)Zpopen_forkserverr�r�rrrryXszForkServerProcess._PopenNr{rrrrr�Usr�c@seZdZdZeZdS)�ForkContextrfN)rprqrrr`r�rwrrrrr�]sr�c@seZdZdZeZdS��SpawnContextrQN�rprqrrr`r�rwrrrrr�asr�c@seZdZdZeZdd�ZdS)�ForkServerContextr[cCsddlm}|jstd��dS)Nrr�z%forkserver start method not available)rVr�r�rr�rrrr]isz"ForkServerContext._check_availableN)rprqrrr`r�rwr]rrrrr�esr�r�rfc@seZdZdZedd��ZdS)r�rQcCsddlm}||�Sr�)Zpopen_spawn_win32r�r�rrrryzsr�Nr{rrrrr�wsc@seZdZdZeZdSr�r�rrrrr�srQcCst|t_dSr_)r\rxr})r^rrr�_force_start_method�sr�cCsttdd�S)N�spawning_popen)rP�_tlsrrrr�get_spawning_popen�sr�cCs
|t_dSr_)r�r�)rrrr�set_spawning_popen�sr�cCs t�durtdt|�j��dS)NzF%s objects should only be shared between processes through inheritance)r�r��typerp)�objrrr�assert_spawning�s
��r�)%rr�	threadingrkrVr�__all__rn�
exceptionsrrrrrr	r
rZBaseProcessrwr|�list�dirrr�r�r�r�r�r�r\rxr��localr�r�r�r�rrrr�<module>sD
$j(
��