AlkantarClanX12

Your IP : 13.59.95.170


Current Path : /opt/alt/python312/lib64/python3.12/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/__pycache__/traceback.cpython-312.opt-2.pyc

�

�Q�f������	ddlZddlZddlZddlZddlZddlmZgd�Zd8d�Z	d�Z
d9d�Zd8d�Zd8d�Z
d	Zd
ZGd�d�Ze�Zd
�Zeedddfd�Zeeddfd�Zefd�Zd�Zefd�Zd:d�Zd;d�Zd:d�Zd<d�Zd9d�Zd9d�Zd�ZGd�d�Z d�Z!d�Z"d�Z#d �Z$d!Z%Gd"�d#e&�Z'd$�Z(ejRd%gd&�d'd(g�)�Z*d*�Z+d+Z,d,�Z-Gd-�d.�Z.Gd/�d0�Z/d1Z0d2Z1d3Z2d4Z3d5�Z4d6�Z5d7�Z6y)=�N)�suppress)�
extract_stack�
extract_tb�format_exception�format_exception_only�format_list�format_stack�	format_tb�	print_exc�
format_exc�print_exception�
print_last�print_stack�print_tb�clear_frames�FrameSummary�StackSummary�TracebackException�
walk_stack�walk_tbc��	|�tj}tj|�j	�D]}t||d���y)N���file�end)�sys�stderrr�	from_list�format�print)�extracted_listr�items   �0/opt/alt/python312/lib64/python3.12/traceback.py�
print_listr$sA��E��|��z�z���&�&�~�6�=�=�?��
�d��2�&�@�c�J�	tj|�j�S�N)rrr)r!s r#rrs#��
��!�!�.�1�8�8�:�:r%c�6�	tt||��|��y�N��limit)r)r$r)�tbr+rs   r#rr/s����z�"�E�*��6r%c�:�	t||��j�S�Nr*)rr�r,r+s  r#r
r
9s��?��b��&�-�-�/�/r%c�D�	tjt|�|��Sr.)r� _extract_from_extended_frame_gen�_walk_tb_with_full_positionsr/s  r#rr=s+����8�8�$�R�(��9�7�7r%zG
The above exception was the direct cause of the following exception:

zF
During handling of the above exception, another exception occurred:

c��eZdZd�Zy)�	_Sentinelc��y)Nz
<implicit>���selfs r#�__repr__z_Sentinel.__repr__[s��r%N)�__name__�
__module__�__qualname__r9r6r%r#r4r4Zs��r%r4c���|tu|tuk7rtd��||cxurturIn||fS|�@t|t�r||jfStdt
|�j�d���y||fS)Nz-Both or neither of value and tb must be givenzException expected for value, z found�NN)�	_sentinel�
ValueError�
isinstance�
BaseException�
__traceback__�	TypeError�typer:)�exc�valuer,s   r#�_parse_value_tbrH`s���
����i��0��H�I�I����i���"�9���?��#�}�-��C�-�-�-�-��<�#�C�y�1�1�2�&�:�;�
;���"�9�r%Tc�~�	t|||�\}}tt|�|||d��}|j||��y)NT�r+�compact�r�chain)rHrrEr )rFrGr,r+rrM�tes       r#r
r
osA��	� ��U�B�/�I�E�2�	�D��K���%��	N�B��H�H�$�e�H�$r%c��	t|||�\}}tt|�|||d��}t|j	|���S)NTrJ�rM)rHrrE�listr)rFrGr,r+rMrNs      r#rr�sG��� ��U�B�/�I�E�2�	�D��K���%��	N�B���	�	��	�&�'�'r%c�z�	|tur|}tt|�|dd��}t|j	��S)NT)rK)r?rrErQr)rFrGrNs   r#rr�s>��	�
�	����	�D��K���d�	C�B���(�(�*�+�+r%c�D�t|d�}|�|sd|z}|S|�d|�d�}|S)N�	exceptionz%s
z: �
)�_safe_string)�etyperG�valuestr�lines    r#�_format_final_exc_linerZ�s6���E�;�/�H��}�H���~���K�#�H�-���Kr%c�H�	||�S#d|�d|j�d�cYSxYw)N�<� z
() failed>)r:)rG�what�funcs   r#rVrV�s1��4��E�{���4��4�&��$�-�-��
�3�3�s�
�!c�H�	ttj�|||��y)N�r+rrM)r
rrTras   r#rr�s��O��C�M�M�O�5�t�5�Ir%c�b�	djttj�||���S)Nr�r+rM)�joinrrrTrcs  r#rr�s$��/�
�7�7�#�C�M�M�O�5��N�O�Or%c�*�	ttd�sttd�std��ttd�rttj|||�yttj
tjtj|||�y)N�last_exc�	last_typezno last exception)�hasattrrr@r
rfrg�
last_value�last_tracebackras   r#rr�sc��V��3�
�#�G�C��,E��,�-�-��s�J������e�T�5�9���
�
�s�~�~�s�7I�7I��t�U�	,r%c�v�	|�tj�j}tt	||��|��yr))r�	_getframe�f_backr$r)�fr+rs   r#rr�s0���	�y��M�M�O�"�"���}�Q�e�,�4�8r%c�p�	|�tj�j}tt	||���Sr.)rrlrmrr)rnr+s  r#r	r	�s-��?��y��M�M�O�"�"���}�Q�e�4�5�5r%c��	|�tj�j}tj	t|�|��}|j
�|Sr.)rrlrmr�extractr�reverse)rnr+�stacks   r#rr�sF���	�y��M�M�O�"�"��� � ��A��e� �<�E�	�M�M�O��Lr%c�~�	|�+	|jj�|j}|��*yy#t$rY�wxYwr')�tb_frame�clear�RuntimeError�tb_next�r,s r#rr�sE��K�
�.�	��K�K�����Z�Z��

�.���	��	�s�0�	<�<c�f�eZdZ	dZddddddd�d�Zd�Zd�Zd�Zd	�Zd
�Z	e
d��Ze
d��Zy)
r)�filename�lineno�
end_lineno�colno�	end_colno�name�_line�localsTN)�lookup_liner�rYr}r~rc
�
�	||_||_||_||_|r|j|r4|j�D�
�cic]\}
}|
t
|dt����c}}
nd|_||_	||_
|	|_ycc}}
w)N�local�r_)r{r|r�r�rY�itemsrV�reprr�r}r~r)r8r{r|r�r�r�rYr}r~r�k�vs            r#�__init__zFrameSummary.__init__	s���	�!��
������	���
���I�I�+1�����(�&���1��,�q�'��=�=�&�(�7;�	
��$�����
�"����	(s�A?c��t|t�rj|j|jk(xrO|j|jk(xr4|j|jk(xr|j
|j
k(St|t�r1|j|j|j|jf|k(StSr')	rArr{r|r�r��tuplerY�NotImplemented�r8�others  r#�__eq__zFrameSummary.__eq__!s����e�\�*��M�M�U�^�^�3�0��K�K�5�<�<�/�0��I�I����+�0��K�K�5�<�<�/�
1��e�U�#��M�M�4�;�;��	�	�4�9�9�E��N�N��r%c�d�|j|j|j|jf|Sr')r{r|r�rY)r8�poss  r#�__getitem__zFrameSummary.__getitem__+s&���
�
�t�{�{�D�I�I�t�y�y�A�#�F�Fr%c�p�t|j|j|j|jg�Sr')�iterr{r|r�rYr7s r#�__iter__zFrameSummary.__iter__.s&���T�]�]�D�K�K����D�I�I�F�G�Gr%c�f�dj|j|j|j��S)Nz7<FrameSummary file {filename}, line {lineno} in {name}>)r{r|r�)rr{r|r�r7s r#r9zFrameSummary.__repr__1s0��H�O�O��]�]�4�;�;�T�Y�Y�P�H�	Hr%c��y)N�r6r7s r#�__len__zFrameSummary.__len__5s��r%c�2�|j|jSr')rYr�r7s r#�_original_linezFrameSummary._original_line8s��	
�	�	��z�z�r%c���|j�<|j�ytj|j|j�|_|jj�Sr')r�r|�	linecache�getliner{�stripr7s r#rYzFrameSummary.line>sH���:�:���{�{�"��"�*�*�4�=�=�$�+�+�F�D�J��z�z���!�!r%)
r:r;r<�	__slots__r�r�r�r�r9r��propertyr�rYr6r%r#rr�si���,�I�?C��d��4�4�#�0�G�H�H������
�"��"r%rc#��K�	|�<tj�jjjj}|� ||jf��|j}|��yy�wr')rrlrm�f_lineno)rns r#rrGsX�����
	�y��M�M�O�"�"�)�)�0�0�7�7��
�-�����m��
�H�H���-�s�A A%�#A%c#�fK�	|�*|j|jf��|j}|��)yy�wr')ru�	tb_linenorxrys r#rrTs5�����

�.��k�k�2�<�<�'�'�
�Z�Z��
�.�s�,1�1c#��K�|�qt|jj|j�}|d�"|j|jf|ddzf��n|j|f��|j
}|��pyy�w�Nr�)�_get_code_positionru�f_code�tb_lastir�rx)r,�	positionss  r#r2r2_ss����
�.�&�r�{�{�'9�'9�2�;�;�G�	��Q�<���+�+����/�)�A�B�-�?�?�?��+�+�y�(�(�
�Z�Z��
�.�s�A2A7�5A7c�t�|dkry|j�}ttj||dzd��S)Nr)NNNN�)�co_positions�next�	itertools�islice)�code�instruction_index�
positions_gens   r#r�r�ms;���1��'��%�%�'�M��	� � ��0A�Q�0F��M�N�Nr%�c�^�eZdZ	edddd�d��Zedddd�d��Zed��Zd�Zd	�Zy)
rNTF�r+�lookup_lines�capture_localsc�D��	�fd�}|j|�|||��S)Nc3�6�K��D]\}}||dddff���y�wr'r6)rnr|�	frame_gens  �r#�extended_frame_genz0StackSummary.extract.<locals>.extended_frame_gen�s)�����&�	��6��&�$��d�3�3�3�'�s�r�)r1)�klassr�r+r�r�r�s `    r#rqzStackSummary.extractys4���
	�	4��5�5�� ��L�)�6�+�	+r%c
�\�|�ttdd�}|�|dkrd}|�4|dk\rtj||�}nt	j
||��}|�}t
�}|D]�\}\}}	}
}|j}|j}
|j}|j|
�tj|
|j�|r
|j}nd}|jt!|
||d||	|
|�����|D]}
tj"|
��|r|D]}|j$�|S)N�tracebacklimitr)�maxlenF)r�r�r}r~r)�getattrrr�r��collections�deque�setr��co_filename�co_name�addr��	lazycache�	f_globals�f_locals�appendr�
checkcacherY)r�r�r+r�r��result�fnamesrnr|r}r~r�cor{r�r�s                r#r1z-StackSummary._extract_from_extended_frame_gen�s+���=��C�!1�4�8�E�� �U�Q�Y�������z�%�,�,�Y��>�	�'�-�-�i���G�	�������9B�5�A�5��
�E�9����B��~�~�H��:�:�D��J�J�x� �����!�+�+�6���:�:�����M�M�,��&�$�E�(�%�U�i�I�
J�:C��H�� � ��*����������
r%c	��	t�}|D]I}t|t�r|j|��%|\}}}}|jt||||����K|S)N�rY)rrArr�)r��a_listr��framer{r|r�rYs        r#rzStackSummary.from_list�s\��	�����E��%��.��
�
�e�$�/4�,��&�$���
�
�l�8�V�T��M�N���
r%c�*�	g}|jdj|j|j|j��|j
�rM|j
j
�}|jdj|��|j}t|�}t|j
j��}||z
}|j���|j���t||j�}t||j�}	|||	}
d}|j|jk(r$tt�5t!|
�}ddd�nt|j#��}	|	|z
t|�ks |�r|j$|j&z
dkD�rt)||�dz}t)||	�dz}
|jd�|jd||z
z�|r�t)|
|j&�}t)|
|j$�}|j|j*|z�|j|j,||z
z�|j|j*|
|z
|z
z�n|jd|
|z
z�|jd�|j.rMt1|j.j3��D]'\}}|jd	j||�
���)dj5|�S#1swY���xYw)Nz  File "{}", line {}, in {}
�    {}
rr�z    r]�^rUz    {name} = {value}
)r�rGr)r�rr{r|r�rYr�r��len�lstripr~r� _byte_offset_to_character_offsetr}r�	Exception�(_extract_caret_anchors_from_line_segment�rstrip�right_start_offset�left_end_offset�_display_width�primary_char�secondary_charr��sortedr�rd)r8�
frame_summary�row�
stripped_linerY�
orig_line_len�frame_line_len�stripped_characters�start_offset�
end_offset�code_segment�anchors�dp_start_offset�
dp_end_offset�dp_left_end_offset�dp_right_start_offsetr�rGs                  r#�format_frame_summaryz!StackSummary.format_frame_summary�s���	�
���
�
�2�9�9��"�"�M�$8�$8�-�:L�:L�N�	O����)�.�.�4�4�6�M��J�J�z�(�(��7�8� �/�/�D���I�M� ��!3�!3�!:�!:�!<�=�N�"/�.�"@���#�#�/�!�+�+�7�?��-�-�-� /��=��-�1�1�3�
�#�L��<���� �'�'�=�+C�+C�C�!�)�,�"J�<�"X��-�,�
"%�T�[�[�]�!3�J���,�s�=�/A�A��G�$>�$>��AX�AX�$X�[\�$\�'5�T�<�&H�1�&L�O�$2�4��$D�q�$H�M��J�J�v�&��J�J�s�o�8K�&K�L�M��-;�L�'�Ja�Ja�-b�*�0>�|�W�Mg�Mg�0h�-��
�
�7�#7�#7�:L�#L�M��
�
�7�#9�#9�=R�Ug�=g�#h�i��
�
�7�#7�#7�=�?�;Z�]r�;r�#s�t��
�
�3�-�/�*I�#J�K��J�J�t�$����%�m�&:�&:�&@�&@�&B�C���e��
�
�3�:�:��E�:�R�S� D��w�w�s�|��E-�,�s�?L�Lc��	g}d}d}d}d}|D]�}|j|�}|��|�1||jk7s"|� ||jk7s|�||jk7rW|tkDr(|tz}|jd|�d|dkDrdnd�d��|j}|j}|j}d}|dz
}|tkDr��|j|���|tkDr(|tz}|jd|�d|dkDrdnd�d��|S)Nrz  [Previous line repeated z
 more timer��srz]
)r�r{r|r��_RECURSIVE_CUTOFFr�)r8r��	last_file�	last_line�	last_name�countr��formatted_frames        r#rzStackSummary.format
sR��
	����	��	��	���!�M�"�7�7�
�F�O��&���!�Y�-�2H�2H�%H��!�Y�-�2F�2F�%F��!�Y�-�2D�2D�%D��,�,��.�.�E��M�M�4�U�G�<�&+�a�i�s�R�8��=��*�2�2�	�)�0�0�	�)�.�.�	����Q�J�E��(�(���M�M�/�*�)"�,�$�$��&�&�E��M�M�,�U�G�4�#�a�i�s�R�0��5�
��
r%)	r:r;r<�classmethodrqr1rr�rr6r%r#rrvs[��I��+/�d� �+��+�*�DH��e�'��'�R����$?�B-r%rc�b�|jd�}t|d|jdd���S)Nzutf-8�replace)�errors)�encoder��decode)�str�offset�as_utf8s   r#r�r�=s2���j�j��!�G��w�w���&�&�w�y�&�A�B�Br%�_Anchors)r�r�r�r��~r�)�defaultsc�t��ddl}	|j��}t|j�dk7ry�fd�}|jd}||j
d�x��S\}|x|jd�x��!\||jj�}||jj�}�||}t|�t|j��z
}	|jj|	z}
|
dz}|	dzt|�kr||	dzj�s|dz
}|
t��krL�|
x}j�s|dvr3|
dz
}
|dz
}|
t��kr�|
x}j�r�.|dvr�3t||
�||��S|jd�x��
\||jj�}
||j jdz�}|
t��krI�|
x}j�s|dk7r/|
dz
}
|
t��kr�|
x}j�r�)|dk7r�/|t��krI�|x}j�s|dk7r/|dz
}|t��kr�|x}j�r�)|dk7r�/|t��kr|dz
}t|
|�Syy#t$rYywxYw)Nrr�c���t�|�Sr')r�)r�segments �r#�<lambda>z:_extract_caret_anchors_from_line_segment.<locals>.<lambda>Xs
���?���Pr%r6z)#�[�])�ast�parse�SyntaxErrorr��body�Expr�BinOp�left�end_col_offset�right�
col_offsetr��isspacer�	SubscriptrG�slice)
rr�tree�	normalize�	statement�expr�operator_start�operator_end�operator_str�operator_offset�left_anchor�right_anchor�chs
`            r#r�r�Ms�������y�y��!���4�9�9�~����P�I��	�	�!��I�
�
�X�X�^�� �S�Y�Y�[�%.�t�y�y�/G�/G�%H�N�#,�T�Z�Z�-B�-B�#C�L�#*�>�,�#G�L�&)�,�&7�#�l�>Q�>Q�>S�:T�&T�O�"&�)�)�":�":�_�"L�K�#.��?�L�'�!�+�c�,�.?�?� ,�_�q�-@� A� I� I� K�$��)��%��G��4���AU�;U�2�:^�:^�:`�df�jn�dn�#�q�(��$��)��&��G��4���AU�;U�2�:^�:^�:`�df�jn�dn�$�I�k�$:�I�l�<S�T�T�#!�$�]�]�_�"+�D�J�J�,E�,E�"F�K�#,�T�Z�Z�-F�-F��-J�#K�L�%��G��4���AU�;U�2�:^�:^�:`�df�jm�dm�#�q�(��&��G��4���AU�;U�2�:^�:^�:`�df�jm�dm�&��W��5�'�,�BW�<W�B�;`�;`�;b�fh�lo�fo�$��)��'��W��5�'�,�BW�<W�B�;`�;`�;b�fh�lo�fo�#�c�'�l�2�$��)��#�K��>�>�%��?�>��Q����s�J+�+	J7�6J7�WFc�`��	|j�r|Sddl�t�fd�|d|D��S)Nrc3�T�K�|]}�j|�tvrdnd���!y�w)r�r�N)�east_asian_width�_WIDE_CHAR_SPECIFIERS)�.0�char�unicodedatas  �r#�	<genexpr>z!_display_width.<locals>.<genexpr>�s1������!�D��
)�
)�$�
/�3H�
H��a�O�!�s�%()�isasciir/�sum)rYrr/s  @r#r�r�~s<���I�
�|�|�~��
������&�M���r%c� �eZdZd�Zd�Zdd�Zy)�_ExceptionPrintContextc�>�t�|_d|_d|_y)NrF)r��seen�exception_group_depth�
need_closer7s r#r�z_ExceptionPrintContext.__init__�s���E��	�%&��"���r%c�&�dd|jzzS)Nr]r�)r7r7s r#�indentz_ExceptionPrintContext.indent�s���a�$�4�4�4�5�5r%Nc#��K�|�d}|j�}|jr||dzz
}t|t�rt	j||d����y|D]}t	j||d�����y�w)N�|r]c��y�NTr6r�s r#r
z-_ExceptionPrintContext.emit.<locals>.<lambda>����Tr%c��yr>r6r�s r#r
z-_ExceptionPrintContext.emit.<locals>.<lambda>�r?r%)r:r7rAr�textwrap)r8�text_gen�margin_char�
indent_str�texts     r#�emitz_ExceptionPrintContext.emit�sp�������K��[�[�]�
��%�%��+��+�+�J��h��$��/�/�(�J�8I�J�J� ���o�o�d�J�8I�J�J�!�s�A6A8r')r:r;r<r�r:rFr6r%r#r4r4�s�� �
6�Kr%r4c�p�eZdZ	dddddddd�d�Zed��Zd	�Zd
�Zd�Zd�Z	d
�Z
ddd�d�Zddd�d�Zy)rNTF��
)r+r�r�rK�max_group_width�max_group_depth�_seenc�p	�|
du}|
�
t�}
|
jt|��||_|	|_t
j
t|�|||��|_||_	t|d�|_	t|dd�|_
|r�t!|t"�r�|j$|_|j&}
|
�t)|
�nd|_|j*}|�t)|�nd|_|j,|_|j.|_|j0|_|j2|_�n|rSt!|t4�rCt|dd��6t|dd�}t7|||�}|r�|xjd|�d�z
c_n�|r�t!|t8t:f�r�t|dd���t|dd�}t7|||�}|r|xjd|�d�z
c_t!|t8�rVt|dd�}|�G|t<j>vr5|r|xjd	|�d
�z
c_n|xjd|�d
�z
c_|r|jA�|�|jBnd|_!|�s||fg}|�r
|jE�\}}|ri|jF�]t|jF�|
vrFtItK|jF�|jF|jFjL|||||	|
�
�	}nd}|r|duxr|duxr
|jB}nd}|rk|jN�_|r]t|jN�|
vrFtItK|jN�|jN|jNjL|||||	|
�
�	}nd}|r\tQ|tR�rLg}|jTD]:}tItK|�||jL|||||	|
�
�	}|jW|��<nd}||_#||_'||_*|r'|jW|jF|jFf�|r'|jW|jN|jNf�|r/|jYt[|jT|jT��|r��	yyy#t$r%}dt|dt���g|_
Yd}~��%d}~wwxYw)Nr�rT�	__notes__z!Ignored error getting __notes__: �	name_fromz. Did you mean: 'z'?r�z Or did you forget to import '�'z. Did you forget to import 'F)r+r�r�rJrKrLT).r�r��idrJrKrr1r2rs�exc_typerV�_strr�rNr�r��
issubclassrr{r|rr}rErr��msg�ImportError�_compute_suggestion_error�	NameError�AttributeErrorr�stdlib_module_names�_load_lines�__suppress_context__�pop�	__cause__rrErC�__context__rA�BaseExceptionGroup�
exceptionsr��extend�zip)r8rR�	exc_value�
exc_tracebackr+r�r�rKrJrKrL�is_recursive_call�e�lno�end_lno�
wrong_name�
suggestion�queuerN�cause�need_context�contextrarF�texcs                         r#r�zTracebackException.__init__�so��"��-���=��E�E�
�	�	�"�Y�-� �.���.���!�B�B�(��7��l�)�C�+��
�!��
�!��K�8��	�	Z�$�Y��T�B�D�N�
�
�8�[�9�%�.�.�D�M��"�"�C�&)�o�#�c�(�4�D�K��*�*�G�.5�.A�c�'�l�t�D�O�!���D�I�#�*�*�D�K�'�2�2�D�O� �}�}�D�H�
�*�X�{�;��	�;��5�A� ��K��>�J�2�9�m�Z�X�J���	�	�0���B�?�?�	�
�*�X�	�>�/J�K��	�6�4�0�<� ��F�D�9�J�2�9�m�Z�X�J���	�	�0���B�?�?�	��(�I�.�$�Y���=�
��)�j�C�<S�<S�.S�!��	�	�'E�j�\�QR�%S�S�	��	�	�'C�J�<�q�%Q�Q�	������.7�.C�I�*�*��	
�!�
!��I�&�'�E���	�	����A��!�+�+�1��1�;�;��u�4�.��Q�[�[�)�������1�1�#�%1�'5�(7�(7�#�	%�E�!�E��$)�T�M�%?�$%�T�M�%?�()�(>�(>�$>�!�$(�L��!�-�-�3�$��A�M�M�):�%�)G�0��Q�]�]�+��
�
��
�
�3�3�#�%1�'5�(7�(7�#�	%�G�#�G���A�'9�:�!#�J� �|�|��1� ��I���-�-�"'�)5�+9�,;�,;�"'�	 )��#�)�)�$�/� ,�"&�J�$���!(��� *��
���L�L�"�,�,����!<�=���L�L�"�.�.�!�-�-�!@�A���L�L��R�]�]�A�L�L�!A�B��!��S�	Z�3�L��K�QU�4V�3W�X�Z�D�N�N��	Z�s�9R�	R5�R0�0R5c�F�	|t|�||jg|��i|��Sr')rErC)�clsrF�args�kwargss    r#�from_exceptionz!TracebackException.from_exceptionSs(��<��4��9�c�3�#4�#4�F�t�F�v�F�Fr%c�@�	|jD]}|j�yr')rsrY)r8r�s  r#r[zTracebackException._load_linesXs��E��Z�Z�E��J�J� r%c�`�t|t�r|j|jk(StSr')rAr�__dict__r�r�s  r#r�zTracebackException.__eq__]s&���e�/�0��=�=�E�N�N�2�2��r%c��|jSr')rSr7s r#�__str__zTracebackException.__str__bs���y�y�r%c#�6K�	|j�td|j���y|jj}|jj}|dvrt|t�sd}|dz|z}t|jt�st||j���n|j|�Ed{���t|jtjj�rht|jttf�sH|jD]8}t|d�}|j!d�D�cgc]}|dz��	c}Ed{����:y|j�.dj#t|jdt$�����yy7��cc}w7�I�w)	N)�__main__�builtinsz	<unknown>�.�noterUz{}
rNr�)rRrZrSr<r;rArrTr�_format_syntax_errorrNr��abc�Sequence�bytesrV�splitrr�)r8�stype�smodr�ls     r#rz(TracebackException.format_exception_onlyesJ����	��=�=� �(��t�y�y�9�9���
�
�*�*���}�}�'�'���/�/��d�C�(�"���3�J��&�E��$�-�-��5�(���	�	�:�:��0�0��7�7�7�
�t�~�~�{���'?�'?�@��t�~�~��U�|�<�����#�D�&�1��.2�j�j��.>�?�.>��A��H�.>�?�?�?�'��^�^�
'��-�-��T�^�^�[�t� T�U�U�(�
8��@�?�s2�B8F�:F�;BF�;F�F�
F�AF�Fc#��K�	d}|j�-dj|jxsd|j���n'|j�dj|j�}|j}|��|j	d�}|jd�}t
|�t
|�z
}dj|���|j��|j}|jdvr|jn|}||k(s|d	k(r|d
z}|d
z
|z
}	|d
z
|z
}
|	dk\r8d�|d|	D�}d
jdj|�d|
|	z
zdz���|jxsd}dj|||���y�w)Nrz  File "{}", line {}
z<string>z ({})rUz 
r�>Nr���r�rc3�DK�|]}|j�r|nd���y�w)r]N)r)r-�cs  r#r0z:TracebackException._format_syntax_error.<locals>.<genexpr>�s����!U�}�!��	�	��1��#<�}�s� z    {}{}r�z<no detail available>z	{}: {}{}
)r|rr{rEr�r�r�rr�rdrU)
r8r��filename_suffixrE�rtext�ltext�spacesrr�r~r�
caretspacerUs
             r#r�z'TracebackException._format_syntax_error�sq����>����;�;�"�*�1�1��
�
�+��T�[�[�:�
:�
�]�]�
&�%�n�n�T�]�]�;�O��y�y�����K�K��%�E��L�L��)�E���Z�#�e�*�,�F��#�#�E�*�*��{�{�&�����04���y�0P�T�_�_�V\�
��Z�'�:��+;�!'�!��J���
�V�+��&��N�V�3�	��A�:�!U�u�V�e�}�!U�J�$�+�+�B�G�G�J�,?�#��UZ�IZ�B[�^b�Bb�d�d��h�h�1�1���!�!�%��o�>�>�s�E4E6�rM�_ctxc	#�K�	|�
t�}g}|}|ri|rz|j�t}|j}n/|j�|jst
}|j}nd}d}|j
||f�|}|r�fn|j
d|f�t|�D�]\}}|�|j|�Ed{���|j�~|jrJ|jd�Ed{���|j|jj��Ed{���|j|j��Ed{�����|j|jkDr(|jd|j�d��Ed{�����|jdk(}|r|xjdz
c_
|jrP|jd|rdnd��Ed{���|j|jj��Ed{���|j|j��Ed{���t|j�}	|	|j kr|	}
n|j dz}
d	|_t%|
�D�]}||
dz
k(}|rd
|_|j �||j k\}
nd	}
|
s|dz�nd}|j'�|dk(rdnd
zd|�d�z��|xjdz
c_
|
s)|j|j||��Ed{���n8|	|j z
}|dkDrdnd}|jd|�d|�d��Ed{���|r(|j"r|j'�dz��d	|_|xjdzc_
��|s���d|_
��y7���7���7���7��j7��,7���7���7���7��7�o�w)Nz#Traceback (most recent call last):
z... (max_group_depth is z)
rr�z3Exception Group Traceback (most recent call last):
�+)rCFTz...z+-z  z+---------------- z ----------------
r�r�rzand z more exceptionrUz&+------------------------------------
)r4r^�_cause_messager_r\�_context_messager��reversedrFrarsrrr7rKr�rJr8�ranger:)r8rMr��outputrF�chained_msg�chained_excrU�is_toplevel�num_excs�n�irf�	truncated�title�	remaining�plurals                 r#rzTracebackException.format�s�����
	��<�)�+�D��������=�=�,�"0�K�"%�-�-�K��o�o�2��2�2�"2�K�"%�/�/�K�"&�K�"&�K��
�
�{�C�0�1�!���
�M�M�4��+�&� ��(�H�C�����9�9�S�>�)�)��~�~�%��9�9�#�y�y�)O�P�P�P�#�y�y����)9�)9�);�<�<�<��9�9�S�%>�%>�%@�A�A�A��+�+�d�.B�.B�B��9�9�.�t�/C�/C�.D�C�H�J�J�J� $�9�9�Q�>����.�.�!�3�.��9�9�#�y�y�N�-8�c�d� )� D�D�D� $�y�y����)9�)9�);�<�<�<��9�9�S�%>�%>�%@�A�A�A��s�~�~�.���t�3�3�3� �A��,�,�q�0�A�"'����q��A� !�Q�q�S��H��*.����+�+�7�%&�$�*>�*>�%>�	�$)�	�,5�q��s�e�5�E��;�;�=�$%�q�D�D�d�4�/��w�6I�J�K�L��.�.�!�3�.�$�#&�>�>�!�#4�#;�#;�%�d�#;�#S�S�S�$,�t�/C�/C�$C�	�(1�A�
��2��#'�9�9�"�9�+�_�V�H�B�G�$I�I�I� �D�O�O�#�{�{�}�H� I�J�*/����.�.�!�3�.�7"�:�12�D�.�})�)��Q��<��A��J��D��=��A��.T��I�s��A;O�><O�:N$�;0O�+N'�,0O�N*�&O�N-�AO�N0�AO�N3�0O�N6�&O�.N9�/C&O�N<�8O�N>�AO�O�'O�*O�-O�0O�3O�6O�9O�<O�>OrLc�t�	|�tj}|j|��D]}t||d���y)NrPrr)rrrr )r8rrMrYs    r#r zTracebackException.prints4��E��<��:�:�D��K�K�e�K�,�D��$�T�r�*�-r%)
r:r;r<r�r�rur[r�rzrr�rr r6r%r#rr�sq��$�LEI��e�U���$�CC�J�G��G��
�
�%V�N"?�H#��b3�J!��+r%ri��(r�r�c�h�||k(ry|j�|j�k(rtStS)Nr)�lower�
_CASE_COST�
_MOVE_COST)�ch_a�ch_bs  r#�_substitution_costr�#s,���t�|���z�z�|�t�z�z�|�#����r%c�h�|�t|t�syt|t�r|j}	t	|�}n�t|t�r"	t|j�}t	|�}n�|�y|j�|j}|j��|j}t|j�t|j�zt|j�z}d|jvr |jd}t||�rd|��St!|�t"kDryt!|�}|t$kDry|}	d}
|D]Q}||k(r�	t!|�|zdzt&zdz}t)||	dz
�}t+|||�}
|
|kDr�F|
r|
|	ks�N|}
|
}	�S|
S#t
$rYywxYw#t
$rYywxYw)Nr8zself.r��r�)rArrY�obj�dirr�rV�
__import__r�rxrurQr�r��
f_builtinsrhr��_MAX_CANDIDATE_ITEMS�_MAX_STRING_SIZEr��min�_levenshtein_distance)rdr,rjr��d�modr�r8�wrong_name_len�
best_distancerk�
possible_name�max_distance�current_distances              r#rWrW+s������J��!<���)�^�,��m�m��	��C��A�
�I�{�	+�	��Y�^�^�,�C��C��A��:���j�j�$����B��j�j�$��������� ��5�?�?�#�
$��5�#�#�$�
%�	
��U�^�^�#��>�>�&�)�D��t�Z�(��z�l�+�+��1�v�$�$����_�N��(�(��"�M��J��
��J�&���M�*�^�;�a�?�:�M�QR�R���<���):�;��0��]�L�Y���l�*���-�
�=�&�J�,�M�����i�	��	���	��	�s#�F� F%�	F"�!F"�%	F1�0F1c	�
�||k(ryd}||dr+||dr&||||k(r|dz
}||dr||dr||||k(r�||d}||d}d}|d|xsdrC|d|xsdr:||dz
||dz
k(r)|dz}|d|xsdr|d|xsdr||dz
||dz
k(r�)|d|xsd}|d|xsd}|r|stt|�t|�zzSt|�tkDst|�tkDr|dzSt|�t|�kr||}}t|�t|�z
tz|kDr|dzStt	ttt|�dzzt��}d}t	t|��D]�}||}|tzx}	}t
j}
t	t|��D]E}|	t|||�z}||}	t||	�tz}
t|
|�}|||<||
ks�D|}
�G|
|kDs��|dzcS|Sr�)	r�r�r�rQr�r�maxsizer�r�)�a�b�max_cost�pre�postr�r��bindex�bchar�distance�minimum�index�
substitute�
insert_deletes              r#r�r�ise��	�A�v���C�
�C�D�'�a���g�!�C�&�A�c�F�"2��q����C�D�'�a���g�!�C�&�A�c�F�"2�	�#�$��A�	�#�$��A��D�
�M�T�\�T�
�q��$�,�$�/�A�d�1�f�I��4��6��4J���	���M�T�\�T�
�q��$�,�$�/�A�d�1�f�I��4��6��4J�	�-�4�<�4��A�	�-�4�<�4��A��A��S��V�c�!�f�_�-�-�
�1�v� � �C��F�-=�$=��!�|���1�v��A����!�1��	�A���Q���:�%��0��!�|��
�u�Z��s�1�v��z�!:�J�G�
H�C�
�F���A��-���&�	��"�Z�/�/��6��+�+���3�q�6�]�E�!�$6�u�a��h�$G�G�J��5�z�H� ���1�J�>�M���
�3�F� �C��J���� ��#��X���a�<��) �*�Mr%r'r>)NNTr>)NNN)7�collections.abcr�r�r�rrA�
contextlibr�__all__r$rrr
rr�r�r4r?rHr
rrrZrrVrrrrr	rrrrrr2r�r�rQrr��
namedtuplerr�r,r�r4rr�r�r�r�r�rWr�r6r%r#�<module>r�s���F����
���$��'�;�$7�0�7�*&��
&��
��
�K�	��#,�	���T�%�"$-��$��(�)2�,�&�$'�4�J�P�	,� 	9�6�
� �L"�L"�^
���O���D�4�D�NC�
"�;�!�!����3�Z�	��-�^���$K�K�.s+�s+�l����
�
�
�
��;�|:r%