+
    €",io*  ã                   ó¨   € ^ RI t ^ RIt^ RIt^ RIt^RIHtHt ^RIH	t	 ^RI
Ht R.t]P                  ! 4       t^ sRsRsR tR
R lt ! R R	]4      tR# )é    N)ÚProcessPoolExecutorÚEXTRA_QUEUED_CALLS)Ú	cpu_count)Úget_contextÚget_reusable_executorc                 ó†   € \         ;_uu_ 4        \        p \        ^,          sV uuRRR4       #   + '       g   i     R# ; i)z£Ensure that each successive executor instance has a unique, monotonic id.

The purpose of this monotonic id is to help debug and test automated
instance creation.
N)Ú_executor_lockÚ_next_executor_id)Úexecutor_ids    ÚI/usr/lib/python3/dist-packages/joblib/externals/loky/reusable_executor.pyÚ_get_next_executor_idr      s(   € ÷ 
ŽÜ'ˆÜ˜QÕÐØ÷ 
��‹ús	   �/¯A 	c
                óH   € \         P                  V VVVVVVVVV	R7
      w  r«V
# )a4  Return the current ReusableExectutor instance.

Start a new instance if it has not been started already or if the previous
instance was left in a broken state.

If the previous instance does not have the requested number of workers, the
executor is dynamically resized to adjust the number of workers prior to
returning.

Reusing a singleton instance spares the overhead of starting new worker
processes and importing common python packages each time.

``max_workers`` controls the maximum number of tasks that can be running in
parallel in worker processes. By default this is set to the number of
CPUs on the host.

Setting ``timeout`` (in seconds) makes idle workers automatically shutdown
so as to release system resources. New workers are respawn upon submission
of new tasks so that ``max_workers`` are available to accept the newly
submitted tasks. Setting ``timeout`` to around 100 times the time required
to spawn new processes and import packages in them (on the order of 100ms)
ensures that the overhead of spawning workers is negligible.

Setting ``kill_workers=True`` makes it possible to forcibly interrupt
previously spawned jobs to get a new instance of the reusable executor
with new constructor argument values.

The ``job_reducers`` and ``result_reducers`` are used to customize the
pickling of tasks and results send to the executor.

When provided, the ``initializer`` is run first in newly spawned
processes with argument ``initargs``.

The environment variable in the child process are a copy of the values in
the main process. One can provide a dict ``{ENV: VAL}`` where ``ENV`` and
``VAL`` are string literals to overwrite the environment variable ``ENV``
in the child processes to value ``VAL``. The environment variables are set
in the children before any module is loaded. This only works with the
``loky`` context.
)
Úmax_workersÚcontextÚtimeoutÚkill_workersÚreuseÚjob_reducersÚresult_reducersÚinitializerÚinitargsÚenv)Ú_ReusablePoolExecutorr   )r   r   r   r   r   r   r   r   r   r   Ú	_executorÚ_s   &&&&&&&&&&  r   r   r   %   sB   € ôh )×>Ñ>ØØØØ!ØØ!Ø'ØØØð ?ó �L€Ið Ðó    c                   ón   a a€ ] tR t^ht oRV 3R llt]R	R l4       tV 3R ltR tR t	V 3R lt
RtVtV ;t# )
r   c                óN   <€ \         SV `  VVVVVVV	V
R 7       WPn        Wn        R# ))r   r   r   r   r   r   r   r   N)ÚsuperÚ__init__r   Ú_submit_resize_lock)ÚselfÚsubmit_resize_lockr   r   r   r   r   r   r   r   r   Ú	__class__s   &&&&&&&&&&&€r   r    Ú_ReusablePoolExecutor.__init__i   s=   ø€ ô 	‰ÑØ#ØØØ%Ø+Ø#ØØð 	ô 		
ð 'ÔØ#5Ö r   c                óÌ  € \         ;_uu_ 4        \        pVf#   VRJ d   Ve   VP                  pM!\        4       pMV^ 8:  d   \	        RV R24      h\        V\        4      '       d   \        V4      pVe!   VP                  4       R8X  d   \	        R4      h\        VVVVVV	V
R7      pVfG   Rp\        P                  P                  RV R24       \        4       pVsV ! \         3R	VR
V/VB ;spEMRVR8X  d
   V\        8H  pVP                  P                   '       g6   VP                  P"                  '       g   V'       d   VP$                  V8  d²   VP                  P                   '       d   RpM5VP                  P"                  '       d   RpMVP$                  V8  d   RpMRp\        P                  P                  RV RV R24       VP#                  RVR7       R ;s;psV P&                  ! RR	V/VB uuR R R 4       # \        P                  P                  RVP                   R24       RpVP)                  V4       R R R 4       W½3#   + '       g   i     XX3# ; i)NTz(max_workers must be greater than 0, got Ú.Úforkz4Cannot use reusable executor with the 'fork' context)r   r   r   r   r   r   r   Fz#Create a executor with max_workers=r   r   ÚautoÚbrokenÚshutdownzqueue size is too smallzarguments have changedz)Creating a new executor with max_workers=z, as the previous instance cannot be reused (z).)Úwaitr   z+Reusing existing executor with max_workers=© )r	   r   Ú_max_workersr   Ú
ValueErrorÚ
isinstanceÚstrr   Úget_start_methodÚdictÚmpÚutilÚdebugr   Ú_executor_kwargsÚ_flagsr*   r+   Ú
queue_sizer   Ú_resize)Úclsr   r   r   r   r   r   r   r   r   r   ÚexecutorÚkwargsÚ	is_reusedr   Úreasons   &&&&&&&&&&&     r   r   Ú+_ReusablePoolExecutor.get_reusable_executorƒ   sƒ  € ÷ Ž^ä ˆHàÒ"Ø˜D“= XÒ%9Ø"*×"7Ñ"7‘Kä"+£+‘KØ Ô!Ü Ø>¸{¸mÈ1ÐMóð ô ˜'¤3×'Ò'Ü% gÓ.�ØÒ" w×'?Ñ'?Ó'AÀVÔ'KÜ ØJóð ô ØØØ)Ø /Ø'Ø!ØôˆFð ÒØ!�	Ü—‘—‘Ø9¸+¸ÀaÐHôô 4Ó5�Ø#)Ð Ù'*Ü"ñ(à +ð(ð !,ð(ð ñ	(ð �	šHð ˜F”?Ø"Ô&6Ñ6�Eà—O‘O×*×*Ð*Ø—‘×/×/Ð/ß Ø×*Ñ*¨[Ô8à—‘×-×-Ð-Ø!)™Ø!Ÿ™×1×1Ð1Ø!+™Ø!×,Ñ,¨{Ô:ð ";™à!9˜Ü—G‘G—M‘MØCØ&˜-ð (#Ø#) (¨"ð.ôð
 ×%Ñ%¨4¸lÐ%ÔKØ>BÐB�IÐB Ð+;à×4Ò4ñ Ø$/ðØ39ñ÷M Š^ôT —G‘G—M‘Mð'Ø'/×'<Ñ'<Ð&=¸Qð@ôð !%�IØ×$Ñ$ [Ô1÷_ ðb Ð"Ð"÷c Ž^ðb ˜Ð"Ð"ús2   �DIÄIÄ;IÅ,IÅ0IÆA+IÈA IÉI#	c                ó’   <€ V P                   ;_uu_ 4        \        SV `  ! V.VO5/ VB uuR R R 4       #   + '       g   i     R # ; i©N)r!   r   Úsubmit)r"   ÚfnÚargsr=   r$   s   &&*,€r   rC   Ú_ReusablePoolExecutor.submitä   s4   ø€ Ø×%×%Ó%Ü‘7’> "Ð6 tÒ6¨vÑ6÷ &×%×%Ó%ús	   –5µA	c           	     óò  € V P                   ;_uu_ 4        Vf   \        R4      hWP                  8X  d    R R R 4       R # V P                  f   Wn         R R R 4       R # V P	                  4        V P
                  ;_uu_ 4        \        V P                  P                  4       4      p\        R V 4       4      pWn        \        W4       F  pV P                  P                  R 4       K   	  R R R 4       \        V P                  4      V8”  d5   V P                  P                  '       g   \         P"                  ! R4       KN  V P%                  4        \        V P                  P                  4       4      p\&        ;QJ d    R V 4       F  '       d   K   RM	  RM! R V 4       4      '       g   \         P"                  ! R4       KR   R R R 4       R #   + '       g   i     Lî; i  + '       g   i     R # ; i)Nz&Trying to resize with max_workers=Nonec              3   ó@   "  € T F  qP                  4       x € K  	  R # 5irB   ©Úis_alive©Ú.0Úps   & r   Ú	<genexpr>Ú0_ReusablePoolExecutor._resize.<locals>.<genexpr>ý   s   é € Ð'H¹i¸¯
