Current File : //usr/lib/python3/dist-packages/pip/_vendor/rich/__pycache__/syntax.cpython-312.pyc
�

/�ge����UddlZddlZddlZddlZddlZddlmZmZddl	m
Z
ddlmZm
Z
mZmZmZmZmZmZmZmZmZddlmZddlmZmZddlmZddlm Z dd	l!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+dd
l,m-Z-ddl.m/Z/ddl0m1Z1m2Z2d
dl3m4Z4d
dl5m6Z6d
dl7m8Z8m9Z9d
dl:m;Z;m<Z<m=Z=m>Z>d
dl?m@Z@d
dlAmBZBd
dlCmDZDmEZEd
dlFmZmGZGd
dlHmIZIeeJdfZKej��dk(ZMdZNie*e��e+ed���e"ed���e"j�ed���e%ed���e%j*ed���e(j�ed ���e&j�ed���e&j�ed!���e&j�edd�"��e&j�ed!d�"��e&j�ed���e&j�ed d�#��e&j�ed$���e&j�ed$���e&j�ed���e&j�ed%���e)ed&��e'ed��e$j�ed'��e$j�ed!��e$j�ed�(�e$j�ed d�#�e$j�ed�(�e$jFed'��e#ed$d�"�i	�Z`e
eKefead)<ie*e��e+ed*���e"ed���e"j�ed+���e%ed%���e%j*ed+���e(j�ed,���e&j�ed+���e&j�ed-���e&j�ed+d�"��e&j�ed-d�"��e&j�ed+���e&j�ed,d�#��e&j�ed'���e&j�ed'���e&j�ed+���e&j�ed%���e)ed&��e'ed%��e$j�ed'��e$j�ed-��e$j�ed�(�e$j�ed,d�#�e$j�ed�(�e$jFed'��e#ed$d�"�i	�Zbe
eKefead.<e`ebd/�Zcd0ZdGd1�d2e�ZeGd3�d4ee�ZfGd5�d6ee�ZgeehehfZiGd7�d8e�ZjGd9�d:e@�Zkd;eehd<eid=eehfd>�Zlemd?k(�r�ddlnZnddlZenj�d@�A�Zpepj�dBdCdD�E�epj�dFdGdHdIddJ�K�epj�dLdMdNdIdOdP�K�epj�dQdRdSdIdT�U�epj�dVdWehdXddY�Z�epj�d[d\d]dIdOd^�K�epj�d_d`dIdadOdb�c�epj�dddedfddg�h�epj�didjdkddl�h�epj�dmdnddodp�q�epj�drdsehddtdu�v�epj�dwehddxdy�v�epj��Zsddzltm;Z;e;esj�esj��{�Z:esj�d|k(r�ej�j��Zzekezesj�esj�esj�esj�esj�es�jes�jes�jh�}�	Z�nyek�j	esj�esj�esj�esj�esj�esj�es�jes�jes�jh�~�	Z�e:�je�es�j��yy)��N)�ABC�abstractmethod)�Path)�Any�Dict�Iterable�List�
NamedTuple�Optional�Sequence�Set�Tuple�Type�Union)�Lexer)�get_lexer_by_name�guess_lexer_for_filename)�Style)�get_style_by_name)
�Comment�Error�Generic�Keyword�Name�Number�Operator�String�Token�
Whitespace)�
ClassNotFound)�Lines)�Padding�PaddingDimensions�)�
loop_first��cell_len)�Color�	blend_rgb)�Console�ConsoleOptions�
JustifyMethod�RenderResult)�JupyterMixin)�Measurement)�Segment�Segments)r�	StyleType)�Text.�Windows�monokai�white��colorT��dim�cyan�blue�magenta�green)r8�	underline)r8�bold�red�bright_blue�yellow�
bright_red)r@�
ANSI_LIGHT�bright_black�bright_cyan�bright_magenta�bright_green�	ANSI_DARK)�
ansi_light�	ansi_dark�c�@�eZdZdZededefd��Zedefd��Zy)�SyntaxThemezBase class for a syntax theme.�
token_type�returnc��t�)z'Get a style for a given Pygments token.��NotImplementedError)�selfrPs  �9/usr/lib/python3/dist-packages/pip/_vendor/rich/syntax.py�get_style_for_tokenzSyntaxTheme.get_style_for_token~�
��"�!�c��t�)zGet the background color.rS�rUs rV�get_background_stylez SyntaxTheme.get_background_style�rXrYN)	�__name__�
__module__�__qualname__�__doc__r�	TokenTyperrWr\�rYrVrOrO{s@��(��"�i�"�E�"��"��"�e�"��"rYrOc�L�eZdZdZdeeeefddfd�Zde	de
fd�Zde
fd�Zy)	�PygmentsSyntaxThemez.Syntax theme that delegates to Pygments theme.�themerQNc��i|_t|t�r	t|�|_n||_|jj|_t|j��|_	y#t
$rtd�|_Y�RwxYw)N�default��bgcolor)
�_style_cache�
isinstance�strr�_pygments_style_classr �background_color�_background_colorr�_background_style)rUres  rV�__init__zPygmentsSyntaxTheme.__init__�sx��46����e�S�!�
J�->�u�-E��*�*/�D�&�!%�!;�!;�!L�!L���!&�t�/E�/E�!F����
!�
J�->�y�-I��*�
J�s�A(�(B�BrPc	�V�	|j|S#t$r�	|jj|�}|d}|d}t	|rd|znd|rd|zn|j
|d|d|d��}n##t$rt	j�}YnwxYw||j|<Y|SwxYw)	z"Get a style from a Pygments class.r8ri�#z#000000r@�italicr?)r8rir@rtr?)rj�KeyErrorrm�style_for_tokenrro�null)rUrP�pygments_styler8ri�styles      rVrWz'PygmentsSyntaxTheme.get_style_for_token�s���	2��$�$�Z�0�0���	2�

�!%�!;�!;�!K�!K�J�!W��'�w�/��(��3���).�#��+�I�-4�C�'�M�$�:P�:P�'��/�)�(�3�,�[�9�����
%��
�
���
%��-2�D���j�)���!	2�s1��	B(�A2�<B(�2B�B(�B�B(�'B(c��|jS�N�rpr[s rVr\z(PygmentsSyntaxTheme.get_background_style�����%�%�%rY)
r]r^r_r`rrlr�
PygmentsStylerqrarrWr\rbrYrVrdrd�sI��8�G�e�C��m�)<�$<�=�G�$�G��i��E��,&�e�&rYrdc�F�eZdZdZdeeefddfd�Zdedefd�Zdefd�Z	y)	�ANSISyntaxThemez$Syntax theme to use standard colors.�	style_maprQNc��||_tj�|_tj�|_i|_yr{)r�rrw�_missing_stylerprj)rUr�s  rVrqzANSISyntaxTheme.__init__�s-��"���#�j�j�l���!&������46��rYrPc���	|j|S#t$rX|jj}t	|�}|j
}|r||�}|�|}n|dd}|r�||j|<|cYSwxYw)zLook up style in the style map.N���)rjrur��get�tupler�)rUrP�	get_style�tokenry�_styles      rVrWz#ANSISyntaxTheme.get_style_for_token�s���	��$�$�Z�0�0���	����*�*�I��*�%�E��'�'�E��"�5�)���%�"�E���c�r�
���-2�D���j�)��L�	�s��AA2�A2�1A2c��|jSr{r|r[s rVr\z$ANSISyntaxTheme.get_background_style�r}rY)
r]r^r_r`rrarrqrWr\rbrYrVr�r��sA��.�7�$�y�%�'7�"8�7�T�7��i��E��(&�e�&rYr�c�0�eZdZUdZeed<eed<eed<y)�_SyntaxHighlightRangez�
    A range to highlight in a Syntax object.
    `start` and `end` are 2-integers tuples, where the first integer is the line number
    (starting from 1) and the second integer is the column index (starting from 0).
    ry�start�endN)r]r^r_r`r2�__annotations__�SyntaxPositionrbrYrVr�r��s�������	�rYr�c"�
�eZdZUdZeeed<eed<ede	e
efdefd��Zedddd	d	d	d
dd	ddd�d
e
de	e
e
fde	e
efdedededeeeeeefdeeedeedededee
dededd	fd�Zedd	eddd	dd	d	d
dd	ddfde
de
dee	e
e
fde	e
efdededeeeefdedeeedeedededee
dededdf d��Zed6de
d
ee
de
fd ��Zdefd!�Zd"edeefd#�Zedee
fd$��Z	d6d
e
deeeeeefdefd%�Zd&e d'e!d(e!dd	fd)�Z"d7d*e#defd+�Z$edefd,��Z%d-e&deeeeffd.�Z'						d8d0�Z(d-e&d/e)de*fd1�Z+d-e&d/e)de,e-fd2�Z.d3edd	fd4�Z/d
e
deee
ffd5�Z0y	)9�Syntaxa�Construct a Syntax object to render syntax highlighted code.

    Args:
        code (str): Code to highlight.
        lexer (Lexer | str): Lexer to use (see https://pygments.org/docs/lexers/)
        theme (str, optional): Color theme, aka Pygments style (see https://pygments.org/docs/styles/#getting-a-list-of-available-styles). Defaults to "monokai".
        dedent (bool, optional): Enable stripping of initial whitespace. Defaults to False.
        line_numbers (bool, optional): Enable rendering of line numbers. Defaults to False.
        start_line (int, optional): Starting number for line numbers. Defaults to 1.
        line_range (Tuple[int | None, int | None], optional): If given should be a tuple of the start and end line to render.
            A value of None in the tuple indicates the range is open in that direction.
        highlight_lines (Set[int]): A set of line numbers to highlight.
        code_width: Width of code to render (not including line numbers), or ``None`` to use all available width.
        tab_size (int, optional): Size of tabs. Defaults to 4.
        word_wrap (bool, optional): Enable word wrapping.
        background_color (str, optional): Optional background color, or None to use theme color. Defaults to None.
        indent_guides (bool, optional): Show indent guides. Defaults to False.
        padding (PaddingDimensions): Padding to apply around the syntax. Defaults to 0 (no padding).
    rm�_theme�namerQc�x�t|t�r|S|tvrtt|�}|St	|�}|S)zGet a syntax theme instance.)rkrO�RICH_SYNTAX_THEMESr�rd)�clsr�res   rV�	get_themezSyntax.get_theme�sD���d�K�(��K��%�%�#�$6�t�$<�=�E���(��-�E��rYFr$N�r)re�dedent�line_numbers�
start_line�
line_range�highlight_lines�
code_width�tab_size�	word_wraprn�
indent_guides�padding�code�lexerrer�r�r�r�r�r�r�r�rnr�r�c�F�||_||_||_||_||_||_|xs
t
�|_|	|_|
|_	||_
||_|rt|��n	t�|_
|
|_||_|j!|�|_g|_y)Nrh)r��_lexerr�r�r�r��setr�r�r�r�rnr�background_styler�r�r�r��_stylized_ranges)rUr�r�rer�r�r�r�r�r�r�r�rnr�r�s               rVrqzSyntax.__init__s���$��	�������(���$���$���.�7�#�%���$��� ��
�"��� 0���/?�E�*�+�U�W�	
��+�������n�n�U�+���=?��rYzutf-8�path�encodingc��t|�j|��}|s|j||��}|||||||||	|
|||
||��S)aConstruct a Syntax object from a file.

        Args:
            path (str): Path to file to highlight.
            encoding (str): Encoding of file.
            lexer (str | Lexer, optional): Lexer to use. If None, lexer will be auto-detected from path/file content.
            theme (str, optional): Color theme, aka Pygments style (see https://pygments.org/docs/styles/#getting-a-list-of-available-styles). Defaults to "emacs".
            dedent (bool, optional): Enable stripping of initial whitespace. Defaults to True.
            line_numbers (bool, optional): Enable rendering of line numbers. Defaults to False.
            start_line (int, optional): Starting number for line numbers. Defaults to 1.
            line_range (Tuple[int, int], optional): If given should be a tuple of the start and end line to render.
            highlight_lines (Set[int]): A set of line numbers to highlight.
            code_width: Width of code to render (not including line numbers), or ``None`` to use all available width.
            tab_size (int, optional): Size of tabs. Defaults to 4.
            word_wrap (bool, optional): Enable word wrapping of code.
            background_color (str, optional): Optional background color, or None to use theme color. Defaults to None.
            indent_guides (bool, optional): Show indent guides. Defaults to False.
            padding (PaddingDimensions): Padding to apply around the syntax. Defaults to 0 (no padding).

        Returns:
            [Syntax]: A Syntax object that may be printed to the console
        )r�)r�)rer�r�r�r�r�r�r�r�rnr�r�)r�	read_text�guess_lexer)r�r�r�r�rer�r�r�r�r�r�r�r�rnr�r�r�s                 rV�	from_pathzSyntax.from_path-sh��R�D�z�#�#�X�#�6����O�O�D�t�O�4�E������%�!�!�+�!���-�'��
�	
rYc�`�d}d}|r
	t||�}|sO	tjj	|�\}}|r*|jd�j
