ó
    Ñ]jé½  ã                   óÔ  • 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rSSKrSSK	J
r
  SSKJr  SSKJrJrJrJr  SSK	Jr  SSK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KJrJr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*J+r+J,r,J-r-J.r.J/r/J0r0J1r1J2r2  Sr3Sr4 " S S\*5      r5\6" 5       r7Sr8 " S S\*5      r9 " S S\9\55      r: " S S\:5      r; " S S\:5      r< " S S \55      r=g)!aT  
Verbose and colourful traceback formatting.

**ColorTB**

I've always found it a bit hard to visually parse tracebacks in Python.  The
ColorTB class is a solution to that problem.  It colors the different parts of a
traceback in a manner similar to what you would expect from a syntax-highlighting
text editor.

Installation instructions for ColorTB::

    import sys,ultratb
    sys.excepthook = ultratb.ColorTB()

**VerboseTB**

I've also included a port of Ka-Ping Yee's "cgitb.py" that produces all kinds
of useful info when a traceback occurs.  Ping originally had it spit out HTML
and intended it for CGI programmers, but why should they have all the fun?  I
altered it to spit out colored text to the terminal.  It's a bit overwhelming,
but kind of neat, and maybe useful for long-running programs that you believe
are bug-free.  If a crash *does* occur in that type of program you want details.
Give it a shot--you'll love it or you'll hate it.

.. note::

  The Verbose mode prints the variables currently visible where the exception
  happened (shortening their strings if too long). This can potentially be
  very slow, if you happen to have a huge data structure whose string
  representation is complex to compute. Your computer may appear to freeze for
  a while with cpu usage at 100%. If this occurs, you can cancel the traceback
  with Ctrl-C (maybe hitting it more than once).

  If you encounter this kind of situation often, you may want to use the
  Verbose_novars mode instead of the regular Verbose, which avoids formatting
  variables (but otherwise includes the information and context given by
  Verbose).

.. note::

  The verbose mode print all variables in the stack, which means it can
  potentially leak sensitive information like access keys, or unencrypted
  password.

Installation instructions for VerboseTB::

    import sys,ultratb
    sys.excepthook = ultratb.VerboseTB()

Note:  Much of the code in this module was lifted verbatim from the standard
library module 'traceback.py' and Ka-Ping Yee's 'cgitb.py'.


Inheritance diagram:

.. inheritance-diagram:: IPython.core.ultratb
   :parts: 3
é    N)ÚSequence)ÚTracebackType)ÚAnyÚListÚOptionalÚTuple)ÚCallable)ÚTerminal256Formatter)ÚToken)Úget_ipython)Úpath)Ú	py3compat)ÚParserÚThemeÚTokenStreamÚtheme_table)Úget_terminal_sizeé   )ÚDisplayTrap)ÚDocTB)
Ú	FrameInfoÚTBToolsÚ_format_traceback_linesÚ_safe_stringÚ_simple_format_traceback_linesÚ_tokens_filenameÚeqreprÚget_line_number_of_frameÚnullreprÚ	text_repré   i'  c                   ó:  • \ rS rSrSrS\\   S\S-  S\S-  SS4S jrS	\S-  S\	R                  S-  4S
 jr   SS\S\\   S\\   S\\   S\S\\   4S jjrS\\   S\\   4S jrS\\   S\S-  S\\   4S jrS rS\S-  S\S-  SS4S jrS\S\4S jrSrg)ÚListTBét   a:  Print traceback information from a traceback list, with optional color.

Calling requires 3 arguments: (etype, evalue, elist)
as would be obtained by::

  etype, evalue, tb = sys.exc_info()
  if tb:
    elist = traceback.extract_tb(tb)
  else:
    elist = None

It can thus be used by programs which need to process the traceback before
printing (such as console replacements based on the code module from the
standard library).

