+
    öÙ†jÃ&  ã                   óì   € R t ^ RIHtHt ^ RIHt ^ RIHt ^ RIt^ RI	H
t
Ht  ! R R]4      t ! R R	]4      tR
 R ltR tR tR tR tR tR tRR ltR tR R ltR tR R ltR R ltR R ltR# )z3Tools to analyze tasks running in asyncio programs.)ÚdefaultdictÚ
namedtuple)Úcount)ÚEnumN)ÚRemoteUnwinderÚ	FrameInfoc                   ó   € ] tR t^	t^t^tRtR# )ÚNodeType© N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú	COROUTINEÚTASKÚ__static_attributes__r
   ó    Ú$/usr/lib/python3.14/asyncio/tools.pyr	   r	   	   s   † Ø€IØ„Dr   r	   c                   óB   a a€ ] tR t^t oRtV3R lV 3R lltRtVtV ;t# )ÚCycleFoundExceptionz8Raised when there is a cycle when drawing the call tree.c                ó`   <€ V ^8„  d   QhRS[ S[ S[,          ,          RS[S[S[3,          RR/# )é   ÚcyclesÚid2nameÚreturnN)ÚlistÚintÚdictÚstr)ÚformatÚ__classdict__s   "€r   Ú__annotate__Ú CycleFoundException.__annotate__   s9   ø€ ÷ ñ á™™c�•Oðñ ™#™s˜(•^ðð ñ	r   c                ó>   <€ \         SV `  W4       Wn        W n        R # ©N)ÚsuperÚ__init__r   r   )Úselfr   r   Ú	__class__s   &&&€r   r&   ÚCycleFoundException.__init__   s   ø€ ô
 	‰Ñ˜Ô)ØŒØŽr   )r   r   )	r   r   r   r   Ú__doc__r&   r   Ú__classdictcell__Ú__classcell__)r(   r    s   @@r   r   r      s   ù‡ € ÙB÷÷ ó r   r   c                óF   € V ^8„  d   QhR\         \        ,          R\         /# )r   Úelemr   )r   r   )r   s   "r   r!   r!      s   € ÷ ñ œc¤)�mð ´ñ r   c                 óà   € \        V \        4      '       gX   V P                  ^ 8X  d   V P                  R8X  d   V P                   # V P                   RV P                   RV P                   2# V # )é    Ú Ú Ú:)Ú
isinstancer   ÚlinenoÚfilenameÚfuncname)r.   s   &r   Ú_format_stack_entryr8      sZ   € Ü�dœC× Ò Ø�;‰;˜!Ô §¡°Ô 3Ø—m‘m�_Ð%à—m‘m�_ A d§m¡m _°A°d·k±k°]ÐCÐCØ€Kr   c           	      ó  € / . / r2pV  Fí  pVP                    FÚ  pVP                  pVP                  pWqV&   VP                  '       d>   VP                   F-  pVP                  p	V	 U
u. uF  p
\        V
4      NK  	  pp
W³V&   K/  	  VP                   '       g   K‚  VP                    FH  pVP                  p	VP                  pV	 U
u. uF  p
\        V
4      NK  	  pp
VP                  WÍV34       KJ  	  KÜ  	  Kï  	  WV3# u up
i u up
i r$   )Ú
awaited_byÚtask_idÚ	task_nameÚcoroutine_stackÚ
call_stackr8   Úappend)Úresultr   ÚawaitsÚtask_stacksÚawaited_infoÚ	task_infor;   r<   Ú	coro_infor>   ÚframeÚinternal_stackÚparent_task_idÚstacks   &             r   Ú_indexrJ   %   s  € Ø#% r¨2�[€GÛˆØ%×0Ô0ˆIØ×'Ñ'ˆGØ!×+Ñ+ˆIØ(�GÑð ×(×(Ð(Ø!*×!:Ô!:�IØ!*×!5Ñ!5�JÙNXÓ%YÉjÀUÔ&9¸%Ö&@Éj�NÐ%YØ+9 Ó(ñ ";ð ×#×#Ò#Ø!*×!5Ô!5�IØ!*×!5Ñ!5�JØ%.×%8Ñ%8�NÙEOÓPÁZ¸EÔ0°Ö7ÁZ�EÐPØ—M‘M >¸'Ð"BÖCó	 "6ó 1ñ ð( ˜KÐ'Ð'ùò &Zùò Qs   Á'C=
ÃD
c                 óž  aaaa€ V P                  4        UUu/ uF  w  r4\        P                  V3VbK  	  uppo\        \        4      o\        \
        4      o\        ^4      oVVVV3R lpV Fl  w  rgp\        P                  V3p	\        V4       F  p