�}t|�}|r)|jr|jd}|S|j}|S#t$rY��wxYw#t$rY�GwxYw)a�Guess the alias of the Pygments lexer to use based on a path and an optional string of code.
        If code is supplied, it will use a combination of the code and the filename to determine the
        best lexer to use. For example, if the file is ``index.html`` and the file contains Django
        templating syntax, then "html+django" will be returned. If the file is ``index.html``, and no
        templating language is used, the "html" lexer will be used. If no string of code
        is supplied, the lexer will be chosen based on the file extension..

        Args:
             path (AnyStr): The path to the file containing the code you wish to know the lexer for.
             code (str, optional): Optional string of code that will be used as a fallback if no lexer
                is found for the supplied path.

        Returns:
            str: The name of the Pygments lexer that best matches the supplied path/code.
        Nrg�.r)
rr �osr��splitext�lstrip�lowerr�aliasesr�)r�r�r�r��
lexer_name�_�ext�	extensions        rVr�zSyntax.guess_lexerls���""&���
��
�0��t�<���
����)�)�$�/���3�� #�
�
�3�� 5� 5� 7�I�-�i�8�E���}�}�"�]�]�1�-�
���#�Z�Z�
����%!�
��
��!�
��
�s#�B�AB!�	B�B�!	B-�,B-c�T�|jj�|jz}|S)zGet the base style.)r�r\r�)rU�
default_styles  rV�_get_base_stylezSyntax._get_base_style�s%�����8�8�:�T�=R�=R�R�
��rYrPc�P�|jj|�}|jS)z�Get a color (if any) for the given token.

        Args:
            token_type (TokenType): A token type tuple from Pygments.

        Returns:
            Optional[Color]: Color from theme, or None for no color.
        )r�rWr8)rUrPrys   rV�_get_token_colorzSyntax._get_token_color�s"�����/�/�
�;���{�{�rYc��t|jt�r|jS	t|jdd|j��S#t
$rYywxYw)z�The lexer for this syntax, or None if no lexer was found.

        Tries to find the lexer by name if a string was passed to the constructor.
        FT)�stripnl�ensurenl�tabsizeN)rkr�rrr�r r[s rVr�zSyntax.lexer�sV���d�k�k�5�)��;�;��	�$�������
�
�	�
���	��	�s�"A�	A�Ac�����	�
��|j�}|jrdnd}t|||j|j��}|j
j�|j���|j��n�|rg|\�
�	dttttff��fd��dtttttff��	�
�fd�}|j|��n)|j�fd��j!��D��|j"�|j%d|j"���|j&r|j)|�|S)	aHighlight code and return a Text instance.

        Args:
            code (str): Code to highlight.
            line_range(Tuple[int, int], optional): Optional line range to highlight.

        Returns:
            Text: A text instance containing highlighted syntax.
        rg�left)�justifyryr��no_wraprQc3��K��sJ��j��D])\}}|s�	|jd�\}}}|||zf��|r�!�+y�w)zSplit tokens to one per line.�
N)�
get_tokens�	partition)rPr��
line_token�new_liner�r�s    ��rV�
line_tokenizez'Syntax.highlight.<locals>.line_tokenize�s\����� �L�5�-2�-=�-=�d�-C�D�)�
�E�#�:?�/�/�$�:O�7�J��%�",�j�8�.C�"C�C�$�D�s�A� A�Ac3�<�K�t�	��}d}�r�dz
nd}||kr1	t|�\}}|df��|jd�r|dz
}||kr�1|D]2\}}|�|�f��|jd�s�$|dz
}�s�,|�k\s�2yy#t$rY�CwxYw�w)zConvert tokens to spans.rr$Nr�)�iter�next�
StopIteration�endswith)
�tokens�line_no�_line_start�_token_typer�rP�_get_theme_style�line_end�
line_startr�s
      ����rV�tokens_to_spansz)Syntax.highlight.<locals>.tokens_to_spans�s������!�-�/�2�F��G�4>�*�q�.�A�K�"�K�/�"�15�f��.�K�� %�d�m�+� �>�>�$�/�#�q�L�G�"�K�/�.4�&�)�
