python (3.11.7)

(root)/
lib/
python3.11/
concurrent/
futures/
__pycache__/
process.cpython-311.opt-2.pyc

e8	dZddlZddlmZddlZddlZddlZddlm	Z	ddl
Z
ddlZddlm
Z
ddlZddlZddlmZejZdaGdd	Zd
Ze
jedZdZGd
deZGddZdZGddeZGddeZ GddeZ!Gdde	Z"dZ#dZ$		d&dZ%d'dZ&Gdde
j'Z(da)da*d Z+d!Z,Gd"d#ej-Z.Gd$d%ej/Z0dS)(z"Brian Quinlan (brian@sweetapp.com)N)_base)Queue)partial)format_exceptionFc&eZdZdZdZdZdZdS)
_ThreadWakeupcXd|_tjd\|_|_dS)NF)duplex)_closedmpPipe_reader_writerselfs N/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/concurrent/futures/process.py__init__z_ThreadWakeup.__init__Cs(%'WE%:%:%:"dlllc|js;d|_|j|jdSdSNT)rrcloserrs rrz_ThreadWakeup.closeGsM|	!DLL   L     	!	!rcL|js|jddSdS)Nr)rr
send_bytesrs rwakeupz_ThreadWakeup.wakeupRs2|	)L##C(((((	)	)rc|jsM|jr6|j|j2dSdSdSN)rrpoll
recv_bytesrs rclearz_ThreadWakeup.clearVsl|	*,##%%
*''))),##%%
*
*
*	*	*
*
*rN)__name__
__module____qualname__rrrrrrrrBsP;;;	!	!	!)))*****rrcdatt}|D]\}}||D]\}}|dSr)_global_shutdownlist_threads_wakeupsitemsrjoin)r(_
thread_wakeupts    r_python_exitr-\sw!''))**E!=1	r=ceZdZdZdZdS)_RemoteTracebackc||_dSrtb)rr4s  rrz_RemoteTraceback.__init__|s
rc|jSrr3rs r__str__z_RemoteTraceback.__str__~s	wrN)r r!r"rr6r#rrr1r1{s2rr1ceZdZdZdZdS)_ExceptionWithTracebackcdtt|||}||_d|j_d|z|_dS)Nz

"""
%s""")r)rtypeexc
__traceback__r4)rr<r4s   rrz _ExceptionWithTraceback.__init__sI
WW%d3iib99
:
:"& 2%rc,t|j|jffSr)_rebuild_excr<r4rs r
__reduce__z"_ExceptionWithTraceback.__reduce__sdh000rN)r r!r"rr@r#rrr8r8s2&&&11111rr8c.t||_|Sr)r1	__cause__)r<r4s  rr?r?s$R((CMJrceZdZdZdS)	_WorkItemc>||_||_||_||_dSr)futurefnargskwargs)rrFrGrHrIs     rrz_WorkItem.__init__s"	rNr r!r"rr#rrrDrD#rrDceZdZddZdS)_ResultItemNc>||_||_||_||_dSr)work_id	exceptionresultexit_pid)rrOrPrQrRs     rrz_ResultItem.__init__s"" 


rNNNrJr#rrrMrMs(!!!!!!rrMceZdZdZdS)	_CallItemc>||_||_||_||_dSr)rOrGrHrI)rrOrGrHrIs     rrz_CallItem.__init__s"	rNrJr#rrrUrUrKrrUc,eZdZ	dfd	ZfdZxZS)
_SafeQueuercx||_||_||_t||dS)N)ctx)pending_work_items
shutdown_lockr+superr)rmax_sizerZr[r\r+	__class__s      rrz_SafeQueue.__init__s>"4**
s+++++rc t|trtt|||j}tdd||_|j	
|jd}|j5|j
dddn#1swxYwY||j|dSdSt#||dS)Nz

