
    !2i              #          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jG        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    r0 ePd#B           d dlZdCeddfdDZXdCeddfdEZYdGdFZZ eZ             dS dS )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V  dS t          t          ||dz                       D ]!\  }}}|r||dfV  |r|d|fV  |ddfV  "dS )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	            Y/var/www/html/pixcura-vrs/venv/lib/python3.11/site-packages/pip/_vendor/rich/traceback.py_iter_syntax_linesrC   7   s       NE7NE7~~Wg%%%%%%$3E%4K4K$L$L 	% 	% E4 %w***** %q')))))q"n$$$$	% 	%    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_framesrI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   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                               | ||	
t                              }                    |           d S )NrJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   )	Tracebackfrom_exceptionboolprint)rY   rZ   r[   exception_tracebackrK   rL   rT   rR   rS   rP   rQ   rV   rO   rU   rM   traceback_consolerJ   rN   s       rB   
excepthookzinstall.<locals>.excepthook   sv    
 (66!##//1#$677'!! 7 
 
$ 	 344444rD   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	 _        d S )
Nargskwargsr7   c                      | | i | dS )zEwrap the default ip.showtraceback to store info for ip._showtracebackNrH   )rg   rh   default_showtracebacktb_datas     rB   ipy_show_tracebackzCinstall.<locals>.ipy_excepthook_closure.<locals>.ipy_show_traceback   s&     G!!42622222rD   F)	is_syntaxrm   c                    	                                 }| rdn|d         }
                    dd          }
                    d          }||rdnd}t          |          D ]}| n|j        } |d         |d         |           i 
dS )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   _rd   re   rk   s           rB   ipy_display_tracebackzFinstall.<locals>.ipy_excepthook_closure.<locals>.ipy_display_traceback   s    
 ((**I 3<*M$$1B {{#:EBBHK00I !)0AAq	9%%    :EZJy|Yq\2666GGGrD   c                       | ddi|S )Nrm   TrH   )rg   rh   ry   s     rB   <lambda>z9install.<locals>.ipy_excepthook_closure.<locals>.<lambda>   s(    5J5J6
!6
%+6
 6
 rD   )showtracebackr	   r`   _showtracebackshowsyntaxerror)re   rl   rj   ry   rk   rd   s   ` @@@rB   ipy_excepthook_closurez'install.<locals>.ipy_excepthook_closure   s     " 0	3c 	3S 	3T 	3 	3 	3 	3 	3 	3 	3 +0	 	 		#'	;>		 	 	 	 	 	 	 	4 2-
 
 
 
rD   )r#   
is_jupyterr   BaseExceptionr   r   r	   get_ipythonsysrd   	Exception)rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   r   re   old_excepthookrd   rc   s    `````````````   @@rB   installr   S   sf   V 18t,,,,W (	 -?-G 	 5M"55 M*5 
	5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 52)
3 )
4 )
 )
 )
 )
 )
 )
V	]]r"""~   #	s   $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<   dS )	Framefilenamelinenoname lineNlocalslast_instruction)__name__
__module____qualname__str__annotations__intr   r   r   r   r   Noder   r   rH   rD   rB   r   r      s         MMMKKK
IIID#NNN/3FHT#v{*+,333JNhuU38_eCHo%EFGNNNNNrD   r   c                   p    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<   dS )	_SyntaxErroroffsetr   r   r   msgdefault_factorynotesN)
r   r   r   r   r   r   r   listr   r   rH   rD   rB   r   r      s`         KKKMMM
IIIKKK	HHHuT222E492222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<   dS )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   rH   rD   rB   r   r      s         MMMNNN+/L(<(///Hd%555FDK555uT222E49222Hd %d ; ; ;JW;;;;;rD   r   c                   &    e Zd ZU ee         ed<   dS )r   stacksN)r   r   r   r   r   r   rH   rD   rB   r   r      s"         KrD   r   c                       e Zd ZdgZdS )PathHighlighterz(?P<dim>.*/)(?P<bold>.+)N)r   r   r   
highlightsrH   rD   rB   r   r      s        -.JJJrD   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!dS )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.pxiNrE   rF   rG   FTrH   r]   tracerJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   c                   |Et          j                    \  }}}|||t          d          |                     ||||          }|| _        || _        || _        || _        t          j	        |pd          | _
        || _        || _        || _        || _        |	| _        |