�E�$�&6�z�&B�C�C� �>�>�$�/�#�q�L�G�'�G�x�,?� %�&��
 -�"�!�"�s?�!B�B
�!B�%B�;B�B�	B�
	B�B�B�Bc3�8�K�|]\}}|�|�f���y�wr{rb)�.0rPr�r�s   �rV�	<genexpr>z#Syntax.highlight.<locals>.<genexpr>s(�����#�)�
�E��,�Z�8�9�#�s�zon )r��transparent_backgroundr3r�r�r�rWr��appendrrrrlrr�
append_tokensr�rn�stylizer��_apply_stylized_ranges)rUr�r��
base_styler��textr�r�r�r�r�r�s `     @@@@@rV�	highlightzSyntax.highlight�sA����)�)�+�
�#�:�:�I��	�����]�]����&�	
�� �;�;�:�:���
�
���=��K�K����(2�$�
�H�D�x��c�3�h��'@�D�&��%��X�e�_�8L�2M�)N�&�&�.�"�"�?�#4�5��"�"�#�-2�-=�-=�d�-C�#���$�$�0����s�4�#8�#8�"9�:�;�� � ��'�'��-��rYryr�r�c�P�|jjt|||��y)a�
        Adds a custom style on a part of the code, that will be applied to the syntax display when it's rendered.
        Line numbers are 1-based, while column indexes are 0-based.

        Args:
            style (StyleType): The style to apply.
            start (Tuple[int, int]): The start of the range, in the form `[line number, column index]`.
            end (Tuple[int, int]): The end of the range, in the form `[line number, column index]`.
        N)r�r�r�)rUryr�r�s    rV�
stylize_rangezSyntax.stylize_ranges"��	
���$�$�%:�5�%��%M�NrY�blendc��|jj�|jz}|j}|�|jrtj�S|jtj�}|�|jr|xstj�St|j�|j�|��}tj|�S)N)�
cross_fade)
r�r\r�ri�is_system_definedr(rgr�rr3r)�
get_truecolor�from_triplet)rUr�r�rn�foreground_color�	new_colors      rV�_get_line_numbers_colorzSyntax._get_line_numbers_colors����;�;�;�;�=��@U�@U�U��+�3�3���#�'7�'I�'I��=�=�?�"��0�0����<���#�'7�'I�'I�#�6�u�}�}��6���*�*�,��*�*�,��
�	�
�!�!�)�,�,rYc��d}|jrAtt|j|jjd�z��tz}|S)z?Get the number of characters used to render the numbers column.rr�)r��lenrlr�r��count�NUMBERS_COLUMN_DEFAULT_PADDING)rU�column_widths  rV�_numbers_column_widthzSyntax._numbers_column_width,sJ��������C����$�)�)�/�/�$�*?�?�@�A�0�1�
��rY�consolec
��|j�}|jr3tj�td��tj�fS|jdvr�tj
||jjtj�t|j���|j�}tj
||jjtj�td|jd���|j�}n|td��z}|td��z}|||fS)z>Get background, number, and highlight styles for line numbers.Tr9)�256�	truecolorr7g�������?)r@r8F)r�r�rrw�color_system�chainr�rWrr3r�r�)rUr�r��number_style�highlight_number_styles     rV�_get_number_styleszSyntax._get_number_styles7s����/�/�1���2�2��:�:�<��4��%�*�*�,�>�>����#7�7� �;�;� ����/�/��
�
�;��D�8�8�:�;��%�%�	�L�&+�[�[� ����/�/��
�
�;��4�t�'C�'C�C�'H�I��%�%�	&�"�,�e��o�=�L�%5��%�8H�%H�"���/E�E�ErY�optionsc��tj|j�\}}}}||z}|j�5|j|jz|zdz}t|j|�S|jj�}|j|z|rtd�|D��ndz}|jr|dz
}t|j|�S)Nr$c3�2K�|]}t|����y�wr{r&)r��lines  rVr�z*Syntax.__rich_measure__.<locals>.<genexpr>Zs����4�d�8�D�>�4�s�r)
r"�unpackr�r�r�r/r��
splitlines�maxr�)	rUr�rr��rightr�r��width�liness	         rV�__rich_measure__zSyntax.__rich_measure__Ns���$�N�N�4�<�<�8���5�!�T���,���?�?�&��O�O�d�&@�&@�@�7�J�Q�N�E��t�9�9�5�A�A��	�	�$�$�&���&�&��
�8=�s�4�e�4�4�1�
F�	�
����Q�J�E��4�5�5�u�=�=rYc#��K�t|j||��}|jr3t||jj�|j����y|��y�w)N�ry�pad)r1�_get_syntaxr�r"r�r\)rUr�r�segmentss    rV�__rich_console__zSyntax.__rich_console__`sR�����D�,�,�W�g�>�?���<�<������ @� @� B�����
��N�s�A A"c#�|	K�|j�j}|j�4|jr|j|j
z
dz
n|jn|j}|j
|j�\}}|j||j�}|j�s/|j�s"|j�s|s|jd�|j�|jjt�ztd��z|j z}|j"r0|j$s$|j'|j(|��}d|_|jr,|j-||j/|���	�Ed{���y|j1||j/|dd
��|j dd��}	|	D]}
|
Ed{����y|jxsd
\}}d}
|rt3d|dz
�}
|j5d|��}|jr|
t7|�kDry||
|}|j"r�|j$s�|j�|jjt�ztd��z|j z}t9d�j;|�j'|j(|td��z��j5dd��}|j
}|j/|��}|j<j>}t@}|d�}|jBrdnd}|jE|�\}}}tG||jH|
z�D�]@\}}|jr(|j1||j/dd
��||��}nMtK|j-|d���}|jLr|g}n!|jO||j||��g}|jr�|d|zdz|�}tQ|�D]y\}}|r`tS|�jU|dz
�dz}||�r!||td�����|||���n|d|���|||���n|��|Ed{���|���{��,|D]}|Ed{���|�����Cy7��7���7�+7��w)zc
        Get the Segments for the Syntax object, excluding any vertical/horizontal padding
        Nr$r�Tr9)ry�crop)r)rr�)r�heightr�)ryr�	new_lines)NNr)�allow_blankF)rtz> u❱ )rr�r�)r�� rMrAr7z  )+r�r�r�r��	max_widthr��
_process_coder�r�r�r��
remove_suffixr�rWrrr�r��
ascii_only�with_indent_guidesr��overflow�render�update�render_linesr	�splitr�r3�joinr��__contains__r0�legacy_windowsr�	enumerater��listr��adjust_line_lengthr%rl�rjust) rUr�rr�r��
ends_on_nl�processed_coder�ry�syntax_lines�syntax_liner��end_line�line_offsetr�numbers_column_width�render_options�highlight_line�_Segmentr��line_pointerr�rrr�r�
wrapped_linesr�wrapped_line_left_pad�first�wrapped_line�line_columns                                 rVrzSyntax._get_syntaxks�����"&�!5�!5�!7�!N�!N�����&��$�$��"�"�T�%?�%?�?�!�C��&�&����	�&*�%7�%7��	�	�%B�"�
�N��~�~�n�d�o�o�>��� � ���������"�"�4�(��$�$�&��+�+�1�1�'�:�;��D�/�"��'�'�(�
��!�!�'�*<�*<��.�.�t�}�}�E�.�J�� &��
��+�+�"�>�>��'�.�.�z�.�"B�*����
� '�3�3���N�N��D�&�N�Q��/�/��"� 4� ��$0�+�K�*�*�*�+��#���>�,��
�H�����a��a��0�K�*.�*�*�T�z�*�*R���?�?��S��Z�'���+�h�/�E����g�&8�&8��$�$�&��+�+�1�1�'�:�;��D�/�"��'�'�(�
��T�
���e��#�#�D�M�M���e�AT�9T�#�U���t���.�	
� $�9�9�� ���j��9���-�-�:�:�����D�>��&�5�5�t�6��
�#�#�G�,�		
���"�'�u�d�o�o��.K�L�*	#�M�G�T��~�~� '� 4� 4��"�)�)��v�)�F�*�2�2�	!5�!�
� ����G��� <�=���?�?�%-�J�M�!�3�3�$�*�4�4�"2�$:� :�	4��%�M�� � �(0��.�.��4�6F�)�%�,6�m�+D�#�'�E�<��&)�'�l�&8�&8�9M�PQ�9Q�&R�UX�&X��)�'�2�"*�<��U�9K�"L�L�"*�;�8N�"O�O�"*�4�1G�"H�H�"*�;��"E�E�3�3�+�+�+�"�N�#�%2�#�L�+�+�+�"�N�#�Q*	#�m��+��^,��,�sJ�FR<�R2�AR<�R5�J4R<�R8�
R<�#R:�$R<�5R<�8R<�:R<r�c��|j}dgtjd|tj��D�cgc]}|j	�dz��c}�t|�dz�}|jD]Q}t||j�}t||j�}|��2|��5|j|j||��Sycc}w)z�
        Apply stylized ranges to a text instance,
        using the given code to determine the right portion to apply the style to.

        Args:
            text (Text): Text instance to apply the style to.
        rr�)�flagsr$N)�plain�re�finditer�	MULTILINEr�r�r��#_get_code_index_for_syntax_positionr�r�ry)rUr�r��match�newlines_offsets�stylized_ranger�r�s        rVr�zSyntax._apply_stylized_ranges�s����z�z��
�	
� �[�[��t�2�<�<�H������
��!��		
�
��I��M�	
��#�3�3�	?�N�7� �.�"6�"6��E�6� �.�"4�"4��C�� �S�_����^�1�1�5�#�>�	?��s�Cc��|jd�}|r|n|dz}|jrtj|�n|}|j|j�}||fS)a�
        Applies various processing to a raw code string
        (normalises it so it always ends with a line return, dedents it if necessary, etc.)

        Args:
            code (str): The raw code string to process

        Returns:
            Tuple[bool, str]: the boolean indicates whether the raw code ends with a line return,
                while the string is the processed code.
        r�)r�r��textwrap�
expandtabsr�)rUr�r,r-s    rVrzSyntax._process_codesY���]�]�4�(�
�!+������/3�{�{�H�O�O�N�+��	�(�2�2�4�=�=�A���>�)�)rYr{)g333333�?)r�r*rr+rQr/)1r]r^r_r`rr~r�rO�classmethodrrlr��
DEFAULT_THEMEr�bool�intrrr
r#rqr�r�rr�rar(r��propertyr�r3r�r2r�r��floatr�r�r*rr
r+r-rrr0rr�rrbrYrVr�r��s&���( �
�.�.����	�U�3��#3�4�	��	��	� *7��"��DH�.2�$(���*.�#�%&�!$@��$@��U�C�Z� �$@�
�S�+�%�&�$@��
$@��$@��$@��U�8�C�=�(�3�-�#?�@�A�$@�"�#�c�(�+�$@��S�M�$@��$@��$@�#�3�-�$@��$@� #�!$@�"
�#$@�L� �-1�)6��"�04��.2�$(���*.�#�%&�!<
��<
��<
���e�S�j�)�*�	<
�
�S�+�%�&�<
��
<
��<
��U�3��8�_�-�<
��<
�"�#�c�(�+�<
��S�M�<
��<
��<
�#�3�-�<
��<
� #�!<
�"
�#<
��<
�|�'�s�'�(�3�-�'�3�'��'�R���

�9�
��%��
���x������*EI�S��S��U�8�C�=�(�3�-�#?�@�A�S�
�	S�jO��O�'5�O�<J�O�	
�O�
-�U�
-�U�
-���s����F�'�F�e�E�5�%�<O�6P�F�.>� �>�+;�>�	�>�$	��	�)7�	�	�	�D#��D#� �D#�
�'�	�	D#�L?�4�?�D�?�<*�#�*�%��c�	�*:�*rYr�rD�positionrQc��t|�}|\}}||kDst|�|dzkry|dz
}||dz||z
dz
}t||�}|||zS)a
    Returns the index of the code string for the given positions.

    Args:
        newlines_offsets (Sequence[int]): The offset of each newline character found in the code snippet.
        position (SyntaxPosition): The position to search for.

    Returns:
        Optional[int]: The index of the code string for this position, or `None`
            if the given position's line number is out of range (if it's the column that is out of range
            we silently clamp its value so that it reaches the end of the line)
    r$N)r��min)rDrO�lines_count�line_number�column_index�
line_index�line_lengths       rVrBrB$sy���&�'�K� (��K���[� �C�(8�$9�[�1�_�$M���q��J�"�:��>�2�5E�j�5Q�Q�TU�U�K��{�L�1�L��J�'�,�6�6rY�__main__z&Render syntax to the console with Rich)�descriptionr��PATHzpath to file, or - for stdin)�metavar�helpz-cz
--force-color�force_color�
store_truezforce color for non-terminals)�dest�actionrgr[z-iz--indent-guidesr�Fzdisplay indent guidesz-lz--line-numbersr�zrender line numbers)r^r_r[z-wz--widthrz*width of output (default will auto-detect))�typer^rgr[z-rz--wrapr�zword wrap long linesz-sz--soft-wrap�	soft_wrapzenable soft wrapping mode)r_r^rgr[z-tz--themerezpygments theme)r^rgr[z-bz--background-colorrnzOverride background colorz-xz--lexerr�z
Lexer name)rgr^r[z-pz	--paddingr�r")r`rgr^r[z--highlight-liner4z)The line number (not index!) to highlight)r*)�force_terminalr�-)	r�r�r�r�rernr�r�r�)r�r�r�rernr�r�r�)ra)��os.pathr��platformr?�sysrG�abcrr�pathlibr�typingrrrr	r
rrr
rrr�pip._vendor.pygments.lexerr�pip._vendor.pygments.lexersrr�pip._vendor.pygments.stylerr~�pip._vendor.pygments.stylesr�pip._vendor.pygments.tokenrrrrrrrrrr�pip._vendor.pygments.utilr �pip._vendor.rich.containersr!�pip._vendor.rich.paddingr"r#�_loopr%�cellsr'r8r(r)r�r*r+r,r-�jupyterr.�measurer/�segmentr0r1ryr2r�r3rlra�system�WINDOWSrJ�Preproc�Word�Builtin�Function�	Namespace�Class�	Exception�	Decorator�Variable�Constant�	Attribute�Tag�Deleted�Inserted�Heading�
Subheading�PromptrEr�rJr�r�rOrdr�rLr�r�r�rBr]�argparse�ArgumentParser�parser�add_argument�
parse_args�args�pip._vendor.rich.consoler\rr��stdin�readr�r�r�r�rernr�r�r4�syntaxr��printrarbrYrV�<module>r�s�����	�
��#������-�S�=�9����4�-�?���#�I�I�!� �&�#���#�s�(�O�	�
�(�/�/�
�y�
(���
�
&�	�5�7�&���G�$�&��U�t�_�&��O�O�U��(�	&�
�U��
 �&��L�L�%�f�%�
&�
�M�M�5�y�)�&�	�L�L�%�f�%�&�	�M�M�5�w�'�&�	�N�N�E��$�7�&�	�J�J��G�t�4�&�	�N�N�E��'�&�	�N�N�E�	��5�&�	�M�M�5�u�%�&�	�M�M�5�u�%�&� 	�N�N�E��'�!&�"	�H�H�e�-�(�#&�$�E��!�
�E����O�O�U��.����e�'�*��O�O�U��%�����I�D�9��N�N�E�t�$��M�M�5�|�,�	�5�u��-�5&�
�D��E�!�"��:%�	�5�7�%���N�+�%��U�t�_�%��O�O�U��/�	%�
�U��
'�%��L�L�%�m�,�
%�
�M�M�5�/�0�%�	�L�L�%�m�,�%�	�M�M�5�~�.�%�	�N�N�E�
��>�%�	�J�J��N�d�;�%�	�N�N�E�
�.�%�	�N�N�E� 0�t�<�%�	�M�M�5�|�,�%�	�M�M�5�|�,�%� 	�N�N�E�
�.�!%�"	�H�H�e�-�(�#%�$�E��!�
�E�
�&��O�O�U��.����e�.�1��O�O�U��%�����$4�4�@��N�N�E�t�$��M�M�5�|�,�	�5�u��-�5%�	�4�	�5� �!��:%/�Y�G��!"��"�#�"�'&�+�'&�T&�k�&�B�s�C�x���	�J�	�~*�\�~*�B7��s�m�7�/=�7�
�c�]�7�6�z����
$�X�
$�
$�<��F������
+���
�����
���
,�
�������
���
$�
�������
��
"��������
�
��
9�
�������
���
#�
��������
��
(�
������i�g�y�?O��������
��
(���������
�
�������k��Q�Y�Y�������
��
�
8�������D�0��T�%5�%5�T�Z�Z�H�G��y�y�C���y�y�~�~������/�/��*�*��n�n��*�*�!�2�2��,�,��L�L�!�0�0�1�

���!�!��I�I��/�/��*�*��n�n��*�*�!�2�2��,�,��L�L�!�0�0�1�"�

���M�M�&�D�N�N�M�3�krY
¿Qué es la limpieza dental de perros? - Clínica veterinaria


Es la eliminación del sarro y la placa adherida a la superficie de los dientes mediante un equipo de ultrasonidos que garantiza la integridad de las piezas dentales a la vez que elimina en profundidad cualquier resto de suciedad.

A continuación se procede al pulido de los dientes mediante una fresa especial que elimina la placa bacteriana y devuelve a los dientes el aspecto sano que deben tener.

Una vez terminado todo el proceso, se mantiene al perro en observación hasta que se despierta de la anestesia, bajo la atenta supervisión de un veterinario.

¿Cada cuánto tiempo tengo que hacerle una limpieza dental a mi perro?

A partir de cierta edad, los perros pueden necesitar una limpieza dental anual o bianual. Depende de cada caso. En líneas generales, puede decirse que los perros de razas pequeñas suelen acumular más sarro y suelen necesitar una atención mayor en cuanto a higiene dental.


Riesgos de una mala higiene


Los riesgos más evidentes de una mala higiene dental en los perros son los siguientes:

  • Cuando la acumulación de sarro no se trata, se puede producir una inflamación y retracción de las encías que puede descalzar el diente y provocar caídas.
  • Mal aliento (halitosis).
  • Sarro perros
  • Puede ir a más
  • Las bacterias de la placa pueden trasladarse a través del torrente circulatorio a órganos vitales como el corazón ocasionando problemas de endocarditis en las válvulas. Las bacterias pueden incluso acantonarse en huesos (La osteomielitis es la infección ósea, tanto cortical como medular) provocando mucho dolor y una artritis séptica).

¿Cómo se forma el sarro?

El sarro es la calcificación de la placa dental. Los restos de alimentos, junto con las bacterias presentes en la boca, van a formar la placa bacteriana o placa dental. Si la placa no se retira, al mezclarse con la saliva y los minerales presentes en ella, reaccionará formando una costra. La placa se calcifica y se forma el sarro.

El sarro, cuando se forma, es de color blanquecino pero a medida que pasa el tiempo se va poniendo amarillo y luego marrón.

Síntomas de una pobre higiene dental
La señal más obvia de una mala salud dental canina es el mal aliento.

Sin embargo, a veces no es tan fácil de detectar
Y hay perros que no se dejan abrir la boca por su dueño. Por ejemplo…

Recientemente nos trajeron a la clínica a un perro que parpadeaba de un ojo y decía su dueño que le picaba un lado de la cara. Tenía molestias y dificultad para comer, lo que había llevado a sus dueños a comprarle comida blanda (que suele ser un poco más cara y llevar más contenido en grasa) durante medio año. Después de una exploración oftalmológica, nos dimos cuenta de que el ojo tenía una úlcera en la córnea probablemente de rascarse . Además, el canto lateral del ojo estaba inflamado. Tenía lo que en humanos llamamos flemón pero como era un perro de pelo largo, no se le notaba a simple vista. Al abrirle la boca nos llamó la atención el ver una muela llena de sarro. Le realizamos una radiografía y encontramos una fístula que llegaba hasta la parte inferior del ojo.

Le tuvimos que extraer la muela. Tras esto, el ojo se curó completamente con unos colirios y una lentilla protectora de úlcera. Afortunadamente, la úlcera no profundizó y no perforó el ojo. Ahora el perro come perfectamente a pesar de haber perdido una muela.

¿Cómo mantener la higiene dental de tu perro?
Hay varias maneras de prevenir problemas derivados de la salud dental de tu perro.

Limpiezas de dientes en casa
Es recomendable limpiar los dientes de tu perro semanal o diariamente si se puede. Existe una gran variedad de productos que se pueden utilizar:

Pastas de dientes.
Cepillos de dientes o dedales para el dedo índice, que hacen más fácil la limpieza.
Colutorios para echar en agua de bebida o directamente sobre el diente en líquido o en spray.

En la Clínica Tus Veterinarios enseñamos a nuestros clientes a tomar el hábito de limpiar los dientes de sus perros desde que son cachorros. Esto responde a nuestro compromiso con la prevención de enfermedades caninas.

Hoy en día tenemos muchos clientes que limpian los dientes todos los días a su mascota, y como resultado, se ahorran el dinero de hacer limpiezas dentales profesionales y consiguen una mejor salud de su perro.


Limpiezas dentales profesionales de perros y gatos

Recomendamos hacer una limpieza dental especializada anualmente. La realizamos con un aparato de ultrasonidos que utiliza agua para quitar el sarro. Después, procedemos a pulir los dientes con un cepillo de alta velocidad y una pasta especial. Hacemos esto para proteger el esmalte.

La frecuencia de limpiezas dentales necesaria varía mucho entre razas. En general, las razas grandes tienen buena calidad de esmalte, por lo que no necesitan hacerlo tan a menudo e incluso pueden pasarse la vida sin requerir una limpieza. Sin embargo, razas pequeñas como el Yorkshire o el Maltés, deben hacérselas todos los años desde cachorros si se quiere conservar sus piezas dentales.

Otro factor fundamental es la calidad del pienso. Algunas marcas han diseñado croquetas que limpian la superficie del diente y de la muela al masticarse.

Ultrasonido para perros

¿Se necesita anestesia para las limpiezas dentales de perros y gatos?

La limpieza dental en perros no es una técnica que pueda practicarse sin anestesia general , aunque hay veces que los propietarios no quieren anestesiar y si tiene poco sarro y el perro es muy bueno se puede intentar…… , pero no se va a poder pulir ni acceder a todas la zona de la boca …. Además los limpiadores dentales van a irrigar agua y hay riesgo de aspiración a vías respiratorias si no se realiza una anestesia correcta con intubación traqueal . En resumen , sin anestesia no se va hacer una correcta limpieza dental.

Tampoco sirve la sedación ya que necesitamos que el animal esté totalmente quieto, y el veterinario tenga un acceso completo a todas sus piezas dentales y encías.

Alimentos para la limpieza dental

Hay que tener cierto cuidado a la hora de comprar determinados alimentos porque no todos son saludables. Algunos tienen demasiado contenido graso, que en exceso puede causar problemas cardiovasculares y obesidad.

Los mejores alimentos para los dientes son aquellos que están elaborados por empresas farmacéuticas y llevan componentes químicos con tratamientos específicos para el diente del perro. Esto implica no solo limpieza a través de la acción mecánica de morder sino también un tratamiento antibacteriano para prevenir el sarro.

Conclusión

Si eres como la mayoría de dueños, por falta de tiempo , es probable que no estés prestando la suficiente atención a la limpieza dental de tu perro. Por eso te animamos a que comiences a limpiar los dientes de tu perro y consideres atender a su higiene bucal con frecuencia.

Estas simples medidas pueden conllevar a que tu perro tenga una vida más larga y mucho más saludable.

Si te resulta imposible introducir un cepillo de dientes a tu perro en la boca, pásate con él por clínica Tus Veterinarios y te explicamos cómo hacerlo.

Necesitas hacer una limpieza dental profesional a tu mascota?
Llámanos al 622575274 o contacta con nosotros

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

¡Hola!