V! Wš4      p	K  	  \        P                  V3pVSV	,          9  g   KT  SV	,          P                  V4       Kn  	  V UUu0 uF  w  p qÆkK
  	  pppV  FE  pWí9  g   K  Wâ9   g   K  \        P                  V3p	\        W.,          4       F  p
V! Wš4      p	K  	  KG  	  SS3# u uppi u uppi )é   c                óÒ   <€ VSV ,          9   d   SV ,          V,          # \         P                  R\        S4       23pVSV&   SV ,          P                  V4       VSV ,          V&   V# )z:Get existing coroutine node or create new one under parentÚc)r	   r   Únextr?   )ÚparentrF   Únode_keyÚchildrenÚ	cor_nodesÚid2labelÚnext_cor_ids   && €€€€r   Úget_or_create_cor_nodeÚ+_build_tree.<locals>.get_or_create_cor_nodeD   sn   ø€ à�I˜fÕ%Ô%Ø˜VÕ$ UÕ+Ð+ä×&Ñ&¨!¬D°Ó,=Ð+>Ð(?Ð@ˆØ"ˆ�ÑØ�Õ×Ñ Ô)Ø#+ˆ	�&Õ˜%Ñ Øˆr   )	Úitemsr	   r   r   r   r   r   Úreversedr?   )r   rA   rB   ÚtidÚnamerV   Ú	parent_idrI   Úchild_idÚcurrF   Ú	child_keyÚ_Úawaiting_tasksr;   rR   rS   rT   rU   s   &&&            @@@@r   Ú_build_treerb   >   s-  û€ Ø<C¿M¹M¼OÔL¹O©y¨s”—‘ Ð$ dÒ*¹OÒL€HÜœ4Ó €HÜœDÓ!€IÜ˜“(€K÷	ð 	ó '-Ñ"ˆ	˜(Ü�}‰}˜iÐ(ˆÜ˜e–_ˆEÙ(¨Ó4ŠCñ %ô —]‘] HÐ-ˆ	Ø˜H S�MÖ)Ø�S�M× Ñ  Ö+ñ '-ñ 8>Ô>±v¡O I¨q°!’i±v€NÑ>ÛˆØÖ(¨WÖ-CÜ—=‘= 'Ð*ˆCÜ! +Õ"6Ö7�Ù,¨SÓ8’ó 8ñ ð �XÐÐùóE Mùó6 ?s   ˜EÃ#E	c                 óœ   € VP                  4        UUu0 uF  q" F  q3kK  	  K  	  pppV  Uu. uF  qUV9  g   K  VNK  	  up# u uppi u upi r$   )Úvalues)rT   rR   ÚkidsrN   Úall_childrenÚns   &&    r   Ú_rootsrh   d   sL   € Ø"*§/¡/Ô"3ÔBÑ"3˜$ºT¸’A¹T‘AÑ"3€LÑBÙÓ9‘x�!¨LÑ#8�AˆA‘xÑ9Ð9ùó CùÚ9s   ”A­A	ºA	c                ój   € \        \        4      pV  F  w  r#pW,          P                  V4       K  	  V# )u3   Return {parent_task_id: {child_task_id, â€¦}, â€¦}.)r   ÚsetÚadd)rA   Úgr\   Ú_stackr]   s   &    r   Ú_task_graphrn   i   s0   € ä”CÓ€AÛ'-Ñ#ˆ	˜8Ø	�×Ñ˜Ö"ñ (.à€Hr   c                óº   a aaaaaaa€ ^ ^^uooo\        V3R l4      o. . uooVVVVVVV V3R lo\        S 4       F  pSV,          S8X  g   K  S! V4       K  	  S# )z‹
Depth-first search for back-edges.

