
    dh              #          d dl Z d dlZd dlZd dlZd dlmZmZ d dlmZ d dl	m
Z
 d dlmZmZ d dlmZmZmZmZmZmZmZmZmZmZmZ d dlmZ d dlmZmZmZm Z m!Z!m"Z" d d	lm#Z$ d d
lm%Z% d dl&m'Z' ddl(m)Z) ddl*m+Z+m,Z, ddl-m.Z. ddl/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5 ddl6m7Z7 ddl8m9Z9m:Z: ddl;m<Z< ddl=m>Z> ddl?m@Z@ ddlAmBZBmCZC dd	lDm#Z# ddlEmFZF ej                  dk(  ZHdZIdZJdeCdeCdeeeKeKeKf      fdZLddd d!dd"d"eIeJd#dd#d$dd%d&ee0   d'eeK   d(eeK   d)eKd*eeM   d+eNd,eNd-eKd.eKd/eNd0eeN   d1eNd2eeeMef      d3eKdeeeO   eOee   gef   fd4ZPe G d5 d6             ZQe G d7 d8             ZRe G d9 d:             ZSe G d; d<             ZT G d= d>e9      ZU G d? d@      ZVeWdAk(  r) ePd#B       d dlZdCeddfdDZXdCeddfdEZYdGdFZZ eZ        yy)H    N)	dataclassfield)islice)walk_tb)
ModuleTypeTracebackType)AnyCallableDictIterableListOptionalSequenceSetTupleTypeUnion)guess_lexer_for_filename)CommentKeywordNameNumberOperatorString)Text)Token)ClassNotFound   )pretty)loop_first_last	loop_last)Columns)ConsoleConsoleOptionsConsoleRenderableGroupRenderResultgroup)	Constrain)RegexHighlighterReprHighlighter)Panel)render_scope)Style)SyntaxSyntaxPosition)Themewin32
   P   startendreturnc              #      K   | \  }}|\  }}||k(  r|||f yt        t        ||dz               D ]!  \  }}}|r||df |r|d|f |ddf # yw)zYield start and end positions per line.

    Args:
        start: Start position.
        end: End position.

    Returns:
        Iterable of (LINE, COLUMN1, COLUMN2).
    r   r   N)r    range)	r5   r6   line1column1line2column2firstlastline_nos	            \/var/www/html/vivango/api/ia/venv/lib/python3.12/site-packages/pip/_vendor/rich/traceback.py_iter_syntax_linesrC   7   s      NE7NE7~Wg%%$3E%4K$L 	% E4w**q'))q"n$	%s   AAd   X      FT )consolewidth
code_widthextra_linestheme	word_wrapshow_localslocals_max_lengthlocals_max_stringlocals_hide_dunderlocals_hide_sunderindent_guidessuppress
max_framesrH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   c                   	
 | t        d      n| j                  r
dn

dt        t           dt        dt        t
           ddf	
fdd	t        ddffd
}	 t               } ||       t        j                  S # t        $ r  t        j                  }t        _	        |cY S w xY w)a  Install a rich traceback handler.

    Once installed, any tracebacks will be printed with syntax highlighting and rich formatting.


    Args:
        console (Optional[Console], optional): Console to write exception to. Default uses internal Console instance.
        width (Optional[int], optional): Width (in characters) of traceback. Defaults to 100.
        code_width (Optional[int], optional): Code width (in characters) of traceback. Defaults to 88.
        extra_lines (int, optional): Extra lines of code. Defaults to 3.
        theme (Optional[str], optional): Pygments theme to use in traceback. Defaults to ``None`` which will pick
            a theme appropriate for the platform.
        word_wrap (bool, optional): Enable word wrapping of long lines. Defaults to False.
        show_locals (bool, optional): Enable display of local variables. Defaults to False.
        locals_max_length (int, optional): Maximum length of containers before abbreviating, or None for no abbreviation.
            Defaults to 10.
        locals_max_string (int, optional): Maximum length of string before truncating, or None to disable. Defaults to 80.
        locals_hide_dunder (bool, optional): Hide locals prefixed with double underscore. Defaults to True.
        locals_hide_sunder (bool, optional): Hide locals prefixed with single underscore. Defaults to False.
        indent_guides (bool, optional): Enable indent guides in code and locals. Defaults to True.
        suppress (Sequence[Union[str, ModuleType]]): Optional sequence of modules or paths to exclude from traceback.

    Returns:
        Callable: The previous exception handler that was replaced.

    NT)stderrtype_value	tracebackr7   c                     t         j                  | ||	
