ó
    Eñi’  ã                   ó|   • S r SSKJr  SSKJr  SSKJr  SSKJr	  SSK
Jr  SS	/0rS
S/r\SS j5       rS rS rS rg)z,
Thin wrappers around `concurrent.futures`.
é    )Úcontextmanager)Úlength_hint)Ú	cpu_counté   )Útqdm)ÚTqdmWarningzgithub.com/Ú	casperdclÚ
thread_mapÚprocess_mapc              #   óÈ   #   • [        U SS5      nU=(       d    U R                  5       n[        X1U5      nU R                  U5        Uv •  Uc  U ?gU R                  U5        g7f)z>get (create if necessary) and then restore `tqdm_class`'s lockÚ_lockN)ÚgetattrÚget_lockÚset_lockr   )Ú
tqdm_classÚ	lock_nameÚold_lockÚlocks       ÚT/home/mande/repo/quber/.venv/lib/python3.13/site-packages/tqdm/contrib/concurrent.pyÚensure_lockr      sa   é € ô �z 7¨DÓ1€HØ×,�z×*Ñ*Ó,€DÜ�4 DÓ)€DØ×Ñ˜ÔØ
‚JØÑØÑà×Ñ˜HÕ%ùs   ‚A A"c                 ó  • UR                  5       nSU;  a  [        US   5      US'   UR                  S[        5      nUR                  S[	        S[        5       S-   5      5      nUR                  SS5      nUR                  S	S
5      n[        XXS9 n	U " XeR                  U	4S9 n
[        U" U
R                  " U/UQ7SU0640 UD65      sSSS5        sSSS5        $ ! , (       d  f       O= f SSS5        g! , (       d  f       g= f)zâ
Implementation of `thread_map` and `process_map`.

Parameters
----------
tqdm_class  : [default: tqdm.auto.tqdm].
max_workers  : [default: min(32, cpu_count() + 4)].
chunksize  : [default: 1].
lock_name  : [default: "":str].
Útotalr   r   Úmax_workersé    é   Ú	chunksizeé   r   Ú )r   )r   ÚinitializerÚinitargsN)
Úcopyr   ÚpopÚ	tqdm_autoÚminr   r   r   ÚlistÚmap)ÚPoolExecutorÚfnÚ	iterablesÚtqdm_kwargsÚkwargsr   r   r   r   ÚlkÚexs              r   Ú_executor_mapr.      sï   € ð ×ÑÓ€FØ�fÓÜ% i°¡lÓ3ˆˆw‰Ø—‘˜L¬)Ó4€JØ—*‘*˜]¬C°´I³KÀ!±OÓ,DÓE€KØ—
‘
˜;¨Ó*€IØ—
‘
˜;¨Ó+€IÜ	�ZÒ	5¸á k×?RÑ?RØ$& 5ò*Ø-/Ü™
 2§6¢6¨"Ð#N¨yÒ#NÀIÑ#NÑYÐRXÑYÓZ÷*ð *÷ 
6Ñ	5÷*õ *úð *÷ 
6×	5Ö	5ús$   ÂC9Â%&CÃ	C9Ã
C,	Ã(C9Ã9
Dc                 ó,   • SSK Jn  [        X0/UQ70 UD6$ )av  
Equivalent of `list(map(fn, *iterables))`
driven by `concurrent.futures.ThreadPoolExecutor`.

Parameters
----------
tqdm_class  : optional
    `tqdm` class to use for bars [default: tqdm.auto.tqdm].
max_workers  : int, optional
    Maximum number of workers to spawn; passed to
    `concurrent.futures.ThreadPoolExecutor.__init__`.
    [default: max(32, cpu_count() + 4)].
r   )ÚThreadPoolExecutor)Úconcurrent.futuresr0   r.   )r(   r)   r*   r0   s       r   r
   r
   6   s   € õ 6ÜÐ+ÐK°)ÒK¸{ÑKÐKó    c                 óä   • SSK Jn  U(       a:  SU;  a4  [        [        [        U5      5      nUS:”  a  SSKJn  U" SU-  [        SS9  S	U;  a  UR                  5       nS
US	'   [        X0/UQ70 UD6$ )af  
Equivalent of `list(map(fn, *iterables))`
driven by `concurrent.futures.ProcessPoolExecutor`.

Parameters
----------
tqdm_class  : optional
    `tqdm` class to use for bars [default: tqdm.auto.tqdm].
max_workers  : int, optional
    Maximum number of workers to spawn; passed to
    `concurrent.futures.ProcessPoolExecutor.__init__`.
    [default: min(32, cpu_count() + 4)].
chunksize  : int, optional
    Size of chunks sent to worker processes; passed to
    `concurrent.futures.ProcessPoolExecutor.map`. [default: 1].
lock_name  : str, optional
    Member of `tqdm_class.get_lock()` to use [default: mp_lock].
r   )ÚProcessPoolExecutorr   iè  )Úwarnz…Iterable length %d > 1000 but `chunksize` is not set. This may seriously degrade multiprocess performance. Set `chunksize=1` or more.r   )Ú
stacklevelr   Úmp_lock)
r1   r4   Úmaxr&   r   Úwarningsr5   r   r!   r.   )r(   r)   r*   r4   Úlongest_iterable_lenr5   s         r   r   r   H   s…   € õ& 7Þ�[¨Ó3ô  #¤3¤{°IÓ#>Ó?ÐØ $Ó&Ý%Ùð /à1EñFô ¨ò,ð ˜+Ó%Ø!×&Ñ&Ó(ˆØ#,ˆ�KÑ ÜÐ,ÐL°9ÒLÀÑLÐLr2   N)r   )Ú__doc__Ú
contextlibr   Úoperatorr   Úosr   Úautor   r#   Ústdr   Ú
__author__Ú__all__r   r.   r
   r   © r2   r   Ú<module>rD      sW   ðñõ &Ý  Ý å $Ý à˜k˜]Ð+€
Ø˜Ð
'€ð ó
&ó ð
&ò[ò2Ló$!Mr2   