©
¯¨»iùó   ‚çü©ñÒMbP?c              3   ó@   "  € T F  qP                  4       x € K  	  R # 5irB   rI   rK   s   & r   rN   rO     s   é € Ð:±	¨1Ÿ*™*Ÿ,˜,³	ùrP   FT)r!   r/   r.   Ú_executor_manager_threadÚ_wait_job_completionÚ_processes_management_lockÚlistÚ
_processesÚvaluesÚsumÚrangeÚ_call_queueÚputÚlenr8   r*   ÚtimeÚsleepÚ_adjust_process_countÚall)r"   r   Ú	processesÚnb_children_aliver   s   &&   r   r:   Ú_ReusablePoolExecutor._resizeè   sj  € Ø×%×%Ó%ØÒ"Ü Ð!IÓJÐJØ× 1Ñ 1Ô1Ø÷	 &Ñ%ð ×,Ñ,Ò4ð %0Ô!Ø÷ &Ñ%ð ×%Ñ%Ô'ð
 ×0×0Ó0Ü  §¡×!7Ñ!7Ó!9Ó:�	Ü$'Ñ'H¹iÓ'HÓ$HÐ!Ø$/Ô!Ü˜{Ö>�AØ×$Ñ$×(Ñ(¨Ö.ñ ?÷	 1ô �D—O‘OÓ$ {Ô2¸4¿;¹;×;M×;MÐ;Mä—