t                    }j                  |       y )NrI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   )	Tracebackfrom_exceptionboolprint)rX   rY   rZ   exception_tracebackrJ   rK   rS   rQ   rR   rO   rP   rU   rN   rT   rL   traceback_consolerI   rM   s       rB   
excepthookzinstall.<locals>.excepthook   sb    
 (66!##//1#$67'!! 7 
$ 	 34    ipc           	           i  j                   dt        dt        dd ffd}dddt        dt        dt        dd f fd _        | _         fd	 _        y )
Nargskwargsr7   c                      | | i | y)zEwrap the default ip.showtraceback to store info for ip._showtracebackNrG   )rg   rh   default_showtracebacktb_datas     rB   ipy_show_tracebackzCinstall.<locals>.ipy_excepthook_closure.<locals>.ipy_show_traceback   s     G!4262rd   F)	is_syntaxrm   c                     	j                         }| rdn|d   }
j                  dd      }
j                  d      }||rdnd}t        |      D ]  }| n|j                  }  |d   |d   |       i 
y)z2Internally called traceback from ip._showtracebackN   running_compiled_codeF	tb_offsetr   r   )_get_exc_infogetr:   tb_next)rm   rg   rh   	exc_tupletbcompiledrq   _rc   re   rk   s           rB   ipy_display_tracebackzFinstall.<locals>.ipy_excepthook_closure.<locals>.ipy_display_traceback   s    
 ((*I 3<$1B {{#:EBHK0I !)Aq	9%  :ZZ 
 y|Yq\26Grd   c                       | ddi|S )Nrm   TrG   )rg   rh   ry   s     rB   <lambda>z9install.<locals>.ipy_excepthook_closure.<locals>.<lambda>   s     5J6
!6
%+6
 rd   )showtracebackr	   r_   _showtracebackshowsyntaxerror)re   rl   rj   ry   rk   rc   s   ` @@@rB   ipy_excepthook_closurez'install.<locals>.ipy_excepthook_closure   st     " 0 0	3c 	3S 	3T 	3 +0		#'	;>		4 2-
rd   )r#   
is_jupyterr   BaseExceptionr   r   r	   get_ipythonsysrc   	Exception)rH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   r   re   old_excepthookrc   rb   s    `````````````   @@rB   installr   S   s    V 18t,W ((-?-G 	 5M"55 M*5 
	5 5 52)
3 )
4 )
V	]r"~~ #	s   6!B &C Cc                       e Zd ZU eed<   eed<   eed<   dZeed<   dZee	ee
j                  f      ed<   dZeeeeef   eeef   f      ed<   y)	Framefilenamelinenoname lineNlocalslast_instruction)__name__
__module____qualname__str__annotations__intr   r   r   r   r   Noder   r   rG   rd   rB   r   r      sa    MK
ID#N/3FHT#v{{*+,3JNhuU38_eCHo%EFGNrd   r   c                   b    e Zd ZU eed<   eed<   eed<   eed<   eed<    ee      Ze	e   ed<   y)	_SyntaxErroroffsetr   r   r   msgdefault_factorynotesN)
r   r   r   r   r   r   r   listr   r   rG   rd   rB   r   r      s.    KM
IK	HT2E492rd   r   c                       e Zd ZU eed<   eed<   dZee   ed<   dZe	ed<    e
e      Zee   ed<    e
e      Zee   ed	<   dZe	ed
<    e
e      Zed   ed<   y)Stackexc_type	exc_valueNsyntax_errorFis_causer   framesr   is_groupTrace
exceptions)r   r   r   r   r   r   r   r   r   r_   r   r   r   r   r   r   r   r   rG   rd   rB   r   r      sh    MN+/L(<(/Hd5FDK5T2E492Hd %d ;JW;rd   r   c                       e Zd ZU ee   ed<   y)r   stacksN)r   r   r   r   r   r   rG   rd   rB   r   r      s    Krd   r   c                       e Zd ZdgZy)PathHighlighterz(?P<dim>.*/)(?P<bold>.+)N)r   r   r   
highlightsrG   rd   rB   r   r      s
    -.Jrd   r   c            $       (   e Zd ZdZddddddZ	 d0dd	d
dddeedddddddee   dee	   dee	   de	dee
   dedede	de	dedededeee
ef      de	fdZedd	d
dddeedddddddee   ded ee   dee	   dee	   de	dee
   dedede	de	dedededeee
ef      de	d!d f"d"       Zedeedddd#dee   ded ee   dede	de	deded$eee      d!efd%       Zd&ed'ed!efd(Z e       d)ed!efd*       Zed+e
d,e
d!e
fd-       Z e       d.e d!efd/       Z!y)1r]   a  A Console renderable that renders a traceback.

    Args:
        trace (Trace, optional): A `Trace` object produced from `extract`. Defaults to None, which uses
            the last exception.
        width (Optional[int], optional): Number of characters used to traceback. Defaults to 100.
        code_width (Optional[int], optional): Number of code characters used to traceback. Defaults to 88.
        extra_lines (int, optional): Additional lines of code to render. Defaults to 3.
        theme (str, optional): Override pygments theme used in traceback.
        word_wrap (bool, optional): Enable word wrapping of long lines. Defaults to False.
        show_locals (bool, optional): Enable display of local variables. Defaults to False.
        indent_guides (bool, optional): Enable indent guides in code and locals. Defaults to True.
        locals_max_length (int, optional): Maximum length of containers before abbreviating, or None for no abbreviation.
            Defaults to 10.
        locals_max_string (int, optional): Maximum length of string before truncating, or None to disable. Defaults to 80.
        locals_hide_dunder (bool, optional): Hide locals prefixed with double underscore. Defaults to True.
        locals_hide_sunder (bool, optional): Hide locals prefixed with single underscore. Defaults to False.
        suppress (Sequence[Union[str, ModuleType]]): Optional sequence of modules or paths to exclude from traceback.
        max_frames (int): Maximum number of frames to show in a traceback, 0 for no maximum. Defaults to 100.

    textpythoncythonpyrex)r   z.pyz.pxdz.pyxz.pxiNrD   rE   rF   FTrG   r\   tracerI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   c                   |>t        j                         \  }}}|||t        d      | j                  ||||      }|| _        || _        || _        || _        t        j                  |xs d      | _
        || _        || _        || _        || _        |	| _        |
