+
    ‹°³j‘&  ã                   óÐ   € R t ^ RIt^ RIHt ^ RIHt ^RIHt ^RI	H
t
 RR./t. ROt ! R R	4      t]RR l4       tR tR tRRRRR^RR
R]RRRRRRRR/	R ltR tR tRR/R ltR# )z,
Thin wrappers around `concurrent.futures`.
N)Úcontextmanager©Úlength_hint)Útqdm)ÚTqdmWarningzgithub.com/Ú	casperdclc                   ó^   a € ] tR t^t o Rt^ RIHt ^ RIHt	 R t
RR ltR tR tR tR	tV tR
# )Ú_InterpreterLockz3Reentrant lock backed by a cross-interpreter queue.)Ú	get_ident)Ú	monotonicc                óR   € ^ RI Hp Wn        V! 4       V n        RV n        ^ V n        R# )é    )ÚRLockN)Ú	threadingr   Ú_queueÚ_lockÚ_ownerÚ_depth)ÚselfÚqueuer   s   && ÚX/home/luca/screen-checking/.venv/lib/python3.14/site-packages/tqdm/contrib/concurrent.pyÚ__init__Ú_InterpreterLock.__init__   s!   € Ý#ØŒÙ“WˆŒ
ØˆŒØˆŽó    c                ó¸  € ^ RI Hp V P                  4       pVR8X  d   V P                  P	                  V4      pMV P                  P	                  W4      pV'       g   R# V P
                  '       d   V ;P
                  ^,          un        R#  V'       g   V P                  P                  4        MfVR8X  d   V P                  P                  4        MD\        ^ W P                  4       V,
          ,
          4      pV P                  P                  VR7        V P                  4       V n        ^V n        R#   T d    T P                  P                  4         R# i ; i)r   )ÚEmptyFT)Útimeoutéÿÿÿÿ)r   r   Ú_timer   Úacquirer   r   Ú
get_nowaitÚgetÚmaxÚreleaser
   r   )r   Úblockingr   r   ÚstartÚacquiredÚ	remainings   &&&    r   r   Ú_InterpreterLock.acquire   sö   € ÝØ—
