/usr/local/lib/python3.9/site-packages/pip/_vendor/rich/__pycache__
a ���h� � @ s� d dl Z d dlZd dlZd dlZd dlmZmZ d dlmZ d dl m Z d dlmZm Z d dlmZmZmZmZmZmZmZmZmZmZmZ d dlmZ d dlmZmZmZm Z m!Z!m"Z" d d lm#Z$ d d lm%Z% d dl&m'Z' dd l(m)Z) ddl*m+Z+m,Z, ddl-m.Z. ddl/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5 ddl6m7Z7 ddl8m9Z9m:Z: ddl;m<Z< ddl=m>Z> ddl?m@Z@ ddlAmBZBmCZC dd lDm#Z# ddlEmFZF ejGdkZHdZIdZJeCeCeeeKeKeKf d�dd�ZLdddd dd!d!eIeJd"dd"d#dd$�ee0 eeK eeK eKeeM eNeNeKeKeNeeN eNeeeMef eKeeeO eOee gef d%�d&d'�ZPeG d(d)� d)��ZQeG d*d+� d+��ZReG d,d-� d-��ZSeG d.d/� d/��ZTG d0d1� d1e9�ZUG d2d3� d3�ZVeWd4k�r�ePd"d5� d dlZedd6�d7d8�ZXedd6�d9d:�ZYdd;�d<d=�ZZeZ� dS )>� 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 c sx | \}}|\}}||kr&|||fV nNt t||d ��D ]:\}}}|rT||dfV q8|rf|d|fV q8|ddfV q8dS )z�Yield start and end positions per line. Args: start: Start position. end: End position. Returns: Iterable of (LINE, COLUMN1, COLUMN2). r ���r N)r �range) r4 r5 �line1�column1Zline2�column2�first�last�line_no� r? �D/usr/local/lib/python3.9/site-packages/pip/_vendor/rich/traceback.py�_iter_syntax_lines7 s rA �d �X � FTr? )�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_frames)rE rF rG rH rI rJ rK rL rM rN rO rP rQ rR r6 c s� | du rt dd�n| ��jr(�du r(dn��tt ttt dd�� �������� � ��� �fdd��tdd��fdd �}zt� }||� tj W S t y� tj }�t_ | Y S 0 dS ) 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� tracebackr6 c s<