| _        || _        g | _        |D ]  }t'        |t(              s@|j*                  
J |d       t,        j.                  j1                  |j*                        }n|}t,        j.                  j3                  t,        j.                  j5                  |            }| j$                  j7                  |        |dkD  rt9        d|      | _        y d| _        y )Nz9Value for 'trace' required if not called in except: blockrN   	ansi_darkz+ must be a module with '__file__' attributer      )r   exc_info
ValueErrorextractr   rI   rJ   rK   r/   	get_themerL   rM   rN   rS   rO   rP   rQ   rR   rT   
isinstancer   __file__ospathdirnamenormpathabspathappendmaxrU   )selfr   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   r   r   rZ   suppress_entityr   s                       rB   __init__zTraceback.__init__  sy   $ =-0\\^*Hi9#4	8I O  LL)YK ! E 

$&%%e&:{;
"&*!2!2"4"4')' 		'Oos3#,,8U%((STU8ww'?'?@&77##BGGOOD$9:DMM  &		' 1;Q#a,Ard   r   r   rZ   r7   c                `    | j                  ||||	|
|||      } | |||||||	||
|||||      S )a  Create a traceback from exception info

        Args:
            exc_type (Type[BaseException]): Exception type.
            exc_value (BaseException): Exception value.
            traceback (TracebackType): Python Traceback object.
            width (Optional[int], optional): Number of characters used to traceback. Defaults to 100.
            code_width (Optional[int], optional): Number of code characters used to traceback. Defaults to 88.
            extra_lines (int, optional): Additional lines of code to render. Defaults to 3.
            theme (str, optional): Override pygments theme used in traceback.
            word_wrap (bool, optional): Enable word wrapping of long lines. Defaults to False.
            show_locals (bool, optional): Enable display of local variables. Defaults to False.
            indent_guides (bool, optional): Enable indent guides in code and locals. Defaults to True.
            locals_max_length (int, optional): Maximum length of containers before abbreviating, or None for no abbreviation.
                Defaults to 10.
            locals_max_string (int, optional): Maximum length of string before truncating, or None to disable. Defaults to 80.
            locals_hide_dunder (bool, optional): Hide locals prefixed with double underscore. Defaults to True.
            locals_hide_sunder (bool, optional): Hide locals prefixed with single underscore. Defaults to False.
            suppress (Iterable[Union[str, ModuleType]]): Optional sequence of modules or paths to exclude from traceback.
            max_frames (int): Maximum number of frames to show in a traceback, 0 for no maximum. Defaults to 100.

        Returns:
            Traceback: A Traceback instance that may be printed.
        )rN   rO   rP   rQ   rR   )rI   rJ   rK   rL   rM   rN   rS   rO   rP   rQ   rR   rT   rU   )r   )clsr   r   rZ   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rich_tracebacks                     rB   r^   zTraceback.from_exceptionS  si    Z #//11 % 	
 !##'//11!
 	
