Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/pylint/checkers/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/pylint/checkers/__pycache__/strings.cpython-311.pyc

�

�܋f���P�UdZddlmZddlZddlZddlZddlZddlmZddlm	Z	m
Z
ddlmZddl
Z
ddl
mZmZmZddlmZdd	lmZmZmZmZdd
lmZddlmZddlmZerdd
lmZej dkrddlm!Z!nddl"m!Z!dZ#hd�Z$ej%dd�&e$���d���Z'ej%dd�&e$���d���Z(ej%dd�&e$���d�ej)��Z*idd�dd�dd�dd�dd �d!d"�d#d$�d%d&�d'd(�d)d*�d+d,�d-d.�d/d0�d1d2�d3d4�d5d6�d7d8�d9d:d;d<��Z+d=e,d><ej-ej.ej/ej0ej1ej2ej3fZ4dYdE�Z5dZdJ�Z6GdK�dLe��Z7GdM�dNee��Z8d[dR�Z9d\dT�Z:d]dV�Z;d^dW�Z<d]dX�Z=dS)_z)Checker for string formatting operations.�)�annotationsN)�Counter)�Iterable�Sequence)�
TYPE_CHECKING)�bases�nodes�util)�SuccessfulInferenceResult)�BaseChecker�BaseRawFileChecker�BaseTokenChecker�utils)�only_required_for_messages)�HIGH)�MessageDefinitionTuple)�PyLinter)��)�Literal)z__builtin__.unicodez__builtin__.str�builtins.str>�B�F�R�U�b�f�r�u�BR�Br�FR�Fr�RB�RF�Rb�Rf�bR�br�fR�fr�rB�rF�rb�rf�(�|z)?'''z)?"""z)?("|')�E1300)z3Unsupported format character %r (%#02x) at index %d�bad-format-characterzEUsed when an unsupported format character is used in a format string.�E1301)z4Format string ends in middle of conversion specifier�truncated-format-stringzNUsed when a format string terminates before the end of a conversion specifier.�E1302)z?Mixing named and unnamed conversion specifiers in format string�mixed-format-stringz�Used when a format string contains both named (e.g. '%(foo)d') and unnamed (e.g. '%d') conversion specifiers.  This is also used when a named conversion specifier contains * for the minimum field width and/or precision.�E1303)z*Expected mapping for format string, not %s�format-needs-mappingzoUsed when a format string that uses named conversion specifiers is used with an argument that is not a mapping.�W1300)z7Format string dictionary key should be a string, not %s�bad-format-string-keyzyUsed when a format string that uses named conversion specifiers is used with a dictionary whose keys are not all strings.�W1301)z)Unused key %r in format string dictionary�unused-format-string-keyz�Used when a format string that uses named conversion specifiers is used with a dictionary that contains keys not required by the format string.�E1304)z*Missing key %r in format string dictionary�missing-format-string-keyz�Used when a format string that uses named conversion specifiers is used with a dictionary that doesn't contain all the keys required by the format string.�E1305)z$Too many arguments for format string�too-many-format-argsz^Used when a format string that uses unnamed conversion specifiers is given too many arguments.�E1306)z&Not enough arguments for format string�too-few-format-argsz\Used when a format string that uses unnamed conversion specifiers is given too few arguments�E1307)z)Argument %r does not match format type %r�bad-string-format-typezSUsed when a type required by format string is not suitable for actual argument type�E1310)z!Suspicious argument in %s.%s call�bad-str-strip-callzFThe argument to a str.{l,r,}strip call contains a duplicate character,�W1302)zInvalid format string�bad-format-stringz.Used when a PEP 3101 format string is invalid.�W1303)z-Missing keyword argument %r for format string�missing-format-argument-keyzhUsed when a PEP 3101 format string that uses named fields doesn't receive one or more required keywords.�W1304)zUnused format argument %r�unused-format-string-argumentz}Used when a PEP 3101 format string that uses named fields is used with an argument that is not required by the format string.�W1305)zTFormat string contains both automatic field numbering and manual field specification�format-combined-specificationz�Used when a PEP 3101 format string contains both automatic field numbering (e.g. '{}') and manual field specification (e.g. '{0}').�W1306)z2Missing format attribute %r in format specifier %r�missing-format-attributez�Used when a PEP 3101 format string uses an attribute specifier ({0.length}), but the argument passed for formatting doesn't have that attribute.�W1307)z2Using invalid lookup key %r in format specifier %r�invalid-format-indexz�Used when a PEP 3101 format string uses a lookup specifier ({a[1]}), but the argument passed for formatting doesn't contain or doesn't have that key as an attribute.)zKDuplicate string formatting argument %r, consider passing as named argument�$duplicate-string-formatting-argumentzmUsed when we detect that a string formatting is repeating an argument instead of using named string arguments)z?Using an f-string that does not have any interpolated variables�f-string-without-interpolationz�Used when we detect an f-string that does not use any interpolation variables, in which case it can be either a normal string or a bug in the code.)zKUsing formatting for a string that does not have any interpolated variables�#format-string-without-interpolationz�Used when we detect a string that does not have any interpolation variables, in which case it can be either a normal string without formatting or a bug in the code.)�W1308�W1309�W1310z!dict[str, MessageDefinitionTuple]�MSGS�key�str | Literal[0]�parts�list[tuple[bool, str]]�return�strc���g}|D]9\}}|r|�d|����� |�d|�d����:t|��d�|��zS)z]Given a list of format specifiers, returns
    the final access path (e.g. a.b.c[0][1]).
    �.�[�]�)�appendr`�join)r[r]�path�is_attribute�	specifiers     �h/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pylint/checkers/strings.py�get_access_pathrl�s|���D�#(�,�,���i��	,��K�K��I���(�(�(�(��K�K�*�I�*�*�*�+�+�+�+��s�8�8�b�g�g�d�m�m�#�#��arg_typer�format_type�boolc��|dvrdSt|tj��r4|���}|dkr|dkS|dkr|dvS|dkrdSdSdS)	N�srTr�czbuiltins.floatz	deEfFgGn%zbuiltins.intF)�
isinstance�astroid�Instance�pytype)rnros  rk�arg_matches_format_typerx�s���d����t��(�G�,�-�-�	��?�?�$�$���~�%�%��#�%�%��'�'�'��+�-�-��~�%�%��4��u��4rmc
��eZdZdZdZeZeddddddd	d
ddd
��d%d���Zed��d&d���Z	d&d�Z
d'd�Zd(d�Zd)d�Z
d*d#�Zd$S)+�StringFormatCheckerz�Checks string formatting operations to ensure that the format string
    is valid and the arguments match the format string.
    �stringr3r5r7r;r?r=rEr9rArCrV�node�nodes.BinOpr_�Nonec	��	�|jdkrdS|j}|j}t|tj��rt|jt��sdS|j}	tj	|��\}}}}n#tj
$rE}	||	j}
|�d||
t|
��|	jf���Yd}	~	dSd}	~	wtj$r|�d|���YdSwxYw|s|s|�d|���dS|r|r|�d|���dS|�r�t|tj���r{t!��}d}|jD]l\}
}t|
tj��rK|
j}t|t��r|�|���Q|�d	||����jd
}�m|s!|D]}||vr|�d||����|D]}||vr|�d||����|jD]�\}}t|tj��s� |�|jd��}tj|��}|�X|rVt|t*j��s<t/||��s,|�d
||���|f�����dSt|t2tjf��r.t7|��j}|�d||���dSdSg}t|tj��rGtj|��}d}t|tj��r|j}t?|��}n�t|t2tjtj ff��r|g}d}n�t|tj!��rhtj|��}t|tj��r|j}t?|��}n%t|tj��r|g}d}nd}nd}|��||kr|�d|���n||kr|�d|���tE||��D]v\}}|s�tj|��}|rVt|t*j��s<t/||��s,|�d
||���|f����udSdS)N�%r3�r|�argsr5�r|rVr7Fr;Tr?r=rEr9�rArC)#�op�left�rightrtr	�Const�valuer`r�parse_format_string�UnsupportedFormatCharacter�index�add_message�ord�IncompleteFormatString�Dict�set�items�add�get�
safe_inferr
�UninferableBaserxrw�OTHER_NODES�Tuple�type�__name__�
BaseContainer�elts�len�DictComp�Name�zip)�selfr|r�r��
format_string�
required_keys�required_num_args�required_key_types�required_arg_types�exc�	formatted�keys�unknown_keys�k�_r[�argrorn�	type_name�	args_elts�	rhs_tuple�num_args�inferreds                        rk�visit_binopzStringFormatChecker.visit_binop�s����7�c�>�>��F��y���z���4���-�-�	�*�T�Z��2M�2M�	��F��
�
�	��)�-�8�8�
��!�"�"�"���/�	�	�	�%�c�i�0�I����&����Y�����;�
�
�
�
�

�F�F�F�F�F������+�	�	�	����6�T��B�B�B��F�F�	�����	�%6�	����B���N�N�N��F��o	�.�o	�
���2���>�>�>�>�>�
�k	�
�$��
�+�+�/
T��u�u��$�� �J�,�,�D�A�q�!�!�U�[�1�1�
,��g��%�c�3�/�/�� �H�H�S�M�M�M�M� �,�,� 7�d��-�����(,���#��,�����d�?�?� �,�,� ;�$�S�-����� ���C��-�/�/��(�(�6�T��)�����!%�
���H�C��%�c�5�;�7�7�!� �"4�"8�"8���D�"I�"I�K�$�/��4�4�H�#�/�$�0� *�8�T�5I� J� J�0�!8��+� N� N�0�
�(�(�4�!%�"*�/�/�"3�"3�[�!A�)������� �D�;���"<�=�=�
T� ��J�J�/�	�� � �!7�d�� �S�S�S�S�S�
T�
T��I��$���,�,�
 �!�,�T�2�2�	����i��)<�=�=�.� )��I�"�9�~�~�H���D�;���U�^�0L�"M�N�N�
 �!�F�	�����D�%�*�-�-�
 � �+�D�1�1���h���4�4�	$�!)�
�I�"�9�~�~�H�H���%�+�6�6�$�!)�
�I� �H�H�#�H�H�
 ���#��/�/�/��$�$�%;�$�$�G�G�G�G�� 1�1�1��$�$�%:��$�F�F�F�(+�I�7I�(J�(J�
�
�$�C���!� �$�/��4�4�H� �	� *�8�T�5I� J� J�	�!8��+� N� N�	�
�(�(�4�!%�"*�/�/�"3�"3�[�!A�)�����$�#�

�
s�A4�4C0�:C�)C0�/C0rU�nodes.JoinedStrc�0�|�|��dS�N)�_check_interpolation�r�r|s  rk�visit_joinedstrz#StringFormatChecker.visit_joinedstr�s���!�!�$�'�'�'�'�'rmc���t|jtj��rdS|jD]}t|tj��rdS� |�d|���dS)NrUr�)rt�parentr	�FormattedValue�valuesr�)r�r|r�s   rkr�z(StringFormatChecker._check_interpolation�sp���d�k�5�#7�8�8�	��F��[�	�	�E��%��!5�6�6�
����
����9���E�E�E�E�Erm�
nodes.Callc��tj|j��}t|tj���rt|jtj��r�|jjdvr�|jdvr�|j	r�tj|j	d��}t|tj��rt|jt��sdSt|j��tt|j����kr+|�d||jj|jf���dSdS|jdkr|�||��dSdSdSdSdS)N>r`�bytes�unicode>�strip�lstrip�rstriprrGr��format)rr��funcrtru�BoundMethod�boundrv�namer�r	r�r�r`r�r�r��_check_new_format)r�r|r�r�s    rk�
visit_callzStringFormatChecker.visit_call�s_�����	�*�*���t�W�0�1�1�	3��4�:�w�'7�8�8�	3��
��#>�>�>��y�9�9�9�d�i�9��&�t�y��|�4�4��!�#�u�{�3�3��:�c�i�QT�;U�;U���F��s�y�>�>�S��S�Y���%8�%8�8�8��$�$�,�!�"�j�o�t�y�9�%������9�8���h�&�&��&�&�t�T�2�2�2�2�2�!	3�	3�	3�	3�?�>�'�&rm�positional_arguments�list[SuccessfulInferenceResult]c��tjd�|D����}|���D]%\}}|dkr�|�d||f����&dS)Nc3�XK�|]%}t|tj���|jV��&dSr�)rtr	r�r�)�.0r�s  rk�	<genexpr>zAStringFormatChecker._detect_vacuous_formatting.<locals>.<genexpr>�sI����&
�&
��
�3��
�8S�8S�&
��H�&
�&
�&
�&
�&
�&
rmr�rTr�)�collectionsrr�r�)r�r|r��counterr��counts      rk�_detect_vacuous_formattingz.StringFormatChecker._detect_vacuous_formatting�s����%�&
�&
� 4�&
�&
�&
�
�
��#�=�=�?�?�	�	�K�D�%���z�z�����6�T���
�
�
�
�
�	�	rmr��bases.BoundMethodc�~�t|jtj��r&t|jjtj��sdS|js|jrdS	t|j	�
����}n#tj$rYdSwxYwt|tj��rt|j
t��sdS	tjj�|��}n#tj$rYdSwxYw	t%j|j
��\}}}n-#t$j$r|�d|���YdSwxYw|j}|j}	d�|D��}
|r|r|�d|���dSd}|t1d�|
D����z
}|
ro|
D]!}|r||	vr|�d||f�	���"|	D]}||
vr|�d
||f�	��� |p|}|s|r t3d�|
D����}
|	s|
rd}nd}|rt|p|}|s|�d
|���dSt5|��|kr|�d|���n*t5|��|kr|�d|���|�||��|�|||	��dS)z Check the new string formatting.NrIr�c�T�h|]%}t|dt���|d��&S)r)rtr`�r��fields  rk�	<setcomp>z8StringFormatChecker._check_new_format.<locals>.<setcomp>�s/��R�R�R�U�
�5��8�S�8Q�8Q�R��a��R�R�RrmrOFc3�K�|]}|�dV��	dS)r�N�r�s  rkr�z8StringFormatChecker._check_new_format.<locals>.<genexpr>�s'����A�A�e�5�A��A�A�A�A�A�ArmrKr�rMc3�K�|]}|V��dSr�r�r�s  rkr�z8StringFormatChecker._check_new_format.<locals>.<genexpr>s"����@�@�%��@�@�@�@�@�@rmTrVrArC)rtr�r	�	Attribute�exprr��starargs�kwargs�nextr��inferru�InferenceErrorr�r`�	arguments�CallSite�	from_callr�parse_format_method_stringr�r�r��keyword_arguments�sum�allr�r��_check_new_format_specifiers)r�r|r��strnode�	call_site�fieldsr��
manual_posr��named_arguments�named_fields�
check_argsr��emptys              rkr�z%StringFormatChecker._check_new_format�s����d�i���1�1�	�*��I�N�E�K�;
�;
�	�
�F��=�	�D�K�	��F�	��4�:�+�+�-�-�.�.�G�G���%�	�	�	��F�F�	�����7�E�K�0�0�	�Z��
�s�5S�5S�	��F�	��)�2�<�<�T�B�B�I�I���%�	�	�	��F�F�	����	�+0�+K��
�,�,�(�F�H�j�j���+�	�	�	����0�t��<�<�<��F�F�	���� )�=��#�5��R�R�f�R�R�R���	�
�	����<�4��H�H�H��F��
��C�A�A�|�A�A�A�A�A�A���	�%�
�
����U�/�9�9��$�$�5�D��x�%�����)�
�
����,�,��$�$�7�d�%��%����� �-�:�H�#�
&�x�
&��@�@�<�@�@�@�@�@�@��"�&�e�&�"&�J���J��		C��-�:�H��
�� � �!F�T� �R�R�R����'�(�(�8�3�3�� � �!7�d� �C�C�C�C��)�*�*�X�5�5�� � �!6�T� �B�B�B��'�'��.B�C�C�C��)�)�$���H�H�H�H�Hs6�&A>�>B�B�$C0�0D�D�D%�%&E�Er��(list[tuple[str, list[tuple[bool, str]]]]�named�$dict[str, SuccessfulInferenceResult]c��|D�]�\}}|sd}t|t��r,	tj||��}n"#tj$rY�GwxYw||vr�P||}|�t|t
j��r�u	tj|��}n#tj	$rY��wxYw|r|s��|j
r t|j
tj��r��|}g}	|D�]�\}
}t|t
j��r�n�|	�
|
|f��|
r�	|�|��d}�n]#tj$rWt!|d��r|���rY�n`t%||	��}|�d||f|���Y�n2wxYwd}
t!|d��r�	|�tj|����}n?#tjtjtjf$rd}
Yntj	$rYn�wxYwt|t
j��rn�n/	|�d	��n#tj$rd}
YnwxYw|
r,t%||	��}|�d
||f|���n:	t3|�����}���#tj	$rYnwxYw���dS)z^Check attribute and index access in the format
        string ("{0.a}" and "{0[a]}").
        rN�has_dynamic_getattrrQ)r�r|F�getitemT�__getitem__rS)rt�intr�get_argument_from_call�NoSuchArgumentErrorr
r�r�rur�r�r	�	Argumentsrf�getattr�
NotFoundError�hasattrr�rlr�r�r��AstroidIndexError�AstroidTypeError�AttributeInferenceErrorr�r�)r�r|r�r�r[�
specifiers�argname�argument�previous�parsedrirjrh�
warn_errors              rkr�z0StringFormatChecker._check_new_format_specifierss��� &�Y	�Y	�O�C���
����#�s�#�#�
%��#�:�4��E�E�G�G���0�����H������e�#�#����*����*�W�d�6J�"K�"K���
� �+�G�4�4�����)�
�
�
���
�����
�X�
����
�:�h�o�u��#O�#O�
���H�-/�F�+5�8
�8
�'��i��h��(<�=�=���E��
�
�|�Y�7�8�8�8��.��#+�#3�#3�I�#>�#>�q�#A����"�0�
�
�
�#�H�.C�D�D�"� (� <� <� >� >�"�
"�E�E�.�s�F�;�;���(�(�6�"+�T�!2�!%�)����
���
����"'�J��x��3�3�.�	"�'/�'7�'7���I�8N�8N�'O�'O�H�H��#�5�#�4�#�;� �.�.�.�
*.�J�J�J�&�5�"�"�"�!�E�E�"����%�h��0D�E�E�"�!�E�"�.�%�,�,�]�;�;�;�!�E��&�4�.�.�.�)-�J�J�J�.����!��.�s�F�;�;���(�(�2�)�T�9J�QU�)�������#�H�N�N�$4�$4�5�5�H�H���-�����E�E������oY	�Y	su�9�A�
A�9B�B �B �D/�/3F�&*F�F�+'G�(H�=H�H�0I�I�I�
!J0�0K�KN)r|r}r_r~)r|r�r_r~�r|r�r_r~)r|r�r�r�r_r~)r|r�r�r�r_r~)r|r�r�r�r�r�r_r~)r��
__module__�__qualname__�__doc__r�rZ�msgsrr�r�r�r�r�r�r�r�rmrkrzrz�s%���������D��D� ���!���#�"� ����-���M�M�M���M�^ �� @�A�A�(�(�(�B�A�(�F�F�F�F�3�3�3�3�(����RI�RI�RI�RI�jc�c�c�c�c�crmrzc���eZdZdZdZddddddd	gifd
dd�Zd
ddddd�fdddddd�ffZdZdZd@�fd�Z	dAd�Z
dBd!�Zed��dCd#���Z
ed��dDd%���Zed��dEd'���Zed��dFd)���ZdGd+�ZdHd-�ZdId2�ZdJd7�ZdKd;�Zed<��dLd>���ZdLd?�Z�xZS)M�StringConstantCheckerzCheck string literals.r{)zRAnomalous backslash in string: '%s'. String constant might be missing an r prefix.�anomalous-backslash-in-stringzBUsed when a backslash is in a literal string but not as an escape.)zaAnomalous Unicode escape in byte string: '%s'. String constant might be missing an r or u prefix.�"anomalous-unicode-escape-in-stringzSUsed when an escape like \u is encountered in a byte string where it has no effect.z)Implicit string concatenation found in %s�implicit-str-concatziString literals are implicitly concatenated in a literal iterable definition : maybe a comma is missing ?�	old_names)�W1403zimplicit-str-concat-in-sequence)z<Quote delimiter %s is inconsistent with the rest of the file�inconsistent-quoteszxQuote delimiters are not used consistently throughout a module (with allowances made for avoiding unnecessary escaping).)z?The u prefix for strings is no longer necessary in Python >=3.0�redundant-u-string-prefixz�Used when we detect a string with a u prefix. These prefixes were necessary in Python 2 to indicate a string was Unicode, but since Python 3.0 strings are Unicode by default.)�W1401�W1402�W1404�W1405�W1406z check-str-concat-over-line-jumpsF�ynz<y or n>z�This flag controls whether the implicit-str-concat should generate a warning on implicit string concatenation in sequences defined over several lines.)�defaultr��metavar�helpzcheck-quote-consistencyz�This flag controls whether inconsistent-quotes generates a warning when the character used as a quote delimiter is used inconsistently within a module.zabfnrtvx

	\'"01234567�uUN�linterrr_r~c�X��t���|��i|_dSr�)�super�__init__�
string_tokens)r�r%�	__class__s  �rkr(zStringConstantChecker.__init__�s0���
������ � � �
�	
��	;�:rmr|�nodes.Modulec�"�d|jv|_dS)N�unicode_literals)�future_imports�_unicode_literalsr�s  rk�process_modulez$StringConstantChecker.process_module�s��!3�t�7J�!J����rm�tokens�list[tokenize.TokenInfo]c�*�d}t|��D�]W\}\}}}}}|tjkr|}�|tjk�r'|�||d|d��|dz}	|	t|��krx||	jtjtjtj	fvrH|	dz
}	|	t|��kr0||	jtjtjtj	fv�H|	t|��kr||	nd}
|dkr8|dt|d|d��
|����f}t|��|
f|j|<��Y|j
jjr|�|��dSdS)N�asciirr�)�	enumerate�tokenize�ENCODING�STRING�process_string_tokenr�r��NEWLINE�NL�COMMENT�encode�str_evalr)r%�config�check_quote_consistency�&check_for_consistent_string_delimiters)r�r1�encoding�i�
token_type�token�startr��line�j�
next_tokens           rk�process_tokensz$StringConstantChecker.process_tokens�s�����6?��6G�6G�	J�	J�2�A�2�
�E�5�!�T��X�.�.�.� ����x��.�.��)�)�%��q��5��8�D�D�D���E���#�f�+�+�o�o�&��)�.��$��K��$�=�+�+�
��F�A��#�f�+�+�o�o�&��)�.��$��K��$�=�+�+�+,�c�&�k�k�/�/�V�A�Y�Y�t�
��w�&�&�#�1�X�s�4�
�%��(�
�+;�+B�+B�8�+L�+L�'M�'M�N�E�-5�e�_�_�j�,I��"�5�)���;��5�	@��7�7��?�?�?�?�?�	@�	@rmr�c�<�|�|jd��dS)N�call)�check_for_concatenated_stringsr�r�s  rkr�z StringConstantChecker.visit_call�� ���+�+�D�I�v�>�>�>�>�>rm�
nodes.Listc�<�|�|jd��dS)N�list�rMr�r�s  rk�
visit_listz StringConstantChecker.visit_list�rNrm�	nodes.Setc�<�|�|jd��dS)Nr�rRr�s  rk�	visit_setzStringConstantChecker.visit_set�s ���+�+�D�I�u�=�=�=�=�=rm�nodes.Tuplec�<�|�|jd��dS)N�tuplerRr�s  rk�visit_tuplez!StringConstantChecker.visit_tuple�s ���+�+�D�I�w�?�?�?�?�?rm�nodes.Assignc���t|jtj��r=t|jjt��r |�|jgd��dSdSdS)N�
assignment)rtr�r	r�r`rMr�s  rk�visit_assignz"StringConstantChecker.visit_assign�si���d�j�%�+�.�.�	L�:�d�j�>N�PS�3T�3T�	L��/�/����l�K�K�K�K�K�	L�	L�	L�	Lrm�Iterable[tokenize.TokenInfo]c���tj��}|D]D\}}}}}|tjkr,t	|��r|t|��xxdz
cc<�Et
|��dkr�|�d��dd}|D]^\}}}}}|tjkr�t|��}t	|��r%||kr|�d|d|f����]dSdS)a\Adds a message for each string using inconsistent quote delimiters.

        Quote delimiters are used inconsistently if " and ' are mixed in a module's
        shortstrings without having done so to avoid escaping an internal quote
        character.

        Args:
          tokens: The tokens to be checked against for consistent usage.
        r�rr)rGr�N)	r�rr6r8�!_is_quote_delimiter_chosen_freely�_get_quote_delimiterr��most_commonr�)	r�r1�string_delimiters�tok_typerEr��most_common_delimiterrF�quote_delimiters	         rkrAz<StringConstantChecker.check_for_consistent_string_delimiterss6��+6�*=�*?�*?��)/�	D�	D�$�H�e�Q��1��8�?�*�*�/P�QV�/W�/W�*�!�"6�u�"=�"=�>�>�>�!�C�>�>�>��� �!�!�A�%�%�$5�$A�$A�!�$D�$D�Q�$G��$J�!�06�

�

�,��%���1��x��.�.��"6�u�"=�"=��5�e�<�<��'�+@�@�@��$�$�-�E�!�H�O�CU�%�����&�%�

�

rm�elements�Sequence[nodes.NodeNG]�
iterable_typer`c��|D]�}t|tj��r|���tvs�8|jdkr�D|j|jf}||jvr�\|j|\}}||jkrb|�`|j	tjkrK|jd|jks|j
jjr$|�d|j|ft"�����dS)Nrr)rGr��
confidence)rtr	r�rw�_AST_NODE_STR_TYPES�
col_offset�linenor)r�r�r6r8rFr%r?� check_str_concat_over_line_jumpsr�r)r�rhrj�elt�token_index�matching_tokenrIs       rkrMz4StringConstantChecker.check_for_concatenated_strings%s���	�	�C��3���,�,�
�14�����AT�1T�1T���~��!�!���:�s�~�6�K��$�"4�4�4��)-�);�K�)H�&�N�J����*�*�z�/E��?�h�o�5�5��$�Q�'�3�:�5�5��{�)�J�6��$�$�-� �Z�+�-�#'�	%�����+	�	rmrE�	start_rowr��	start_colc	�^�d}t|��D]
\}}|dvr|}n�|�dS|d|����}||d�}|dd�|dd�cxkr	d|zkrnndnd}	||	|	�}
d|vr-|�||
||t|��z|	z��dSdS)Nz'"r���r�r)r5�lower�process_non_raw_string_tokenr�)r�rErtru�
quote_char�_index�char�prefix�after_prefix�quote_length�string_bodys           rkr9z*StringConstantChecker.process_string_tokenDs���
�%�e�,�,�	�	�L�F�D��u�}�}�!�
�������F��w��w��%�%�'�'���V�W�W�~���b�q�b�!�\�"�#�#�%6�H�H�H�H�!�j�.�H�H�H�H�H�A�A�a�	�#�<��
�#=�>���f����-�-�����C��K�K�'�,�6�	
�
�
�
�
��rmr}r��string_start_colc��d}	|�d|��}|dkrd
S||dz}|||dz�}|�dd|��}|dkr|}	||z}
n"||�dd|��z}	||z
dz
}
||jvr%d|vrnCd	|vrn>|�d
|	|f|
���n#||jvr|�d|	|f|
���|dz
}��)aJCheck for bad escapes in a non-raw string.

        prefix: lowercase string of string prefix markers ('ur').
        string_body: the un-parsed body of the string, not including the quote
        marks.
        start_row: line number in the source.
        string_start_col: col number of the string start in the source.
        rT�\���r���
rrr)rGr�rnrN)�find�rfindr��UNICODE_ESCAPE_CHARACTERSr��ESCAPE_CHARACTERS)r�r}r�rtr�r��	next_char�match�last_newlinerGrns           rkryz2StringConstantChecker.process_non_raw_string_token^sY��&��(	��$�$�T�5�1�1�E���{�{���$�E�A�I�.�I�����	� 1�2�E�'�,�,�T�1�e�<�<�L��r�!�!� ��"�%5�5�
�
� �;�#4�#4�T�1�e�#D�#D�D��"�\�1�A�5�
��D�:�:�:��&�=�=����&�&���$�$�<�!�#�X�#-�	%������$�"8�8�8�� � �3����)�	!����
�Q�J�E�Q(	rmr�nodes.Constc��|���dkr6t|jtj��s|�|��dSdSdS)Nr)rwrtr�r	�	JoinedStr�_detect_u_string_prefixr�s  rk�visit_constz!StringConstantChecker.visit_const�sW���;�;�=�=�N�*�*�:��K���4
�4
�*�
�(�(��.�.�.�.�.�+�*�*�*rmc�d�|jdkr$|�d|j|j���dSdS)z:Check whether strings include a 'u' prefix like u'String'.rr)rGrnN)�kindr�rornr�s  rkr�z-StringConstantChecker._detect_u_string_prefix�sK���9�������+��[��?�
�
�
�
�
�
��rm�r%rr_r~)r|r+r_r~)r1r2r_r~r
)r|rOr_r~)r|rTr_r~)r|rWr_r~)r|r[r_r~)r1r_r_r~)rhrirjr`r_r~)rEr`rtr�rur�r_r~)
r}r`r�r`rtr�r�r�r_r~)r|r�r_r~)r�rrrr�r�optionsr�r�r(r0rJrr�rSrVrZr^rArMr9ryr�r��
__classcell__)r*s@rkrrsw������� � ��D�
�
�
8�!�
)��G�H�I�

�
�
�9#�#�D�L
/� ��%�!�	
�
�	
�
&� ��%�2�	
�
�
	
��G�86��!&��;�;�;�;�;�;�K�K�K�K�@�@�@�@�8 �� 5�6�6�?�?�?�7�6�?� �� 5�6�6�?�?�?�7�6�?� �� 5�6�6�>�>�>�7�6�>� �� 5�6�6�@�@�@�7�6�@�L�L�L�L� � � � �D����>����4<�<�<�<�| �� ;�<�<�/�/�/�=�<�/��������rmrr%rr~c��|�t|����|�t|����dSr�)�register_checkerrzr)r%s rk�registerr��sB��
���/��7�7�8�8�8�
���1�&�9�9�:�:�:�:�:rmrEc���|dd����dvr|dd�}n&|d���dvr
|dd�}|dd�dvr
|dd	�S|dd
�S)a!Mostly replicate `ast.literal_eval(token)` manually to avoid any performance hit.

    This supports f-strings, contrary to `ast.literal_eval`.
    We have to support all string literal notations:
    https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals
    rr�>r+r/N>rrrr�r>�"""�'''rwr�)rx)rEs rkr>r>�s���
�Q�q�S�z�����\�)�)��a�b�b�	���	�q����	�	�_�	,�	,��a�b�b�	���Q�q�S�z�^�#�#��Q�r�T�{����2��;�rm�string_tokenc��tt�|��pt�|����S)arIs this string token a "longstring" (is it triple-quoted)?

    Long strings are triple-quoted as defined in
    https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals

    This function only checks characters up through the open quotes.  Because it's meant
    to be applied only to tokens that represent string literals, it doesn't bother to
    check for close-quotes (demonstrating that the literal is a well-formed string).

    Args:
        string_token: The string token to be parsed.

    Returns:
        A boolean representing whether this token matches a longstring
        regex.
    )rp�SINGLE_QUOTED_REGEXr��DOUBLE_QUOTED_REGEX)r�s rk�_is_long_stringr��s=��"��!�!�,�/�/�	3��$�$�\�2�2���rmc��t�|��}|std|�d����|�d��S)a}Returns the quote character used to delimit this token string.

    This function checks whether the token is a well-formed string.

    Args:
        string_token: The token to be parsed.

    Returns:
        A string containing solely the first quote delimiter character in the
        given string.

    Raises:
      ValueError: No quote delimiter characters are present.
    z
string token z is not a well-formed stringr�)�QUOTE_DELIMITER_REGEXr��
ValueError�group)r�r�s  rkrbrb�sJ��
"�'�'��5�5�E��U��S��S�S�S�T�T�T��;�;�q�>�>�rmc��t|��}|dkrdnd}t|o t|��o|t|��v��S)a�Was there a non-awkward option for the quote delimiter?

    Args:
        string_token: The quoted string whose delimiters are to be checked.

    Returns:
        Whether there was a choice in this token's quote character that would
        not have involved backslash-escaping an interior quote character.  Long
        strings are excepted from this analysis under the assumption that their
        quote characters are set by policy.
    �'�")rbrpr�r>)r�rg�unchosen_delimiters   rkrara�sb��+�<�8�8�O� /�3� 6� 6���C����	=���-�-�-�	=��h�|�&<�&<�<���rm)r[r\r]r^r_r`)rnrror`r_rpr�)rEr`r_r`)r�r`r_rp)r�r`r_r`)>r�
__future__rr��re�sysr6r�collections.abcrr�typingrrurr	r
�astroid.typingr�pylint.checkersrr
rr�pylint.checkers.utilsr�pylint.interfacesr�
pylint.typingr�pylint.lintr�version_infor�typing_extensionsrm�	_PREFIXES�compilergr�r��DOTALLr�rZ�__annotations__r��List�Lambda�FunctionDef�ListComp�SetComp�GeneratorExpr�rlrxrzrr�r>r�rbrar�rmrk�<module>r�s���
0�/�/�"�"�"�"�"�"�����	�	�	�	�
�
�
�
�����������.�.�.�.�.�.�.�.� � � � � � �����&�&�&�&�&�&�&�&�&�&�4�4�4�4�4�4�T�T�T�T�T�T�T�T�T�T�T�T�<�<�<�<�<�<�"�"�"�"�"�"�0�0�0�0�0�0��%�$�$�$�$�$�$���v����������)�)�)�)�)�)�Q��
�
�
�	�4!�b�j�!?�S�X�X�i�%8�%8�!?�!?�!?�@�@�� �b�j�!B�S�X�X�i�%8�%8�!B�!B�!B�C�C��"��
�#D�s�x�x�	�':�':�#D�#D�#D�b�i�P�P��������
����(��)�4��5�@��A�N��O�\��]�h��i�t��u�@��A�J��K�T��U�`��a�n��o�~���L��M�Z���s����A�A�A�A�H
�K�	�J�	�L�	��	�N�	�M�	����
$�
$�
$�
$�����&J�J�J�J�J�+�J�J�J�Zk�k�k�k�k�,�.@�k�k�k�\	;�;�;�;�

�
�
�
� ����.����*�����rm

Hacked By AnonymousFox1.0, Coded By AnonymousFox