‘
“ˆØ�bŒ=Ø—z‘z×)Ñ)¨(Ó3‰Hà—z‘z×)Ñ)¨(Ó<ˆHßÙØ�;�;ˆ;Ø�KŠK˜1Õ�KÙð
	ßØ—‘×&Ñ&Õ(Ø˜B”Ø—‘—‘Õ!ä  7¯j©j«l¸UÕ.BÕ#CÓD�	Ø—‘—‘¨	�Õ2ð —n‘nÓ&ˆŒØˆŒÙøð ô 	Ø�J‰J×ÑÔ Úð	ús%   ÂD4 ÂD4 Â0!D4 ÃAD4 Ä4!EÅEc                ó(  € V P                   V P                  4       8w  d   \        R 4      hV ;P                  ^,          un        V P                  '       g#   RV n         V P                  P                  R4       V P                  P                  4        R# )zcannot release un-acquired lockN)r   r
   ÚRuntimeErrorr   r   Úputr   r#   ©r   s   &r   r#   Ú_InterpreterLock.release6   s_   € Ø�;‰;˜$Ÿ.™.Ó*Ô*ÜÐ@ÓAÐAØ�Š�qÕ�Ø�{�{ˆ{ØˆDŒKØ�K‰K�O‰O˜DÔ!Ø�
‰
×ÑÖr   c                ó&   € V P                  4        V # ©N)r   r,   s   &r   Ú	__enter__Ú_InterpreterLock.__enter__?   s   € Ø�‰ŒØˆr   c                ó&   € V P                  4        R # r/   )r#   )r   Úexcs   &*r   Ú__exit__Ú_InterpreterLock.__exit__C   s   € Ø�‰Žr   )r   r   r   r   N)Tr   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r
   Útimer   r   r   r   r#   r0   r4   Ú__static_attributes__Ú__classdictcell__)Ú__classdict__s   @r   r	   r	      s,   ø‡ € Ù=Ý#Ý'òôò6ò÷ð r   r	   Ú c              #  óØ   "  € \        V RR4      pVf   T;'       g    V P                  4       p\        W!V4      pV P                  V4       Vx € Vf   V =R# V P                  V4       R# 5i)z>get (create if necessary) and then restore `tqdm_class`'s lockr   N)ÚgetattrÚget_lockÚset_lockr   )Ú
tqdm_classÚ	lock_nameÚlockÚold_locks   &&& r   Úensure_lockrH   G   si   é € ô �z 7¨DÓ1€HØ‚|Ø×0Ð0˜:×.Ñ.Ó0ˆÜ�4 DÓ)€DØ×Ñ˜ÔØ
‚JØÒØÒà×Ñ˜HÖ%ùs   ‚A*�AA*c           	     óœ   € R\         P                  : RV P                  : RV P                  P	                  R4      : RV: R2	p\
        V33# )zGReturn an initializer which bootstraps the parent import path and lock.zimport sys
sys.path[:] = z™
from concurrent import interpreters
from importlib import import_module
from tqdm.contrib.concurrent import _InterpreterLock
tqdm_class = import_module(z)
for name in Ú.z…:
    tqdm_class = getattr(tqdm_class, name)
tqdm_class.monitor_interval = 0
tqdm_class.set_lock(_InterpreterLock(interpreters.Queue(z))))ÚsysÚpathr7   r8   ÚsplitÚexec)rD   Úlock_queue_idÚcodes   && r   Ú_get_interpreter_initrQ   V   sk   € ð	ÜŸ™™ð %&ð '1×&;Ñ&;Ñ%>ð ?Ø!×.Ñ.×4Ñ4°SÓ9Ñ<ð =Cð DQÑBSÐSVð		Xð 	ô �$�ˆ=Ðr   c                ó2   a€ \        V3R lV  4       ^ R7      # )z+min(map(length_hint, iterables), default=0)c              3   óR   <"  € T F  p\        VR4      ;o^ 8¼  g   K  Sx € K  	  R# 5i)é   Nr   r   )Ú.0ÚitÚns   & €r   Ú	<genexpr>Ú_min_map_len.<locals>.<genexpr>h   s&   øé € ÐI™I�b¬{¸2¸rÓ/BÐ*B¨!ÀqÑ)H—’›Iùs   ƒ'�
')Údefault)Úmin)Ú	iterablesrW   s   &@r   Ú_min_map_lenr]   f   s   ø€ äÔI™IÓIÐSTÔUÐUr   Úmax_workersr   Ú	chunksizerE   rD   Ú	smoothingg        r   Ú_initializerÚ	_initargsc       	        óØ  aa€ VP                  4       pRV9  d   \        V4      VR&   / pRV9   d   VP                  R4      VR&   / pR F   pVV9   g   K  VP                  V4      VV&   K"  	  RpVR,          '       dP   RV9  dI    ^ RIHp T;'       g#    \        ^ V! 4       ;'       g    ^^,           4      pVR,          V8”  d   VVR&   Rp\        WeVR7      ;_uu_ 4       pV	f   VP                  p	V3p
V ! RR	VR
V	RV
/VB ;_uu_ 4       pV! RRV/VB ;_uu_ 4       oVe   RSn
        VP                  oVV3R lpVVn        \        VP                  ! V.VO5RVRV/VB 4      uuRRR4       uuRRR4       uuRRR4       #   \
         d    ^ RIHp  ELi ; i  + '       g   i     M; i RRR4       M  + '       g   i     M; iRRR4       R#   + '       g   i     R# ; i)zó
Implementation of `thread_map`, `process_map` and `interpreter_map`.

Parameters
----------
max_workers  : int
timeout  : int
buffersize  : int
    Requires Python>=3.14.