rd   )rN   rO   rP   rQ   rR   _visited_exceptionsr   c                L   g }
d}ddl m} t        |dd      xs g }|	
t               n|	}dt        dt
        fd}	 t         ||j                         ||      ||
      }t        j                  dk\  rt        |t        t        f      rwd	|_        |j                  D ]a  }||v r|j                  |       |j                  j!                  t"        j%                  t'        |      ||j(                  |||             c t        |t*              rXt-        |j.                  xs d|j0                  xs d|j2                  xs d|j4                  xs d|j6                  |      |_        |
j!                  |       |j:                  j                   }dt<        t>        t
        t@        f      dt<        t>        t
        t@        f      ffd}tC        |      D ]  \  }}|jD                  jF                  }d}t        j                  dk\  rW|jH                  dz  }tK        tM        |jD                  jO                         ||dz               }|\  }}}}|||
|||f||ff}|rP|jQ                  d      s?tR        jT                  jW                  |      s tR        jT                  jY                  ||      }|jZ                  j]                  dd      rt_        |xs d||jD                  j`                  |rt ||jZ                  jc                               D ci c]H  \  }}te        jf                  |      s.te        jh                  |      s|tk        jl                  |||      J c}}nd|      }  ||        |jZ                  j]                  dd      s|j:                  dd=  |sjt        |dd      }!|!"|!|ur|!jn                  }|!}|!j(                  }d	}|jp                  }!|!+t        |dd      s|!jn                  }|!}|!j(                  }d}	 ts        |
      }"|"S c c}}w )a  Extract traceback information.

        Args:
            exc_type (Type[BaseException]): Exception type.
            exc_value (BaseException): Exception value.
            traceback (TracebackType): Python Traceback object.
            show_locals (bool, optional): Enable display of local variables. Defaults to False.
            locals_max_length (int, optional): Maximum length of containers before abbreviating, or None for no abbreviation.
                Defaults to 10.
            locals_max_string (int, optional): Maximum length of string before truncating, or None to disable. Defaults to 80.
            locals_hide_dunder (bool, optional): Hide locals prefixed with double underscore. Defaults to True.
            locals_hide_sunder (bool, optional): Hide locals prefixed with single underscore. Defaults to False.

        Returns:
            Trace: A Trace instance which you can use to construct a `Traceback`.
        Fr   )_IMPORT_CWD	__notes__N_objectr7   c                 8    	 t        |       S # t        $ r Y yw xY w)z1Don't allow exceptions from __str__ to propagate.z<exception str() failed>)r   r   )r   s    rB   safe_strz#Traceback.extract.<locals>.safe_str  s#    27|# 212s   
 	T)r   r   r   r   )rF      )rN   rO   rQ   rR   r   ?r   )r   r   r   r   r   r   iter_localsc              3      K   ss| E d{    y| D ]3  \  }}r|j                  d      rr|j                  d      r.||f 5 y7 >w)z-Extract locals from an iterator of key pairs.N__rx   
startswith)r   keyrY   rQ   rR   s      rB   
get_localsz%Traceback.extract.<locals>.get_locals  s_      +.@***"- %JC)cnnT.B )cnnS.A u*$% +s   
AA?Aro   r   <_rich_traceback_omit)
max_length
max_string)r   r   r   r   r   _rich_traceback_guard	__cause____suppress_context__)r   ):pip._vendor.richr   getattrsetr	   r   r   r   r   version_infor   BaseExceptionGroupExceptionGroupr   r   addr   r]   r   type__traceback__SyntaxErrorr   r   r   r   r   r   r   r   r   r   objectr   f_codeco_filenamef_lastinextr   co_positionsr   r   r   isabsjoinf_localsrs   r   co_nameitemsinspect
isfunctionisclassr   traverse	__class____context__r   )#r   r   r   rZ   rN   rO   rP   rQ   rR   r   r   r   r   r   grouped_exceptionsr   stack	exceptionr   r   frame_summaryrA   r   r   instruction_indexinstruction_position
start_lineend_linestart_column
end_columnr   rY   framecauser   s#          ``                          rB   r   zTraceback.extract  s:   > !0"9k4@FB )0CE6I 		2c 	2c 	2 !("3"34"9-!	E 7*i*<n)MN%)EN%.%9%9 	$(::$*..y9((//%-- $Y ) ) 7 7,72C3E3E4F . 		" )[1%1$++0q&//63$++0q"-2!&" MM% \\((F%%eCK&89%%V,-% +2)*< :(&w(//;; $( ##w.(5(=(=(B%+/)00==?--1,( -" $" #.$0(4&2 (6%z2,(
 H$7$7$<77==2#%77<<X#F ))--.DeL%_"&--55 ' /99O9O9U9U9W.X !+U$+$6$6u$=QVAW   %+<+<"  "%5#& u ))--.EuMQu:(x &	;=$i)?$H %I !& 3 3I#H!--$W5u.  %H %I % 3 3I$HV$Ws   AP rH   optionsc              #      	
K    j                   }|j                         |j                  }t        i d |t              d |t
              d |t              d |t        j                        d |t              d |t              t        d      z   d	 |t              d
 |t              t        d      z   d |t              d |t        j                        d |t        j                        d |t        j                        d |t        j                        d |t              d |t              d |t        j                        t        d      z   d      
t!               t#               dt$        dt&        dt(        f	 
fd       	t+        t-         j.                  j0                              D ]  \  }} 	||        y w)Nr   pygments.textpygments.stringpygments.functionpygments.numberzrepr.indentT)dimzrepr.strz
repr.brace)boldzrepr.numberzrepr.bool_truezrepr.bool_falsez	repr.nonezscope.borderzscope.equalsz	scope.keyzscope.key.specialF)inheritr   r@   r7   c              3   4  K   | j                   rTt        j                  |       d	ddd      }t        |j                        }
j                        5  | d d d        | j                  
j                        5  t        t        j                  | j                        	dddj                        j                         d d d        t        j                  | j                   dd	f | j                  j                               nh| j                  r8t        j                  | j                   dd	f | j                               n$t        j                  | j                   d	f       | j                  D ]   }t        j                  d
 |             " | j                  rt        | j                   d      D ]m  \  }}g }t#        |j$                        D ]  \  }}|j'                   ||              d t        t        t)        | d| d      j                         o |s<| j*                  rt        j,                  d       y t        j,                  d       y y # 1 sw Y   $xY w# 1 sw Y   xY ww)Nz7[traceback.title]Traceback [dim](most recent call last)ztraceback.borderT)r   r   )titlestyleborder_styleexpandpaddingztraceback.border.syntax_error)r  r  r  r  rI   z: ztraceback.exc_type)z[NOTE] ztraceback.noter   r   zSub-exception #ztraceback.group.border)r  r  zI
[i]The above exception was the direct cause of the following exception:
zH
[i]During handling of the above exception, another exception occurred:
)r   r,   _render_stackr)   rI   	use_themer   _render_syntax_errorr   assembler   r   r   r   r   	enumerater   r!   r   r   r&   r   from_markup)r   r@   stack_renderablenotegroup_nogroup_exceptionr   
group_lastgroup_stackbackground_stylerH   highlighterrender_stackr   traceback_themes            rB   r&  z0Traceback.__rich_console__.<locals>.render_stackz  s    ||6;&&u-S*!3"7  $--=tzz#J &&7 +**+ !!-&&7 # 55e6H6HI"2)H#'$*"&** 


 
 mm'r*,@A 2 2 6 67  mm'r*,@A0 
 mm'7:N$OPP Vmm$A;tCTUUV ~~1:5;K;KQ1O -Ho68&3<_=S=S3T Y/
K*11,{J2WXYH#!#56$3H:">)A
 

  >>**e  **d  ]+ + s8   AJI>%JAJF2J>JJJJ)rL   get_background_styleget_style_for_tokenr1   	TextTokenr   r   r   Functionr   r   r.   r   Constant	Delimiterr   r+   r(   r   r_   r'   r!   reversedr   r   )r   rH   r	  rL   token_styler@   r   r$  r%  r&  r'  s   ``     @@@@rB   __rich_console__zTraceback.__rich_console__[  s     

 557//+i0U!3 ";v#6 $[%?	
 ";v#6 {73eoE K/ k)4u$7GG {62 !+g.>.>"? ";w/?/?#@ [)9)9: F,<,< = H 5 [.  $[%?%D/%Q!$ '
, &'	A	 A	T A	l A	 A	 
A	F %Xdjj.?.?%@A 	,KD%ud++	,s   GG!r   c              #   8  K   t               }t               }|j                  dk7  rpt        j                  j                  |j                        rGt        j                  d|j                   dfdt        |j                        dfd      } ||        ||j                  j                               }d|_        t        |j                  d	z
  t        |            }|j!                  d
||       |t        j"                  dd|z  z   dz   d      z  }| y w)Nz<stdin> r  :r  r  r  r  Tr   zbold underline
u   [traceback.offset]▲[/])r+   r   r   r   r   existsr   r  r   r   r   rstripno_wrapminr   lenstylizer  )r   r   r%  path_highlighterr   syntax_error_textr   s          rB   r  zTraceback._render_syntax_error  s    %'*,  I-ww~~l334}}../02CD*,,-/@A)	 't,,'(9(9(@(@(BC$(!\((1,c2C.DE!!"2FFCT--3<"<<!
 	
  s   DDr   codec                 R   t         j                  j                  |      d   }|sA|j                  d      }|dk7  r|d | n|}|j	                  d      rd|j                         v ry	 | j                  j                  |      xs t        ||      j                  S # t        $ r Y yw xY w)Nr9   r6  z#!r   r   )r   r   splitextindexr   lowerLEXERSrs   r   r   r   )r   r   r?  extnew_line_index
first_lines         rB   _guess_lexerzTraceback._guess_lexer  s    ggx(, "ZZ-N2@B2Fo~.DJ$$T*x:;K;K;M/M	::>>#&W*B8T*R*W*WW 		s   '2B 	B&%B&r   c              #      K   t               } j                  }dt        dt        t           f fd}d } j
                  dk7  r<t         j
                  dz  t        |j                         j
                  dz  z
        }d}t        |j                        D ]  \  }}|r||v rd}|r#|J t        dt        |       d	d
d       d}|dk(  }	|j                  t        fd j                  D              }
t        j                  j!                  |j                        rXt        j"                   |t        |j                  d            dt%        |j&                        dfd|j(                  dfd      }n;t        j"                  d|j(                  dfdt%        |j&                        dfd      }|j                  j+                  d      s|	sd | |j                  j+                  d      r ||      E d {    r|
rv	 t-        j.                  |j                        }dj1                  |      }|s j3                  |j                  |      }t5        |||d|j&                   j6                  z
  |j&                   j6                  z   f|j&                  h j8                   j:                   j<                  d
      }d |j>                  |j>                  \  }}tA        ||      D ]g  \  }}}	 |dk(  r-||dz
     }t        |      t        |jC                               z
  }|dk(  rt        ||dz
           }|jG                  d||f||f       i |jH                  rtK        |g ||      d      n|  y 7 # tD        $ r Y w xY w# tL        $ r'}t        j"                  d| df       Y d }~1d }~ww xY ww)Nr  r7   c              3      K   | j                   r;t        | j                   dj                  j                  j                         y y w)Nr   )r  rS   r   r   )r   r-   rS   rO   rP   )r  r   s    rB   render_localsz.Traceback._render_stack.<locals>.render_locals  sE     ||"LL""&"4"4#55#55  s   A	Ar   ro   FTz
... z frames hidden ...centerztraceback.error)justifyr  c              3   @   K   | ]  }j                  |        y wNr   ).0r   frame_filenames     rB   	<genexpr>z*Traceback._render_stack.<locals>.<genexpr>  s     W^66t<Ws   r  r5  r3  r  z in r  r  zin r   r   )rL   line_numbers
line_rangehighlight_linesrM   rJ   rS   dedentr   r9   ztraceback.error_range)r  r5   r6   )r  r6  )'r   rL   r   r   r%   rU   r:   r;  r   r  r   r   anyrT   r   r   r7  r  r   r   r   r   	linecachegetlinesr   rH  r/   rK   rM   rJ   rS   r   rC   lstrip
IndexErrorstylize_ranger   r"   r   )r   r   r=  rL   rK  exclude_framesexcludedframe_indexr  r?   
suppressedr   
code_linesr?  
lexer_namesyntaxr5   r6   r;   r<   r>   r   errorrQ  s   `                      @rB   r  zTraceback._render_stack  s    *,

	 	84E+F 	 +/??a"1$ELL!DOOq$88N
 "+ELL"9 g	K+"?%111S011CD$+ 
 !1$E"^^NWWWJww~~enn-}}$T%..@Q%RS*&(9:ZZ!45) }}ZZ!45*&(9:) >>,,S1%J~~((-(///=!*!3!3ENN!CJ77:.D !!%!2!25>>4!HJ#"#%)!LL4+;+;;!LL4+;+;;$ */"&..#'??&*&8&8$F H --9%*%;%;