’
˜4Ö à×&Ñ&Ô(Ü˜TŸ_™_×3Ñ3Ó5Ó6ˆIß“cÑ:±	Ó:—c—c’cÑ:±	Ó:×:Ò:Ü—
’
˜4Ö ð ;÷? &Ñ%÷$ 1×0ú÷% &×%Ð%úsI   •!G%Á G%Á$G%ÂA)G	Ã,=G%Ä*AG%Æ G%ÆG%Æ/G%ÇG"ÇG%Ç%G6	c                ó  € V P                   '       dI   \        P                  ! R\        4       \        P
                  P                  RV P                   R24       V P                   '       d   \        P                  ! R4       K*  R# )z8Wait for the cache to be empty before resizing the pool.z\Trying to resize an executor with running jobs: waiting for jobs completion before resizing.z	Executor z, waiting for jobs completion before resizingrQ   N)
Ú_pending_work_itemsÚwarningsÚwarnÚUserWarningr4   r5   r6   r   r^   r_   )r"   s   &r   rT   Ú*_ReusablePoolExecutor._wait_job_completion  sm   € ð ×#×#Ð#Ü�MŠMð?äôô
 �G‰G�M‰MØ˜D×,Ñ,Ð-ð ."ð "ôð
 ×&×&Ð&Ü�JŠJ�tÖñ 'r   c                ó¬   <€ \        \        4       V P                  4      p^V,          \        ,           V n        \
        SV `  WV P                  R7       R# )é   )r9   N)Úmaxr   r.   r   r9   r   Ú_setup_queues)r"   r   r   Úmin_queue_sizer$   s   &&& €r   rn   Ú#_ReusablePoolExecutor._setup_queues  sF   ø€ ô œY›[¨$×*;Ñ*;Ó<ˆØ˜nÕ,Ô/AÕAˆŒÜ‰ÑØ°d·o±oð 	ö 	
r   )r.   r!   r   r9   )	NNNr   NNNr-   N©
NNé
   Fr)   NNNr-   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r    Úclassmethodr   rC   r:   rT   rn   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r$   Ú__classdict__s   @@r   r   r   h   s;   ù‡ € ÷6ð4 ó^#ó ð^#õ@7ò!!òF÷"

õ 

r   r   rq   )r^   rg   Ú	threadingÚmultiprocessingr4   Úprocess_executorr   r   Úbackend.contextr   Úbackendr   Ú__all__ÚRLockr	   r
   r   r7   r   r   r   r-   r   r   Ú<module>rƒ      s^   ðó Û Û Û ç EÝ &Ý  à"Ð
#€ð —’Ó"€ØÐ Ø€	ØÐ ò
ô@ôF~
Ð/ö ~
r   