| _        || _        g | _        |D ]}t'          |t(                    s9|j        J |d            t,          j                            |j                  }n|}t,          j                            t,          j                            |                    }| j                            |           |dk    rt9          d|          nd| _        d S )Nz9Value for 'trace' required if not called in except: blockrO   	ansi_darkz+ must be a module with '__file__' attributer      )r   exc_info
ValueErrorextractr   rJ   rK   rL   r/   	get_themerM   rN   rO   rT   rP   rQ   rR   rS   rU   
isinstancer   __file__ospathdirnamenormpathabspathappendmaxrV   )selfr   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   r   r   r[   suppress_entityr   s                       rB   __init__zTraceback.__init__  s   $ =-0\^^*Hi9#4	8I O   LL)YK !  E 

$&%e&:{;;
"&*!2!2"4"4')' 		' 		'Oos33 '#,88%TTT 988w'?@@&7##BGOOD$9$9::DM  &&&&0:Q#a,,,ArD   r   r   r[   r7   c                n    |                      ||||	|
|||          } | |||||||	||
|||||          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.
        )rO   rP   rQ   rR   rS   )rJ   rK   rL   rM   rN   rO   rT   rP   rQ   rR   rS   rU   rV   )r   )clsr   r   r[   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rich_tracebacks                     rB   r_   zTraceback.from_exceptionS  sz    Z #//11 % 	
 	
 s!##'//11!
 
 
 	
rD   )rO   rP   rQ   rR   rS   _visited_exceptionsr   c                   g }
d}ddl m} t          |dd          pg }|	t                      n|	}dt          dt
          fd}	 t           ||j                   ||          ||
          }t          j	        dk    rt          |t          t          f          rwd	|_        |j        D ]h}||v r|                    |           |j                            t"                              t'          |          ||j        ||                     it          |t*                    r;t-          |j        pd|j        pd|j        pd|j        pd|j        |          |_        |
                    |           |j        j        }dt<          t>          t
          t@          f                  dt<          t>          t
          t@          f                  ffd}tC          |          D ]p\  }}|j"        j#        }d}t          j	        dk    rY|j$        dz  }tK          tM          |j"        '                                ||dz                       }|\  }}}}|||
|||f||ff}|rT|(                    d          s?tR          j*        +                    |          s tR          j*        ,                    ||          }|j-        .                    dd          rt_          |pd||j"        j0        |r/fd ||j-        1                                          D             nd|          } ||           |j-        .                    dd          r
|j        dd= r|sYt          |dd          }|||ur|j2        }|}|j        }d	}<|j3        }|%t          |dd          s|j2        }|}|j        }d}j	 ti          |
          } | S )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                 D    	 t          |           S # t          $ r Y dS 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  s7    27||# 2 2 21112s    
T)r   r   r   r   )rG      )rO   rP   rR   rS   r   ?r   )r   r   r   r   r   r   iter_localsc              3      K   ss
| E d{V  dS | D ];\  }}r|                     d          rr|                     d          r5||fV  <dS )z-Extract locals from an iterator of key pairs.N__rx   
startswith)r   keyrZ   rR   rS   s      rB   
get_localsz%Traceback.extract.<locals>.get_locals  s       + .@ ********F"- % %JC) !cnnT.B.B ! ) !cnnS.A.A ! u*$$$$% %rD   ro   r   <_rich_traceback_omitc                     i | ]E\  }}t          j        |          t          j        |          -|t          j        |           FS ))
max_length
max_string)inspect
isfunctionisclassr   traverse).0r   rZ   rP   rQ   s      rB   
<dictcomp>z%Traceback.extract.<locals>.<dictcomp>.  ss        !+U$+$6u$=$= BIQVAWAW %+<+<" " "  rD   )r   r   r   r   r   _rich_traceback_guard	__cause____suppress_context__)r   )5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	__class____context__r   )!r   r   r   r[   rO   rP   rQ   rR   rS   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_columnframecauser   s!        ````                        rB   r   zTraceback.extract  s   > !000000"9k4@@FB )0CEEE6I 		2c 	2c 	2 	2 	2 	2H	!("344"(9--!	  E 7**i*<n)MNN %)EN%.%9  	$(:::$*..y999(//%-- $Y ) ) 7,72C3E3E4F . 	 	    )[11 %1$+0q&/63$+0q"-2!& & &" MM%   \(F%%eCK&89%%V,-% % % % % % % +2)*<*< :( :(&w(/; $( #w..(5(=(B%+/)0==??--1 , ,( -" $" #.$0(4&2 (6%z2,(
  GH$7$7$<$< G7==22 G#%7<<X#F#F )--.DeLL %_"&-5 '
"      /9j9O9U9U9W9W.X.X    "%5#  & u )--.EuMM (QQQ% 	;==$i)?)?$H %I !& 3I#H!-$W5u. .$  %H %I % 3I$HV$$$rD   rI   optionsc              #   6   	
K    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        j                            D ]\  }} 	||          V  d S )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     K   | j         rnt                              |           d	ddd          }t          |j                  }
                              5  |V  d d d            n# 1 swxY w Y   | j        
                              5  t          t                              | j                  	dddj                  j                  V  d d d            n# 1 swxY w Y   t          j	        | j
         dd	f | j        j                            V  nU| j        r0t          j	        | j
         dd	f | j                            V  nt          j	        | j
         d	f          V  | j        D ]"}t          j	        d
 |                    V  #| j        rt          | j        d          D ]u\  }}g }t#          |j                  D ]$\  }}|                     ||                     %dV  t          t          t)          | d| d          j                  V  v|s7| j        rt          j        d          V  d S t          j        d          V  d S d S )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  rJ   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)   rJ   	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_stylerI   highlighterrender_stackr   traceback_themes            rB   r)  z0Traceback.__rich_console__.<locals>.render_stackz  s     | +6;&&u--S*!3"7 7 7  $--=tz#J#J &&77 + +****+ + + + + + + + + + + + + + + !-&&77  # 55e6HII"2)H#'$*"&*   

 
 
 
 
               m***,@AK 2 677       Qm***,@AK00     
 m%8:N$OPPPPP V Vm$A;;tCTCTUUUUUU~ 1:5;KQ1O1O  -Ho68&3<_=S3T3T Y Y/