s 8J%QT7U 3E7G	)#*a<+5eai+@D.1$i#dkkm:L.LG#*b=.1*UQY2G.HG #00&=',g&6%*G$4 1 2 !<<   &!.u!5 %& $
{g	N 0X $. ) !))# ! --eW'89  so   G?ONO2NOBN.O ANAO	NONO	O'O	O	OOrO  )"r   r   r   __doc__rD  LOCALS_MAX_LENGTHLOCALS_MAX_STRINGr   r   r   r   r_   r   r   r   r   classmethodr   r	   r   r   r^   r   r   r#   r$   r'   r0  r(   r   r  rH  r   r  rG   rd   rB   r]   r]      sn   . F "&3F  #$&#!!2!2#'#("57!3F3F }	3F
 SM3F 3F }3F 3F 3F 3F 3F !3F !3F 3F 5j123F  !3Fj   #$&#!!2!2#'#("57%F
s)F
 !F
 M*	F
 }F
 SMF
 F
 }F
 F
 F
 F
 F
 !F
 !F
  !F
" 5j12#F
$ %F
& 
'F
 F
P  "!2!2#'#(<@|}%| !| M*	| | | | !| !| &c-&89| 
| ||d,d,)7d,	d,L W   ,    , C s s   W}5 }\ } }rd   r]   __main__r   ac                 $    d}t        || z         y )Nr   )r`   )rj  ones     rB   barrm  m  s     cAgrd   c                 ,    d}h ddd}t        |        y )NT>   Duncan IdahoThufir HawatPaul AtreidesVladimir Harkonnen)NFT)
charactersatomic_types)rm  )rj  r   zeds      rB   foorv  s  s"     $ 0
 	Ard   c                      t        d       y )Nr   )rv  rG   rd   rB   rd  rd    s	    Ard   )r7   N)[r   rX  r   r   dataclassesr   r   	itertoolsr   rZ   r   typesr   r   typingr	   r
   r   r   r   r   r   r   r   r   r   pip._vendor.pygments.lexersr   pip._vendor.pygments.tokenr   r   r   r   r   r   r   r*  r   pip._vendor.pygments.utilr   r   r   _loopr    r!   columnsr"   rH   r#   r$   r%   r&   r'   r(   	constrainr)   r%  r*   r+   panelr,   scoper-   r  r.   rc  r/   r0   r   rL   r1   platformWINDOWSrf  rg  r   rC   r   r_   r   r   r   r   r   r   r   r]   r   rm  rv  rd  rG   rd   rB   <module>r     s     	 
 (   +    A W W 8 , 3  -   ! :    *  
,,'
!  %% .%eCcM"#%< "& "..#)-13@g@ C=@ 	@
 @ C=@ @ @ @ @ @ !@ @ uS*_-.@ @  tM"M8M3JKSPQ!@F O O O 3 3 3 < < <   /& /g	 g	T z	s t  
G5 rd   