thread_name_prefix  : str
max_tasks_per_child  : int
mp_context  : str
ÚtotalÚ
buffersizeNÚminiters)Úprocess_cpu_count)Ú	cpu_countT)rE   rF   r^   ÚinitializerÚinitargsr`   c                  óB   <€ S! V / VB pVP                  V3R  l4       V# )c                 ó$   <€ SP                  4       # r/   )Úupdate)Ú_Úpbars   &€r   Ú<lambda>Ú4_executor_map.<locals>.patchsubmit.<locals>.<lambda>    s   ø€ °D·K±K´Mr   )Úadd_done_callback)ÚargsÚkwargsÚfutÚ	orisubmitro   s   *, €€r   ÚpatchsubmitÚ"_executor_map.<locals>.patchsubmitž   s&   ø€ Ù# TÐ4¨VÑ4�CØ×)Ñ)Ô*AÔBØ�Jr   r   r_   )Úthread_name_prefixÚmax_tasks_per_childÚ
mp_context© )Úcopyr]   ÚpopÚosrg   ÚImportErrorrh   r[   rH   rC   Údynamic_minitersÚsubmitÚlistÚmap)ÚPoolExecutorÚfnr^   r   r_   rE   rD   r`   r   ra   rb   r\   Útqdm_kwargsrt   Ú
map_kwargsÚpool_kwargsÚkr�   rh   Ú	rough_maxÚlkÚexrw   rv   ro   s   &&$$$$$$$$$*,          @@r   Ú_executor_maprŽ   k   s   ù€ ð$ ×ÑÓ€FØ�fÔÜ& yÓ1ˆˆw‰Ø€JØ�vÔØ#)§:¡:¨lÓ#;ˆ
�<Ñ Ø€KÛHˆØ�Ž;Ø#ŸZ™Z¨›]ˆK˜‹Nñ Ið ÐØˆg‡„˜:¨VÔ3ð	%Ý9ð  ×BÐB¤3 r©I«K×,<Ð,<¸1ÀÕ+AÓ#Bˆ	Ø�'�?˜YÔ&Ø!*ˆF�:ÑØ#ÐÜ	�Z¸5×	AÕ	AÀRàÒØ%×.Ñ.ˆLØ˜ˆIÙñ ) kð )¸|ð )ÐV_ð )Ø'÷)ò )Ø,.ÙÑ: iÐ:°6×:Ò:¸dØ#Ò/Ø,0�DÔ)ØŸI™I�	öð (�”	Ü˜BŸFšFØðXØ"òXØ,3ðXØ?HðXØLVñXó Y÷ ;Ñ:÷)ñ )÷ 
BÒ	Aøô ô 	%ß$Ð$ð	%ú÷ ;×:úÐ:÷)÷ )÷ )ð )ú÷ 
B×	A×	AÒ	AúsU   ÂF Ã"*GÄF;	ÄAFÅ'
F;	Å1
GÆFÆFÆF.Æ)F;	Æ2	GÆ;GÇGÇG)	c                ó,   € ^ RI Hp \        W0.VO5/ VB # )a`  
Equivalent of `list(map(fn, *iterables))`
driven by `concurrent.futures.ThreadPoolExecutor`.

Parameters
----------
max_workers  : int, optional
    Maximum number of workers to spawn; passed to `concurrent.futures.ThreadPoolExecutor`.
thread_name_prefix  : str, optional
    Passed to `concurrent.futures.ThreadPoolExecutor` [default: ''].
timeout  : int or float, optional
    Seconds to wait before raising `TimeoutError` if `__next__` is called and the
    result isn't available. [default: None].
buffersize  : int, optional
    Requires Python>=3.14 [default: None].
tqdm_class  : optional
    `tqdm` class to use for bars [default: tqdm.auto.tqdm].
smoothing  : float, optional
    Passed to `tqdm_class`; the [default: 0] is average (due to erratic update frequency).