K*11,,{J2W2WXXXXHHH#!#56">H">">)A  
 
       > *e       *d       s%   A..A25A2AC))C-0C-)rM   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   rI   r  rM   token_styler@   r  r'  r(  r)  r*  s   ``     @@@@rB   __rich_console__zTraceback.__rich_console__[  s      
 5577/++i00U!3!3 ";;v#6#6 $[[%?%?	
 ";;v#6#6 {{733eoooE KK// kk)44u$7G7G7GG {{622 !++g.>"?"? ";;w/?#@#@ [[)9:: F,< = = H 5 5 [[..  $[[%?%?%D///%Q!$ '
 
 
, &''	A	 A	T A	l A	 A	 A	 A	 A	 A	 A	 A	 A	 A	 
A	F %Xdj.?%@%@AA 	, 	,KD%,ud++++++	, 	,rD   r   c              #   <  K   t                      }t                      }|j        dk    rgt          j                            |j                  rCt          j        d|j         dfdt          |j	                  dfd          } ||          V   ||j
                                                  }d|_        t          |j        d	z
  t          |                    }|                    d
||           |t          j        dd|z  z   dz   d          z  }|V  d S )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  sJ     %''*,, I--w~~l344 -}0.002CD*,--/@A)	   '&t,,,,,'K(9(@(@(B(BCC$(!\(1,c2C.D.DEE!!"2FFCCCT-3<"<<!
 
 
 	
  rD   r   codec                 z   t           j                            |          d         }|sT|                    d          }|dk    r
|d |         n|}|                    d          rd|                                v rdS 	 | j                            |          pt          ||          j	        S # t          $ r Y dS w xY w)Nr9   r9  z#!r   r   )r   r   splitextindexr   lowerLEXERSrs   r   r   r   )r   r   rB  extnew_line_index
first_lines         rB   _guess_lexerzTraceback._guess_lexer  s    gx((, 	  "ZZ--N2@B2F2Fo~o..DJ$$T**  x:;K;K;M;M/M/Mx	:>>#&&W*B8T*R*R*WW 	 	 	66	s   =.B, ,
B:9B:r  c              #   X   K   t                      } j        }dt          dt          t                   f fd}d } j        dk    r5t           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          V  d}|dk    }	|j        t          fd j        D                       }
t          j                            |j                  rSt          j         |t          |j        d                    dt%          |j                  dfd|j        dfd          }n4t          j        d|j        dfdt%          |j                  dfd          }|j                            d          s|	sdV  |V  |j                            d          r ||          E d {V  e|
s	 t-          j        |j                  }d                    |          }|s                     |j        |          }t5          |||d|j         j        z
  |j         j        z   f|j        h j         j         j        d
  
        }dV  |j        |j        \  }}tA          ||          D ]\  }}}	 |dk    r<||dz
           }t          |          t          |!                                          z
  }|dk    rt          ||dz
                     }n# tD          $ r Y tw xY w|#                    d||f||f           |j$        rtK          |g ||          d          n|V  # tL          $ r&}t          j        d| df          V  Y d }~d }~ww xY wd S )Nr
  r7   c              3   r   K   | j         r,t          | j         dj        j        j                  V  d S d S )Nr   )r  rT   r   r   )r   r-   rT   rP   rQ   )r
  r   s    rB   render_localsz.Traceback._render_stack.<locals>.render_locals  s`      | "L""&"4#5#5        rD   r   ro   FTz
... z frames hidden ...centerztraceback.error)justifyr  c              3   B   K   | ]}                     |          V  d S Nr   )r   r   frame_filenames     rB   	<genexpr>z*Traceback._render_stack.<locals>.<genexpr>  s1      WW^66t<<WWWWWWrD   r  r8  r6  r  z in r  r  zin r   r   )rM   line_numbers
line_rangehighlight_linesrN   rK   rT   dedentr   r9   ztraceback.error_range)r  r5   r6   )r  r9  )'r   rM   r   r   r%   rV   r:   r>  r   r  r   r   anyrU   r   r   r:  r  r   r   r   r   	linecachegetlinesr   rK  r/   rL   rN   rK   rT   r   rC   lstrip
IndexErrorstylize_ranger   r"   r   )r   r  r@  rM   rN  exclude_framesexcludedframe_indexr
  r?   
suppressedr   
code_linesrB  
lexer_namesyntaxr5   r6   r;   r<   r>   r   errorrS  s   `                      @rB   r  zTraceback._render_stack  s     *,,
	 	84E+F 	 	 	 	 	 	 +/?a"1$EL!!DOq$88 N
 "+EL"9"9 g	 g	K +"?"? !%111DS00DDD$+     
 !1$E"^NWWWWWWWWWJw~~en-- }$$T%.@Q%R%R%RSS*&&(9:Z!45)   }Z!45*&&(9:)   >,,S11 % JJJ~((-- (=///////// >=!*!3EN!C!CJ77:..D ! !!%!2!25>4!H!HJ#"#%)!L4+;;!L4+;;$ */"&.#'?&*&8$  F HHH -9%*%;