Returns a list of cycles (each cycle is a list of task-ids) or an
empty list if the graph is acyclic.
c                  ó   <€ S # r$   r
   )ÚWHITEs   €r   Ú<lambda>Ú_find_cycles.<locals>.<lambda>y   s   ø€ ¡r   c                 ó:  <€ SSV &   S
P                  V 4       S	P                  V R4       FX  pSV,          S8X  d   S! V4       K  SV,          S8X  g   K+  S
P                  V4      pSP                  S
VR  V.,           4       KZ  	  SSV &   S
P                  4        R # )Nr
   )r?   ÚgetÚindexÚpop)ÚvÚwÚiÚBLACKÚGREYrq   Úcolorr   ÚdfsÚgraphÚpaths   &  €€€€€€€€r   r~   Ú_find_cycles.<locals>.dfs|   s„   ø€ Øˆˆa‰Ø�‰�AŒØ—‘˜1˜bÖ!ˆAØ�Q�x˜5Ô Ù�A–Ø�q•˜TÖ!Ø—J‘J˜q“M�Ø—‘˜d 1 2˜h¨!¨�nÖ-ñ "ð ˆˆa‰Ø�‰Ž
r   )r   r   )	r   rx   r{   r|   rq   r}   r   r~   r€   s	   f @@@@@@@r   Ú_find_cyclesr‚   q   s^   ÿ€ ð ˜A˜qÐ€Eˆ4�ÜœÓ&€EØ�r€L€Dˆ&÷
ô 
ô �%Ž[ˆØ��8�uÖÙ�ŽFñ ð €Mr   c                 ó8   € \        V 4      pVP                  4       # r$   )r   Úget_all_awaited_by)ÚpidÚunwinders   & r   r„   r„   �   s   € Ü˜cÓ"€HØ×&Ñ&Ó(Ð(r   c                ó  aaa	a
aa€ \        V 4      w  r4p\        V4      p\        V4      pV'       d   \        Ws4      h\	        W4V4      w  o
o	VV
V3R loRV	VV3R llo\        S
S	4       Uu. uF  pS! V4      NK  	  up# u upi )z¿
Build a list of strings for pretty-print an async call tree.

The call tree is produced by `get_all_async_stacks()`, prefixing tasks
with `task_emoji` and coroutine frames with `cor_emoji`.
c                 ó`   <€ V ^ ,          \         P                  8X  d   SMSpV RSV ,           2# )r0   r2   )r	   r   )ÚnodeÚflagÚ	cor_emojiÚlabelsÚ
task_emojis   & €€€r   ÚprettyÚ build_async_tree.<locals>.pretty¢   s.   ø€ Ø! !�W¬¯©Ô5‰z¸9ˆØ��q˜ �˜Ð'Ð'r   c           	      ó  <€ Vf   . pTP                  T V'       d   RMR S	! V 4       24       Y'       d   RMR,           pSP                  V . 4      p\        V4       F"  w  rgS
! WtV\        V4      ^,
          8H  V4       K$  	  V# )Nu
   â””â”€â”€ u
   â”œâ”€â”€ z    u   â”‚   )r?   ru   Ú	enumerateÚlen)r‰   ÚprefixÚlastÚbufÚnew_prefre   rz   ÚkidrR   rŽ   Úrenders   &&&&    €€€r   r˜   Ú build_async_tree.<locals>.render¦   s{   ø€ ØŠ;ØˆCØ�
‰
�f�X¯d™l¸ÐEÁfÈTÃlÀ^ÐTÔUØ¦t™V°Õ:ˆØ�|‰|˜D "Ó%ˆÜ –o‰FˆAÙ�3 !¤s¨4£y°1¥}Ñ"4°cÖ:ñ &àˆ
r   )r1   TN)rJ   rn   r‚   r   rb   rh   )r@   r�   r‹   r   rA   rB   rl   r   ÚrootrR   rŒ   rŽ   r˜   s   &ff      @@@@r   Úbuild_async_treer›   ”   s{   ý€ ô $*¨&£>Ñ €G�[Ü�FÓ€AÜ˜!‹_€FßÜ! &Ó2Ð2Ü" 7°KÓ@Ñ€FˆH÷(÷ñ ô &,¨F°HÔ%=Ó>Ñ%=˜T‰F�4ŽLÑ%=Ñ>Ð>ùÒ>s   Á-Bc                 óN  € \        V 4      w  p p. pV  EF�  pVP                  pVP                   EF`  pVP                  pVP                  pVP
                   U	U
u. uF  p	V	P                   F  p
V
NK  	  K  	  pp	p
R P                  R V 4       4      pVP                  '       g#   VP                  V\        V4      WŒRRR.4       K˜  VP                   F¸  pVP                  pVP                   Uu. uF$  p\        V4      P                  R4      ^ ,          NK&  	  ppR P                  V4      pVP                  VR4      p\        V\        4      '       d   \        V4      M
\        V4      pVP                  V\        V4      WŒVVV.4       Kº  	  EKc  	  EK„  	  V# u up
p	i u upi )z -> c              3   ód   "  € T F&  p\        V4      P                  R 4      ^ ,          x € K(  	  R# 5i)r2   N)r8   Úsplit)Ú.0Úxs   & r   Ú	<genexpr>Ú#build_task_table.<locals>.<genexpr>Á   s/   é € ð %4Ù,2 qô &9¸Ó%;×%AÑ%AÀ#Ó%FÀq×%IÒ%IÛ,2ùs   ‚.0r1   Ú0x0r2   ÚUnknown)rJ   Ú	thread_idr:   r;   r<   r=   r>   Újoinr?   Úhexr8   rž   ru   r4   r   r   )r@   r   r`   ÚtablerC   r¥   rD   r;   r<   ÚcororF   ÚframesÚ
coro_stackrE   r\   r    Úawaiter_framesÚawaiter_chainÚawaiter_nameÚparent_id_strs   &                   r   Úbuild_task_tabler°   ³   s¥  € Ü˜6“N�M€GˆQ�Ø€EäˆØ ×*Ñ*ˆ	Ø%×0Õ0ˆIà×'Ñ'ˆGØ!×+Ñ+ˆIð )2×(AÒ(Aô 3Ñ(A Ø"&§/¤/˜ó Ù"1ñ Ñ(AˆFñ 3àŸ™ñ %4Ù,2ó%4ó 4ˆJð ×'×'Ð'Ø—‘˜i¬¨W«°yØ  Eð+ô ,áð '×1Ô1�	Ø%×/Ñ/�	à)2×)=Ò)=ó"?Ù)= Aô #6°aÓ"8×">Ñ">¸sÓ"CÀA×"FÐ"FÙ)=ð ð "?à &§¡¨NÓ ;�Ø&Ÿ{™{¨9°iÓ@�Ü3=¸iÌ×3MÒ3M¤ Y¤Ü$'¨	£Nð ð —‘˜i¬¨W«°yØ)¨<¸ðHö Iô 2ô% 1ñ ð@ €Lùó13ùò"?s   ÁF
Ã1*F"
c                ó$   € V ^8„  d   QhR\         /# )r   Ú	exception)r   )r   s   "r   r!   r!   Ù   s   € ÷ 3ñ 3Ô&9ñ 3r   c                 ó  a € \        R \        P                  R7       \        R\        P                  R7       S P                   F<  pRP	                  V 3R lV 4       4      p\        RV 2\        P                  R7       K>  	  R# )z9ERROR: await-graph contains cycles - cannot print a tree!)Úfiler1   u    â†’ c              3   ón   <"  € T F*  pSP                   P                  V\        V4      4      x € K,  	  R # 5ir$   )r   ru   r§   )rŸ   rZ   r²   s   & €r   r¡   Ú)_print_cycle_exception.<locals>.<genexpr>Ý   s+   øé € ÐPÉaÀs˜i×/Ñ/×3Ñ3°C¼¸S»×BÐBËaùs   ƒ25zcycle: N)ÚprintÚsysÚstderrr   r¦   )r²   rN   Úinamess   f  r   Ú_print_cycle_exceptionr»   Ù   sY   ø€ Ü	Ð
EÌCÏJÉJÕWÜ	ˆ"”3—:‘:ÕØ×ÔˆØ—‘ÔPÉaÓPÓPˆÜ�˜�xÐ ¤s§z¡z×2ó r   c                 óH   € \        R4       \        P                  ! ^4       R# )z¿
Prints a message pointing to platform-specific permission help text and exits the program.
This function is called when a PermissionError is encountered while trying
to attach to a process.
zúError: The specified process cannot be attached to due to insufficient permissions.
See the Python documentation for details on required privileges and troubleshooting:
https://docs.python.org/3.14/howto/remote_debugging.html#permission-requirements
N)r·   r¸   Úexitr
   r   r   Úexit_with_permission_help_textr¾   á   s   € ô 
ð	]ôô
 ‡H‚HˆQ†Kr   c                ó0   € V ^8„  d   QhR\         R\        /# )r   r…   r   )r   r   )r   s   "r   r!   r!   ï   s   € ÷ 	)ñ 	)œsð 	)¤tñ 	)r   c                 ó  €  \        V 4      #   \         dL   pTP                  e   TP                  pK  \        RT 24       \        P
                  ! ^4        R p?R # R p?i\         d   p\        4         R p?R # R p?ii ; i)NzError retrieving tasks: )r„   ÚRuntimeErrorÚ__context__r·   r¸   r½   ÚPermissionErrorr¾   )r…   Úes   & r   Ú_get_awaited_by_tasksrÅ   ï   sd   € ð)Ü! #Ó&Ð&øÜô Ø�m‰mÒ'Ø—‘ŠAÜÐ(¨¨Ð,Ô-Ü�Š��ŠûÜô )Ü&×(Ò(ûð)ús'   ‚
 �B˜A AÁBÁ+BÁ,
A<Á<Bc                ó(   € V ^8„  d   QhR\         RR/# ©r   r…   r   N©r   )r   s   "r   r!   r!   û   s   € ÷ mñ m¬ð m°ñ mr   c                óT  € \        V 4      p\        V4      p\        RR RRR RRR RRR RR	R RR
R RRR 24       \        R4       V FZ  p\        V^ ,          R RV^,          R RV^,          R RV^,          R RV^,          R RV^,          R RV^,          R 24       K\  	  R# )z9Build and print a table of all pending tasks under `pid`.rZ   z<10r2   ztask idz<20z	task namezcoroutine stackz<50zawaiter chainzawaiter namez<15z
awaiter idNz´------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------)rÅ   r°   r·   )r…   Útasksr¨   Úrows   &   r   Údisplay_awaited_by_tasks_tablerÌ   û   sò   € ô " #Ó&€EÜ˜UÓ#€Eä	Ø�ˆ+�Q�y �o Q {°3Ð&7°qÐ9JÈ3Ð8OÈqÐQ`ÐadÐPeÐefÐguÐvyÐfzÐz{ð  }Ið  JMð  |Nð  	Oôô 
ˆ)ÔÛˆÜ��Q•˜�˜A˜c !�f S˜\¨¨3¨q­6°#¨,°a¸¸A½¸s°|À1ÀSÈÅVÈCÀLÐPQÐRUÐVWÕRXÐY\ÐQ]Ð]^Ð_bÐcdÕ_eÐfiÐ^jÐkÖló r   c                ó(   € V ^8„  d   QhR\         RR/# rÇ   rÈ   )r   s   "r   r!   r!   	  s   € ÷ ñ ¤sð ¨tñ r   c                óì   € \        V 4      p \        V4      pX F  p\        RP                  V4      4       K  	  R#   \         d,   p\        T4       \        P
                  ! ^4        Rp?LVRp?ii ; i)z8Build and print a tree of all pending tasks under `pid`.NÚ
)rÅ   r›   r   r»   r¸   r½   r·   r¦   )r…   rÊ   r@   rÄ   Útrees   &    r   Údisplay_awaited_by_tasks_treerÑ   	  s`   € ô " #Ó&€EðÜ! %Ó(ˆó
 ˆÜˆd�i‰i˜‹oÖó øô	 ô Ü˜qÔ!Ü�Š��‰ûðús   �= ½A3Á!A.Á.A3)z(T)r1   )r*   Úcollectionsr   r   Ú	itertoolsr   Úenumr   r¸   Ú_remote_debuggingr   r   r	   Ú	Exceptionr   r8   rJ   rb   rh   rn   r‚   r„   r›   r°   r»   r¾   rÅ   rÌ   rÑ   r
   r   r   Ú<module>r×      sx   ðÙ 9ç /Ý Ý Û 
ß 7ôˆtô ô
	˜)ô 	õò(ò2#òL:ò
òò<)ô
?ò>$õL3òõ	)õm÷r   