ó
    áÅŸg   ã                   ó   • S r SSKrSSKrSSKrSSKrSSKrSSKrSSKJr  SSK	J
r
JrJr  SSKJr  SSKJr  SSKJrJr  SSKJr  SS	KJrJr  SS
KJr  SSKJr  SSKJr  SSKJ r J!r!  S"S jr"S\S   SS4S jr#S\RH                  SS4S jr%\" SS9S\&\   S\'S\S\S\!S\\(   SS4S j5       r)S\&\   S\'S\S\SSS\RH                  SS SS4S! jr*g)#z§
Formatting many files at once via multiprocessing. Contains entrypoint and utilities.

NOTE: this module is only imported if we need to format several files at once.
é    N)ÚIterable)ÚExecutorÚProcessPoolExecutorÚThreadPoolExecutor)ÚManager)ÚPath)ÚAnyÚOptional)Ú
mypyc_attr)Ú	WriteBackÚformat_file_in_place)ÚCache)ÚMode)Úerr)ÚChangedÚReportÚreturnc                  óN   •  SSK n U R                  5         g! [         a     gf = f)z³If our environment has uvloop installed we use it.

This is called only from command-line entry points to avoid
interfering with the parent process if Black is used as a library.
r   N)ÚuvloopÚinstallÚImportError)r   s    ÚR/var/www/blue/EV-Temp_rev04/venv/lib/python3.13/site-packages/black/concurrency.pyÚmaybe_install_uvloopr      s&   € ðÛà�‰ÕøÜó Ùðús   ‚ —
$£$Útaskszasyncio.Future[Any]c                 óL   • [        S5        U  H  nUR                  5         M     g)zFasyncio signal handler that cancels all `tasks` and reports to stderr.zAborted!N)r   Úcancel)r   Útasks     r   r   r   *   s   € äˆ
„OÛˆØ�‰Žò ó    Úloopc                 ó¼  •  [         R                  " U 5       Vs/ sH  oR                  5       (       a  M  UPM     nnU(       dG   [        R                  " S5      nUR                  [        R                  5        U R                  5         gU H  nUR                  5         M     U R                  [         R                  " USS065        [        R                  " S5      nUR                  [        R                  5        U R                  5         gs  snf ! [        R                  " S5      nUR                  [        R                  5        U R                  5         f = f)zFCancel all pending tasks on `loop`, wait for them, and close the loop.zconcurrent.futuresNÚreturn_exceptionsT)ÚasyncioÚ	all_tasksÚdoneÚloggingÚ	getLoggerÚsetLevelÚCRITICALÚcloser   Úrun_until_completeÚgather)r   r   Ú	to_cancelÚ	cf_loggers       r   Úshutdownr.   1   sý   € ðä&-×&7Ò&7¸Ô&=ÓQÑ&=˜dÇYÁYÇ[—TÑ&=ˆ	ÐQÞØô ×%Ò%Ð&:Ó;ˆ	Ø×Ñœ7×+Ñ+Ô,Ø�
‰
�ó ˆDØ�K‰KŽMñ à×Ñ¤§¢°	Ð RÈTÑ RÔSô
 ×%Ò%Ð&:Ó;ˆ	Ø×Ñœ7×+Ñ+Ô,Ø�
‰
�ùò Røô ×%Ò%Ð&:Ó;ˆ	Ø×Ñœ7×+Ñ+Ô,Ø�
‰
�ús'   ‚D šDµD»	D Â>D ÄD ÄAET)Ú	patchableÚsourcesÚfastÚ
write_backÚmodeÚreportÚworkersc                 ó>  • [        5         UcP  [        [        R                  R	                  SS5      5      nU=(       d    [        R
                  " 5       =(       d    Sn[        R                  S:X  a  [        US5      n [        US9n[        R                  " 5       n[        R                   " U5         UR#                  [%        U UUUUUUS95         ['        U5        [        R                   " S5        Ub  UR'                  5         gg! [        [        [        4 a    [        SS9n N¡f = f! [        R                   " S5        f = f!  ['        U5        [        R                   " S5        O! [        R                   " S5        f = fUb  UR'                  5         f f = f)	z4Reformat multiple files using a ProcessPoolExecutor.NÚBLACK_NUM_WORKERSr   é   Úwin32é<   )Úmax_workers)r0   r1   r2   r3   r4   r   Úexecutor)r   ÚintÚosÚenvironÚgetÚ	cpu_countÚsysÚplatformÚminr   r   ÚNotImplementedErrorÚOSErrorr   r"   Únew_event_loopÚset_event_loopr*   Úschedule_formattingr.   )r0   r1   r2   r3   r4   r5   r<   r   s           r   Úreformat_manyrJ   G   s]  € ô Ôð �Ü”b—j‘j—n‘nÐ%8¸!Ó<Ó=ˆØ×0œRŸ\š\›^×0¨qˆÜ
‡|�|�wÓä�g˜rÓ"ˆð5Ü&°7Ñ;ˆô ×!Ò!Ó#€DÜ×Ò˜4Ô ð Ø×ÑÜØØØ%ØØØØ!ñô
	
ð	)Ü�TŒNä×"Ò" 4Ô(ØÑØ×ÑÕð  øô5 Ô,¬gÐ6ó 5ô
 &°!Ñ4Šð5ûô2 ×"Ò" 4Õ(ûð	)Ü�TŒNä×"Ò" 4Õ(øŒG×"Ò" 4Õ(úØÑØ×ÑÕð  úsB   Á?	D	 Â4E ÃD- Ä	D*Ä)D*Ä-EÅFÅ
E,ÅFÅ,FÆFr   r<   r   c              ƒ   ó   #   • [         R                  " U5      nU[        R                  [        R                  4;  aE  UR                  U 5      u  p[        U5       H#  n	UR                  U	[        R                  5        M%     U (       d  g/ n
/ nSnU[        R                  [        R                  4;   a  [        5       nUR                  5       n[        U 5       V	s0 sH1  n	[        R                  " UR                  U[        X‘X2U5      5      U	_M3     nn	UR!                  5       n UR#                  [$        R&                  [(        U5        UR#                  [$        R*                  [(        U5        U(       Ga}  [        R.                  " U[        R0                  S9I Sh  v•N u  nnU GH>  nUR3                  U5      n	UR5                  5       (       a  U
R7                  U5        M=  UR9                  5       =n(       aY  UR:                  (       a+  [<        R>                  " [A        U5      UURB                  5        URE                  U	[G        U5      5        M­  URI                  5       (       a  [        RJ                  O[        RL                  nU[        RJ                  L d&  U[        RN                  L a$  U[        RL                  L a  UR7                  U	5        UR                  U	U5        GMA     U(       a  GM}  U
(       a  [        RP                  " U
SS06I Sh  v•N   U(       a  URS                  U5        ggs  sn	f ! [,         a     GNÖf = f GN¬ N77f)zÑRun formatting of `sources` in parallel using the provided `executor`.

(Use ProcessPoolExecutors for actual parallelism.)

`write_back`, `fast`, and `mode` options are passed to
:func:`format_file_in_place`.
N)Úreturn_whenr!   T)*r   Úreadr   ÚDIFFÚ
COLOR_DIFFÚfiltered_cachedÚsortedr$   r   ÚCACHEDr   ÚLockr"   Úensure_futureÚrun_in_executorr   ÚkeysÚadd_signal_handlerÚsignalÚSIGINTr   ÚSIGTERMrE   ÚwaitÚFIRST_COMPLETEDÚpopÚ	cancelledÚappendÚ	exceptionÚverboseÚ	tracebackÚprint_exceptionÚtypeÚ__traceback__ÚfailedÚstrÚresultÚYESÚNOÚCHECKr+   Úwrite)r0   r1   r2   r3   r4   r   r<   ÚcacheÚcachedÚsrcr^   Úsources_to_cacheÚlockÚmanagerr   Úpendingr$   Ú_r   ÚexcÚchangeds                        r   rI   rI   z   s‰  é € ô  �JŠJ�tÓ€EØœ)Ÿ.™.¬)×*>Ñ*>Ð?Ó?Ø×/Ñ/°Ó8‰ˆÜ˜&–>ˆCØ�K‰K˜œWŸ^™^Ö,ñ "æØà€IØÐØ€DØ”i—n‘n¤i×&:Ñ&:Ð;Ó;ô “)ˆØ�|‰|‹~ˆô ˜'”?óñ #ˆCô 	×ÒØ× Ñ ØÔ.°¸4ÈTóó	
ð ò		ñ
 #ð 
ð ð �j‰j‹l€GðØ×Ñ¤§¡¬v°wÔ?Ø×Ñ¤§¡´¸Ô@÷ ÜŸš W¼'×:QÑ:QÑR×R‰ˆˆaÜˆDØ—)‘)˜D“/ˆCØ�~‰~×ÑØ× Ñ  Ö&ØŸ™Ó(Ð(�Õ(Ø—>—>Ü×-Ò-¬d°3«i¸¸c×>OÑ>OÔPØ—‘˜c¤3 s£8Ö,à)-¯©¯©œ'Ÿ+š+¼G¿J¹J�ð ¤§¡Ò.Ø¤)§/¡/Ò1°gÄÇÁÒ6Kà$×+Ñ+¨CÔ0Ø—‘˜C ×)ñ! ÷ ‰'ö& Ü�nŠn˜iÐ@¸4Ñ@×@Ð@ÞØ�‰Ð$Õ%ð ùòIøô ó âðúò Sñ& 	Aùs\   ‚CMÃ7L3ÄMÄ%A
L8 Å/.MÆM	ÆEMË4 MÌMÌ#MÌ8
MÍMÍMÍMÍM)r   N)+Ú__doc__r"   r%   r>   rX   rB   rb   Úcollections.abcr   Úconcurrent.futuresr   r   r   Úmultiprocessingr   Úpathlibr   Útypingr	   r
   Úmypy_extensionsr   Úblackr   r   Úblack.cacher   Ú
black.moder   Úblack.outputr   Úblack.reportr   r   r   r   ÚAbstractEventLoopr.   ÚsetÚboolr=   rJ   rI   © r   r   Ú<module>r‡      sA  ðñó Û Û 	Û Û 
Û Ý $ß PÑ PÝ #Ý ß  å &ç 1Ý Ý Ý ß (ôð�(Ð0Ñ1ð °dô ð�7×,Ñ,ð °ô ñ, �dÑð/ Ø�‰Yð/ à
ð/ ð ð/ ð ð	/ ð
 ð/ ð �c‰]ð/ ð 
ó/ ó ð/ ðdE&Ø�‰YðE&à
ðE&ð ðE&ð ð	E&ð
 ðE&ð ×
#Ñ
#ðE&ð ðE&ð 
õE&r   