s 8J%QT7U7U  3E7G	)#*a<<+5eai+@D.1$ii#dkkmm:L:L.LG#*b==.1*UQY2G.H.HG#- ) ) ) !))
 #00&=',g&6%*G$4 1     !<$ &!.u!5!5 %&    $
 
 
 
7 !   -%e'89         3>Sg	 g	s2   :0M5,A)M5=A L
L+*L+5
N%?N  N%rR  )"r   r   r   __doc__rG  LOCALS_MAX_LENGTHLOCALS_MAX_STRINGr   r   r   r   r`   r   r   r   r   classmethodr   r	   r   r   r_   r   r   r#   r$   r'   r3  r(   r   r  rK  r   r  rH   rD   rB   r^   r^      s        .  F "&3F  #$&#!!2!2#'#("57!3F 3F 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 3F 3F 3Fj   #$&#!!2!2#'#("57%F
 F
 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
 F
 [F
P  "!2!2#'#(<@| | |}%| !| M*	| | | | !| !| &c-&89| 
| | | [||d,d,)7d,	d, d, d, d,L UWW   ,       W , C s s    [ UWW}5 }\ } } } W} } }rD   r^   __main__r   ac                 .    d}t          || z             d S )Nr   )ra   )rl  ones     rB   barro  m  s     cAgrD   c                 6    d}h ddd}t          |            d S )NT>   Duncan IdahoThufir HawatPaul AtreidesVladimir Harkonnen)NFT)
charactersatomic_types)ro  )rl  r   zeds      rB   foorx  s  s9     $   0
 
 	ArD   c                  $    t          d           d S )Nr   )rx  rH   rD   rB   rf  rf    s    ArD   )r7   N)[r   rZ  r   r   dataclassesr   r   	itertoolsr   r[   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"   rI   r#   r$   r%   r&   r'   r(   	constrainr)   r(  r*   r+   panelr,   scoper-   r  r.   re  r/   r0   r   rM   r1   platformWINDOWSrh  ri  r   rC   r   r`   r   r   r   r   r   r   r   r^   r   ro  rx  rf  rH   rD   rB   <module>r     s        				 



 ( ( ( ( ( ( ( (             + + + + + + + +                          A @ @ @ @ @ W W W W W W W W W W W W W W W W 8 8 8 8 8 8 , , , , , , 3 3 3 3 3 3       - - - - - - - -                      !           : : : : : : : :                   * * * * * * * *            
,'
!  %% .%eCcM"#% % % %< "& "..#)-13@ @ @g@ C=@ 	@
 @ C=@ @ @ @ @ @ !@ @ uS*_-.@ @  tM"M8M3JKSPQ!@ @ @ @F O O O O O O O O 3 3 3 3 3 3 3 3 < < < < < < < <        / / / / /& / / /g	 g	 g	 g	 g	 g	 g	 g	T zGJJJ	   s t        
EGGGGG5 rD   