Because they are meant to be called without a full traceback (only a
list), instances of this class can't call the interactive pdb debugger.ÚetypeÚevalueNÚetbÚreturnc                 óÄ   • U R                   R                  5         U R                   R                  U R                  XU5      5        U R                   R                  S5        g ©NÚ
)ÚostreamÚflushÚwriteÚtext©Úselfr%   r&   r'   s       ÚQ/home/mande/repo/quber/.venv/lib/python3.13/site-packages/IPython/core/ultratb.pyÚ__call__ÚListTB.__call__‡   sC   € ð 	�‰×ÑÔØ�‰×Ñ˜4Ÿ9™9 U°CÓ8Ô9Ø�‰×Ñ˜4Õ ó    Útbc                 ó>   • U(       a  [         R                  " U5      $ g ©N)Ú	tracebackÚ
extract_tb)r1   r6   s     r2   Ú_extract_tbÚListTB._extract_tb‘   s   € ÞÜ×'Ò'¨Ó+Ð+àr5   Ú	tb_offsetÚcontextc           
      óÈ  • [        U[        5      (       a  Uu  p6O
[        5       n[        U[        5      (       a  UnOUb  U R	                  U5      nO/ nUc  U R
                  OUn[        U[        5      (       d   e/ nU(       a˜  U(       a  [        U5      U:”  a  XtS nUR                  [        U R                     R                  [        S4[        S4[        R                  S4[        S4[        S4/5      5        UR                  U R                  U5      5        SR!                  U R#                  X5      5      n	UR                  U	5        Ub‘  U R%                  U5      n
U
(       ay  ['        U
S   5      U;  ag  Ub  U R)                  UR*                  5      S	   OS/nU
u  pnUR-                  ['        U
S   5      5        S	nU R/                  UUX64UU5      nUnXÞ-   U-   nU$ )
aU  Return a color formatted string with the traceback info.

Parameters
----------
etype : exception type
    Type of the exception raised.
evalue : object
    Data stored in the exception
etb : list | TracebackType | None
    If list: List of frames, see class docstring for details.
    If Traceback: Traceback of the exception.
tb_offset : int, optional
    Number of frames in the traceback to skip.  If not given, the
    instance evalue is used (set in constructor).
context : int, optional
    Number of lines of context information to print.

Returns
-------
String with formatted exception.
NÚ	TracebackÚ z(most recent call last)Ú:r+   Ú r   r   )Ú
isinstanceÚtupleÚsetÚlistr;   r=   ÚintÚlenÚappendr   Ú_theme_nameÚformatr   ÚNormalEmÚextendÚ_format_listÚjoinÚ_format_exception_onlyÚget_parts_of_chained_exceptionÚidÚ!prepare_chained_exception_messageÚ	__cause__ÚaddÚstructured_traceback)r1   r%   r&   r'   r=   r>   Úchained_exc_idsÚelistÚout_listÚlinesÚ	exceptionÚchained_exception_messageÚchained_exceptions_tb_offsetÚol1Úol2s                  r2   rW   ÚListTB.structured_traceback—   sÝ  € ô> �cœ5×!Ñ!Ø#&Ñ ˆC�ä!›eˆOä�cœ4× Ñ Ø‰EØ‰_Ø×$Ñ$ SÓ)‰EàˆEØ&/Ñ&7�D—N’N¸Yˆ	Ü˜)¤S×)Ñ)Ð)Ð)Ø ˆÞÞœS ›Z¨)Ó3Ø˜jÐ)�à�O‰OÜ˜D×,Ñ,Ñ-×4Ñ4ä Ð,Ü ˜ÜŸ™Ð)BÐCÜ ˜Ü ˜ðóô
ð �O‰O˜D×-Ñ-¨eÓ4Ô5à—‘˜×3Ñ3°EÓBÓCˆØ�‰˜Ôð ‰?Ø×;Ñ;¸FÓCˆIæœb ¨1¡Ó.°oÓEð Ñ)ð ×:Ñ:¸6×;KÑ;KÓLÈQÒOà˜ð *ð
 &/Ñ"�˜sà×#Ñ#¤B y°¡|Ó$4Ô5Ø/0Ð,Ø×/Ñ/ØØØÐ*Ø0Øó�ð 0�à™9 xÑ/�àˆr5   Úextracted_listc           
      óÔ  • / n[        U5       GHÕ  u  nu  pEpgU[        U5      S-
  :X  a  SOSn[        U R                     R	                  U(       a  [
        R                  O[
        R                  S4/[        X„US9-   5      n	US:w  a‰  U	[        U R                     R	                  U(       a  [
        R                  O[
        R                  S4U(       a  [
        R                  R                  O[
        R                  R                  U4/5      -  n	U	[        U R                     R	                  U(       a  [
        R                  O[
        S4/5      -  n	U(       av  U	[        U R                     R	                  U(       a  [
        R                  O[
        S	4U(       a  [
        R                  O[
        UR                  5       4[
        S4/5      -  n	UR                  U	5        GMØ     U$ )
aÀ  Format a list of traceback entry tuples for printing.

Given a list of tuples as returned by extract_tb() or
extract_stack(), return a list of strings ready for printing.
Each string in the resulting list corresponds to the item with the
same index in the argument list.  Each string ends in a newline;
the strings may contain internal newlines as well, for those items
whose source text line is not None.

Lifted almost verbatim from traceback.py
r   TFú  ©Úlinenoú<module>z in r+   ú    )Ú	enumeraterI   r   rK   rL   r   rM   ÚNormalr   ÚTBÚNameEmÚNameÚLineÚstriprJ   )
r1   rb   Úoutput_listÚindÚfilenamerf   ÚnameÚlineÚemÚitems
             r2   rO   ÚListTB._format_listó   s†  € ð ˆÜ3<¸^×3LÑ/ˆCÑ/�( Dà¤ NÓ 3°aÑ 7Ó7‘¸UˆBä˜t×/Ñ/Ñ0×7Ñ7Þ$&”%—.’.¬E¯L©L¸$Ð?Ð@Ü" 2¸Ñ?ñ@óˆDð �zÓ!Øœ D×$4Ñ$4Ñ5×<Ñ<æ+-œŸš´5·<±<ÀÐHÞ,.œŸ™Ÿš´E·H±H·M±MÀ4ÐHðóñ �ð ”K × 0Ñ 0Ñ1×8Ñ8Þ$&”%—.’.¬E°4Ð8Ð9óñ ˆDö Øœ D×$4Ñ$4Ñ5×<Ñ<æ')œŸš¬u°fÐ=Þ')œŸš¬u°d·j±j³lÐCÜ ˜ðóñ �ð ×Ñ˜t×$ñ; 4Mð> Ðr5   Úvaluec                 ó²  • Sn/ n[         R                  UR                  4/n[        U R                     R                  U5      nUc  UR                  US-   5        GOŠ[        U[        5      (       GaÊ  [        US5      (       d   e[        US5      (       d   e[        US5      (       d   e[        US5      (       d   e[        US5      (       d   eS	nUR                  (       d  S
Ul
        UR                  (       a8  UR                  n[        R                  " UR                  UR                  5      nOSnSnUR                  [        U R                     R                  [         S4/[        S	UR                  US:X  a  SOUS9-   [         S4/-   5      5        US:X  a=  UR                  c  SnO-[!        UR                  ["        5      (       d   eUR                  nUGbP  Sn	U	[%        U5      :  aD  X‰   R'                  5       (       a-  U	S-  n	U	[%        U5      :  a  X‰   R'                  5       (       a  M-  UR                  [        U R                     R                  [         R(                  S4[         R(                  UR+                  5       4[         S4/5      5        UR,                  b†  Sn
X‰UR,                  S-
    H#  nUR'                  5       (       a  X«-  n
M  U
S-  n
M%     UR                  [        U R                     R                  [         R.                  U
S-   4[         S4/5      5        UR0                  n
OU R3                  U5      n
U
(       a[  UR                  [        U R                     R                  U[         R                  S4[         S4[         U
4[         S4/-   5      5        OUR                  SU-  5        UR5                  S [7        US/ 5       5       5        U(       ai  [9        5       nUb\  Uc   e[        US5      (       d   e[        US5      (       d   eUR:                  R=                  UR                  UR                  S5        U$ )a  Format the exception part of a traceback.

The arguments are the exception type and value such as given by
sys.exc_info()[:2]. The return value is a list of strings, each ending
in a newline.  Normally, the list contains a single string; however,
for SyntaxError exceptions, it contains several lines that (when
printed) display detailed information about where the syntax error
occurred.  The message indicating which exception occurred is the
always last string in the list.

Also lifted nearly verbatim from traceback.py
FNr+   rr   rf   r/   ÚoffsetÚmsgTz<string>ÚunknownrC   rd   re   r   r   rh   rA   Ú^rB   z%s
c              3   ó*   #   • U  H	  o S 3v •  M     g7f)r+   N© )Ú.0Úxs     r2   Ú	<genexpr>Ú0ListTB._format_exception_only.<locals>.<genexpr>ˆ  s   é € ÐQÒ1P¨A  B�xÒ1Pùs   ‚Ú	__notes__)r   ÚExcNameÚ__name__r   rK   rL   rJ   Ú
issubclassÚSyntaxErrorÚhasattrrr   rf   Ú	linecacheÚgetliner   r/   rD   ÚstrrI   Úisspacern   ro   rz   ÚCaretr{   Ú	_some_strrN   Úgetattrr   ÚhooksÚsynchronize_with_editor)r1   r%   rx   Úhave_filedatarp   Ústype_tokensÚstyperf   ÚtextlineÚiÚsÚcÚipinsts                r2   rQ   ÚListTB._format_exception_only"  sÙ  € ð ˆØˆÜŸ™¨¯©Ð7Ð8ˆÜ  ×!1Ñ!1Ñ2×9Ñ9¸,ÓGˆØ‰=à×Ñ˜u t™|Ö,ä˜%¤×-Ò-Ü˜u j×1Ñ1Ð1Ð1Ü˜u h×/Ñ/Ð/Ð/Ü˜u f×-Ñ-Ð-Ð-Ü˜u h×/Ñ/Ð/Ð/Ü˜u e×,Ñ,Ð,Ð,Ø $�Ø—~—~Ø%/�E”NØ—<—<Ø"Ÿ\™\�FÜ(×0Ò0°·±ÀÇÁÓN‘Hà&�FØ!�HØ×"Ñ"Ü × 0Ñ 0Ñ1×8Ñ8Ü ˜˜Ü*Ø Ø!ŸN™NØ,2°iÓ,?¡DÀVññô " 4˜=˜/ñ*óô
ð ˜r“>ð —z‘zÑ)Ø#%™ä)¨%¯*©*´c×:Ñ:Ð:Ð:Ø#(§:¡:˜àÒ'Ø�AØœc (›mÓ+°±×0CÑ0C×0EÑ0EØ˜Q™˜ð œc (›mÓ+°±×0CÑ0C×0EÓ0Eà×&Ñ&Ü# D×$4Ñ$4Ñ5×<Ñ<ä!&§¡¨VÐ 4Ü!&§¡¨X¯^©^Ó-=Ð >Ü!&¨ ðóôð —|‘|Ñ/Ø"˜Ø!)¨e¯l©l¸QÑ.>Ó!?˜AØ Ÿy™yŸ{™{Ø !¡¢à ! S¡¢ñ	 "@ð
 $×*Ñ*Ü'¨×(8Ñ(8Ñ9×@Ñ@Ü"'§+¡+¨q°3©wÐ!7¼%À¸Ð Góôð
 —I‘I‘à—N‘N 5Ó)�ÞØ×"Ñ"Ü × 0Ñ 0Ñ1×8Ñ8Ø$ä"Ÿ]™]¨CÐ0Ü" C˜LÜ" A˜JÜ" D˜Mð	ñóõ
ð ×"Ñ" 6¨E¡>Ô2ð ×ÑÑQ´¸ÀÈRÔ1PÓQÔQö Ü “]ˆFØÑ!ØÑ(Ð(Ð(Ü˜u h×/Ñ/Ð/Ð/Ü˜u j×1Ñ1Ð1Ð1Ø—‘×4Ñ4°U·^±^ÀUÇ\Á\ÐSTÔUàÐr5   c                 ó.   • [         R                  XU5      $ )z†Only print the exception type and message, without a traceback.

Parameters
----------
etype : exception type
value : exception value
)r#   rW   )r1   r%   rx   s      r2   Úget_exception_onlyÚListTB.get_exception_only•  s   € ô ×*Ñ*¨4¸Ó>Ð>r5   c                 óº   • U R                   nUR                  5         UR                  SR                  U R	                  X5      5      5        UR                  5         g)z‡Only print the exception type and message, without a traceback.

Parameters
----------
etype : exception type
evalue : exception value
r+   N)r,   r-   r.   rP   r�   )r1   r%   r&   r,   s       r2   Úshow_exception_onlyÚListTB.show_exception_onlyŸ  s?   € ð —,‘,ˆØ�‰ŒØ�‰�d—i‘i × 7Ñ 7¸Ó FÓGÔHØ�‰�r5   c                 óX   •  [        U5      $ !   S[        U5      R                  -  s $ = f)Nz<unprintable %s object>)rŒ   Útyper†   )r1   rx   s     r2   r�   ÚListTB._some_str°  s/   € ð	DÜ�u“:Ðøð	DØ,¬t°E«{×/CÑ/CÑCÒCús   ‚
 �)r   ©NNé   )r†   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r£   ÚBaseExceptionr   r3   r9   ÚStackSummaryr;   r   rH   rG   rŒ   rW   r   rO   rQ   r�   r    r�   Ú__static_attributes__r   r5   r2   r#   r#   t   sX  † ñOð$!à�MÑ"ð!ð  Ñ$ð!ð ˜TÑ!ð	!ð
 
ô!ð˜m¨dÑ2ð °y×7MÑ7MÐPTÑ7Tô ð (,Ø#'ØñZàðZð ˜Ñ'ðZð �mÑ$ð	Zð
 ˜C‘=ðZð ðZð 
ˆc‰õZðx-¨4°©9ð -¸¸c¹ô -ð^qØ˜-Ñ(ðqØ1>ÀÑ1Eðqà	ˆc‰ôqòf?ðØ" TÑ)ðØ3@À4Ñ3Gðà	ôð"D˜sð D s÷ Dr5   r#   Údefaultc                   ó”  ^ • \ rS rSr% SrSrSr\\S'   \	SSSSS	SS4\
S
.S\S\S\S\S\S\S\/ S4   S-  S\S-  S\4U 4S jjjjrS\S\4S jrS'S\S\S\4S jjrS rS\S\\   S\\   S\S\\   S\\\      4S jrS\S\S\S\4S  jr   S(S\S\\   S\\   S\\   S\S\\   4S! jjrS'S"\SS4S# jjrS)S$ jrS*S% jrS&rU =r $ )+Ú	VerboseTBi½  a+  A port of Ka-Ping Yee's cgitb.py module that outputs color text instead
of HTML.  Requires inspect and pydoc.  Crazy, man.

Modified version which optionally strips the topmost entries from the
traceback, to be used with alternate interpreters (because their own code
would appear in the traceback).zbg:ansiyellowr®   Ú_modeFNr   T)Úcolor_schemeÚ
theme_nameÚcall_pdbr,   r=   Úlong_headerÚinclude_varsÚcheck_cacheÚdebugger_clsr²   c	                ó¬  >• U	[         Lae  [        U	[        5      (       d   eU	R                  5       n[        R
                  " SS[        S9  U[        :w  a  [        R
                  " SS[        S9  U[        :X  a  Sn[        U[        5      (       d   e[        T
U ]%  UUUUS9  X@l
        XPl        X`l        Uc  [        R                  nXpl        SU l        g)	a7  Specify traceback offset, headers and color scheme.

Define how many frames to drop from the tracebacks. Calling it with
tb_offset=1 allows use of this handler in interpreters which will have
their own code at the top of the traceback (VerboseTB will first
remove that frame before printing the traceback info).z¸color_scheme is deprecated as of IPython 9.0 and replaced by theme_name (which should be lowercase). As you passed a color_scheme value I will try to see if I have corresponding theme.é   )Ú
stacklevelÚcategoryz‡You passed both `theme_name` and `color_scheme` (deprecated) to VerboseTB constructor. `theme_name` will be ignored for the time being.Úlinux)r³   r´   r,   r¸   NT)Ú	_sentinelrD   rŒ   ÚlowerÚwarningsÚwarnÚDeprecationWarningÚ_defaultÚsuperÚ__init__r=   rµ   r¶   rŠ   Ú
checkcacher·   Úskip_hidden)r1   r³   r´   r,   r=   rµ   r¶   r·   r¸   r²   Ú	__class__s             €r2   rÅ   ÚVerboseTB.__init__Ê  sÞ   ø€ ð( œyÒ(Ü˜l¬C×0Ñ0Ð0Ð0Ø%×+Ñ+Ó-ˆJä�MŠMðð Ü+òð œXÓ%Ü—’ð5ð  !Ü/òð œÓ!Ø ˆJä˜*¤c×*Ñ*Ð*Ð*Ü‰ÑØ!ØØØ%ð	 	ñ 	
ð #ŒØ&ÔØ(Ôð ÑÜ#×.Ñ.ˆKØ&ÔàˆÕr5   Ú
frame_infor(   c           
      óú
  • [        U[        5      (       d   e[        UR                  [        R                  5      (       aN  [
        U R                     R                  [        S4[        R                  SUR                  -  4[        S4/5      $ S[        -  n[        UR                  [        5      (       d   e[        R                  " UR                   5      u  p4pVUR"                  b  UR"                  R%                  5       nODUR&                  b5  [)        UR&                  SS5      =(       d    UR&                  R*                  nOSnUS:X  a  S	nO–U R,                  (       a  [.        O[0        n	 [        R2                  " X4XVU	S
9n
[        U
[4        5      (       d   e[
        U R                     R                  [        S4[        R6                  U4[        R8                  U
4/5      n/ nU R,                  (       at   UR<                  nU Ha  nUR?                  [        UR@                  4[        S4[        R8                  S4[        R8                  [C        URD                  5      4/5        Mc     UR                  GcÏ  URH                  c   e[K        SURH                  UR                  S9[        U(       a  SOS	4[        U4[        S4/-   n[M        U R                  S9RN                  n[        UR&                  [P        RR                  5      (       d   eUR&                  RT                  nUR                  nURV                  nUU-
  nURX                  c   eUURX                  :¼  a5  [[        UURX                  -
  S5      nUURX                  -   nURX                  nOSnUURX                  -   nUUU n/ nU H.  nU" US5      u  nnUc   S5       eUR?                  UUU445        M0     []        UUUU[
        U R                     S9n[
        U R                     R                  U5      n[
        U R                     R                  UU-   5      $ [
        U R                     R                  [K        SURH                  UR                  S95      nUU(       a  SOS	-  nUU S3-  nU[
        U R                     R                  [_        UR`                  [
        U R                     U Rb                  U5      5      -  nU$ ! [:         aO    [
        U R                     R                  [        S4[        R6                  U4[        R8                  S4/5      n GNif = f! [F         a    UR?                  [        S4/5         GNf = f)zFormat a single stack framerh   z![... skipping similar frames: %s]r+   rA   NÚco_qualnameÚ?rg   rC   )Úformatvaluezin z"(***failed resolving arguments***)z= z<Exception trying to inspect frame. No more locals available.Tre   z, ©r³   r   rŒ   z(format2 should return str when out='str')Útheme)2rD   r   Ú_sdÚ
stack_dataÚRepeatedFramesr   rK   rL   r   r…   ÚdescriptionÚINDENT_SIZErf   rH   ÚinspectÚgetargvaluesÚframeÚ	executingÚcode_qualnameÚcoder�   Úco_namer¶   r   r   ÚformatargvaluesrŒ   ÚVNameÚValEmÚKeyErrorÚvariables_in_executing_piecerJ   rs   Úreprrx   Ú	Exceptionrr   r   r   Úformat2ÚtypesÚCodeTypeÚco_firstlinenoÚ	raw_linesr>   Úmaxr   r   r[   Ú
has_colors)r1   rÊ   ÚindentÚargsÚvarargsÚvarkwÚlocals_ÚfuncÚcallÚvar_reprÚscopeÚ
lvals_toksÚfibpÚvarÚlevel_tokensÚ_line_formatÚ
first_lineÚcurrent_linerè   ÚindexÚstartÚstopÚraw_color_errr˜   Ú	formattedÚis_errorÚ	tb_tokensÚ	_tb_linesÚresults                                r2   Úformat_recordÚVerboseTB.format_record
  s  € ä˜*¤i×0Ñ0Ð0Ð0ä�j—n‘n¤j×&?Ñ&?×@Ñ@Ü˜t×/Ñ/Ñ0×7Ñ7ä˜F�OäŸ™Ø;¸j×>TÑ>TÑTðô ˜D�Mðó	ð 	ð œKÑ'ˆä˜*×+Ñ+¬S×1Ñ1Ð1Ð1Ü(/×(<Ò(<¸Z×=MÑ=MÓ(NÑ%ˆ�uà×ÑÑ+Ø×'Ñ'×5Ñ5Ó7‰DØ�_‰_Ñ(ä˜
Ÿ™¨¸Ó=×XÀÇÁ×AXÑAXñ ð ˆDØ�:ÓØ‰Dð "&×!2×!2•v¼ˆHðÜ×/Ò/Ø 5¸xñ�ô " %¬×-Ñ-Ð-Ð-Ü" 4×#3Ñ#3Ñ4×;Ñ;Ü˜U�^¤e§k¡k°4Ð%8¼5¿;¹;ÈÐ:NÐOó�ð8 )+ˆ
Ø××ðð "×>Ñ>�Û�CØ×%Ñ%ä" C§H¡HÐ-Ü" C˜LÜ"Ÿ[™[¨$Ð/Ü"Ÿ[™[¬$¨s¯y©y«/Ð:ð	öñ  ð& �>‰>Ò!à×&Ñ&Ñ2Ð2Ð2ä   z×':Ñ':À:×CTÑCTÑUä¦D™D¨bÐ1Ü˜D�MÜ˜D�Mðñð ô "¨T×-=Ñ-=Ñ>×FÑFˆLÜ˜jŸo™o¬u¯~©~×>Ñ>Ð>Ð>Ø(Ÿo™o×<Ñ<ˆJØ *× 1Ñ 1ˆLØ#-×#7Ñ#7ˆIØ%¨
Ñ2ˆEØ×%Ñ%Ñ1Ð1Ð1Ø˜
×*Ñ*Ó*Ü˜E J×$6Ñ$6Ñ6¸Ó:�Ø˜z×1Ñ1Ñ1�Ø"×*Ñ*‘à�Ø˜z×1Ñ1Ñ1�Ø! %¨Ð-ˆIð ˆMÛ�Ù&2°1°eÓ&<Ñ#�	˜8Ø Ñ,ÐXÐ.XÓXÐ,Ø×$Ñ$ a¨)°XÐ)>Ð%?Ö@ñ ô
 7ØØØØÜ! $×"2Ñ"2Ñ3ñˆIô )¨×)9Ñ)9Ñ:×AÑAÀ)ÓLˆIä˜t×/Ñ/Ñ0×7Ñ7¸ÀyÑ8PÓQÐQä  ×!1Ñ!1Ñ2×9Ñ9Ü   z×':Ñ':À:×CTÑCTÑUóˆFð žd‘d¨Ñ*ˆFØ˜˜˜b�kÑ!ˆFØ”k $×"2Ñ"2Ñ3×:Ñ:Ü'Ø×$Ñ$Ü × 0Ñ 0Ñ1Ø—O‘OØó	óñ ˆFð ˆMøô[ ó ô" # 4×#3Ñ#3Ñ4×;Ñ;ä ˜ÜŸ™ dÐ+ÜŸ™Ð&JÐKðó“ð#ûôP ó Ø×!Ñ!ô "ØZðð÷ðús'   Å/A8S8 Ç;A3U Ó8AUÕUÕ"U:Õ9U:r%   Úlong_versionc                 ó  • [        S[        5       S   5      nU(       Ga  S[        R                  R	                  5       S   -   S-   [        R
                  -   n[        R                  " [        R                  " 5       5      n[        U R                     nUR                  [        R                  UR                  S   U-  4[        S4[        R                  U4[        SU[        U5      -
  [        U5      -
  -  4[        U4[        S4[        UR!                  U5      4/5      nUS-  nU$ [        U R                     R                  [        R                  U4[        S	R!                  U[        U5      -
  5      4/5      nU$ )
NéK   r   zPython ú: Útop_liner+   rA   z—
A problem occurred executing Python code.  Here is the sequence of function
calls leading up to the error, with the most recent (innermost) call last.z!Traceback (most recent call last))Úminr   ÚsysÚversionÚsplitÚ
executableÚtimeÚctimer   rK   rL   r   ÚToplineÚsymbolsr…   rI   Úrjust)r1   r%   r  ÚwidthÚpyverÚdaterÐ   Úheads           r2   Úprepare_headerÚVerboseTB.prepare_header£  sS  € Ü�BÔ)Ó+¨AÑ.Ó/ˆßà¤§¡× 1Ñ 1Ó 3°AÑ 6Ñ6¸Ñ=ÄÇÁÑNˆEÜ—:’:œdŸiši›kÓ*ˆDÜ × 0Ñ 0Ñ1ˆEØ—<‘<ä—]‘] E§M¡M°*Ñ$=ÀÑ$EÐFÜ˜D�MÜ—]‘] EÐ*Ü˜C 5¬3¨u«:Ñ#5¼¸E»
Ñ#BÑCÐDÜ˜E�NÜ˜D�MÜ˜DŸJ™J uÓ-Ð.ðó
ˆDð ð_ñˆDð  ˆô ˜t×/Ñ/Ñ0×7Ñ7ä—]‘] EÐ*äØ;×AÑAÀ%Ì#ÈeË*ÑBTÓUððóˆDð ˆr5   c                 ó  ^ •  [        [        X45      u  p4[	        US/ 5      n[        U[        5      (       a  [        U[        [        45      (       a  [        US[        S9/nU H  n[        U[        5      (       a  M   e   Un[        T R                     R                  [        R                  U4[        S4[        U4/5      /U 4S jU 5       Q$ !   [        [        R                  " 5       S S p![        [        X45      u  p4 Nñ= f)Nrº   r„   )rð   r	  c              3   óv   >#   • U  H.  n[         TR                     R                  [        U4/5      v •  M0     g 7fr8   )r   rK   rL   r   )r€   Únoter1   s     €r2   r‚   Ú-VerboseTB.format_exception.<locals>.<genexpr>ß  s7   øé € ð â%�Dô ˜D×,Ñ,Ñ-×4Ñ4´u¸d°m°_×EÐEÚ%ùs   ƒ69)ÚmaprŒ   r  Úexc_infor�   rD   r   Úbytesr   râ   r   rK   rL   r   r…   )r1   r%   r&   Ú	etype_strÚ
evalue_strÚnotesr  Ú	str_notess   `       r2   Úformat_exceptionÚVerboseTB.format_exceptionÇ  sü   ø€ ð	>Ü$'¬¨e¨_Ó$=Ñ!ˆIô ˜ ¨RÓ0ˆÜ˜%¤×*Ñ*¬j¸ÄÄeÀ×.MÑ.MÜ! %¨¼4Ñ@ÐAˆEãˆDÜ˜d¤C×(Ó(Ð(Ð(ñ ð $)ˆ	ô ˜×(Ñ(Ñ)×0Ñ0Ü—-‘- Ð+¬e°T¨]¼UÀJÐ<OÐPóð
ôá%óð	
ð 	
øð!	>ä¤§¢£°°Ð!3�6Ü$'¬¨e¨_Ó$=Ñ!ˆI‘zús   ƒC Ã2Dr&   r'   r>   c           	      ó¶  • Un UR                   nUc  U R                  OUn[        U[        5      (       d   eU R                  [        U5      U R                  5      nU(       a  U R                  X4U5      O/ n/ n	Sn
[        U5      S-
  n[        U5       Hò  u  pÍ[        UR                  [        R                  5      (       dH  U R                  (       a7  UR                  R                   R#                  SS5      (       a  XË:w  a  U
S-  n
Mv  U
(       aU  U	R%                  [&        U R(                     R+                  [,        S4[,        R.                  SU
-  4[,        S4/5      5        Sn
U	R%                  U R1                  U5      5        Mô     U
(       aS  U	R%                  [&        U R(                     R+                  [,        S4[,        R.                  SU
-  4[,        S4/5      5        U R3                  X5      nU(       aC  US   n[5        5       nUb1  UR6                  R9                  UR:                  UR<                  S5        U/U	-   U-   /$ ! [         a     GNGf = f)zšFormats the header, traceback and exception message for a single exception.

This may be called multiple times by Python 3 exception chaining
(PEP 3134).
r   r   Ú__tracebackhide__rh   z[... skipping hidden %s frame]r+   éÿÿÿÿ)r†   ÚAttributeErrorr=   rD   rH   r  rŒ   rµ   Úget_recordsrI   ri   rÑ   rÒ   rÓ   rÇ   rØ   Úf_localsÚgetrJ   r   rK   rL   r   r…   r  r&  r   r‘   r’   rr   rf   )r1   r%   r&   r'   r>   r=   Ú
orig_etyper  ÚrecordsÚframesÚskippedÚ
lastrecordr—   ÚrecordÚformatted_exceptionrÊ   rš   s                    r2   Úformat_exception_as_a_wholeÚ%VerboseTB.format_exception_as_a_wholeå  s  € ð ˆ
ð	Ø—N‘NˆEð '0Ñ&7�D—N’N¸Yˆ	Ü˜)¤S×)Ñ)Ð)Ð)Ø×"Ñ"¤3 u£:¨t×/?Ñ/?Ó@ˆÞ?B�$×"Ñ" 3°Ô;ÈˆàˆØˆÜ˜“\ AÑ%ˆ
Ü" 7Ö+‰IˆAä˜vŸz™z¬:×+DÑ+D×EÑEØ×$×$ð —L‘L×)Ñ)×-Ñ-Ð.AÀ1×EÑEØ›à˜q‘L�GÙÞØ—‘Ü × 0Ñ 0Ñ1×8Ñ8ä" F˜OÜ"Ÿ]™]Ð,LÈwÑ,VÐWÜ" D˜Mðóôð �Ø�M‰M˜$×,Ñ,¨VÓ4Ö5ñ- ,ö. Ø�M‰MÜ˜D×,Ñ,Ñ-×4Ñ4ä ˜ÜŸ™Ð(HÈ7Ñ(RÐSÜ ˜ðóôð #×3Ñ3°EÓBÐÞØ  ™ˆJÜ “]ˆFØÑ!Ø—‘×4Ñ4Ø×'Ñ'¨×):Ñ):¸Aôð �˜‘Ð"5Ñ5Ð6Ð6øôm ó 	Úð	ús   „I
 É

IÉIc                 óf  • Uc   eUS-
  nUS-  nX$-
  nU R                   (       aw  [        U R                     nUR                  5       nUR                  R                  [        R                  U R                  5      n[        R                  " Xx5      n	[        U	S9n
OS n
[        R                  " UUU
S9nUn/ nUb¾   [        R                  " UR                  5      nUb3  UR                   nUR#                  S5      tnnUS:X  a  UR$                  nMZ  ['        UR                  5      nUS:X  a"   [        R(                  " UR                  5        O Uc   eUR/                  UU45        UR$                  nUb  M¾  / nSnU[1        U5      :  Gak  UU   u  nnU[,        :”  aS  UR                  nUR2                  nUR4                  nUR6                  nUR/                  [9        SUUUUUS	95        US-  nOôUnU[1        U5      :  a6  UU   S   [,        ::  a&  US-  nU[1        U5      :  a  UU   S   [,        ::  a  M&  [;        UU5       Vs1 s H  nUU   S   R                  iM     nn[        R8                  R                  UU   S   US
9 HY  n[=        U[        R>                  5      (       d  UR@                  U;   d  M4  UR/                  [8        RB                  " U5      5        M[     U[1        U5      :  a  GMk  U$ ! [*         a    [,        S-   n GNÀf = f! [*         a    [,        S-   n GNÚf = fs  snf )Nr   rº   )Ústyle)ÚbeforeÚafterÚpygments_formatterÚ.ÚIPythonr   z	Raw frame)r>   )Úoptions)"rê   r   rK   Úas_pygments_styleÚextra_styler.  r   ÚTbHighlightÚtb_highlightrÒ   Ústyle_with_executing_noder
   ÚOptionsrÖ   Ú	getmoduleÚtb_framer†   r  Útb_nextr   ÚgetsourcelinesÚOSErrorÚFAST_THRESHOLDrJ   rI   Úf_linenoÚf_codeÚco_filenamer   ÚrangerD   rÓ   rØ   Ú_from_stack_data_FrameInfo)r1   r'   r>   r=   r;  r:  rÐ   Ú
base_stylerC  r9  Ú	formatterr?  ÚcfÚtbsÚmodÚmod_nameÚ	root_nameÚ_Ú	frame_lenÚFIsr—   r6   rØ   rf   rÛ   rr   Úgroup_startÚjÚgroup_framesÚsd_fis                                 r2   r,  ÚVerboseTB.get_records.  s  € Ø‰ÐˆØ˜A‘+ˆØ˜1‘ˆØ‘ˆØ�?�?Ü × 0Ñ 0Ñ1ˆEØ×0Ñ0Ó2ˆJØ ×,Ñ,×0Ñ0´×1BÑ1BÀD×DUÑDUÓVˆLÜ×8Ò8¸ÓRˆEÜ,°5Ñ9‰IàˆIÜ×$Ò$ØØØ(ñ
ˆð '*ˆØ/1ˆØ‰nð/Ü×'Ò'¨¯©Ó4�Ø‘?Ø"Ÿ|™|�HØ$,§N¡N°3Ó$7�M�I Ø  IÓ-ØŸZ™Z˜Ù Ü4°R·[±[ÓA�	Ø “>ð
7Ü×.Ò.¨r¯{©{Õ;ð "ð ‘>Ð!�>Ø�J‰J˜˜I�Ô'Ø—‘ˆBð/ ‹nð8  "ˆØˆØ”#�c“(ŒlØ ™F‰MˆB�	Øœ>Ó)ØŸ™�ØŸ™�Ø—|‘|�Ø×+Ñ+�Ø—
‘
ÜØ# X¨v°u¸dÈGñôð
 �Q‘‘ð  �Øœ#˜c›(“l s¨1¡v¨a¡y´NÓ'BØ˜‘F�Að œ#˜c›(“l s¨1¡v¨a¡y´NÕ'Bô =BÀ+ÈqÔ<QÓRÒ<Q°q  A¡ q¡	× 2Ô 2Ñ<Q�ÐRä'×1Ñ1×<Ñ<Ø˜Ñ$ QÑ'°ð =ó �Eô " %¬×)BÑ)B×CÑCÀuÇ{Á{ÐVbÕGbØŸ
™
¤9×#GÒ#GÈÓ#NÖOñð+ ”#�c“(Žlð< ˆ
øôW #ó 7Ü$2°QÑ$6›	ð7ûäó /Ü*¨QÑ.“	ð/üò<  Ss=   Â<AL ÄL Ä. K: ÉL.Ë:LÌL ÌLÌL ÌL+Ì*L+c                 óØ  • U R                  XX5U5      n[        S[        5       S   5      n[        U R                     nUR                  [        R                  UR                  S   U-  4/5      n	U	/n
SnSnU R                  U5      nU(       a(  Uc   eX`R                  UR                  5      -  nUu  pnOSn[        5       nU(       aŠ  X`R                  XX<U5      -  nU R                  U5      nU(       aR  [        US   5      U;  a@  UR                  [        US   5      5        X`R                  UR                  5      -  nUu  pnOSnU(       a  MŠ  [        U5       H  nX¯-  n
M	     U
$ )z5Return a nice text document describing the traceback.r  r   r
  é   Nr   )r6  r  r   r   rK   rL   r   r  r  rR   rT   rU   rF   rS   rV   Úreversed)r1   r%   r&   r'   r=   r>   Úformatted_exceptionsÚtermsizerÐ   r  Ústructured_traceback_partsr^   Úlines_of_contextr\   rX   Úfxs                   r2   rW   ÚVerboseTB.structured_traceback‚  s�  € ð 15×0PÑ0PØ˜3¨ó1
Ðô �rÔ,Ó.¨qÑ1Ó2ˆÜ˜D×,Ñ,Ñ-ˆØ—L‘Lô —M‘MØ—M‘M *Ñ-°Ñ8ððó
ˆð 26°Ð"Ø'(Ð$ØÐØ×7Ñ7¸Ó?ˆ	ÞØÑ%Ð%Ð%Ø ×$JÑ$JØ× Ñ ó%ñ Ð ð "+ÑˆE™3àˆFÜ›%ˆÞØ ×$DÑ$DØ˜sÐ6Ró%ñ Ð ð ×;Ñ;¸FÓCˆIæœR 	¨!¡Ó-°_ÓDØ×#Ñ#Ü�y ‘|Ó$ôð %×(NÑ(NØ×$Ñ$ó)ñ Ð$ð &/Ñ"�™sà�÷ ˆfô& Ð/Ö0ˆBØ&Ñ,Ò&ñ 1ð *Ð)r5   Úforcec                 ó>  • U(       d  U R                   (       Gaß  U R                  c  U R                  5       U l        [        [        R
                  S9nU   U R                  R                  5         [        U S5      (       a  U R                  b  U R                  nO[        R                  =o0l        U R                  bq  U R                  R                  bZ  U R                  R                  c   eU R                  R                  U l        U R                  b  U R                  R                  b  MZ  U(       a  UR                  (       a  UR                  nUR                  U R                  l        [        R                  S:  a  [        R                  O[        [        S[        R                  5      nU(       a  U R                  R!                  SU5        OU R                  R!                  SU5        SSS5        [        U S5      (       a  U ?gg! , (       d  f       N#= f)aÌ  Call up the pdb debugger if desired, always clean up the tb
reference.

Keywords:

  - force(False): by default, this routine checks the instance call_pdb
    flag and does not actually invoke the debugger if the flag is false.
    The 'force' option forces the debugger to activate even if the flag
    is false.

If the call_pdb flag is set, the pdb interactive debugger is
invoked. In all cases, the self.tb reference to the current traceback
is deleted to prevent lingering references which hamper memory
management.

Note that each call to pdb() does an 'import readline', so if your app
requires a special setup for the readline completers, you'll have to
fix that by hand after invoking the exception handler.N)Úhookr6   )ra  é   Úlast_exc)r´   Úpdbr¸   r   r  Ú__displayhook__Úresetr‰   r6   Úlast_tracebackrH  rG  ÚbotframeÚversion_infoÚ
last_valuer�   Úinteraction)r1   ri  Údisplay_trapr'   Úexcs        r2   ÚdebuggerÚVerboseTB.debugger¾  ss  € ö( �D—M—M�MØ�x‰xÑØ×,Ñ,Ó.�”ô '¬C×,?Ñ,?Ñ@ˆLÚØ—‘—‘Ô ä˜4 ×&Ñ&¨4¯7©7Ñ+>ØŸ'™'‘Cä$'×$6Ñ$6Ð6�Cœ'Ø—g‘gÑ)¨d¯g©g¯o©oÑ.IØŸ7™7Ÿ?™?Ñ6Ð6Ð6Ø"Ÿg™gŸo™o�D”Gð —g‘gÑ)¨d¯g©g¯o©oÓ.Iö ˜3Ÿ;Ÿ;ØŸ+™+�CØ$'§L¡L�—‘Ô!ô
 ×'Ñ'¨'Ó1ô —N’Nä ¤ j´#·.±.ÓAð ö
 Ø—H‘H×(Ñ(¨¨sÕ3à—H‘H×(Ñ(¨¨sÔ3÷/ ô2 �4˜×ÑØ‘ð ÷3 •ús   ÁCHÄ/CHÈ
Hc                 ó  • U=(       d    [         R                  " 5       u  p#nX@l        U R                  nUR	                  5         UR                  U R                  X#U5      5        UR                  S5        UR	                  5         g r*   )r  r   r6   r,   r-   r.   r/   )r1   Úinfor%   r&   r'   r,   s         r2   ÚhandlerÚVerboseTB.handlerô  sZ   € Ø#×5¤s§|¢|£~Ñˆ˜ØŒØ—,‘,ˆØ�‰ŒØ�‰�d—i‘i ¨sÓ3Ô4Ø�‰�dÔØ�‰�r5   c                 óª   • Uc  U R                  5         OU R                  XU45         U R                  5         g! [         a    [        S5         gf = f)z@This hook can replace sys.excepthook (for Python 2.1 or higher).Nú
KeyboardInterrupt)r|  rx  ÚKeyboardInterruptÚprintr0   s       r2   r3   ÚVerboseTB.__call__ÿ  sG   € à‰;Ø�L‰L�Nà�L‰L˜%¨Ð-Ô.ð	)Ø�M‰M�OøÜ ó 	)ÜÐ'Ö(ð	)ús   ©: ºAÁA)r·   r¶   rµ   rn  rÇ   r6   r=   )Fr¥   r8   )NNN)!r†   r§   r¨   r©   rª   rC  Útb_highlight_stylerŒ   Ú__annotations__rÃ   r¾   Úboolr   rH   r	   r£   rÅ   r   r  r  r&  r   r«   r   rG   r6  r,  rW   rx  r|  r3   r­   Ú__classcell__©rÈ   s   @r2   r°   r°   ½  sð  ø‡ ñ'ð #€LØ"ÐàƒJð
 #ØØØØ!Ø!Ø15Ø$(ð> ð &ò> ð ð> ð ð	> ð
 ð> ð ð> ð ð> ð ð> ð ˜b $˜hÑ'¨$Ñ.ð> ð ˜T‘kð> ð ÷> ñ > ð@W¨	ð W°cô Wñr" Cð "°tð "Èõ "òH
ð<G7àðG7ð ˜Ñ'ðG7ð �mÑ$ð	G7ð
 ðG7ð ˜C‘=ðG7ð 
ˆd�3‰i‰ôG7ðRR˜}ð R°sð RÀsð RÈsô Rðp (,Ø#'Øñ:*àð:*ð ˜Ñ'ð:*ð �mÑ$ð	:*ð
 ˜C‘=ð:*ð ð:*ð 
ˆc‰õ:*ñx4˜dð 4¨tõ 4ôl÷	)ò 	)r5   r°   c                   óà   • \ rS rSr% Sr\\S'            SS jr   SS\S\	S-  S\
S-  S	\S-  S
\S\\   4S jjrS\\   S\4S jrSS\\   SS4S jjrSS jrSS jrSS jrSS jrSrg)ÚFormattedTBi  a¡  Subclass ListTB but allow calling with a traceback.

It can thus be used as a sys.excepthook for Python > 2.1.

Also adds 'Context' and 'Verbose' modes, not available in ListTB.

Allows a tb_offset to be specified. This is useful for situations where
one needs to remove a number of topmost frames from the traceback (such as
occurs with python programs that themselves execute other python code,
like Python shells).ÚmodeNc
                 óº   • / SQU l         U R                   SS U l        [        R                  U UUUUUUUU	S9	  [	        SSSSSS9U l        U R                  U5        g )N)ÚPlainÚContextÚVerboseÚMinimalÚDocsr   ra  ©r³   r´   r,   r=   rµ   r¶   r·   r¸   rC   r+   )Úvalid_modesÚverbose_modesr°   rÅ   ÚdictÚ_join_charsÚset_mode)
r1   rŠ  r³   r´   r,   r=   rµ   r¶   r·   r¸   s
             r2   rÅ   ÚFormattedTB.__init__  sx   € ò NˆÔØ!×-Ñ-¨a°Ð2ˆÔä×ÑØØ!ØØØØ#Ø%Ø#Ø%ð 	ñ 
	
ô  Ø˜d¨D¸"À2ñ
ˆÔð 	�‰�dÕr5   r%   r&   r'   r=   r>   r(   c                 óè  • Uc  U R                   OUnU R                  nX`R                  ;   a  [        R	                  XX#XE5      $ US:X  ag  [        U R                  U R                  U R                  UU R                  U R                  U R                  U R                  S9R	                  XX4S5      $ US:X  a  [        R                  XU5      $ U R                  5         [        R	                  XX#XE5      $ )Nr�  r‘  r   r�  )r=   rŠ  r“  r°   rW   r   rK   r´   r,   rµ   r¶   r·   r¸   r#   r�   )r1   r%   r&   r'   r=   r>   rŠ  s          r2   rW   Ú FormattedTB.structured_traceback?  sð   € ð '0Ñ&7�D—N’N¸Yˆ	Ø�y‰yˆØ×%Ñ%Ó%ä×1Ñ1Ø˜V¨)óð ð �V‹^äØ×+Ñ+ØŸ™ØŸ™Ø#Ø ×,Ñ,Ø!×.Ñ.Ø ×,Ñ,Ø!×.Ñ.ñ	÷ #Ñ"Ø˜s¨qóðð �YÓÜ×,Ñ,¨T¸&ÓAÐAð ×ÑÔä×.Ñ.Ø˜V¨)óð r5   Ústbc                 ó8   • U R                   R                  U5      $ )ú4Convert a structured traceback (a list) to a string.)Útb_join_charrP   ©r1   rš  s     r2   Ústb2textÚFormattedTB.stb2texth  s   € à× Ñ ×%Ñ% cÓ*Ð*r5   c                 óÜ  • U(       dS  U R                   R                  U R                  5      S-   [        U R                   5      -  nU R                   U   U l        OSXR                   ;  a'  [	        SU-   S-   [        U R                   5      -   5      e[        U[
        5      (       d   eXl        U R                  U R                   S   :H  U l        U R                  U R                     U l	        g)zZSwitch to the desired mode.

If mode is not specified, cycles through the available modes.r   z#Unrecognized mode in FormattedTB: <z>
Valid modes: rº   N)
r’  rû   rŠ  rI   Ú
ValueErrorrŒ   rD   r¶   r•  r�  )r1   rŠ  Únew_idxs      r2   r–  ÚFormattedTB.set_model  sÔ   € ö
 Ø×'Ñ'×-Ñ-¨d¯i©iÓ8¸1Ñ<ÄÀD×DTÑDTÓ@UÑUˆGØ×(Ñ(¨Ñ1ˆD�IØ×)Ñ)Ó)ÜØ5¸Ñ<ð @ ñ  Ü"% d×&6Ñ&6Ó"7ñ8óð ô
 ˜d¤C×(Ñ(Ð(Ð(ØŒIà ŸI™I¨×)9Ñ)9¸!Ñ)<Ñ<ˆÔà ×,Ñ,¨T¯Y©YÑ7ˆÕr5   c                 ó@   • U R                  U R                  S   5        g ©Nr   ©r–  r’  ©r1   s    r2   ÚplainÚFormattedTB.plain‚  ó   € Ø�‰�d×&Ñ& qÑ)Õ*r5   c                 ó@   • U R                  U R                  S   5        g )Nr   r§  r¨  s    r2   r>   ÚFormattedTB.context…  r«  r5   c                 ó@   • U R                  U R                  S   5        g )Nrº   r§  r¨  s    r2   ÚverboseÚFormattedTB.verboseˆ  r«  r5   c                 ó@   • U R                  U R                  S   5        g )Nra  r§  r¨  s    r2   ÚminimalÚFormattedTB.minimal‹  r«  r5   )r•  r¶   rŠ  r�  r’  r“  )	rŒ  r½   FNr   FFNNr¥   r8   )r(   N)r†   r§   r¨   r©   rª   rŒ   r„  rÅ   r£   r«   r   rH   rG   rW   rŸ  r   r–  r©  r>   r¯  r²  r­   r   r5   r2   r‰  r‰    sÐ   ‡ ñ	ð ƒIð àØØØØØØØô#ðR %)Ø $Øñ'àð'ð  Ñ$ð'ð ˜TÑ!ð	'ð
 ˜‘:ð'ð ð'ð 
ˆc‰õ'ðR+˜D ™Ið +¨#ô +ñ8˜X c™]ð 8°dõ 8ô,+ô+ô+÷+r5   r‰  c                   ó¤   • \ rS rSrSr     SS\S-  S\S-  S\S-  S\S\	S-  S	S4S
 jjr
   SS\S\\   S\\   S\\	   S\	S	\\   4S jjrSrg)ÚAutoFormattedTBi�  a&  A traceback printer which can be called on the fly.

It will find out about exceptions by itself.

A brief example::

    AutoTB = AutoFormattedTB(mode = 'Verbose', theme_name='linux')
    try:
      ...
    except:
      AutoTB()  # or AutoTB(out=logfile) where logfile is an open file object
Nr%   r&   r'   Úoutr=   r(   c                 ó  • Uc  U R                   nUR                  5         UR                  U R                  XX55      5        UR                  S5        UR                  5          U R	                  5         g! [
         a    [        S5         gf = f)a!  Print out a formatted exception traceback.

Optional arguments:
  - out: an open file-like object to direct output to.

  - tb_offset: the number of frames to skip over in the stack, on a
  per-call basis (this overrides temporarily the instance's tb_offset
  given at initialization time.Nr+   r  )r,   r-   r.   r/   rx  r€  r�  )r1   r%   r&   r'   r¶  r=   s         r2   r3   ÚAutoFormattedTB.__call__ž  sl   € ð" ‰;Ø—,‘,ˆCØ�	‰	ŒØ�	‰	�$—)‘)˜E¨3Ó:Ô;Ø�	‰	�$ŒØ�	‰	Œð	)Ø�M‰M�OøÜ ó 	)ÜÐ'Ö(ð	)ús   Á#A4 Á4BÂBr>   c                 ó²   • Uc  [         R                  " 5       u  pn[        U[        5      (       a  US   U l        OX0l        [
        R                  XX#XE5      $ r¦  )r  r   rD   rE   r6   r‰  rW   )r1   r%   r&   r'   r=   r>   s         r2   rW   Ú$AutoFormattedTB.structured_traceback¼  sP   € ð ‰=Ü!$§¢£ÑˆE˜3Ü�cœ5×!Ñ!à˜!‘fˆD�GàŒGÜ×/Ñ/Ø˜ ió
ð 	
r5   )r6   )NNNNNr¥   )r†   r§   r¨   r©   rª   r£   r«   r   r   rH   r3   r   rG   rŒ   rW   r­   r   r5   r2   rµ  rµ  �  sË   † ñð "Ø'+Ø$(ØØ $ñ)à�d‰{ð)ð  Ñ$ð)ð ˜TÑ!ð	)ð
 ð)ð ˜‘:ð)ð 
õ)ðD (,Ø#'Øñ
àð
ð ˜Ñ'ð
ð �mÑ$ð	
ð
 ˜C‘=ð
ð ð
ð 
ˆc‰÷
ð 
r5   rµ  c                   ó,   ^ • \ rS rSrSrU 4S jrSrU =r$ )ÚColorTBiÕ  zDeprecated since IPython 9.0.c                 óZ   >• [         R                  " S[        SS9  [        TU ]  " U0 UD6  g )NzNDeprecated since IPython 9.0 use FormattedTB directly ColorTB is just an aliasrº   )r»   )rÀ   rÁ   rÂ   rÄ   rÅ   )r1   rì   ÚkwargsrÈ   s      €r2   rÅ   ÚColorTB.__init__Ø  s,   ø€ Ü�ŠØ\ÜØò	
ô 	‰Ò˜$Ð) &Ó)r5   r   )r†   r§   r¨   r©   rª   rÅ   r­   r†  r‡  s   @r2   r¼  r¼  Õ  s   ø† Ù'÷*ó *r5   r¼  c                   óÀ   ^ • \ rS rSr% Sr\S-  \S'   U 4S jrU 4S jr   SS\	S\S-  S	\
S-  S
\S-  S\S\\   4U 4S jjjrS\S-  4S jrS\\   S\4S jrSrU =r$ )ÚSyntaxTBiâ  z:Extension which holds some state: the last exception valueNÚlast_syntax_errorc                ó.   >• [         TU ]  US9  S U l        g )NrÏ   )rÄ   rÅ   rÂ  )r1   r³   rÈ   s     €r2   rÅ   ÚSyntaxTB.__init__ç  s   ø€ Ü‰Ñ JÐÑ/Ø!%ˆÕr5   c                 ó2   >• X l         [        TU ]	  XU5        g r8   )rÂ  rÄ   r3   )r1   r%   rx   rY   rÈ   s       €r2   r3   ÚSyntaxTB.__call__ë  s   ø€ Ø!&Ôä‰Ñ˜ uÕ-r5   r%   r&   r'   r=   r>   r(   c                 ó�  >• Un[        U[        5      (       a–  [        UR                  [        5      (       aw  [        UR                  [
        5      (       aX  [        R                  " UR                  5        [        R                  " UR                  UR                  5      nU(       a  Xvl	        X`l
        [        [        U ]7  XX4US9$ )N)r=   r>   )rD   rˆ   rr   rŒ   rf   rH   rŠ   rÆ   r‹   r/   rÂ  rÄ   rÁ  rW   )	r1   r%   r&   r'   r=   r>   rx   ÚnewtextrÈ   s	           €r2   rW   ÚSyntaxTB.structured_tracebackð  s•   ø€ ð ˆô
 �uœk×*Ñ*Ü˜5Ÿ>™>¬3×/Ñ/Ü˜5Ÿ<™<¬×-Ñ-ä× Ò  §¡Ô0Ü×'Ò'¨¯©¸¿¹ÓEˆGÞØ$”
Ø!&ÔÜ”X˜tÑ9Ø˜#¸Gð :ð 
ð 	
r5   c                 ó,   • U R                   nSU l         U$ )z+Return the current error state and clear itN©rÂ  )r1   Úes     r2   Úclear_err_stateÚSyntaxTB.clear_err_state
  s   € à×"Ñ"ˆØ!%ˆÔØˆr5   rš  c                 ó$   • SR                  U5      $ )rœ  rC   )rP   rž  s     r2   rŸ  ÚSyntaxTB.stb2text  s   € à�w‰w�s‹|Ðr5   rË  r¥   )r†   r§   r¨   r©   rª   r«   r„  rÅ   r3   r£   r   rH   rG   rŒ   rW   r   rÍ  rŸ  r­   r†  r‡  s   @r2   rÁ  rÁ  â  s¨   ø‡ ÙDà$ tÑ+Ó+õ&õ.ð %)Ø $Øñ
àð
ð  Ñ$ð
ð ˜TÑ!ð	
ð
 ˜‘:ð
ð ð
ð 
ˆc‰÷
ð 
ð4  t¡ô ð˜D ™Ið ¨#÷ ò r5   rÁ  )>rª   Ú	functoolsrÖ   rŠ   r  r  r9   rå   rÀ   Úcollections.abcr   r   Útypingr   r   r   r   r	   rÒ   Úpygments.formatters.terminal256r
   Úpygments.tokenr   r>  r   ÚIPython.utilsr   Ú	util_pathr   ÚIPython.utils.PyColorizer   r   r   r   ÚIPython.utils.terminalr   rv  r   Údoctbr   Útbtoolsr   r   r   r   r   r   r   r   r   r    rÕ   rK  r#   Úobjectr¾   rÃ   r°   r‰  rµ  r¼  rÁ  r   r5   r2   Ú<module>rÝ     sÖ   ðñ:óH Û Û Û 
Û Û Û Û Ý $Ý ß -Ó -Ý $ã Ý @Ý  å Ý +Ý #ß LÓ LÝ 4å %Ý ÷÷ ÷ ð €ð €ôADˆWô ADñH
 ‹H€	Ø€ôK	)�ô K	)ô^@+�)˜Vô @+ôH>
�kô >
ôJ
*ˆkô 
*ô0ˆvõ 0r5   