"""
{}"""r:)
isinstancerUrr;r=r1formatr)rBr[poprOr\r+rrF
set_exceptionr]_on_queue_feeder_error)reobjr4	work_itemr_s     rrez!_SafeQueue._on_queue_feeder_errors1c9%%	3!$q''1ao>>B*>+@+@+M+MNNAK/33CKFFI#
,
,"))+++
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
$ ..q11111%$
GG**1c22222sCCC)r)r r!r"rre
__classcell__r_s@rrXrXsYG,,,,,,
3
3
3
3
3
3
3
3
3rrXc'rK	t|}	ttj||}|sdS|V+r)ziptuple	itertoolsislice)	chunksize	iterablesitchunks    r_get_chunksrtsL6	iBi&r95566	F	rc"	fd|DS)Ncg|]}|Sr#r#).0rHrGs  r
<listcomp>z"_process_chunk.<locals>.<listcomp>s((($BBI(((rr#)rGrss` r_process_chunkrys$)(((%((((rc		|t||||dS#t$rE}t||j}|t|||Yd}~dSd}~wwxYw)N)rQrPrRrPrR)putrM
BaseExceptionr8r=)result_queuerOrQrPrRrfr<s       r_sendback_resultrs89WV/88MMM	N	N	N	N	N999%a99W.6888	9	9	9	9	9	9	9	9	99s&+
A::A55A:c<	|9	||n2#t$r%tjddYdSwxYwd}d}	|d}|(|t
jdS||dz
}||krt
j}	|j|j	i|j
}t||j||~nD#t$r7}	t|	|	j}
t||j|
|Yd}	~	nd}	~	wwxYw~|dS)	NzException in initializer:T)exc_inforblockr.)rQrRr{)r}rLOGGERcriticalgetr|osgetpidrGrHrIrrOr8r=)
call_queuer~initializerinitargs	max_tasks	num_tasksrR	call_itemrrfr<s           r_process_workerrs	K"""			L!!"=!MMM
FF		
IHNNN..	RY[[)))F NII%%9;;			inA	0@AAA
\9+<Q&.
0
0
0
0	0	0	0)!Q_==C\9+<&.
0
0
0
0
0
0
0
0
0	0
F9s$+::#C
D-DDc\eZdZ	fdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
xZS)_ExecutorManagerThreadc\|j|_|j|_|j|jfd}t	j|||_|j|_|j	|_
|j|_|j
|_|j|_|j|_t'dS)Nctjd|5|ddddS#1swxYwYdS)Nz?Executor collected: triggering callback for QueueManager wakeup)rutildebugr)r*r+r\s   r
weakref_cbz3_ExecutorManagerThread.__init__.<locals>.weakref_cb1s
GMM1
2
2
2
'
'$$&&&
'
'
'
'
'
'
'
'
'
'
'
'
'
'
'
'
'
'sAAA)_executor_manager_thread_wakeupr+_shutdown_lockr\weakrefrefexecutor_reference
_processes	processes_call_queuer
_result_queuer~	_work_idswork_ids_queue_max_tasks_per_childmax_tasks_per_child_pending_work_itemsr[r]r)rexecutorrr_s   rrz_ExecutorManagerThread.__init__#s
&E%4&*%7%)%7	'	'	'	'#*+h
"C"C",#.%2'0$,#@ #+">
rc	||\}}}|r||dS||||jdu}|r3|j|j}|~|x}rP|r4|j	5|
dddn#1swxYwYn|j~|
rE|||js|dS\r)add_call_item_to_queuewait_result_broken_or_wakeupterminate_brokenprocess_result_itemrRrrcr)rr\_adjust_process_count_idle_worker_semaphorereleaseis_shutting_downflag_executor_shutting_downr[join_executor_internals)rresult_item	is_brokencauseprocess_exitedprs       rrunz_ExecutorManagerThread.runRs(	''))),0,M,M,O,O)KE
%%e,,,&((555!,!5T!A!**;+?@@AFFHHH #668888!%B!/==$::<<<===============!7??AAA $$&&
00222
++---.00222FQ(	s<CC!$C!cv	|jrdS	|jd}|j|}|jr<|jt||j	|j
|jdn|j|=#tj
$rYdSwxYw)NTFr)rfullrrr[rFset_running_or_notify_cancelr|rUrGrHrIqueueEmpty)rrOrhs   rrz-_ExecutorManagerThread.add_call_item_to_queues	##%%

-111>>!3G<	#@@BBO''	'2;,2;.2;2B)D)D/3	(4444/8;



	sB$$B76B7c|jj}|jj}||g}dt|jD}tj||z}d}d}d}||vrR	|	}d}n@#t$r-}	tt|	|	|	j
}Yd}	~	nd}	~	wwxYw||vrd}|j|||fS)Ncg|]	}|j
Sr#)sentinelrwrs  rrxzG_ExecutorManagerThread.wait_result_broken_or_wakeup.<locals>.<listcomp>sNNN1AJNNNrTF)r~rr+r&rvaluesr
connectionwaitrecvr}rr;r=r)
r
result_reader
wakeup_readerreadersworker_sentinelsreadyrrrrfs
          rrz3_ExecutorManagerThread.wait_result_broken_or_wakeups)1
*2
 -0NNT^5J5J5L5L0M0MNNN
""7-=#=>>	E!!
F+0022!		 
F
F
F(a!Q_EE
Fe
#
#I	
  """Iu,,s:B