lock_name  : str, optional
    Member of `tqdm_class.get_lock()` to use [default: ''].
)ÚThreadPoolExecutor)Úconcurrent.futuresr�   rŽ   )r†   r\   r‡   r�   s   &*, r   Ú
thread_mapr’   §   s   € õ. 6ÜÐ+ÐK°)ÒK¸{ÑKÐKr   c           	     óò   € ^ RI Hp ^ RIHp VP	                  4       pVP                  R4       VP                  R\        4      p\        WeP                  4      w  rx\        W@.VO5R\        V4      RVRV/VB # )aB  
Equivalent of `list(map(fn, *iterables))`
driven by `concurrent.futures.InterpreterPoolExecutor` (Python 3.14+).

Parameters
----------
Same as `thread_map`.

Notes
-----
`fn`, its arguments, and its return values must be pickleable.
Worker progress bars using the same `tqdm_class` share a cross-interpreter write lock.
)Úinterpreters)ÚInterpreterPoolExecutorNrD   r   ra   rb   )Ú
concurrentr”   r‘   r•   Úcreate_queuer+   r!   Ú	tqdm_autorQ   ÚidrŽ   r	   )	r†   r\   r‡   r”   r•   Ú
lock_queuerD   ri   rj   s	   &*,      r   Úinterpreter_mapr›   Â   s‰   € õ (Ý:Ø×*Ñ*Ó,€JØ‡N�N�4ÔØ—‘ ¬yÓ9€JÜ1°*¿m¹mÓLÑ€KÜØðEØ&/òEÜ7GÈ
Ó7SðEà ðEà,4ðEà8CñEð Er   Úmp_lockc               óª   € ^ RI Hp V'       d6   RV9  d/   \        V4      pVR8”  d   ^ RIHp V! RV,          \
        ^R7       \        W@.VO5RV/VB # )aá  
Equivalent of `list(map(fn, *iterables))`
driven by `concurrent.futures.ProcessPoolExecutor`.

Parameters
----------
max_workers  : int, optional
    Maximum number of workers to spawn; passed to `concurrent.futures.ProcessPoolExecutor`.
timeout  : int or float, optional
    Seconds to wait before raising `TimeoutError` if `__next__` is called and the
    result isn't available. [default: None].
chunksize  : int, optional
    Approximate size of chunks sent to worker processes; passed to
    `concurrent.futures.ProcessPoolExecutor.map`. [default: 1].
buffersize  : int, optional
    Requires Python>=3.14 [default: None].
max_tasks_per_child  : int, optional
    Maximum number of tasks a worker process can complete before being replaced
    with a new process; passed to `concurrent.futures.ProcessPoolExecutor`.
mp_context  : multiprocessing.BaseContext, optional
    Multiprocessing context to use, e.g. `multiprocessing.get_context('fork')`.
lock_name  : str, optional
    Member of `tqdm_class.get_lock()` to use [default: mp_lock].
tqdm_class  : optional
    `tqdm` class to use for bars [default: tqdm.auto.tqdm].
smoothing  : float, optional
    Passed to `tqdm_class`; the [default: 0] is average (due to erratic update frequency).
)ÚProcessPoolExecutorr_   iè  )Úwarnz…Iterable length %d > 1000 but `chunksize` is not set. This may seriously degrade multiprocess performance. Set `chunksize=1` or more.)Ú
stacklevelrE   )r‘   rž   r]   ÚwarningsrŸ   r   rŽ   )r†   rE   r\   r‡   rž   Úshortest_iterable_lenrŸ   s   &$*,   r   Úprocess_mapr£   Û   sd   € õ: 7ß�[¨Ô3ô !-¨YÓ 7ÐØ  4Ô'Ý%Ùð /à1FõGô ¨õ,ô Ð,Ða°9ÒaÈ	ÐaÐU`ÑaÐar   )r’   r£   r›   )r?   N)r:   rK   Ú
contextlibr   Úoperatorr   Úautor   r˜   Ústdr   Ú
__author__Ú__all__r	   rH   rQ   r]   rŽ   r’   r›   r£   r|   r   r   Ú<module>rª      sÈ   ðñó Ý %Ý  å $Ý à˜k˜]Ð+€
Ú
:€÷5ñ 5ðp ó&ó ð&òò Vð
9YØ.2ð9YØ<@ð9YØLMð9YØY[ð9Yàð9Yà$'ð9Yà/3ð9YàBFð9YàRVô9YòxLò6Eð2(b¨)ö (br   