� ]�g��#��ddlZddlZddlZddlZddlmZmZddlmZddl m Z ddl m Z m Z ddlmZmZmZmZmZmZmZmZmZmZddlmZddlmZmZmZmZm Z m!Z!dd lm"Z#dd lm$Z$dd l%m&Z&d d l'm(Z(d dl)m*Z*m+Z+d dl,m-Z-d dl.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4d dl5m6Z6d dl7m8Z8m9Z9d dl:m;Z;d dl<m=Z=d dl>m?Z?d dl@mAZAmBZBd d lCm"Z"d dlDmEZEejFdkZGdZHdZIdeBdeBdeeeJeJeJffd�ZKddd d!dd"d"eHeId#dd#d$dd%�d&ee/d'eeJd(eeJd)eJd*eeLd+eMd,eMd-eJd.eJd/eMd0eeMd1eMd2eeeLe fd3eJdeeeNeNee geffd4�ZOeGd5�d6����ZPeGd7�d8����ZQeGd9�d:����ZReGd;�d<����ZSGd=�d>e8��ZTGd?�d@��ZUeVdAkr0eOd#�B��ddlZdCeddfdD�ZWdCeddfdE�ZXdGdF�ZYeY��dSdS)H�N)� dataclass�field)�islice)�walk_tb)� ModuleType� TracebackType) �Any�Callable�Dict�Iterable�List�Optional�Sequence�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�|\}}|\}}||kr |||fV�dStt||dz����D]!\}}}|r||dfV��|r|d|fV��|ddfV��"dS)z�Yield start and end positions per line. Args: start: Start position. end: End position. Returns: Iterable of (LINE, COLUMN1, COLUMN2). r�����rN)r�range) r4r5�line1�column1�line2�column2�first�last�line_nos �^/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/rich/traceback.py�_iter_syntax_linesrB6s������N�E�7��N�E�7� ��~�~��W�g�%�%�%�%�%�%�$3�E�%����4K�4K�$L�$L� %� %� �E�4��� %��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_framesrHrIrJrKrLrMrNrOrPrQrRrSrTrUc���������� � � � � ���|�td���n|��jr� �dn� � dttdtdtt ddf��� � � ��� �� ����fd� �d t ddf�fd � } t��}||��tj S#t$rtj }�t_ |cYSwxYw) 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� tracebackr6c���t�|||������ � � �t����� � ���}��|��dS)N� rIrJrKrLrMrNrOrPrQrRrSrTrU)� Traceback�from_exception�bool�print)rXrYrZ�exception_tracebackrJrKrSrQrRrOrPrUrNrTrL�traceback_consolerIrMs ��������������rA� excepthookzinstall.<locals>.excepthook�sv��� (�6�6� � � ��!�#���#�/�/�1�#�$6�7�7�'��!�!7� � ��$ ��� 3�4�4�4�4�4rC�ipc ��������i��j�dtdtddf��fd� }dd�dtdtdtddf���fd����_|�_�fd ��_dS) N�args�kwargsr6c���|��|i|��dS)zEwrap the default ip.showtraceback to store info for ip._showtracebackNrG)rfrg�default_showtraceback�tb_datas ��rA�ipy_show_tracebackzCinstall.<locals>.ipy_excepthook_closure.<locals>.ipy_show_traceback�s&����G� !� !�4� 2�6� 2� 2� 2� 2� 2rCF)� is_syntaxrlc���� ���}|rdn|d}� �dd��}� �d|rdnd��}t|��D] }|�n|j}��|d|d|��i� dS)z2Internally called traceback from ip._showtracebackN��running_compiled_codeF� tb_offsetrr)� _get_exc_info�getr9�tb_next) rlrfrg� exc_tuple�tb�compiledrp�_rcrdrjs ���rA�ipy_display_tracebackzFinstall.<locals>.ipy_excepthook_closure.<locals>.ipy_display_traceback�s���� �(�(�*�*�I�3<�*M�$�$��1��B��{�{�#:�E�B�B�H�� � �K�h�1E���A�F�F�I��9�%�%� � ���:��E��Z��� �J�y��|�Y�q�\�2� 6� 6� 6��G�G�GrCc����|ddi|��S)NrlTrG)rfrgrxs �rA�<lambda>z9install.<locals>.ipy_excepthook_closure.<locals>.<lambda>�s(���5J�5J� �6 �!�6 �%+�6 �6 �rC)� showtracebackr r_�_showtraceback�showsyntaxerror)rdrkrirxrjrcs` @@@�rA�ipy_excepthook_closurez'install.<locals>.ipy_excepthook_closure�s���������� "� 0�� 3�c� 3�S� 3�T� 3� 3� 3� 3� 3� 3� 3�+0� � � �� �#'� �;>� � � � � � � � � � �02���-��� � � � ����rC) r"� is_jupyterr� BaseExceptionrrr � get_ipython�sysrc� Exception)rHrIrJrKrLrMrNrOrPrQrRrSrTrUr~rd�old_excepthookrcrbs ````````````` @@rA�installr�Rsf�����������������V18���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�5�2' �3�' �4�' �' �' �' �' �' �R � �]�]����r�"�"�"��~��� �������#������� ���s�$B&�&$C � C c��eZdZUeed<eed<eed<dZeed<dZee ee j fed<dZ ee e eefe eeffed<dS) �Frame�filename�lineno�name��lineN�locals�last_instruction)�__name__� __module__� __qualname__�str�__annotations__�intr�r�rr r�Noder�rrGrCrAr�r��s���������M�M�M� �K�K�K� �I�I�I��D�#�N�N�N�/3�F�H�T�#�v�{�*�+� ,�3�3�3�JN��h�u�U�3��8�_�e�C��H�o�%E�F�G�N�N�N�N�NrCr�c�p�eZdZUeed<eed<eed<eed<eed<ee���Ze eed<dS) � _SyntaxError�offsetr�r�r��msg��default_factory�notesN) r�r�r�r�r�r�r�listr�r rGrCrAr�r��s`������� �K�K�K��M�M�M� �I�I�I� �K�K�K� �H�H�H��u�T�2�2�2�E�4��9�2�2�2�2�2rCr�c���eZdZUeed<eed<dZeeed<dZe ed<e e ���Z e eed<e e ���Ze eed <dZe ed <e e ���Ze d ed <dS) �Stack�exc_type� exc_valueN� syntax_errorF�is_causer��framesr��is_group�Trace� exceptions)r�r�r�r�r�r�rr�r�r_rr�r�r r�r�r�r�rGrCrAr�r��s���������M�M�M��N�N�N�+/�L�(�<�(�/�/�/��H�d�����%��5�5�5�F�D��K�5�5�5��u�T�2�2�2�E�4��9�2�2�2��H�d���� %��d� ;� ;� ;�J��W� �;�;�;�;�;rCr�c�&�eZdZUeeed<dS)r��stacksN)r�r�r�r r�r�rGrCrAr�r��s"������� ��K�����rCr�c��eZdZdgZdS)�PathHighlighterz(?P<dim>.*/)(?P<bold>.+)N)r�r�r�� highlightsrGrCrAr�r��s������-�.�J�J�JrCr�c$��eZdZdZdddddd�Z d/dd d dd d eed d d d dd� deedee dee de dee de de de de de de de de e e efde fd�Zedd d dd d eed d d d dd� deeded eedee dee de dee de de de de de de de de e e efde d!df"d"���Zed eed d d#�deeded eede de de de de d!efd$���Zd%ed&ed!efd'�Ze��d(ed!efd)���Zed*e d+e d!e fd,���Ze��d-ed!efd.���Z dS)0r]aA 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.pxiNrDrErFFTrGr\�tracerIrJrKrLrMrNrOrPrQrRrSrTrUc ��|�Etj��\}}}|�|�|�td���|�||||���}||_||_||_||_tj |pd��|_ ||_ ||_ | |_ ||_| |_| |_| |_g|_| D]�}t'|t(��s9|j� J|�d����t,j�|j��}n|}t,j�t,j�|����}|j�|����|dkrt9d|��nd|_dS)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�rIrJrKr.� get_themerLrMrNrSrOrPrQrRrT� isinstancer��__file__�os�path�dirname�normpath�abspath�append�maxrU)�selfr�rIrJrKrLrMrNrOrPrQrRrSrTrUr�r�rZ�suppress_entityr�s rA�__init__zTraceback.__init__s���$ �=�-0�\�^�^� *�H�i����9�#4� �8I� �O�����L�L��)�Y�K�!���E��� ��� �$���&����%�e�&:�{�;�;�� �"���&���*���!2���!2���"4���"4���')�� �'� '� '�O��o�s�3�3� '�#�,�8�8�%�T�T�T�9�8�8��w����'?�@�@���&���7�#�#�B�G�O�O�D�$9�$9�:�:�D� �M� � �� &� &� &� &�0:�Q���#�a��,�,�,�A����rCr�r�rZr6c �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. �rNrOrPrQrR) rIrJrKrLrMrNrSrOrPrQrRrTrU)r�)�clsr�r�rZrIrJrKrLrMrNrOrPrQrRrSrTrU�rich_tracebacks rAr^zTraceback.from_exceptionPsz��Z��� � � �#�/�/�1�1�%�  �  ���s� ��!�#���#�'�/�/�1�1��!� � � � rCr�c � �����g} d} ddlm} t|dd��pg} dtdtfd�} t | |j��| |��| | � ��}tjd krxt|ttf��r\d |_ |j D]M}|j �t�t#|��||j|���� �����Nt|t&��r;t)|jpd|jpd |jpd|jpd|j| ���|_| �|��|jj}dt8t:tt<fdt8t:tt<ff��fd� }t?|��D�]p\}}|j j!}d}tjd krY|j"dz}tGtI|j �%��||dz����}|\}}}}|�|� |� |�||f||ff}|rT|�&d��s?tNj(�)|��s tNj(�*| |��}|j+�,dd��r��t[|pd ||j j.|r/��fd�||j+�/����D��nd|���}||��|j+�,dd��r |jdd�=��rt|dd��}|r|j0}|}|j}d } ��|j1}|r%t|dd��s|j0}|}|j}d} ��I te| ���}|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�_objectr6c�D� t|��S#t$rYdSwxYw)z1Don't allow exceptions from __str__ to propagate.z<exception str() failed>)r�r�)r�s rA�safe_strz#Traceback.extract.<locals>.safe_str�s7�� 2��7�|�|�#��� 2� 2� 2�1�1�1� 2���s �� �T)r�r�r�r�)rF� )rNrOrQrR�?r�)r�r�r�r�r�r�� iter_localsc3��K��s �s |Ed{V��dS|D];\}}�r|�d��r��r|�d��r�5||fV��<dS)z-Extract locals from an iterator of key pairs.N�__rw�� startswith)r��keyrYrQrRs ��rA� get_localsz%Traceback.extract.<locals>.get_locals�s������+��.@��*�*�*�*�*�*�*�*��F�"-�%�%�J�C��)�!�c�n�n�T�.B�.B�!� �)�!�c�n�n�S�.A�.A�!� ��u�*�$�$�$�$� %�%rCrnr�<�_rich_traceback_omitc���i|]E\}}tj|���tj|���-|tj|�������FS))� max_length� max_string)�inspect� isfunction�isclassr�traverse)�.0r�rYrOrPs ��rA� <dictcomp>z%Traceback.extract.<locals>.<dictcomp>"ss������ !+��U�$+�$6�u�$=�$=��BI��QV�AW�AW����� %�+<�+<�"�"�"���rC)r�r�r�r�r��_rich_traceback_guard� __cause__�__suppress_context__)r�)3�richr��getattrr r�r�r�r�� version_infor��BaseExceptionGroup�ExceptionGroupr�r�r�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_localsrrr��co_name�items� __class__� __context__r�)r�r�r�rZrNrOrPrQrRr�r�r�r�r��stack� exceptionr�r�� frame_summaryr@r�r��instruction_index�instruction_position� start_line�end_line� start_column� end_column�frame�causer�s ```` rAr�zTraceback.extract�s�������<!����$�$�$�$�$�$�"�9�k�4�@�@�F�B�� 2�c� 2�c� 2� 2� 2� 2�A ��!��(�"3�4�4�"�(�9�-�-�!�� ���E���7�*�*��i�*<�n�)M�N�N� �%)�E�N�%.�%9� � � ��(�/�/�%�-�-� $�Y��� )� )� 7�,7�2C�3E�3E�.��� � � � ��)�[�1�1� �%1�$�+�0�q�&�/�6�3�$�+�0�q�"��-�2�!� �� &�&�&��"� �M�M�%� � � ��\�(�F� %�%�e�C��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�� �)�-�-�.D�e�L�L����%�_��"�&�-�5�'� "������ /9�j��9O�9U�9U�9W�9W�.X�.X� ����"�%5�#����&��u� � � � �)�-�-�.E�u�M�M�(�� �Q�Q�Q����I�{�D�9�9�E�� � �?��!� �"�/� �����)�E�� �W�Y�0F��N�N� � �?��!� �!�/� � ��� ��V�$�$�$��� rCrH�optionsc#�6����� � K��j}|����|j}tid|t���d|t ���d|t ���d|tj���d|t���d|t��td���z�d |t ���d |t��td� ��z�d |t���d |tj ���d|tj ���d|tj ���d|t j���d|t���d|t���d|tj ��td���z�d���� t!���t#��dt$dt&dt(f���� �� fd� ��� t+t-�jj����D]\}}� ||��V��dS)Nr� pygments.text�pygments.string�pygments.function�pygments.numberz repr.indentT)�dimzrepr.strz repr.brace)�boldz repr.numberzrepr.bool_truezrepr.bool_falsez repr.nonez scope.borderz scope.equalsz scope.keyzscope.key.specialF)�inheritr�r?r6c 3���K�|jrnt� �|��d� ddd���}t|� j��}� ����5|V�ddd��n #1swxYwY|j��� ����5tt� �|j��� ddd� j���� j��V�ddd��n #1swxYwYtj |j �d�d f� |jj ����V�nU|j r0tj |j �d�d f� |j ����V�ntj |j �d f��V�|j D]"}tj d � |����V��#|jr�t|jd ��D]u\}}g}t#|j��D]$\}}|�� ||�����%d V�ttt)|�d |��d���� j��V��v|s7|jrtjd��V�dStjd��V�dSdS)Nz7[traceback.title]Traceback [dim](most recent call last)ztraceback.borderT)rr)�title�style� border_style�expand�paddingztraceback.border.syntax_error)rrrrrIz: ztraceback.exc_type)z[NOTE] ztraceback.noterr�zSub-exception #ztraceback.group.border)rrzI [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_exception�grouped_exceptions� group_last� group_stack�background_stylerH� highlighter� render_stackr��traceback_themes ������rAr&z0Traceback.__rich_console__.<locals>.render_stackks�������|� +�6;��&�&�u�-�-�S�*�!3��"� 7�7�7� �$-�-=�t�z�#J�#J� ��&�&��7�7�+�+�*�*�*�*�+�+�+�+�+�+�+�+�+�+�+����+�+�+�+��!�-��&�&��7�7� � �#�� �5�5�e�6H�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�;�;�t�CT�CT�U�U�U�U�U�U��~� �1:�5�;K�Q�1O�1O� � �-�H�o�68�&�3<�_�=S�3T�3T�Y�Y�/� �K�*�1�1�,�,�{�J�2W�2W�X�X�X�X��H�H�H�#��!�#5�6�">�H�">�">�)A���� � � ������� ��>���*�e���������*�d��������  � s%�A.�.A2�5A2�AC)�)C-�0C-)rL�get_background_style�get_style_for_tokenr0� TextTokenrrr�Functionrrr-r�Constant� Delimiterrr*r'r�r_r&r �reversedr�r�) r�rHrrL� token_styler?r�r$r%r&r's `` @@@@rA�__rich_console__zTraceback.__rich_console__Ls������������ �� �5�5�7�7���/� �� ��+�+�i�0�0� ����U�!3�!3� �"�;�;�v�#6�#6� �$�[�[���%?�%?�  � "�;�;�v�#6�#6�  � �{�{�7�3�3�e��o�o�o�E�  ��K�K��/�/� ��k�k�)�4�4�u�$�7G�7G�7G�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%�X�d�j�.?�%@�%@�A�A� ,� ,�K�D�%��,�u�d�+�+� +� +� +� +� ,� ,rCr�c#�<K�t��}t��}|jdkrgtj�|j��rCt jd|j��dfdt|j ��dfd���}||��V�||j � ����}d|_ t|jd z t|����}|�d ||��|t jd d|zzd zd���z }|V�dS) Nz<stdin>� r ��:r r r �rTrzbold underline� u[traceback.offset]▲[/])r*r�r�r�r��existsrrr�r�r��rstrip�no_wrap�minr��len�stylizer)r�r�r%�path_highlighterr��syntax_error_textr�s rArzTraceback._render_syntax_error�sJ����%�'�'� �*�,�,�� � �I� -� -��w�~�~�l�3�4�4� -��}�0��.�0�0�2C�D�*���,�-�-�/@�A�)� ���� '�&�t�,�,�,�,�,�'�K� �(9�(@�(@�(B�(B�C�C��$(��!��\�(�1�,�c�2C�.D�.D�E�E���!�!�"2�F�F�C�C�C��T�-� �3��<� �"<� <�!� � � � �� �����rCr��codec�z�tj�|��d}|sT|�d��}|dkr |d|�n|}|�d��rd|���vrdS |j�|��pt||��j S#t$rYdSwxYw)Nr8r6z#!r�r�) r�r��splitext�indexr��lower�LEXERSrrrr�r)r�r�r?�ext�new_line_index� first_lines rA� _guess_lexerzTraceback._guess_lexer�s����g���x�(�(��,��� �"�Z�Z��-�-�N�2@�B�2F�2F��o�~�o�.�.�D�J��$�$�T�*�*� �x�:�;K�;K�;M�;M�/M�/M��x� ��:�>�>�#�&�&�W�*B�8�T�*R�*R�*W� W��� � � ��6�6� ���s�=.B,�, B:�9B:r�c #�X��K�t��}�j}dtdttf�fd� }d}�jdkr5t �jdzt|j���jdzz ��}d}t|j��D�]\}}|r||vrd}�|r+|�J�tdt|���d �d d � ��V�d}|dk} |j �t�fd ��j D����} tj�|j ��rStj|t|j d�����dt%|j��dfd|jdfd���} n4tjd|jdfdt%|j��dfd���} |j �d��s| sdV�| V�|j �d��r||��Ed{V����e| �s� t-j|j ��} d�| ��} | s�����|j | ��}t5| ||d|j�jz |j�jzf|jh�j�j�jd�� � }dV�|j��|j\}}tA||��D]�\}}} |dkr<| |dz }t|��t|�!����z }|dkrt| |dz ��}n#tD$rY�twxYw|�#d||f||f�����|j$rtK|g||���d���n|V����#tL$r&}tjd|��d f��V�Yd}~��d}~wwxYw��dS)Nrr6c3�r�K�|jr,t|jd�j�j�j���V�dSdS)Nr�)rrSr�r�)r�r,rSrOrP)rr�s �rA� render_localsz.Traceback._render_stack.<locals>.render_locals�s`������|� �"��L�"�"&�"4�#�5�#�5� �������� � rCrrnFTz ... z frames hidden ...�centerztraceback.error)�justifyrc3�B�K�|]}��|��V��dS�Nr�)r�r��frame_filenames �rA� <genexpr>z*Traceback._render_stack.<locals>.<genexpr>s1�����W�W��^�6�6�t�<�<�W�W�W�W�W�WrCr r5r3r z in r r zin r�r�)rL� line_numbers� line_range�highlight_linesrMrJrS�dedentrr8ztraceback.error_range)rr4r5)rr6)'r�rLr�r r$rUr9r;r�rrr��anyrTr�r�r7rr�r�r�r�� linecache�getlinesr�rHr.rKrMrJrSr�rB�lstrip� IndexError� stylize_ranger�r!r�)r�r�r=rLrK�exclude_frames�excluded� frame_indexrr>� suppressedr�� code_linesr?� lexer_name�syntaxr4r5r:r;r=r��errorrPs` @rArzTraceback._render_stack�s������*�,�,��� �� �� �8�4E�+F� � � � � � �+/�� �?�a� � �"���1�$��E�L�!�!�D�O�q�$8�8���N� ��"+�E�L�"9�"9�g �g � �K��� �+��"?�"?����� !�%�1�1�1��D�S��0�0�D�D�D�$�+������� !���1�$�E�"�^�N��W�W�W�W���W�W�W�W�W�J��w�~�~�e�n�-�-� ��}�$�$�T�%�.�@Q�%R�%R�%R�S�S�*����&�&�(9�:���Z�!4�5�)� ������}���Z�!4�5�*����&�&�(9�:�)� �����>�,�,�S�1�1� �%� ������J�J�J��~�(�(��-�-� �(�=��/�/�/�/�/�/�/�/�/���> �=�!*�!3�E�N�!C�!C�J��7�7�:�.�.�D��!�!�!%�!2�!2�5�>�4�!H�!H�J�#��"�#�%)�!�L�4�+;�;�!�L�4�+;�;�$�*/���"&�.�#'�?�&*�&8�$����F��H�H�H� �-�9�%*�%;� ��s�8J�%�QT�7U�7U���3�E�7�G� )�#*�a�<�<�+5�e�a�i�+@�D�.1�$�i�i�#�d�k�k�m�m�:L�:L�.L�G�#*�b�=�=�.1�*�U�Q�Y�2G�.H�.H�G���#-�)�)�)�!)��)���� #�0�0�&=�',�g�&6�%*�G�$4�1�����!�<�$�� &��!.��u�!5�!5��%&� ����$� � � � ��7!�����-�%�e���'8�9�������������������3> �Sg �g s2�:0M5�,A)M5�=A L� L+�*L+�5 N%�?N � N%rO)!r�r�r��__doc__rD�LOCALS_MAX_LENGTH�LOCALS_MAX_STRINGrr�r�r�r_r rrr�� classmethodrr r�rr^r�r"r#r&r0r'r�rrHr�rrGrCrAr]r]�s��������. ����� ��F�"&�3F� #�$&��#��!�!2�!2�#'�#(�"�57��!3F�3F�3F����3F���}� 3F� �S�M� 3F� � 3F���}�3F��3F��3F��3F��3F�!�3F�!�3F��3F��5��j��1�2�3F� �!3F�3F�3F�3F�j� #�$&��#��!�!2�!2�#'�#(�"�57��%F �F �F ��s�)�F �!�F ��M�*� F � ��}� F ��S�M�F ��F ���}�F ��F ��F ��F ��F �!�F �!�F � �!F �"�5��j��1�2�#F �$�%F �& �'F �F �F ��[�F �P�"�!2�!2�#'�#(�p�p�p��}�%�p�!�p��M�*� p� � p��p��p�!�p�!�p� �p�p�p��[�p�dd,��d,�)7�d,� �d,�d,�d,�d,�L �U�W�W� �� �,� � � � �W� �,� �C� �s� �s� � � ��[� � �U�W�W�}�5�}�\�}�}�}� �W�}�}�}rCr]�__main__r��ac�.�d}t||z ��dS)Nr)r`)ri�ones rA�barrl^s���� �c�A�g�����rCc�6�d}hd�dd�}t|��dS)NT>� Duncan Idaho� Thufir Hawat� Paul Atreides�Vladimir Harkonnen)NFT)� characters� atomic_types)rl)rir��zeds rA�fooruds9�� $����� 0� � �� �A�����rCc�$�td��dS)Nr)rurGrCrArcrcqs�� �A�����rC)r6N)Zr�rWr�r�� dataclassesrr� itertoolsrrZr�typesrr�typingr r r r r rrrrr�pygments.lexersr�pygments.tokenrrrrrrrr*r� pygments.utilrr�r�_looprr �columnsr!rHr"r#r$r%r&r'� constrainr(r%r)r*�panelr+�scoper,rr-rbr.r/r�rLr0�platform�WINDOWSrerfr�rBr�r_r�r�r�r�r�r�r�r]r�rlrurcrGrCrA�<module>r�s����������� � � � � � � � �(�(�(�(�(�(�(�(�������������+�+�+�+�+�+�+�+� � � � � � � � � � � � � � � � � � � � � � � � �5�4�4�4�4�4�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�,�,�,�,�,�,� � � � � � �'�'�'�'�'�'�������-�-�-�-�-�-�-�-�����������������������!� � � � � �:�:�:�:�:�:�:�:�������������������*�*�*�*�*�*�*�*������������� �,�'� !������%� �%� .�%� �e�C��c�M�"�#�%�%�%�%�<"&�� "�����.�.�#�)-��13��~�~�~� �g� �~� �C�=�~��� � ~� � ~� �C�=� ~��~��~��~��~��~�!���~��~��u�S�*�_�-�.�~��~� �t�M�"�M�8�M�3J�K�S�P�Q�!~�~�~�~�B �O�O�O�O�O�O�O� ��O� �3�3�3�3�3�3�3� ��3� �<�<�<�<�<�<�<� ��<� �������� ���/�/�/�/�/�&�/�/�/�[ �[ �[ �[ �[ �[ �[ �[ �| �z��� �G�������J�J�J�� �� ����� �s� �t� � � � ����� �E�G�G�G�G�G�5�rC
Memory