C#CCct|trM|j|}||js|dSdS|j|jd}|I|jr!|j	
|jdS|j	|jdSdSr)
raintrrcr)rr[rOrPrFrd
set_resultrQ)rrrrhs    rrz*_ExecutorManagerThread.process_result_itemsk3''	D"";//A
FFHHH>
,,...


/33K4GNNI$(D$22;3HIIIII$//0BCCCCC	%$rcN|}tp
|dup|jSr)rr%_shutdown_thread)rrs  rrz'_ExecutorManagerThread.is_shutting_downs4**,,
!-H$4-,	.rc|}|d|_d|_d}td}|+t	dd|d|_|jD] \}}|j	
|~!|j|j
D]}||jjt$jdkr|jj|dS)NzKA child process terminated abruptly, the process pool is not usable anymoreTz^A process in the process pool was terminated abruptly while the future was running or pending.z
'''
r:z'''win32)r_brokenrBrokenProcessPoolr1r)rBr[r(rFrdrrr	terminaterrrsysplatformrr)rrrbperOrhrs       rrz'_ExecutorManagerThread.terminate_brokensX**,,!1H)-H%H !677,-"''%..---//CM#'"9"?"?"A"A		GY**3///	%%'''&&((		A
KKMMMM	
%%'''<7""O#))+++	
$$&&&&&rcT|}|d|_|jri}|jD]#\}}|js|||<$||_		|jn#tj
$rYnwxYw1d|_dSdSdS)NTF)rr_cancel_pending_futuresr[r(rFcancelr
get_nowaitrr)rrnew_pending_work_itemsrOrhs     rrz2_ExecutorManagerThread.flag_executor_shutting_down	s**,,(,H%/
9*,&*.*A*G*G*I*IDD&GY$+2244D:C.w7*@'+668888 ;49000) 
9
9s-BBBcL|}d}||kr|dkrmt||z
D]8}	|jd|dz
}##tj$rYnwxYw||kr|dkidSdSdSdS)Nrr.)get_n_children_aliveranger
put_nowaitrFull)rn_children_to_stopn_sentinels_sentis    rshutdown_workersz'_ExecutorManagerThread.shutdown_workers#s!6688 "444--//!33-0@@AA

O..t444$)$$zEE
 "444--//!3333543354s
A**A=<A=cb||j|j|j5|jdddn#1swxYwY|jD]}|dSr)	rrrjoin_threadr\r+rrr)rrs  rrz._ExecutorManagerThread.join_executor_internals1s##%%%

	'	'$$&&&	'	'	'	'	'	'	'	'	'	'	'	'	'	'	'&&((		A
FFHHHH		sA44A8;A8cbtd|jDS)Nc3>K|]}|VdSr)is_alivers  r	<genexpr>z>_ExecutorManagerThread.get_n_children_alive.<locals>.<genexpr>?s*AAA1::<<AAAAAAr)sumrrrs rrz+_ExecutorManagerThread.get_n_children_alive=s-AA)>)>)@)@AAAAAAr)r r!r"rrrrrrrrrrrrirjs@rrrs	-----^+++Z.!-!-!-FDDD....-'-'-'^9994


BBBBBBBrrcLtrtrttda	ddl}n$#t$rdattwxYw	tjd}n#ttf$rYdSwxYw|dkrdS|dkrdSd|zatt)NTrzxThis Python build lacks multiprocessing.synchronize, usually due to named semaphores being unavailable on this platform.SC_SEM_NSEMS_MAXz@system provides too few semaphores (%d available, 256 necessary))	_system_limits_checked_system_limitedNotImplementedErrormultiprocessing.synchronizeImportErrorrsysconfAttributeError
ValueError)multiprocessing	nsems_maxs  r_check_system_limitsrFs7	7%o666!3*****333
F	"/2223J122		J'B	C	46?@O
o
.
..s+!AA%%A:9A:c#rK	|D]0}||r|V|1dSr)reverserc)iterableelements  r_chain_from_iterable_of_listsrfs]
  	 ++--	   rceZdZdS)rN)r r!r"r#rrrrrsrrceZdZ		ddddZdZdZdZdZd	Ze	j
jje_dd
dfd
ZddddZ
e	j
j
je
_xZS)ProcessPoolExecutorNr#)rc	t|Jtjpd|_tjdkrt
t|j|_nN|dkrtdtjdkr"|tkrtdt||_|*|tj
d}ntj
}||_|jdd	k|_
|t|std
||_||_|gt%|t&std|dkrtd|jdd	krtd
||_d|_i|_d|_t1j|_t1jd|_d|_d|_i|_d|_ tC|_"|jtFz}tI||j|j|j|j"|_%d|j%_&|'|_(tSj*|_+dS)Nr.rrz"max_workers must be greater than 0zmax_workers must be <= spawnF)
allow_noneforkzinitializer must be a callablez&max_tasks_per_child must be an integerz max_tasks_per_child must be >= 1zpmax_tasks_per_child is incompatible with the 'fork' multiprocessing start method; supply a different mp_context.)r^rZr[r\r+T),rr	cpu_count_max_workersrrmin_MAX_WINDOWS_WORKERSrrget_context_mp_contextget_start_method#_safe_to_dynamically_spawn_childrencallable	TypeError_initializer	_initargsrarr_executor_manager_threadrr	threadingLockr	Semaphorerr_queue_countrrrrEXTRA_QUEUED_CALLSrXr
_ignore_epipeSimpleQueuerrrr)rmax_workers
mp_contextrrr
queue_sizes       rrzProcessPoolExecutor.__init__zs	$	 " 3!D|w&&$'(<(,(9%;%;!a !EFFF,'))222 D.BDDFFF!,D".^G44

^--
% 11U1CCvM	
0"8K+@+@"<==='!*1377
E HIII$)) !CDDD00E0BBfLL "CDDD%8!)-%!&'n..&/&9!&<&<##% ',$0=,&);;
%T%5#7->	@@@*.&'3355rc|j^|js|t||_|j|jt|j<dSdSr)rr_launch_processesrstartrr'rs r_start_executor_manager_threadz2ProcessPoolExecutor._start_executor_manager_threadsn(0;
)&&(((,B4,H,HD))//1114
T:;;;
10rc|jdrdSt|j}||jkr|dSdS)NF)blocking)racquirelenrr	_spawn_process)r
process_counts  rrz)ProcessPoolExecutor._adjust_process_countsb&...>>	FDO,,
4,,,
!!!!!-,rctt|j|jD]}|dSr)rr&rr	r')rr*s  rr z%ProcessPoolExecutor._launch_processessI
s4?++T->??	"	"A!!!!	"	"rc|jt|j|j|j|j|jf}|||j	|j
<dS)N)targetrH)r
Processrrrrrrr!rpidrs  rr'z"ProcessPoolExecutor._spawn_process	sg$$""$#.+	-
%
.
.	
			!"rc,|j5|jrt|j|jrt	dt
rt	dt
j}t||||}||j	|j
<|j|j
|xj
dz
c_
|j
|jr|||cdddS#1swxYwYdS)Nz*cannot schedule new futures after shutdownz6cannot schedule new futures after interpreter shutdownr.)rrrrRuntimeErrorr%rFuturerDrrrr|rrrrr")rrGrHrIfws      rsubmitzProcessPoolExecutor.submitsg

 		|
6'555$
Q"#OPPP
;"$:;;;A!Rv..A:;D$T%67Nt0111"0779997
-**,,,//111+																		sC4D		D
D
r.)timeoutrpc	|dkrtdttt|t|d|i|}t
|S)Nr.zchunksize must be >= 1.rp)r4)rr]maprryrtr)rrGr4rprqresultsr_s      rr6zProcessPoolExecutor.map-sm	(q==6777''++gnb99)9J	JJ&-//-W555rTF)cancel_futurescn|j5||_d|_|j|jdddn#1swxYwY|j|r|jd|_d|_|j|r|j	d|_d|_
d|_dSr)rrrrrrr)rrrr)rrr8s   rshutdownzProcessPoolExecutor.shutdownJs

 	>	>+9D($(D!3?4;;===	>	>	>	>	>	>	>	>	>	>	>	>	>	>	>(44)..000)-%)d)$$&&&!/3,,,s/AA
A)NNNr#)T)r r!r"rr"rr r'r3rExecutor__doc__r6r:rirjs@rrrys48,.l'GKl'l'l'l'l'\555
"
"
""""	#	#	#.^*2FN*.!6666666:4E44444(~.6HrrrSr)1
__author__rconcurrent.futuresrrrrmultiprocessing.connectionmultiprocessing.queuesrrr	functoolsrrnr	tracebackrWeakKeyDictionaryr'r%rr-_register_atexitrr	Exceptionr1r8r?objectrDrMrUrXrtryrrThreadrrrrrBrokenExecutorrr;rr#rr<module>rIsT(T2
				$$$$$$!!!!((((((



&&&&&&-7,..********4	<(((y	1	1	1	1	1	1	1	1!!!!!&!!!333333332	)	)	)DH"	9	9	9	93333lhBhBhBhBhBY-hBhBhBV	///@	 	 	 ,e7e7e7e7e7%.e7e7e7e7e7r