403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.202
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python313/Lib/test/test_ast/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python313/Lib/test/test_ast/__pycache__/test_ast.cpython-313.opt-2.pyc
�

��iO'��r�SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK	r	SSK
r
SSKrSSKrSSK
Jr SSKJr SSKrSSKJr SSKJr SSKJrJr SSKJr SSKJr SS	KJrJrJ r J!r!J"r"J#r# "S
S\
RH5r%"SS
\
RH5r&"SS\
RH5r'"SS\
RH5r("SS\
RH5r)"SS\
RH5r*"SS5r+"SS\+\
RH5r,"SS\\+\
RH5r-"SS\
RH5r.\R^"SS\
RH55r0"S S!\
RH5r1S"r2"S#S$\
RH5r3\4S%:Xa\
Rj"5 gg!\a SrGNof=f)&�N)�partial)�dedent)�support)�import_fresh_module)�	os_helper�
script_helper)�ASTTestMixin)�to_tuple)�
eval_tests�eval_results�
exec_tests�exec_results�single_tests�single_resultsc���\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr Sr!S r"S!r#S"r$S#r%S$r&S%r'S&r(S'r)\*RVS(5r,S)r-S*r.S+r/S,r0S-r1S.r2S/r3S0r4S1r5S2r6S3r7S4r8S5r9\*RVS65r:S7r;S8\<\=R|S9\?S:\?S;S4S<jr@S?S=jrAS>rBg)@�	AST_Tests� Nc��[U[5(dgSUR;agUS:g=(a USR5$)NF�ast�ASTr)�
isinstance�type�
__module__�isupper)�self�name�nodes   �+C:\Python313\\Lib\test\test_ast\test_ast.py�_is_ast_node�AST_Tests._is_ast_node#s;���$��%�%������'���u�}�2��a����!2�2�c���[U[R5(a
URcg[U[R[R
[R45(aAURUR4nURX25 URUR4nURH�n[X5n[U[5(aIUnU(a$US:XaUSRUSR4nUHnURXv5 M MlUcMqURXR5 M� URURUR5 g)N�decorator_listr)rrr�_fields�expr�stmt�
excepthandler�lineno�
col_offset�assertGreaterEqual�getattr�list�_assertTrueorder�assertEqual�__match_args__)r�ast_node�
parent_pos�node_posr�value�	first_pos�childs        rr-�AST_Tests._assertTrueorder*s���(�C�G�G�,�,��0@�0@�0H���h����3�8�8�S�5F�5F� G�H�H� ����)<�)<�=�H��#�#�H�9�"�/�/�8�+>�+>�?�J��$�$�D��H�+�E��%��&�&�&�	��T�%5�5�!&�q����%��(�2E�2E� F�I�"�E��)�)�%�;�#��"��%�%�e�8�%�	
����)�)�8�+B�+B�Cr!c���[R"5nURURS5 SUlURURS5 URUR
SS5 UR
[5 UR SSS5 UR
[5 [R"S5 SSS5 g!,(df   NC=f!,(df   g=f)N��*�foobar�)
rrr.r$r:�__dict__�assertRaises�AttributeError�vararg�	TypeError�r�xs  r�test_AST_objects�AST_Tests.test_AST_objects=s����G�G�I��������B�'����������2�&�������H�-�r�2�
�
�
�~�
.�
�H�H�/��
�
�y�
)��G�G�A�J�*�
)�/�
.��*�
)�s�	
C�3C$�
C!�$
C2c�^�[RRmU4SjnURU5 [R?SnUR	[
U5 [R"SS9 SSS5 UR	[
U5 [R"5 SSS5 g!,(df   NC=f!,(df   g=f)Nc�0>�T[Rlg�N)rrr$)�	old_values�r�cleanup�5AST_Tests.test_AST_fields_NULL_check.<locals>.cleanupOs���'�C�G�G�Or!z0type object 'ast.AST' has no attribute '_fields'�{)�arg1)rrr$�
addCleanup�assertRaisesRegexr>)rrI�msgrHs   @r�test_AST_fields_NULL_check�$AST_Tests.test_AST_fields_NULL_checkKs�����G�G�O�O�	�	(����� ��G�G�O�@��
�
#�
#�N�C�
8��G�G���9�
�
#�
#�N�C�
8��G�G�I�9�
8�9�
8��
8�
8�s�B-�B>�-
B;�>
Cc��"SS5n[R"5nU"5UlX"Rl[R
"UR5nA[R"5 URU"55 g)Nc��\rSrSrSrg)�0AST_Tests.test_AST_garbage_collection.<locals>.X�]r8N��__name__r�__qualname__�__firstlineno__�__static_attributes__r8r!r�XrT]���r!r[)	rrrB�a�weakref�refr�
gc_collect�assertIsNone)rr[r]r_s    r�test_AST_garbage_collection�%AST_Tests.test_AST_garbage_collection\s\��	�	�
�G�G�I���c��������k�k�!�#�#���
��������#�%� r!c	���[[S4[[S4[[
S44H�upn[
X5H�upEURSUS9 [USU[R5nUR[U5U5 URUS5 SSS5 URSXCS	9 [WSU5 SSS5 M� M� g!,(df   N==f!,(df   M�=f)
N�exec�single�eval�parsing)�action�input�?)rr�	compiling)rirj�kind)r
rrrrr�zip�subTest�compiler�
PyCF_ONLY_ASTr.r
r-)rrj�outputrm�i�o�ast_trees       r�
test_snippets�AST_Tests.test_snippetshs���
��v�.�
�>�8�4�
��v�.�$
��E�4�
�E�*����\�\��!�\�<�&�q�#�t�S�5F�5F�G�H��$�$�X�h�%7��;��)�)�(�F�;�=��\�\��A�\�I��H�c�4�0�J�I�+�$
�=�<��J�I�s�
A
C�/C�
C�
C.c��[[-[-nUH&n[R"U5n[USS5 M( g)N�<string>re)r
rrr�parserp)r�snippets_to_validate�snippet�trees    r�test_ast_validation�AST_Tests.test_ast_validationvs6��)�L�8�:�E��+�G��9�9�W�%�D��D�*�f�-�,r!c�@�/SQnUGH�up#URX#S9 [R"SUS9n[R"[R"S5US9nXE4GHnURURS[R
5 [
U[5(alURURSR[R5 URURSRRU5 M�URURSR[R5 URURSRRU5 GM SSS5 GM� g!,(df   GM�=f)N))����	__debug__)rr�)�F)r;F)�optval�expectedr���optimizer)
rorrz�assertIsInstance�body�Exprr�boolr3�Constantr.�Name�id)r�casesr�r��res1�res2�ress       r�!test_optimization_levels__debug__�+AST_Tests.test_optimization_levels__debug__}s��M�� %��F����V��?��y�y��v�>���y�y����;�!7�&�I�� �<�C��)�)�#�(�(�1�+�s�x�x�@�!�(�D�1�1��-�-�c�h�h�q�k�.?�.?����N��(�(����!��):�):�)@�)@�(�K��-�-�c�h�h�q�k�.?�.?����J��(�(����!��):�):�)=�)=�x�H�(�@�?�!&�?�?�s�E#F
�
F	c�t�SnSnSU4SU4SU4SU4/nUH�upEURUS9 [R"SUS	9n[R"[R"S5US	9nXg4H,n[URS5n	URX�5 M. SSS5 M� g!,(df   M�=f)
N)r��r�rr��)r�r��N)r�r�)�BinOpr�)r�)r�rr�r�r�N)�Add)r�)r��r�r�r;Nr�rr�r;)r��1 + 2r�)rorrzr
r�r.)
r�folded�
not_foldedr�r�r��tree1�tree2r}r�s
          r�&test_optimization_levels_const_folding�0AST_Tests.test_optimization_levels_const_folding�s���L��

�
��j�!�A�z�?�Q��K�!�V��M�� %��F����V��,��	�	�'�F�;���	�	�#�)�)�G�"4�v�F��"�N�D�"�4�9�9�Q�<�0�C��$�$�S�3�+�-�,�!&�,�,�s�A2B(�(
B7	c���/SQnUH�up#URSUSU35 Sn[R"U5nX%RSlX5RSlUR
[5 [USS5 SSS5 SSS5 M� /SQnUH�upxURSUSU35 Sn[R"U5nXuRSl	X�RSl
UR
[5 [USS5 SSS5 SSS5 M� g!,(df   N�=f!,(df   GML=f!,(df   N?=f!,(df   M�=f)	N))�
r�)i�������)r�r�)������)r�r�zCheck invalid linenos �:za = 1rryrezCheck invalid col_offset )rorrzr�r(�
end_linenor=�
ValueErrorrpr)�end_col_offset)	r�invalid_linenosr(r�r|r}�invalid_col_offsetsr)r�s	         r�!test_invalid_position_information�+AST_Tests.test_invalid_position_information�s9��M��"1��F���� 6�v�h�a�
�|�L�M�!���y�y��)��&,�	�	�!��#�*4�	�	�!��'��&�&�z�2��D�*�f�5�3�N�M�#2�R��*=�&�J����+�J�<�q��8H�I��"���y�y��)��*4�	�	�!��'�.<�	�	�!��+��&�&�z�2��D�*�f�5�3���+>�	3�2��N�M��"3�2����sI�AE�7D2�E�;AE'�E�E'�2
E�<E�
E	�
E$� E'�'
E6	c���[R"[R"[R"SSSS9/SSS9[R"[R"SSSS9/SSS9//S9n[	USS	5 g)
N�builtinsr�r�rr(r))�namesr(r)�	traceback�r��type_ignoresryre)r�Module�Import�aliasrp�rr}s  r�>test_compilation_of_ast_nodes_with_default_end_position_values�HAST_Tests.test_compilation_of_ast_nodes_with_default_end_position_values�st���z�z��
�
��9�9�*�Q�1�M�N�� ��
�
�
��9�9�+�a�A�N�O�� ��
��
��"	��j�&�)r!c	�X�[R"SSSS9nSSS.SSS.SSSS.SSSS.4HjnURUS9 [R"[R"SS	U/0UD6//S
9n[USS5 [R"US
S9 SSS5 Ml g!,(df   M~=f)Nr�rr�r��r(r))r(r)r�)r(r�r))�attrsr�r�ryrer;r�r8)rr�ror�r�rprz)rr�r�r}s    r�#test_negative_locations_for_compile�-AST_Tests.test_negative_locations_for_compile�s����	�	�{�1��C����+���+���b�A���1�=�	
�E����E��*��z�z��J�J�6�e�W�6��6�(� "�$��
��j�&�1��	�	�$��+�+�*�

�+�*�s�AB�
B)	c��[R"S5RSRRnURUR5 URUR5 URUR5 g)Nzx[::]r)	rrzr�r3�slicera�upper�lower�step)r�slcs  r�
test_slice�AST_Tests.test_slice�s]���i�i�� �%�%�a�(�.�.�4�4�����#�)�)�$����#�)�)�$����#�(�(�#r!c��[R"S5RSnURUR5 g)Nzfrom . import yr)rrzr�ra�module)r�ims  r�test_from_import�AST_Tests.test_from_import�s.��
�Y�Y�(�
)�
.�
.�q�
1�����"�)�)�$r!c���[R"S5nURURS[R5 SR5URSl[USS5 g)Nzfrom __future__ import divisionrz __future__ �<test>re)rrzr�r��
ImportFrom�stripr�rp)r�mods  r�!test_non_interned_future_from_ast�+AST_Tests.test_non_interned_future_from_ast�sR���i�i�9�:�����c�h�h�q�k�3�>�>�:�+�1�1�3���������X�v�&r!c��[R"S5RSnUR[	UR
5S5 UR
SnURURS5 URUR5 URURS5 URURS5 URURS5 URURS5 [R"S5RSnUR
SnURURS5 URUR5 URURS5 URURS5 URURS5 URURS5 [R"S	5RSnUR
SnURURS5 URURS
5 URURS5 URURS5 URURS5 URURS5 [R"S5RSnUR
SnURURS
5 URURS5 URURS5 URURS5 URURS5 URURS5 g)Nzfrom bar import yrr��y��zfrom bar import *�*zfrom bar import y as z�z�zimport bar as foo�bar�foo�)
rrzr�r.�lenr�rra�asnamer(r�r)r�)rr�r�s   r�
test_alias�AST_Tests.test_alias�s���
�Y�Y�*�
+�
0�
0��
3������R�X�X���*�������������S�)����%�,�,�'�������q�)�����)�)�1�-�����)�)�2�.�����-�-�r�2�
�Y�Y�*�
+�
0�
0��
3��������������S�)����%�,�,�'�������q�)�����)�)�1�-�����)�)�2�.�����-�-�r�2�
�Y�Y�/�
0�
5�
5�a�
8��������������S�)�������s�+�������q�)�����)�)�1�-�����)�)�2�.�����-�-�r�2�
�Y�Y�*�
+�
0�
0��
3��������������U�+�������u�-�������q�)�����)�)�1�-�����)�)�1�-�����-�-�r�2r!c��UR[[R[R55 UR[[R
[R55 UR[[R[R55 UR[[R[R55 UR[[R[R55 UR[[R[R55 grG)
�
assertTrue�
issubclassr�Forr&r�r%r�
comprehension�Gt�rs r�test_base_classes�AST_Tests.test_base_classess������
�3�7�7�C�H�H�5�6����
�3�8�8�S�X�X�6�7����
�3�8�8�S�W�W�5�6����
�3�8�8�S�W�W�5�6����
�3�#4�#4�c�g�g�>�?����
�3�6�6�3�7�7�3�4r!c���[S5nSnSH<nUR[URU55 [	X5 SSS5 M> g!,(df   MP=f)NrzSast\.{} is deprecated and will be removed in Python 3.14; use ast\.Constant instead��Num�Str�Bytes�NameConstant�Ellipsis)r�assertWarnsRegex�DeprecationWarning�formatr+)rr�
depr_regexrs    r�test_import_deprecated� AST_Tests.test_import_deprecated!sX��!�%�(��
)�	�F�D��&�&�'9�:�;L�;L�T�;R�S���"�T�S�F�S�S�s�A�
A 	c�n�[R"5 [R"SS[5 SSKJnJnJnJnJ	n SSS5 SH�n[[U5nURXg5(dM+URU5 UR[5 U"5nSSS5 SSS5 [W[R5(dM�UR![#UR$5[&5 M� g!,(df   N�=f!,(df   Nv=f!,(df   N=f)N�ignore�rr�)�warnings�catch_warnings�filterwarningsr�rr�r�r�r�r�r+rro�assertWarnsrr�assertIsrr$�tuple)	rr�r�r�r�r�r�itemrBs	         r�$test_field_attr_existence_deprecated�.AST_Tests.test_field_attr_existence_deprecated+s���
�
$�
$�
&��#�#�H�b�2D�E�C�C�'�H�D��3��%�D�� � ��,�,��\�\�$�'��)�)�*<�=� �F��>�(��a����)�)��M�M�$�q�y�y�/�5�9�H�	'�
&��>�=��(�'�s/�+D�D&�D�%D&�
D�
D#�D&�&
D4	c�X�[RR5H�upUS;aM
US:XaMURX5(dM-UR	U5n[U[R5(dM_UR[UR5[5 M� g)N>r�r�r�r�r��Index)rr<�itemsr�_construct_ast_classrrrrr$r)rrrrBs    r�test_field_attr_existence�#AST_Tests.test_field_attr_existence9sy���,�,�,�,�.�J�D��J�J���w���� � ��,�,��-�-�d�3���a����)�)��M�M�$�q�y�y�/�5�9�/r!c�L�0nURR5H}up4U[LaSX#'MU[LaSX#'M#U[LaSX#'M2[U[5(dMI[U[R5(dMjURU5X#'M U"S0UD6$)N�capybarar9scapybarar8)�__annotations__r�str�int�objectrrr�rrr	)r�cls�kwargsr�typs     rr	�AST_Tests._construct_ast_classFs������,�,�2�2�4�I�D��c�z�)������!������*����C��&�&�:�c�3�7�7�+C�+C�#�8�8��=���5��}�V�}�r!c���[R"5nURURS5 URUR[
[R[
[R[RS-[
[R[
[R[RS-[
[RS.5 URUR/5 URUR5 [R"[SS56nURURS5 URURS5 g)N)�posonlyargs�argsr?�
kwonlyargs�kw_defaults�kwarg�defaultsr��r;r�)r�	argumentsr.r$rr,�argr%rrar?�rangerAs  r�test_arguments�AST_Tests.test_argumentsSs����M�M�O�����
�I�I�
�	
�	
���
���#�C�G�G�}��S�W�W�
��'�'�D�.�"�3�7�7�m�#�C�H�H�~����4�� ����N�
�	
�	
�������$����!�(�(�#��M�M�5��A�;�'���������#�������1�%r!c�
�[R"5 [R"SS[5 [R
"5nSSS5 SWlURURS5 g!,(df   N2=f)Nr�r��)r�r�r�r�rr�r$r.rAs  r�#test_field_attr_writable_deprecated�-AST_Tests.test_field_attr_writable_deprecatedusW��
�
$�
$�
&��#�#�H�b�2D�E����	�A�'���	�������C�(�'�
&�s�2A4�4
Bc�v�[R"S5nSUlURURS5 g)Nr�r$)rr�r$r.rAs  r�test_field_attr_writable�"AST_Tests.test_field_attr_writable}s*���L�L��O����	�������C�(r!c
�
�[R"5 [R"SS[5 SSKJnJnJnJnJ	n SSS5 [R"SS9n[R"SS[5 [R
"5nURURS5 UR[5 UR SSS5 UR[5 UR SSS5 [R
"S	5nURURS	5 URURS	5 UR[5 UR  SSS5 UR[5 UR" SSS5 [R
"S
S9nURUR S
5 [R
"S	SS9nURUR S5 URURS5 URURS	5 URURS	5 UR[$[R
SSS
5 UR[$[R
SSS
SS9 UR[R
"SS
S9R&S
5 UR)[$S5 [R
"SS
S9 SSS5 UR[R
"S	5RS	5 UR[R
"S5RS5 UR[R
"S5RS5 UR[R"S5R*S5 UR[R"S5R*S5 UR-[R"S5RS5 UR-[R"S5RS5 UR-[R"S5RS5 SSS5 URWVs/sHn[/UR05PM sn/SQ5 g!,(df   GN�=f!,(df   GN=f!,(df   GN�=f!,(df   GN�=f!,(df   GN}=f!,(df   GN*=f!,(df   N�=fs snf)Nr�r�rr�T��record�always�r3rmr9r;�r(r�r��r�z(Num got multiple values for argument 'n'��n�@�@�42�42F)�Rast.Num is deprecated and will be removed in Python 3.14; use ast.Constant instead�lConstant.__init__ missing 1 required positional argument: 'value'. This will become an error in Python 3.15.�OAttribute n is deprecated and will be removed in Python 3.14; use value insteadr7r9r7r8r7r9r7r7r7z�Constant.__init__ got an unexpected keyword argument 'foo'. Support for arbitrary keyword arguments is deprecated and will be removed in Python 3.15.r7r9r7r9r7r9�Rast.Str is deprecated and will be removed in Python 3.14; use ast.Constant instead�OAttribute s is deprecated and will be removed in Python 3.14; use value instead�Tast.Bytes is deprecated and will be removed in Python 3.14; use ast.Constant insteadr;�[ast.NameConstant is deprecated and will be removed in Python 3.14; use ast.Constant insteadr=r=)r�r�r�r�rr�r�r�r�r�r.r$r=r>r3r2r(r:r@r�rN�srr�message)	rr�r�r�r�r��wlogrB�ws	         r�test_classattrs_deprecated�$AST_Tests.test_classattrs_deprecated�s���
�
$�
$�
&��#�#�H�b�2D�E�C�C�'��
$�
$�D�
1�T��#�#�H�b�2D�E����	�A����Q�Y�Y�(9�:��"�"�>�2����3��"�"�>�2����3������A����Q�W�W�b�)����Q�S�S�"�%��"�"�>�2����3��"�"�>�2����3����q�!�A����Q�X�X�q�)�����1�%�A����Q�X�X�q�)����Q�Y�Y�(9�:����Q�W�W�b�)����Q�S�S�"�%����i����!�T�1�=����i����!�T�1�Q��G�
���S�W�W�Q�E�2�6�6��>��'�'��E������Q���

���S�W�W�R�[�]�]�B�/����S�W�W�T�]�_�_�d�3����S�W�W�U�^�-�-�u�5����S�W�W�T�]�_�_�d�3����S�Y�Y�u�-�/�/��7��M�M�#�*�*�4�0�6�6��=��M�M�#�*�*�5�1�7�7��?��M�M�#�*�*�4�0�6�6��=�a2�d	
���%)�*�T��S����^�T�*�
�"	
�m'�
&��3�2��3�2��3�2��3�2��$���I2�
1��f
+s��+S�A#T3�
S�
T3�*
S+�7A+T3�"
S=�/T3�
T�ET3�(T!�>FT3�U�
S�
S(	�#T3�+
S:	�5T3�=
T	�T3�
T	�T3�!
T0	�+T3�3
Uc	�
	�UR[5 [R"5nSSS5 UR	WR
S5 UR
[5 UR SSS5 [R"S5nUR	URS5 UR
[5 UR SSS5 UR
[5 UR SSS5 [R"SSS9nUR	URS5 [R"SSS9nUR	URS5 UR	UR
S5 UR	URS5 UR
[[RSSS5 UR
[[RSSSSS9 UR[5 UR	[R"SS	S
9RS	5 SSS5 UR[S5 [R"SSS9 SSS5 UR	[R"S5RS5 UR	[R"S
5RS
5 UR	[R"S5RS5 UR	[R"S5RS5 UR	[R"S5RS5 UR[R"S5RS5 UR[R"S5RS5 UR[R"S5RS5 UR[R"S5RS5 g!,(df   GN�=f!,(df   GN�=f!,(df   GNv=f!,(df   GN^=f!,(df   GN<=f!,(df   GN=f)Nr.r9r;r�)r(r3rr/r�r�r0z1Constant got multiple values for argument 'value'�r3r3r4r5r6TF.)rr�rr�r.r$r=r>r3r(r:r@r�rNrrAs  r�test_classattrs�AST_Tests.test_classattrs�s��
�
�
�0�
1�����A�2�������$5�6�
�
�
�~�
.�
�G�G�/�
�L�L����������"�%�
�
�
�~�
.�
�H�H�/��
�
�~�
.�
�H�H�/�
�L�L���+��������1�%��L�L��A�&��������1�%�������$5�6�������"�%����)�S�\�\�1�d�A�>����)�S�\�\�1�d�A�a��H��
�
�0�
1����S�\�\�!��7�;�;�U�C�2��
#�
#��J�
�
�L�L��!�$�
�
	
������b�)�/�/��4�������d�+�1�1�4�8�������e�,�2�2�E�:�������d�+�1�1�4�8�������e�,�2�2�E�:��
�
�c�l�l�4�(�.�.��5��
�
�c�l�l�5�)�/�/��7��
�
�c�l�l�4�(�.�.��5��
�
�c�l�l�3�'�-�-�s�3�Y2�
1��/�
.��/�
.��/�
.��2�
1��
�
�sG�P�%
P+�
P=�+
Q�<0Q!�
Q3�
P(�+
P:�=
Q�
Q�!
Q0�3
Rc��[R"5 [R"SS[5 SSKJnJnJnJnJ	n SSS5 [R"SS9n[R"SS[5 UR[[R
"S55[R5 UR[[R
"S	55[R5 UR[[R
"S
55[R5 UR[[R"S55[R5 UR[[R"S55[R5 UR[[R"S55[R5 UR[[R"S
55[R5 UR[[R"S55[R5 UR[[R"55[R5 SSS5 URWVs/sHn[UR5PM sn/SQ5 g!,(df   GN�=f!,(df   NY=fs snf)Nr�r�rr�Tr+r-r9r3r4r5r6F)	r7r7r7r:r<r=r=r=zWast.Ellipsis is deprecated and will be removed in Python 3.14; use ast.Constant instead)r�r�r�r�rr�r�r�r�r�rrr�r.rr?)rr�r�r�r�r�r@rAs        r�
test_realtype�AST_Tests.test_realtype
s���
�
$�
$�
&��#�#�H�b�2D�E�C�C�'��
$�
$�D�
1�T��#�#�H�b�2D�E��M�M�$�s�w�w�r�{�+�S�\�\�:��M�M�$�s�w�w�t�}�-�s�|�|�<��M�M�$�s�w�w�u�~�.����=��M�M�$�s�w�w�t�}�-�s�|�|�<��M�M�$�s�y�y��/�0�#�,�,�?��M�M�$�s�/�/��5�6����E��M�M�$�s�/�/��6�7����F��M�M�$�s�/�/��5�6����E��M�M�$�s�|�|�~�.����=�2�	
���%)�*�T��S����^�T�*�

�
	
�!'�
&��2�
1��
+s�+K�IK1�5L�
K.�1
K?c��SSKJn [R"5 [R"SS[
5 SSKJnJnJnJ	nJ
n SSS5 Sn[UR[
URS55n[UR[
URS55n	[UR[
URS	55n
[UR[
URS
55n[UR[
URS55nSHUn
URU
S
9 U"5 W"U
5nSSS5 U"5 URWW5 SSS5 SSS5 MW U	"5 W"S5nSSS5 U	"5 URWW5 SSS5 U
"5 W"S5nSSS5 U
"5 URWW5 SSS5 SHUn
URU
S
9 U"5 W"U
5nSSS5 U"5 URWW5 SSS5 SSS5 MW U"5 W"5nSSS5 U"5 URWW5 SSS5 SHCn
URU
S
9 U"5 URU"U
5W5 SSS5 SSS5 ME U	"5 URU"S5W5 SSS5 U
"5 URU"S5W5 SSS5 SHCn
URU
S
9 U"5 URU"U
5W5 SSS5 SSS5 ME U"5 URU"S5W5 SSS5 U	"5 W"S5nSSS5 U"UR WW5 U
"UR UW5 U"5 U"S5nSSS5 U	"UR WW5 U"UR UW5 U"UR UW5 U"5 U"S5nSSS5 U"5 UR!X�5 SSS5 U"5 U"S5nSSS5 U"5 UR!X�5 SSS5 SHCn
URU
S
9 U"5 UR!U"U
5U5 SSS5 SSS5 ME U	"UR U"S5U5 U
"UR U"S5U5 U"UR U"S5U5 U"UR U"S5U5 U"UR U"S5U5 U	"UR U"S5U5 U
"UR U"S5U5 U"UR U"S5U5 U"UR U"S5U5 "SS["5nU	"5 URU"U"S55U5 SSS5 U"5 UR!U"U"S55U5 SSS5 g!,(df   GN�=f!,(df   GN=f!,(df   GN�=f!,(df   GMV=f!,(df   GN�=f!,(df   GN�=f!,(df   GN�=f!,(df   GN�=f!,(df   GN�=f!,(df   GN�=f!,(df   GM=f!,(df   GN�=f!,(df   GN�=f!,(df   GNm=f!,(df   GM�=f!,(df   GN^=f!,(df   GNH=f!,(df   GN=f!,(df   GMk=f!,(df   GN=f!,(df   GN=f!,(df   GN�=f!,(df   GN�=f!,(df   GN�=f!,(df   GN�=f!,(df   GNt=f!,(df   GNI=f!,(df   GM�=f!,(df   GN;=f!,(df   g=f)Nr)r�r�r�r�zQast.{} is deprecated and will be removed in Python 3.14; use ast.Constant insteadr�r�r�r�r�)r9g������@y������@)rr5r6�TFN.r9TF)r5TFr�c��\rSrSrSrg)�$AST_Tests.test_isinstance.<locals>.Si�r8NrVr8r!r�SrN�r\r!rO)rr�r�r�r�r�r�r�r�r�r�rr�r�ror��assertNotIsInstancer)rr�r�r�r�r�r��cls_depr_msg�assertNumDeprecated�assertStrDeprecated�assertBytesDeprecated�assertNameConstantDeprecated�assertEllipsisDeprecatedrr2r>�b�erOs                   r�test_isinstance�AST_Tests.test_isinstance-s^�� �
�
$�
$�
&��#�#�H�b�2D�E�C�C�'�

'�	�
&��!�!�#5�|�7J�7J�5�7Q�
��&��!�!�#5�|�7J�7J�5�7Q�
��!(��!�!�#5�|�7J�7J�7�7S�!
��(/��!�!������/�(
�$�
$+��!�!�#5�|�7J�7J�:�7V�$
� �!�C����#��&�(�*��C��A�+�(�*��)�)�!�S�1�+�'�&�!�!�
"��D�	�A�#�
 �
"��!�!�!�S�)�#�#�
$��e��A�%�
"�
$��!�!�!�U�+�%�%�C����#��&�1�3�$�S�)�A�4�1�3��)�)�!�\�:�4�'�&�%�&�
'��
�A�(�
%�
'��!�!�!�X�.�(�!�C����#��&�(�*��)�)�(�3�-��=�+�'�&�!�
!�
"��!�!�(�4�.�#�6�#�#�
$��!�!�(�5�/�5�9�%�%�C����#��&�1�3��)�)�(�3�-��F�4�'�&�%�
&�
'��!�!�(�3�-��:�(�!�
"��D�	�A�#��D�4�4�a��=��d�6�6��5�A�
 �
"��B��A�#��D�4�4�a��=�$�T�%=�%=�q�,�O� ��!9�!9�1�h�G�
)�
+��T�"�A�,�
 �
"��$�$�Q�,�#�*�
+��U�#�A�,�
 �
"��$�$�Q�,�#�%�C����#��&�(�*��,�,�X�c�]�C�@�+�'�&�%�
	�D�4�4�h�r�l�C�H��d�6�6�����N�$��$�$�h�r�l�L�	
�	!��!9�!9�8�B�<��R��D�4�4�h�t�n�c�J��D�4�4�h�t�n�c�J��d�6�6�����N�$��$�$�h�q�k�<�	
�	!��!9�!9�8�D�>�8�T�	��	�!�
"��!�!�(�1�T�7�"3�S�9�#�
 �
"��$�$�X�a��g�%6��<�#�
"�q'�
&��:+�*��*�*��'�&��#�
"��
"�
"��%�
$��
$�
$��
4�3��3�3��'�&��(�
'��
'�
'��
+�*��'�&��#�
"��%�
$��
4�3��'�&��(�
'��#�
"��
#�
"��,�
+��
"�
"��,�
+��
"�
"��
+�*��'�&��*#�
"��
"�
"�s��+X5�7Y+�?	Y�Y+�Y�*Y+�	Y>�Z�?	Z"�Z4�[*�	[�[*�&[�9[*�[=�+\�\3�"\!�;\3�]�>]�3]<�;]*�]<�/^�	^!�	^3�+	_�_�$	_)�<_;�*`�2`
�`�`2�
a�5
Y�
Y�Y+�
Y(�#Y+�+
Y;	�>
Z
�
Z�"
Z1�4
[�
[�[*�
['�"[*�*
[:	�=
\�
\�!
\0�+\3�3
]	�
]�
]'�*
]9�4]<�<
^	�
^�!
^0�3
_�
_�
_&�)
_8�;
`
�
`�`�
`/	�2
a�
ac��[R"5 [R"SS[5 SSKJn SSS5 [R"SS9n[R"SS[5 "SS	[R
5n"S
S[R
5nU"S5nUR
URS5 UR
URS
5 UR[U5U5 URXS5 URU[R
5 URXT5 UR[R
"S5U5 U"SS9nUR
URS5 UR[U5U5 SSS5 UR
WVs/sHn[UR5PM sn/SQ5 g!,(df   GN�=f!,(df   NY=fs snf)Nr�r�r�r�Tr+r-c�(^�\rSrSrU4SjrSrU=r$)�8AST_Tests.test_constant_subclasses_deprecated.<locals>.Ni�c�4>�[TU]"U0UD6 SUlg�N�spam��super�__init__r��rrr�	__class__s   �rrd�AAST_Tests.test_constant_subclasses_deprecated.<locals>.N.__init__�s����G�$�d�5�f�5�#�D�Fr!�r��rWrrXrYrdrZ�
__classcell__�rfs@r�Nr^�s
���$�$r!rlc��\rSrSrSrg)�9AST_Tests.test_constant_subclasses_deprecated.<locals>.N2i�r8NrVr8r!r�N2rn����r!ror9rar1)r9r9r7r7r9r9)r�r�r�r�rr�r.r2r�rrr�rPrr?)rr�r@rlror2rAs       r�#test_constant_subclasses_deprecated�-AST_Tests.test_constant_subclasses_deprecated�st��
�
$�
$�
&��#�#�H�b�2D�E��'��
$�
$�D�
1�T��#�#�H�b�2D�E�
$�C�G�G�
$�

�S�W�W�
��"��A����Q�S�S�"�%����Q�S�S�&�)��M�M�$�q�'�1�%��!�!�!�'��!�!�!�S�W�W�-��$�$�Q�+��$�$�S�W�W�R�[�!�4��B��A����Q�S�S�"�%��M�M�$�q�'�1�%�+2�.	
���%)�*�T��S����^�T�*�
�
	
�7'�
&��2�
1��0
+s�#G%�EG7�;H�%
G4�7
Hc��"SS[R5n"SS[R5nU"S5nURURS5 URURS5 UR[U5U5 UR
[X155 UR
[U[R55 UR[X255 UR[[R"S5U55 U"SS9nURURS5 UR[U5U5 g)Nc�(^�\rSrSrU4SjrSrU=r$)�-AST_Tests.test_constant_subclasses.<locals>.Ni�c�4>�[TU]"U0UD6 SUlgr`rbres   �rrd�6AST_Tests.test_constant_subclasses.<locals>.N.__init__�s����� �$�1�&�1���r!rhrirks@rrlru�s
���
 �
 r!rlc��\rSrSrSrg)�.AST_Tests.test_constant_subclasses.<locals>.N2i�r8NrVr8r!rrory�r\r!ror9rarE)	rr�r.r3r�rr�r�assertFalse)rrlror2s    r�test_constant_subclasses�"AST_Tests.test_constant_subclasses�s���	 ����	 �
	����	�
�b�E��������"�%�������f�%�����a��!�$����
�1�(�)����
�1�c�l�l�3�4�����A�*�+�����C�L�L��$4�a�8�9�
�B�K��������"�%�����a��!�$r!c��[R"S5/n[R"U/5nURURU5 g)Nr9)rr�r�r.r�)rr�rBs   r�test_module�AST_Tests.test_module�s7�����R� �!���J�J�t�R� ���������&r!c
��UR[5 [R"5nSSS5 UR	WR
S5 SUlUR	URS5 [R"S5n[R"S5n[R"5n[R"X$U5nUR	URU5 UR	URU5 UR	URU5 [R"SSS5nUR	URS5 UR	URS5 UR	URS5 [R"SSSSS9nUR	URS5 UR	URS5 UR	URS5 UR	URS5 UR[[RSSSS5 UR[[RSSSSSS9 [R"SSSSS	9nUR	URS5 UR	URS5 UR	URS5 UR	URS5 UR[5 [R"SSSS
S9nSSS5 UR	URS
5 g!,(df   GN=f!,(df   N==f)N��left�op�rightr�r�r�r;rr/r�)r�r�r�r(r9)�	foobarbaz)rr�rr�r.r$r�r�r�r�r�r�r(r=r@)rrB�n1�n3�addops     r�test_nodeclasses�AST_Tests.test_nodeclasses�sm��
�
�
�0�
1��	�	��A�2�������$;�<����������a�(�
�\�\�!�_��
�\�\�!�_�����	���I�I�b��$���������$�������u�%�������"�%��I�I�a��A����������#�������q�!�������!�$��I�I�a��A�a�(���������#�������q�!�������!�$�������1�%�	
���)�S�Y�Y��1�a��;����)�S�Y�Y��1�a��1��E�
�I�I�1��!�A�6���������#�������q�!�������!�$�������1�%��
�
�0�
1��	�	�!�Q��R�0�A�2�������b�)�U2�
1��P2�
1�s�L:�=M�:
M	�
Mc�f�[R"5nURURS5 g)Nr8)r�Subr.r$rAs  r�test_no_fields�AST_Tests.test_no_fieldss!���G�G�I��������B�'r!c	�\�[SSS9n[R"[R"[R"S0UD640UD6//5nUR[5n[USS5 SSS5 URS[WR55 g!,(df   N4=f)Nr;r�r�r�rezbut got <ast.exprr8)�dictrr�r�r%r=r@rp�assertInr�	exception)r�pos�m�cms    r�test_invalid_sum�AST_Tests.test_invalid_sum s{���!��*���J�J��������C��8�C�8�9�2�>��
�
�
�y�
)�R��A�x��(�*��
�
�)�3�r�|�|�+<�=�*�
)�s�!B�
B+c	��[R"[R"[R"S[R"555//5n[R
"U5 UR
[5n[USS5 SSS5 URS[WR55 g!,(df   N4=f)Nr9r�rezidentifier must be of type str)rr�r�r��Load�fix_missing_locationsr=r@rpr�rr�)rr�r�s   r�test_invalid_identifier�!AST_Tests.test_invalid_identifier's���J�J�������"�c�h�h�j�!9�:�;�R�@���!�!�!�$�
�
�
�y�
)�R��A�x��(�*��
�
�6��B�L�L�8I�J�*�
)�s�B<�<
C
c�J�[SS[4[SS[454Hmn[R"[R"U5S9n[R
"U5 UR
[S5 [USS5 SSS5 Mo g!,(df   M�=f)Nr�r;�r�zinvalid type in Constant: typer�rg)	r�	frozensetr�
Expressionr�r�rNr@rp)r�invalid_constantrXs   r�test_invalid_constant�AST_Tests.test_invalid_constant.s|�� #�a��C�[�)�Q��3�K�2H� H�����C�L�L�1A�$B�C�A��%�%�a�(��'�'�	�3S�T���8�V�,�U�T�!I�U�T�s�8B�
B"	c�H�[R"S5nSURSRSRlUR	[
5n[
USS5 SSS5 URS[WR55 g!,(df   N4=f)Nzdef f():
 yield from g()rr�rezfield 'value' is required)
rrzr�r3r=r�rpr�rr�)r�empty_yield_fromr�s   r�test_empty_yield_from�AST_Tests.test_empty_yield_from5sz���9�9�%@�A��7;����a� �%�%�a�(�.�.�4�
�
�
�z�
*�b��$�h��7�+��
�
�1�3�r�|�|�3D�E�+�
*�s�B�
B!c��SSKnSn[R"USU5 UR[[
RS5 SSS5 g!,(df   g=f)Nrc��grGr8�rs r�
bad_normalize�0AST_Tests.test_issue31592.<locals>.bad_normalizeCs��r!�	normalizeuϕ)�unicodedatar�	swap_attrr=r@rrz)rr�r�s   r�test_issue31592�AST_Tests.test_issue31592=sC��	�	��
�
�{�K��
G����i����H�=�H�
G�
G�s�&A�
Ac��[R"S5nURSRnURnURnURURS5 URURS5 URURS5 URURS5 URURS5 URURS5 [R"S5nURSRnURnURnURURS5 URURS5 URURS5 URURS	5 URURS5 URURS5 URURS	5 URURS	5 URURS5 URURS5 URURS5 URURS5 g)
Nz4+5+6+7rr�r�r�z
4+5-\
 6-7r�r�r;)
rrzr�r3r�r.r)r�r(r�)rr}�parent_binop�child_binop�grandchild_binops     r� test_issue18374_binop_col_offset�*AST_Tests.test_issue18374_binop_col_offsetIs���y�y��#���y�y��|�)�)��"�'�'��&�+�+������0�0�!�4�����4�4�a�8�����/�/��3�����3�3�Q�7����)�4�4�a�8����)�8�8�!�<��y�y��(���y�y��|�)�)��"�'�'��&�+�+������0�0�!�4�����,�,�a�0�����4�4�a�8�����0�0�!�4�����/�/��3�����+�+�Q�/�����3�3�Q�7�����/�/��3����)�4�4�a�8����)�0�0�!�4����)�8�8�!�<����)�4�4�a�8r!c��[R"S5nURSRSRnURURS5 g)Nz@a.b.c
def f(): passrr�)rrzr�r#r3r.r�)rr}�attr_bs   r�*test_issue39579_dotted_name_end_col_offset�4AST_Tests.test_issue39579_dotted_name_end_col_offsethsE���y�y�0�1�����1��,�,�Q�/�5�5������.�.��2r!c��UR[RRS5 UR[RRS5 UR[R
RS5 UR[RRS5 [RR5Vs/sHnSUR3PM nnS[RR5SR3US'UR[RRRS5U5 gs snf)	Nz0withitem(expr context_expr, expr? optional_vars)�GtEz%Name(identifier id, expr_context ctx)zBcmpop = Eq | NotEq | Lt | LtE | Gt | GtE | Is | IsNot | In | NotInz     | zexpr = r�
)r.r�withitem�__doc__r�r��cmpopr%�__subclasses__�assertCountEqual�split)rr�expressionss   r�test_ast_asdl_signature�!AST_Tests.test_ast_asdl_signaturems�������L�L� � �"T�	
�	
��������%�0�������)�)�+R�S�����I�I���P�	
�=@�H�H�<S�<S�<U�V�<U�D������/�<U��V�"�3�8�8�#:�#:�#<�Q�#?�#G�#G�"H�I��A�����c�h�h�.�.�4�4�T�:�K�H��Ws�	Ec���[R"SSS9 [R"SSS9 UR[5 [R"SSS9 SSS5 UR[5 [R"SSS9 SSS5 [R"SSS9 [R"SSS9 UR[5 [R"SSS9 SSS5 UR[5 [R"SSS9 SSS5 g!,(df   N�=f!,(df   N�=f!,(df   Nd=f!,(df   g=f)Nzdef foo(x, /): ...�r�r��feature_versionzdef bar(x=1, /): ...�r�r�zlambda x, /: ...zlambda x=1, /: ...�rrzr=�SyntaxErrorr�s r�$test_positional_only_feature_version�.AST_Tests.test_positional_only_feature_version{s����	�	�&��?��	�	�(�&�A�
�
�
�{�
+��I�I�*�F�C�,�
�
�
�{�
+��I�I�,�f�E�,�	�	�	�$�f�=��	�	�&��?�
�
�
�{�
+��I�I�(�&�A�,�
�
�
�{�
+��I�I�*�F�C�,�
+�,�
+��
+�
+��
,�
+��
+�
+�s0�D"�3D3�E�E�"
D0�3
E�
E�
E#c��[R"SSS9 UR[5 [R"SSS9 SSS5 g!,(df   g=f)Nz(x := 0)r�r�r�r�r�s r�*test_assignment_expression_feature_version�4AST_Tests.test_assignment_expression_feature_version�s8���	�	�*�f�5�
�
�
�{�
+��I�I�j�&�9�,�
+�
+�s�A
�

Ac�.�[R"SSS9 g)Nzwith (x() if y else z()): ...r�r��rrzr�s r�@test_conditional_context_managers_parse_with_low_feature_version�JAST_Tests.test_conditional_context_managers_parse_with_low_feature_version�s���	�	�1�6�Jr!c���[S5n[R"U5 UR[5 [R"USS9 SSS5 g!,(df   g=f)Nz9
        try: ...
        except* Exception: ...
        )r�r�r�)rrrzr=r�)r�codes  r�%test_exception_groups_feature_version�/AST_Tests.test_exception_groups_feature_version�sF����
��	�	�	�$��
�
�
�{�
+��I�I�d�G�4�,�
+�
+�s�A�
A$c�*�/SQnUHfnURU5 [R"U5 UR[5 [R"USS9 SSS5 SSS5 Mh g!,(df   N=f!,(df   M�=f)N)ztype X = intzclass X[T]: passzdef f[T](): pass)r��r��rorrzr=r��r�samples�samples   r� test_type_params_feature_version�*AST_Tests.test_type_params_feature_version��h��
��
�F����f�%��	�	�&�!��&�&�{�3��I�I�f�g�>�4�&�%��4�3��&�%��#�,B�A2�B�2
B�<B�
B	c�*�/SQnUHfnURU5 [R"U5 UR[5 [R"USS9 SSS5 SSS5 Mh g!,(df   N=f!,(df   M�=f)N)ztype X[*Ts=int] = intzclass X[T=int]: passzdef f[**P=int](): pass)r��r�r�r�s   r�(test_type_params_default_feature_version�2AST_Tests.test_type_params_default_feature_version�r�r�c��UR[5 [R"SSS9 SSS5 UR[5 [R"SSS9 SSS5 g!,(df   NB=f!,(df   g=f)N�pass)r;r�r�)r�r)r=r�rrzr�s r�"test_invalid_major_feature_version�,AST_Tests.test_invalid_major_feature_version�sW��
�
�
�z�
*��I�I�f�f�5�+�
�
�
�z�
*��I�I�f�f�5�+�
*�+�
*��
*�
*�s�A(�	A9�(
A6�9
Bc�B�SH�n[R"[R"U[R"555n[R"U5 UR[SUS35 [USS5 SSS5 M� g!,(df   M�=f)N)�True�False�None�"identifier field can't represent '�
' constantr�rg)rr�r�r�r�rNr�rp)r�constantr%s   r�test_constant_as_name�AST_Tests.test_constant_as_name�sy��/�H��>�>�#�(�(�8�S�X�X�Z�"@�A�D��%�%�d�+��'�'��@��
�*�U����h��/���0���s�4B�
B	c��/SQnUHAnUR[SUSS35 [R"USSS9 SSS5 MC g!,(df   MU=f)N))r�sTruᵉ)r�sFalſe)r�sNºner�rr�r�rg��mode)rNr�rrz)r�	constantsr�s   r�test_constant_as_unicode_name�'AST_Tests.test_constant_as_unicode_name�sa��
�	�
"�H��'�'�
�4�X�a�[�M��L�N��	�	�(�1�+�F�3�N�N�"�N�N�s�A
�
A	c��"SS[R5n[R"U[R5 g)Nc��\rSrSr\R
"5r\R
"5r\R
"5r\R
"5r	\R
"5r
\R
"5r\R
"5r\R
"5r
\R
"5r\r\R
"5r\R
"5r\R
"5r\R
"5r\R
"5r\R
"5r\R
"5r\R
"5r\R
"5rSrSrg)�3AST_Tests.test_precedence_enum.<locals>._Precedencei�c�P�URUS-5$![a Us$f=f)Nr�)rfr�r�s r�next�8AST_Tests.test_precedence_enum.<locals>._Precedence.next�s.�� ��>�>�$��(�3�3��!� ��K� �s��%�%r8N)rWrrXrY�enum�auto�
NAMED_EXPR�TUPLE�YIELD�TEST�OR�AND�NOT�CMP�EXPR�BOR�BXOR�BAND�SHIFT�ARITH�TERM�FACTOR�POWER�AWAIT�ATOMrrZr8r!r�_Precedencer��s�������J��I�I�K�E��I�I�K�E��9�9�;�D�����B��)�)�+�C��)�)�+�C��)�)�+�C��9�9�;�D��C��9�9�;�D��9�9�;�D��I�I�K�E��I�I�K�E��9�9�;�D��Y�Y�[�F��I�I�K�E��I�I�K�E��9�9�;�D�
 r!r)r�IntEnum�_test_simple_enumrr)rrs  r�test_precedence_enum�AST_Tests.test_precedence_enum�s(��	 �$�,�,�	 �<	
���{�C�O�O�<r!c�&^^^^�[R"5mSm[[R"5S-5m[b![R
"5n[
TU5mUUUU4SjnU"SS5 U"SS5 U"SS5 U"SS5 g)	Ni��g�������?c�p>�XT	--n[R"U5 TT4HmnXU--nSRXU5nTR[US9 [
R"5 [R"U5 SSS5 SSS5 Mo g!,(df   N=f!,(df   M�=f)NzCompiling ({!r} + {!r} * {})�rO)rrzr�r=�RecursionErrorr�infinite_recursion)
�prefix�repeated�	expect_ok�depth�broken�details�crash_depth�
fail_depthr�
success_depths
      ����r�check_limit�7AST_Tests.test_ast_recursion_limit.<locals>.check_limit�s�����M�!9�9�I��I�I�i� �$�k�2���U�"2�2��8�?�?��RW�X���&�&�~�7�&�C� �3�3�5��	�	�&�)�6�D�C�3�6�5��D�C�s$�B&�)B�B&�
B#�B&�&
B5	r]�()z.bz[0]z*a)r�exceeds_recursion_limitr�get_c_recursion_limit�_testinternalcapi�get_c_recursion_remaining�min)r�	remainingr+r(r)r*s`  @@@r�test_ast_recursion_limit�"AST_Tests.test_ast_recursion_limit�s�����4�4�6�
����G�9�9�;�c�A�B�
��(�)�C�C�E�I��
�y�9�M�	*�	*�	�C����C����C����C��r!c��UR[SS9 [R"S5 SSS5 g!,(df   g=f)Nz,source code string cannot contain null bytesrzab)r=r�rrzr�s r�test_null_bytes�AST_Tests.test_null_bytess9��
�
�
��K��
�
�I�I�f��
�
�
�s	�5�
Ar�attr�source�returnc��URURSU35 [R"U5nSn[R"U5H&n[Xa5(dM[
XbS5 US-
nM( URUS5 [R"SUSUR35nUR[SUS35 [USS	5 SSS5 SSS5 g!,(df   N=f!,(df   g=f)
N�.rr�zfield 'z' is required for �^�$r�re)
rorWrrz�walkr�setattrr.�re�escaperNr�rp)rrr9r:r}�foundr5rXs        r�assert_none_check�AST_Tests.assert_none_check
s���
�\�\�T�]�]�O�1�T�F�3�
4��9�9�V�$�D��E����$����e�*�*��E��.��Q�J�E�(�
���U�A�&��	�	�G�D�6�);�D�M�M�?�K�L�A��'�'�
�a��s�!�H�=���h��/�>�5�
4�>�=��5�
4�s+�AC<�%A'C<�C+�C<�+
C9	�5C<�<
D
c	�@�[RSS4[RSS4[RSS4[RSS4[RS	S
4[R
SS4[RS
S4/nUHup#nURX#U5 M g)Nrzimport spam as SPAMrzdef spam(SPAM): spam�targetz[spam for SPAM in spam]�iterz[spam for spam in SPAM]r3zspam(**SPAM)�patternzmatch spam:
 case SPAM: spam�context_exprzwith SPAM: spam)rr�rr��keyword�
match_caser�rE)r�testsrr9r:s     r�test_none_checks�AST_Tests.test_none_checkss���
�Y�Y�� 5�6�
�W�W�e�3�4�
�
�
��*C�D�
�
�
��(A�B�
�[�[�'�>�2�
�^�^�Y�(G�H�
�\�\�>�+<�=�
��#(��D���"�"�4�v�6�#(r!r8)r;N)CrWrrXrY�maxDiffrr-rCrPrbrvr~r�r�r�r�r�r�r�r�r�r�r�rr
r	r!r%r(rBrFrIrYrqr{r~r�r�r�r�r�r�r�cpython_onlyr�r�r�r�r�r�r�r�r�r�r�r�r�rr4r7rrrrrErOrZr8r!rrr s{���G�3�D�&��"
!�1�.�
I�4�.6�0*�(,�($�%�'�$3�L5�#�:�:�� &�D)�)�Y
�v-4�^
�@|=�|&
�P%�*'�
,*�\(�
>�K�-�F�
���	>��	>�9�>3�
I�
D�:�
K�5�
?�
?�6�0�	4�=�B
������.�0�d�3�7�7�m�0�3�0��0�PT�0�7r!rc� �\rSrSrSrSrSrg)�	CopyTestsi(c	�\�SSKn[URS-5Hzn[HmnUR	X2S9 [USSS5nUR
URXB55nUR[U5[U55 SSS5 Mo M| g!,(df   M�=f)Nrr�)r��protocolrkrei)
�pickler �HIGHEST_PROTOCOLr
rorp�loads�dumpsr.r
)rrWrVr�r}�ast2s      r�
test_pickling�CopyTests.test_pickling+s�����f�5�5��9�:�H�"���\�\�t�\�?�"�4��f�e�<�D�!�<�<����T�(D�E�D��$�$�X�d�^�X�d�^�D�@�?�#�;�?�?�s�AB�
B+c
���Sn[R"[R"U55n[R"U5H&n[R
"U5H	nX4lM M( [R"S5 [R"U5nSSS5 [R"U5Hn[US5(dMU?M [R"W5H�n[R
"U5H�n[US5(dM[U[R[R[R[R [R"45(aMtUR%['UR5['U55 M� M� g!,(df   GN=f![R"U5Hn[US5(dMU?M f=f)Na=
        ('',)
        while i < n:
            if ch == '':
                ch = format[i]
                if ch == '':
                    if freplace is None:
                        '' % getattr(object)
                elif ch == '':
                    if zreplace is None:
                        if hasattr:
                            offset = object.utcoffset()
                            if offset is not None:
                                if offset.days < 0:
                                    offset = -offset
                                h = divmod(timedelta(hours=0))
                                if u:
                                    zreplace = '' % (sign,)
                                elif s:
                                    zreplace = '' % (sign,)
                                else:
                                    zreplace = '' % (sign,)
                elif ch == '':
                    if Zreplace is None:
                        Zreplace = ''
                        if hasattr(object):
                            s = object.tzname()
                            if s is not None:
                                Zreplace = s.replace('')
                    newformat.append(Zreplace)
                else:
                    push('')
            else:
                push(ch)

        ���parent)rrz�textwraprr@�iter_child_nodesr`rr!�copy�deepcopy�hasattrr�expr_context�boolop�unaryopr��operatorr.r
)rr�r}rr5r�s      r�test_copy_with_parents� CopyTests.test_copy_with_parents5sY��#��H�y�y�����.�/���H�H�T�N�D��-�-�d�3��#��4�#�	$��+�+�C�0��
�
�d�+��1�
�������4��*�*���'��H�H�U�O�D��-�-�d�3���5�(�+�+�J���(�(��
�
�����	�	�����	5�	5��$�$�X�e�l�l�%;�X�d�^�L�4�$�1�0��
�������4��*�*���'�s*�.G�F/�G�/
F>�9G�)G5�.G5r8N)rWrrXrYr\rjrZr8r!rrTrT(s��E�@Mr!rTc���\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr Sr!S r"g)!�ASTHelpers_TestixNc���[R"S5n[SSS[R5nUR	[R
"U5[R
"U55 g)Nz
foo(1 + 1)z	<unknown>re)rrzrprqr.�dump)rr]rWs   r�
test_parse�ASTHelpers_Test.test_parse{sF���I�I�l�#���L�+�v�s�7H�7H�I��������!��c�h�h�q�k�2r!c��SS- g![an UR[5n[R"S5 SSS5 O!,(df   O=fURWRR5 gf=f)Nr�rz'\U')�	Exceptionr=r�r�literal_eval�assertIsNotNoner��__context__�rrXs  r�test_parse_in_error�#ASTHelpers_Test.test_parse_in_error�s_��	:�
��E���	:��"�"�;�/�1�� � ��)�0�/�/��� � ����!8�!8�9�	:�s%��B�A�	B�
A	�,B�?Bc��[R"S5nUR[R"U5S5 UR[R"USS9S5 UR[R"USS9S5 g)	N�spam(eggs, "and cheese")��Module(body=[Expr(value=Call(func=Name(id='spam', ctx=Load()), args=[Name(id='eggs', ctx=Load()), Constant(value='and cheese')]))])F��annotate_fieldszZModule([Expr(Call(Name('spam', Load()), [Name('eggs', Load()), Constant('and cheese')]))])T��include_attributesa�Module(body=[Expr(value=Call(func=Name(id='spam', ctx=Load(), lineno=1, col_offset=0, end_lineno=1, end_col_offset=4), args=[Name(id='eggs', ctx=Load(), lineno=1, col_offset=5, end_lineno=1, end_col_offset=9), Constant(value='and cheese', lineno=1, col_offset=11, end_lineno=1, end_col_offset=23)], lineno=1, col_offset=0, end_lineno=1, end_col_offset=24), lineno=1, col_offset=0, end_lineno=1, end_col_offset=24)])�rrzr.ro�rrs  r�	test_dump�ASTHelpers_Test.test_dump�sw���y�y�3�4������H�H�T�N�
S�	
�
	
����H�H�T�5�1�
*�	
�
	
����H�H�T�d�3�
I�		
r!c��[R"S5nUR[R"USS9S5 UR[R"USSS9S5 UR[R"US	SS
9S5 g)Nr{r���indentz�Module(
   body=[
      Expr(
         value=Call(
            func=Name(id='spam', ctx=Load()),
            args=[
               Name(id='eggs', ctx=Load()),
               Constant(value='and cheese')]))])F�	)r~r�zwModule(
	[
		Expr(
			Call(
				Name('spam', Load()),
				[
					Name('eggs', Load()),
					Constant('and cheese')]))])T)r�r�acModule(
   body=[
      Expr(
         value=Call(
            func=Name(
               id='spam',
               ctx=Load(),
               lineno=1,
               col_offset=0,
               end_lineno=1,
               end_col_offset=4),
            args=[
               Name(
                  id='eggs',
                  ctx=Load(),
                  lineno=1,
                  col_offset=5,
                  end_lineno=1,
                  end_col_offset=9),
               Constant(
                  value='and cheese',
                  lineno=1,
                  col_offset=11,
                  end_lineno=1,
                  end_col_offset=23)],
            lineno=1,
            col_offset=0,
            end_lineno=1,
            end_col_offset=24),
         lineno=1,
         col_offset=0,
         end_lineno=1,
         end_col_offset=24)])r�r�s  r�test_dump_indent� ASTHelpers_Test.test_dump_indent�s|���y�y�3�4������H�H�T�!�$�
4�	
�	
����H�H�T�5��>�
)�	
�	
����H�H�T�d�1�=�!
!�$	
r!c��[R"SSS9nUR[R"U5S5 UR[R"USS9S5 [R"[R"S[R
"5S	9SSS
9nUR[R"U5S5 UR[R"USS
9S5 UR[R"USS9S5 UR[R"USSS9S5 [R"[R"S[R
"5S	9S9nUR[R"U5S5 UR[R"USS
9S5 [R"[R"S5/S9nUR[R"USS
9S5 [R"[R"S5/S9nUR[R"USS
9S5 [R"[R"S5/[R"S5/S9nUR[R"USS
9S5 [R"[R"S5/[R"S5/S9nUR[R"USS
9S5 [R"5nUR[R"USS
9S5 [R"S /[R"S![R"S55//[R"S"[R
"5S#9/5nUR[R"U5S$5 UR[R"USS
9S%5 g)&Nr�r�r�zRaise()TrzRaise(lineno=3, col_offset=4)rX�r��ctx)�excr(r)z#Raise(exc=Name(id='e', ctx=Load()))Fr}zRaise(Name('e', Load()))z;Raise(exc=Name(id='e', ctx=Load()), lineno=3, col_offset=4))r~r�z0Raise(Name('e', Load()), lineno=3, col_offset=4))�causez%Raise(cause=Name(id='e', ctx=Load()))zRaise(cause=Name('e', Load()))rBr�zarguments([], [arg('x')])�rzarguments([arg('x')])r�)rrz,arguments([arg('x')], kwonlyargs=[arg('y')]))rrz0arguments([], [arg('x')], kwonlyargs=[arg('y')])�arguments()�Tr]�	dataclass�r�z~ClassDef(name='T', keywords=[keyword(arg='a', value=Constant(value=None))], decorator_list=[Name(id='dataclass', ctx=Load())])zRClassDef('T', [], [keyword('a', Constant(None))], [], [Name('dataclass', Load())]))r�Raiser.ror�r�rr�ClassDefrLr�r�s  r�test_dump_incomplete�$ASTHelpers_Test.test_dump_incomplete�s����y�y��a�0��������$���3�����H�H�T�d�3�5T�	
��y�y�S�X�X��#�(�(�*�=�a�TU�V��������$��)N�O�����H�H�T�5�1�3M�	
�	
����H�H�T�d�3�I�	
�	
����H�H�T�5�T�J�>�	
��y�y�s�x�x�3�C�H�H�J�?�@��������$��)P�Q�����H�H�T�5�1�3S�	
��}�}�3�7�7�3�<�.�1������H�H�T�5�1�'�	
��}�}�#�'�'�#�,��8������H�H�T�5�1�#�	
��}�}�#�'�'�#�,��S�W�W�S�\�N�S������H�H�T�5�1�:�	
��}�}�3�7�7�3�<�.�c�g�g�c�l�^�L������H�H�T�5�1�>�	
��}�}�������H�H�T�5�1��	
�
�|�|���
�[�[��c�l�l�4�0�
1�2��
�X�X�k�s�x�x�z�
2�3�
��	
����H�H�T�N�
M�	
�	
����H�H�T�5�1�`�	
r!c�^^�U4SjmU4SjnT"[R"5SSS9 T"[R"S[R"5S9SSS9 T"[R"SS	9S
S
S9 T"[R"/S	9SSS9 T"[R
"SS	9SSS9 T"[R
"/S	9S
S
S9 T"[R
"SS	9SSS9 U"SSSS9 U"SSSSS9 U"SSSS9 U"SSSS9 U"SSSS9 g)Nc�N>�TRSS9 TR[R"U4SS0UD6U5 SSS5 TRSS9 TR[R"U4SS0UD6U5 SSS5 g!,(df   NP=f!,(df   g=f)NF)�
show_emptyr�T)ror.rro)r�empty�fullrrs    �r�
check_node�8ASTHelpers_Test.test_dump_show_empty.<locals>.check_node#s���������/�� � ��H�H�T�>�e�>�v�>���0�
�����.�� � ��H�H�T�=�d�=�f�=���/�.�0�/��
/�.�s�*B�*B�
B�
B$c�B>�T"[R"U5X40UD6 grGr�)r�r�r�rr�s    �r�
check_text�8ASTHelpers_Test.test_dump_show_empty.<locals>.check_text/s����s�y�y����>�v�>r!r�zNarguments(posonlyargs=[], args=[], kwonlyargs=[], kw_defaults=[], defaults=[]))r�r�r�r�zName(id='', ctx=Load())rEzMatchSingleton(value=None)zMatchSingleton(value=[])zConstant(value=None)zConstant(value=[])zConstant(value='')zdef a(b: int = 0, *, c): ...z�Module(body=[FunctionDef(name='a', args=arguments(args=[arg(arg='b', annotation=Name(id='int', ctx=Load()))], kwonlyargs=[arg(arg='c')], kw_defaults=[None], defaults=[Constant(value=0)]), body=[Expr(value=Constant(value=Ellipsis))])])a.Module(body=[FunctionDef(name='a', args=arguments(posonlyargs=[], args=[arg(arg='b', annotation=Name(id='int', ctx=Load()))], kwonlyargs=[arg(arg='c')], kw_defaults=[None], defaults=[Constant(value=0)]), body=[Expr(value=Constant(value=Ellipsis))], decorator_list=[], type_params=[])], type_ignores=[])a}Module(body=[FunctionDef(name='a', args=arguments(args=[arg(arg='b', annotation=Name(id='int', ctx=Load(), lineno=1, col_offset=9, end_lineno=1, end_col_offset=12), lineno=1, col_offset=6, end_lineno=1, end_col_offset=12)], kwonlyargs=[arg(arg='c', lineno=1, col_offset=21, end_lineno=1, end_col_offset=22)], kw_defaults=[None], defaults=[Constant(value=0, lineno=1, col_offset=15, end_lineno=1, end_col_offset=16)]), body=[Expr(value=Constant(value=Ellipsis, lineno=1, col_offset=25, end_lineno=1, end_col_offset=28), lineno=1, col_offset=25, end_lineno=1, end_col_offset=28)], lineno=1, col_offset=0, end_lineno=1, end_col_offset=28)])a�Module(body=[FunctionDef(name='a', args=arguments(posonlyargs=[], args=[arg(arg='b', annotation=Name(id='int', ctx=Load(), lineno=1, col_offset=9, end_lineno=1, end_col_offset=12), lineno=1, col_offset=6, end_lineno=1, end_col_offset=12)], kwonlyargs=[arg(arg='c', lineno=1, col_offset=21, end_lineno=1, end_col_offset=22)], kw_defaults=[None], defaults=[Constant(value=0, lineno=1, col_offset=15, end_lineno=1, end_col_offset=16)]), body=[Expr(value=Constant(value=Ellipsis, lineno=1, col_offset=25, end_lineno=1, end_col_offset=28), lineno=1, col_offset=25, end_lineno=1, end_col_offset=28)], decorator_list=[], type_params=[], lineno=1, col_offset=0, end_lineno=1, end_col_offset=28)], type_ignores=[])T)r�r�r�r{r|z�Module(body=[Expr(value=Call(func=Name(id='spam', ctx=Load()), args=[Name(id='eggs', ctx=Load()), Constant(value='and cheese')], keywords=[]))], type_ignores=[])zspam(eggs, text="and cheese")z�Module(body=[Expr(value=Call(func=Name(id='spam', ctx=Load()), args=[Name(id='eggs', ctx=Load())], keywords=[keyword(arg='text', value=Constant(value='and cheese'))]))])z�Module(body=[Expr(value=Call(func=Name(id='spam', ctx=Load()), args=[Name(id='eggs', ctx=Load())], keywords=[keyword(arg='text', value=Constant(value='and cheese'))]))], type_ignores=[])z*import _ast as ast; from module import subz�Module(body=[Import(names=[alias(name='_ast', asname='ast')]), ImportFrom(module='module', names=[alias(name='sub')], level=0)])z�Module(body=[Import(names=[alias(name='_ast', asname='ast')]), ImportFrom(module='module', names=[alias(name='sub')], level=0)], type_ignores=[]))rrr�r��MatchSingletonr�)rr�r�s` @r�test_dump_show_empty�$ASTHelpers_Test.test_dump_show_empty"sZ���
	�	?�	��M�M�O��a�	
�	��H�H�����
�+�+�*�		
�	����T�*�.�-�	
�	����R�(�,�+�	
�	��L�L�t�$�(�'�	
�	��L�L�r�"�&�%�	
�	��L�L�r�"�&�%�	
�	�*��B�	
�	�*�R
�U�#�		
�	�&�X�u�	
�	�+�~�N�	
�	�8�U�e�	
r!c	���[R"SSS9n[R"[R"S5URR
5URlUR
[R"USS9S5 [R"S[R"55n[R"S	S	S	S	US
9n[R"U[R"SSUS95nURUR5 URUR5 UR
URS	5 UR
URS	5 g)N�1 + 1rgr�r;Trz�Expression(body=BinOp(left=Constant(value=1, lineno=1, col_offset=0, end_lineno=1, end_col_offset=1), op=Add(), right=Constant(value=2, lineno=1, col_offset=4, end_lineno=1, end_col_offset=5), lineno=1, col_offset=0, end_lineno=1, end_col_offset=5))rar�)r)r(r�r��func)r)r(r�)rrz�
copy_locationr�r�r�r.ror�r��Callrar�r�r(r))r�srcr��news    r�test_copy_location�"ASTHelpers_Test.test_copy_location|s����i�i��f�-���*�*�3�<�<��?�C�H�H�N�N�K���������H�H�S�T�2�
=�	
��x�x�����
�+���h�h���q���
������S�X�X��d�QU�%V�W�����#�.�.�)����#�,�,�-�������Q�'��������+r!c���[R"S5nURR[R"[R
"[R"S[R"55[R"S5//555 URU[R"U55 SUlUR[R"USS9S5 g)Nz
write("spam")ra�eggsTrawModule(body=[Expr(value=Call(func=Name(id='write', ctx=Load(), lineno=1, col_offset=0, end_lineno=1, end_col_offset=5), args=[Constant(value='spam', lineno=1, col_offset=6, end_lineno=1, end_col_offset=12)], lineno=1, col_offset=0, end_lineno=1, end_col_offset=13), lineno=1, col_offset=0, end_lineno=1, end_col_offset=13), Expr(value=Call(func=Name(id='spam', ctx=Load(), lineno=1, col_offset=0, end_lineno=1, end_col_offset=0), args=[Constant(value='eggs', lineno=1, col_offset=0, end_lineno=1, end_col_offset=0)], lineno=1, col_offset=0, end_lineno=1, end_col_offset=0), lineno=1, col_offset=0, end_lineno=1, end_col_offset=0)]))
rrzr��appendr�r�r�r�r�r.r�rQro�rr�s  r�test_fix_missing_locations�*ASTHelpers_Test.test_fix_missing_locations�s����i�i��(��������H�H�S�X�X�c�h�h�v�s�x�x�z�:�S�\�\�&�=Q�<R�TV�W�X�	
�	
����c�7�7��<�=��������H�H�S�T�2�	
[�	
r!c���[R"SSS9nUR[R"USS9U5 UR[R"USS9S5 [R"SSS9nUR[R"UR
SS9UR
5 UR[R"USS9S5 [R"[R"S	[R"55//S
S9nUR[R"U5RS5 UR[R"U5R5 g)
Nr�rgr�r�r1Trz�Expression(body=BinOp(left=Constant(value=1, lineno=4, col_offset=0, end_lineno=4, end_col_offset=1), op=Add(), right=Constant(value=1, lineno=4, col_offset=4, end_lineno=4, end_col_offset=5), lineno=4, col_offset=0, end_lineno=4, end_col_offset=5))�testr�)r�r�keywordsr(r;)rrzr.�increment_linenoror�r�r�r�r(rar�r�s  r�test_increment_lineno�%ASTHelpers_Test.test_increment_lineno�s���i�i��f�-������-�-�c�Q�7��=�����H�H�S�T�2�
=�	
��i�i��f�-������-�-�c�h�h�!�<�c�h�h�G�����H�H�S�T�2�
=�	
��h�h����&�#�(�(�*�-�B��A�
��	
����-�-�c�2�9�9�1�=����#�.�.�s�3�>�>�?r!c�`�[R"[S5SS9n[R"USS9 UR	UR
SRS5 UR	UR
SRS	5 UR	UR
SRS
5 g)Nzb        a = 1
        b = 2 # type: ignore
        c = 3
        d = 4 # type: ignore@tag
        T)�
type_commentsr�r1rr�r��	z@tag)rrzrr�r.r�r(�tagr�s  r�test_increment_lineno_on_module�/ASTHelpers_Test.test_increment_lineno_on_module�s����i�i���

��
��	���S�A�&�����)�)�!�,�3�3�Q�7�����)�)�!�,�3�3�Q�7�����)�)�!�,�0�0�&�9r!c��[R"SSS9n[[R"UR55nURUR
S5RS5 URU//S.5 g)N�foo()rgr�r�r�)r�r)rrzr��iter_fieldsr�r.�popr�)rr�ds   r�test_iter_fields� ASTHelpers_Test.test_iter_fields�s\���y�y��v�.���������+�,��������v��)�)�5�1������R�8�9r!c	�.�[R"SSS9nUR[[	[R
"UR555S5 [R
"UR5nUR[U5RS5 UR[U5RS5 UR[U5RS5 UR[R"[U55S5 g)	Nzspam(23, 42, eggs='leek')rgr�r�ra�r9z1keyword(arg='eggs', value=Constant(value='leek')))rrzr.r�r,rbr�rr�r3ro)rr�iterators   r�test_iter_child_nodes�%ASTHelpers_Test.test_iter_child_nodes�s����y�y�4�6�B������T�#�"6�"6�t�y�y�"A�B�C�Q�G��'�'��	�	�2������h��*�*�F�3�����h��-�-�r�2�����h��-�-�r�2�����H�H�T�(�^�$�?�	
r!c�R�[R"S5nUR[R"U5S5 [R"S5nUR[R"URS5S5 [R"S5nUR[R"URS5S5 [R"S5nUR[R"URS5S5 [R"S5nUR[R"URSSS	9S
5 [R"S5nUR[[RURS5 g)Nz"""line one
  line two"""zline one
line twoz&class foo:
  """line one
  line two"""rz&def foo():
  """line one
  line two"""z#async def foo():
  """spam
  ham"""zspam
hamF)�cleanz
spam
  hamrB)rrzr.�
get_docstringr�r=r@r�s  r�test_get_docstring�"ASTHelpers_Test.test_get_docstring�s&���y�y�5�6������*�*�4�0�2F�G��y�y�C�D������*�*�4�9�9�Q�<�8�:N�O��y�y�C�D������*�*�4�9�9�Q�<�8�:N�O��y�y�@�A������*�*�4�9�9�Q�<�8�+�F��y�y�@�A������*�*�4�9�9�Q�<�u�E�}�U��y�y��~�����)�S�%6�%6��	�	�!��Er!c���UR[R"[R"S555 [R"S5nUR[R"U55 [R"S5nUR[R"U55 [R"S5nUR[R"URS55 [R"S5nUR[R"URS55 [R"S5nUR[R"URS55 [R"S5nUR[R"URS55 [R"S5nUR[R"URS55 [R"S	5nUR[R"URS55 [R"S
5nUR[R"URS55 [R"S5nUR[R"URS55 g)Nr�zx = "not docstring"zdef foo():
  passzclass foo:
  passrz class foo:
  x = "not docstring"z class foo:
  def bar(self): passz def foo():
  x = "not docstring"zasync def foo():
  passz&async def foo():
  x = "not docstring"zasync def foo():
  42)rarr�rzr�r�s  r�test_get_docstring_none�'ASTHelpers_Test.test_get_docstring_none�s������#�+�+�C�I�I�b�M�:�;��y�y�.�/�����#�+�+�D�1�2��y�y�-�.�����#�+�+�D�1�2��y�y�-�.�����#�+�+�D�I�I�a�L�9�:��y�y�<�=�����#�+�+�D�I�I�a�L�9�:��y�y�<�=�����#�+�+�D�I�I�a�L�9�:��y�y�-�.�����#�+�+�D�I�I�a�L�9�:��y�y�<�=�����#�+�+�D�I�I�a�L�9�:��y�y�3�4�����#�+�+�D�I�I�a�L�9�:��y�y�B�C�����#�+�+�D�I�I�a�L�9�:��y�y�1�2�����#�+�+�D�I�I�a�L�9�:r!c�4�[R"S5nURURSRS5 URURSR
S5 URURSRSRS5 URURSRSR
S5 URURSRSRSRS5 URURSRSRSR
S5 URURSRSRS5 URURSRSR
S5 URURSRS5 URURSR
S	5 g)
Nz�"""line one
line two"""

def foo():
  """line one
  line two"""

  def bar():
    """line one
    line two"""
  """line one
  line two"""
"""line one
line two"""

rr�r;r�r�r�r��
)rrzr.r�r)r(r�s  r�:test_multi_line_docstring_col_offset_and_lineno_issue16806�JASTHelpers_Test.test_multi_line_docstring_col_offset_and_lineno_issue16806s����y�y�
+�
��	
������1��0�0�!�4�������1��,�,�a�0�������1��*�*�1�-�8�8�!�<�������1��*�*�1�-�4�4�a�8�������1��*�*�1�-�2�2�1�5�@�@�!�D�������1��*�*�1�-�2�2�1�5�<�<�a�@�������1��*�*�1�-�8�8�!�<�������1��*�*�1�-�4�4�b�9�������1��0�0�!�4�������1��,�,�b�1r!c���[R"S5nURSRSnUR	UR
S5 UR	URS5 g)Nz if a:
    pass
elif b:
    pass
rr��rrzr��orelser.r(r)�rr�	elif_stmts   r�test_elif_stmt_start_position�-ASTHelpers_Test.test_elif_stmt_start_position!sU���y�y�?�@���I�I�a�L�'�'��*�	�����)�)�1�-�����-�-�q�1r!c���[R"S5nURSRSnUR	UR
S5 UR	URS5 g)Nz/if a:
    pass
elif b:
    pass
else:
    pass
rr�r�r�s   r�'test_elif_stmt_start_position_with_else�7ASTHelpers_Test.test_elif_stmt_start_position_with_else'sU���y�y�P�Q���I�I�a�L�'�'��*�	�����)�)�1�-�����-�-�q�1r!c���[R"S5nURSRRSnURURS5 URURS5 g)Nz
f(*[0, 1])rr�r�)rrzr�r3rr.r�r�)rr�starred_exprs   r�*test_starred_expr_end_position_within_call�:ASTHelpers_Test.test_starred_expr_end_position_within_call-sZ���y�y��&���y�y��|�)�)�.�.�q�1������0�0�!�4�����4�4�a�8r!c�6�UR[R"S5/SQ5 UR[R"S5SS05 UR[R"S5S5 UR[R"S51S	k5 UR[R"S
5S5 UR[R"S5[55 UR	[
[RS
5 UR[R"S5S5 UR[R"S5S5 UR[R"S5S5 UR[R"S5S5 UR[R"S5S5 UR[R"S5S5 UR[
[R"S55S5 UR	[
[RS5 UR	[
[RS5 UR	[
[RS5 g)Nz	[1, 2, 3]�r�r;r�z{"foo": 42}r�r9z(True, False, None)rLz	{1, 2, 3}>r�r;r�zb"hi"shizset()r��6�z+6z-6i����z3.25g
@z+3.25z-3.25g
�z-0.0z++6z+Truez2+3)r.rrt�setr=r��reprr�s r�test_literal_eval�!ASTHelpers_Test.test_literal_eval3s�������)�)�+�6�	�B�����)�)�-�8�5�"�+�F�����)�)�*?�@�BU�V�����)�)�+�6�	�B�����)�)�'�2�E�:�����)�)�'�2�C�E�:����*�c�&6�&6��@�����)�)�#�.��2�����)�)�$�/��3�����)�)�$�/��4�����)�)�&�1�4�8�����)�)�'�2�D�9�����)�)�'�2�E�:�����c�.�.�v�6�7��@����*�c�&6�&6��>����*�c�&6�&6��@����*�c�&6�&6��>r!c��[R"S5 [R"S5 UR	[
5n[R"S5 SSS5 UR
S[WR55 UR
S[UR55 SSS5 g!,(df   Na=f!,(df   g=f)Ni���3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333��33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333zExceeds the limit z Consider hexadecimal )	r�adjust_int_max_str_digitsrrtr=r�r�rr�)r�err_ctxs  r�test_literal_eval_str_int_limit�/ASTHelpers_Test.test_literal_eval_str_int_limitFs���
�
.�
.�t�
4����Z�(��"�"�;�/�7�� � ��,�0��M�M�.��G�4E�4E�0F�G��M�M�2�C��8I�8I�4J�K�5�
4�/�/��5�
4�s$�,C�B5�AC�5
C	�?C�
Cc�R�UR[R"S5S5 UR[R"S5S5 UR[R"S5S5 UR[R"S5S5 UR[R"S	5S
5 UR[R"S5S5 UR[R"S
5S5 UR[R"S5S5 UR[R"S5S5 UR[R"S5S5 UR[R"S5S5 UR[R"S5S5 UR[R"S5S
5 UR[[RS5 UR[[RS5 UR[[RS5 UR[[RS5 UR[[RS5 g)N�6jy@z-6jy��z6.75jy@z-6.75jy��z3+6jy@@z-3+6jy�@z3-6jy@�z-3-6jy��z
3.25+6.75jy
@@z-3.25+6.75jy
�@z
3.25-6.75jy
@�z-3.25-6.75jy
��z(3+6j)z-6j+3z-6j+3jz3+-6jz3+(0+6j)z-(3+6j))r.rrtr=r�r�s r�test_literal_eval_complex�)ASTHelpers_Test.test_literal_eval_complexNs�������)�)�$�/��4�����)�)�%�0�#�6�����)�)�'�2�E�:�����)�)�(�3�V�<�����)�)�&�1�6�:�����)�)�'�2�G�<�����)�)�&�1�6�:�����)�)�'�2�G�<�����)�)�,�7��F�����)�)�-�8�-�H�����)�)�,�7��F�����)�)�-�8�-�H�����)�)�(�3�V�<����*�c�&6�&6��@����*�c�&6�&6��A����*�c�&6�&6��@����*�c�&6�&6�
�C����*�c�&6�&6�	�Br!c���[R"[R"S5[R"S5/[R"S5/S9nUR[[R
U5 [R"[R"S5/[R"S5[R"S5/S9nUR[[R
U5 g)Nr�r;r�)�keys�values)r�Dictr�r=r�rt)r�	malformeds  r�&test_literal_eval_malformed_dict_nodes�6ASTHelpers_Test.test_literal_eval_malformed_dict_nodescs����H�H��,�,�q�/�3�<�<��?�3�S�\�\�!�_�<M�
�	�	
���*�c�&6�&6�	�B��H�H��,�,�q�/�"�C�L�L��O�S�\�\�!�_�+M�
�	�	
���*�c�&6�&6�	�Br!c�2�UR[R"S5S5 UR[R"S5S5 UR[R"S5S5 UR[[RS5 g)Nz    -1r�z		-1z 	 -1z
 -1)r.rrtr=�IndentationErrorr�s r�test_literal_eval_trailing_ws�-ASTHelpers_Test.test_literal_eval_trailing_wsmsl������)�)�(�3�R�8�����)�)�(�3�R�8�����)�)�(�3�R�8����*�C�,<�,<�g�Fr!c	�(�SnUR[U5 [R"S5 SSS5 [R"[R
"5[R"[R
"5[R"S555nUR[USS55 SnUR[U5 [R"U5 SSS5 g!,(df   N�=f!,(df   g=f)Nz#malformed node or string on line 3:z{'a': 1,
'b':2,
'c':++3,
'd':4}r�r(zmalformed node or string:)	rNr�rrt�UnaryOp�UAddr�rar+)rrOrs   r�"test_literal_eval_malformed_lineno�2ASTHelpers_Test.test_literal_eval_malformed_linenoss���4��
�
#�
#�J��
4����A�B�5��{�{�3�8�8�:�s�{�{�3�8�8�:�s�|�|�A��'O�P�����'�$��$�7�8�*��
�
#�
#�J��
4����T�"�5�
4�
5�
4��5�
4�s�C2�D�2
D�
Dc��UR[S5 [R"S5 SSS5 g!,(df   g=f)Nzunexpected indentz4
                \
                (\
            \ )rNr�rrtr�s r�test_literal_eval_syntax_errors�/ASTHelpers_Test.test_literal_eval_syntax_errors~s3��
�
#�
#�K�1D�
E�����
�F�
E�
E�s	�7�
Ac�L�[R"S[R"SS9/SSSS9/n[R"U/5nUR	[
5n[
USS5 SSS5 URS[WR55 g!,(df   N4=f)N�time�sleep�r�r�r��levelr(r)r�rezinvalid integer value: None)
rr�r�r�r=r�rpr�rr�)rr�r�r�s    r�test_bad_integer� ASTHelpers_Test.test_bad_integer�s���
�N�N���y�y�g�.�/����
�
���j�j��r�"��
�
�
�z�
*�b��C���(�+��
�
�3�S����5F�G�+�
*�s�B�
B#c	���[R"S[R"SSSS9/SSSS9/n[R"U/5n[	USS5n0n[X45 UR
SU5 g)Nrrrr�rr�re)rr�r�r�rprer�)rr�r�r��nss     r�test_level_as_none�"ASTHelpers_Test.test_level_as_none�sn���N�N���y�y�g�a�A�F�G����
�
���j�j��r�"���s�F�F�+��
���T���
�
�g�r�"r!c��[R"[R"5SS[R"S5S9nXlUR[5 [R"5 [[R"U5SS5 SSS5 SSS5 g!,(df   N=f!,(df   g=f�Nrr�)r�r(r)�operandr�rg�rr�Notr�rr=r rr!rpr�rws  r�test_recursion_direct�%ASTHelpers_Test.test_recursion_direct�sv���K�K�3�7�7�9�Q�1�c�l�l�ST�o�V���	�
�
�
�~�
.��+�+�-�����q�)�8�V�<�.�/�
.�-�-��/�
.�s$�B4�0"B#�B4�#
B1	�-B4�4
Cc��[R"[R"5SS[R"S5S9n[R"[R"5SS[R"S5S9nX!lXlUR[5 [R"5 [[R"U5SS5 SSS5 SSS5 g!,(df   N=f!,(df   g=frr)rrX�fs   r�test_recursion_indirect�'ASTHelpers_Test.test_recursion_indirect�s����K�K�3�7�7�9�Q�1�c�l�l�ST�o�V���K�K�3�7�7�9�Q�1�c�l�l�ST�o�V���	��	�
�
�
�~�
.��+�+�-�����q�)�8�V�<�.�/�
.�-�-��/�
.�s$�C8�4"C'�C8�'
C5	�1C8�8
D)rQ)#rWrrXrYrQrprxr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrr"rZr8r!rrmrmxs����G�3�
:�
�.>
�@A
�FX
�t,�(
�*@�4
:�:�

�F�&;�62�&2�2�9�?�&L�C�*C�G�	#��H� #� =�=r!rmc �z
�\rSrSrSI\S.SjjrSJ\S.SjjrSJSjrSrSr	S	r
S
rSrSr
S
rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr S r!S!r"S"r#S#r$S$r%S%r&S&r'S'r(S(r)S)r*S*r+S+r,S,r-S-r.S.r/S/r0S0r1S1r2S2r3\4Rj"S35S45r6\7Rp"S55r9\7Rt"\95r;\7Rp"S65r<\7Rt"\<5r=\7Rp"S75r>\7R~"S75r@\7R�"S8\7R�"55rC\7Rt"\7R�"\7R�"\7R�"S6\7R�"55S9\7R�"55S:\7R�"555\7Rt"\7R�"\7R�"\7R�"S6\7R�"55S9\7R�"55S:\7R�"555\7Rt"\7Rp"S;55\7Rt"\7Rp"S755\7Rt"\7Rp"S<55\7R~"S=5\7R�"\7R~"S=5/5\7R�"\7R�"\7R~"S=5/5/5\7R�"\9\>/\=/5\7R�"\>\9/\=\;/S>S?9\7R�"\>\7R�"\7R�"S@\7R�"55\7R�"55/\=\;/SAS?9\7R�"\7R�"\7R�"\<S9\7R�"55S:\7R�"55///SB9\7R�"\C/S>/\;/SB9\7R�"\C//\;/SB9\7R�"\C\7R~"S=5///SB9\7R�"\C\7R�"5///SB9\7R�"\C//\7R�"5/SB9\7R�"\>/S>/\;/SB9\7R�"\7R�"S>5/5\7R�"SCSD9\7R�"/5\7R�"\;/5\7R�"\;\=\7R~"SE5/5\7R�"SFSD9\7R�"S6SD9\7R�"\7R�"SF5/5\7R�"//SFS?9/rMSGrNSHrOg)K�ASTValidatorTestsi�N�r�c�(�S=UlUl[R"U5 Uc[	USU5 gURU5n[	USU5 SSS5 UR
U[WR55 g!,(df   N4=f)Nrr�)	r(r)rr�rpr=r�rr�)rr�rOr�r�r�s      rr��ASTValidatorTests.mod�sp��&'�'��
�S�^��!�!�#�&��;��C��4�(��"�"�3�'�2���X�t�,�(��M�M�#�s�2�<�<�0�1�(�'�s�B�
Bc�|�[R"[R"U5//5nURXBUS9 g)Nr&)rr�r�r�)rrrOr�r�s     rr%�ASTValidatorTests.expr�s-���j�j�#�(�(�4�.�)�2�.������s��#r!c�V�[R"U//5nURX25 grG)rr�r�)rr&rOr�s    rr&�ASTValidatorTests.stmt�s ���j�j�$���$������r!c	�r�[R"[R"[R"S[R"555/5nURUSS5 [R"[R"S[R"555nURUSS5 g)NrB�must have Load contextrfrg)r�Interactiver�r��Storer�r�)rr�s  rr~�ASTValidatorTests.test_module�sn���O�O�S�X�X�c�h�h�s�C�I�I�K�&@�A�B�C������,�h�7��N�N�3�8�8�C�����5�6������,�f�5r!c��^�SU4Sjjn[R"S[R"S[R"555/nU"U"US9S5 U"U"US9S5 U"U"US9S5 U"U"[R"S5/S9S	5 U"U"[R"S
5/S9S5 [R"S[R"S[R
"555/nU"U"U[R"S[R"55/S
9S5 [R"S[R"S[R
"555[R"S[R"S[R
"555/nU"U"US[R"S[R"55/S9S5 g)Nc	�x>�Uc/nUc/nUc/nUc/nUc/n[R"XX#XdU5nT"U5$rG)rr)rrr?rrrr�facs       �rr�5ASTValidatorTests._check_arguments.<locals>.arguments�s^����|����"� ���!��
������"� ���=�=��6�{�8��D��t�9�r!rBr�r.r�)rr�)rz"more positional defaults than argsr�)rz3length of kwonlyargs is not the same as kw_defaults)rrr]rWr�)rr)NNNNNNN)rrr�r0r�r�)rr4�checkrrs `   r�_check_arguments�"ASTValidatorTests._check_arguments�st����������	�0����S�X�X�c�3�9�9�;�7�8�9��
�i�T�"�$<�=�
�i�D�)�+C�D�
�i�4�(�*B�C�
�����Q��0�1�3W�	
�	��3�<�<��?�"3�4�A�	
�����S�X�X�c�3�8�8�:�6�7�8��
��4�3�8�8�C�����+E�*F�G�$�	
�

�G�G�C����#�s�x�x�z�2�3��G�G�C����#�s�x�x�z�2�3�
��	���D�#�(�(�3��	�	��:T�3U�V�$�	
r!c��[R"//S//S/5n[R"SU//SS/5nURUS5 [R"SU[R"5/[R
"S[R"55/SS/5nURUS5 [R"SU[R"5//[R
"S[R"55S/5nURUS5 [R"S[R"5[R"5/5nURU5 SnURX0R5 g)NrBzempty body on FunctionDefr.c	�b�[R"SU[R"5//SS/5$�NrB)r�FunctionDef�Passr�s rr4�+ASTValidatorTests.test_funcdef.<locals>.facs%���?�?�3��s�x�x�z�l�B��d�B�O�Or!)rrr<r&r=r�r0r7)rr]r!r4s    r�test_funcdef�ASTValidatorTests.test_funcdefs���M�M�"�b�$��B��b�9���O�O�C��B��D�$��;���	�	�!�0�1��O�O���S�X�X�Z�L�3�8�8�C�����#=�">��d�B�
��	
�	�	�!�-�.��O�O���S�X�X�Z�L�"�c�h�h�s�C�I�I�K�&@�$��
��	
�	�	�!�-�.��O�O�C�����3�8�8�:�,�?���	�	�!��	P�	
���c�9�9�-r!c���SnSn[R"[R"U55nURSnURU[R5 URU"U55 g)Nc���U[RS`=b�uS:Xa�[RS`=b�ua�S:Ha�u[RS`=b�uS:Xa�a�S:Ha�u[RS`=bquamS:Hagu[R
S`=bQuS:XaJ[RS`=b6u[R
S`=b!uS:Xa[RS`=bug    g	)
Nr8r�r�r�r�r
�pacaranaTF)rr<rrr=r�r�)rs r�matcher�@ASTValidatorTests.test_funcdef_pattern_matching.<locals>.matchersx����_�_����M�M�8�'7�'7������ �L�S�X�X�Z�6�6�S�X�X�5�j�#�(�(�*��H�H�4�Z�������� r!zZ
            @capybara
            def foo(bar) -> pacarana:
                pass
        r)rrzrarr�r�r<r�)rrDr�r:�funcdefs     r�test_funcdef_pattern_matching�/ASTValidatorTests.test_funcdef_pattern_matchingsY��	!���
���8�?�?�4�0�1���+�+�a�.�����g�s���7������(�)r!c��S
SjnURU"[R"S[R"55/S9S5 URU"[R"S[R"S[R"555/S9S5 URU"/S9S5 URU"S/S9S5 URU"[R"S[R"55/S	9S5 g)Nc��Uc/nUc/nUc[R"5/nUc/nUc/n[R"SXX#U5$)N�myclass)rr=r�)�basesr�r�r#�type_paramss     rr�,ASTValidatorTests.test_classdef.<locals>.cls/s[���}��������|����
�|���%�!#���"� ���<�<��5�D�+��
r!rB)rLr.)r�r�zempty body on ClassDef�None disallowed)r#)NNNNN)r&rr�r0rL)rrs  r�
test_classdef�ASTValidatorTests.test_classdef.s���SW�	�"	
�	�	�#�S�X�X�c�3�9�9�;�7�8�9�;S�T��	�	��#�+�+�c�3�8�8�C�����+E�F�G�H�$�	
�	
�	�	�#�2�,� 8�9��	�	�#�D�6�"�$5�6��	�	������c�i�i�k� :�;�<�>V�	
r!c	�<�UR[R"/5S5 UR[R"S/5S5 UR[R"[R"S[R"55/5S5 g)Nzempty targets on DeleterOrBzmust have Del context)r&r�Deleter�r�r�s r�test_delete�ASTValidatorTests.test_deleteKs_���	�	�#�*�*�R�.�";�<��	�	�#�*�*�d�V�$�&7�8��	�	�#�*�*�c�h�h�s�C�H�H�J�7�8�9�;R�Sr!c
��UR[R"/[R"S55S5 UR[R"S/[R"S55S5 UR[R"[R"S[R
"55/[R"S55S5 UR[R"[R"S[R"55/[R"S[R"555S5 g)Nr�zempty targets on AssignrOrB�must have Store contextr�r.)r&r�Assignr�r�r�r0r�s r�test_assign�ASTValidatorTests.test_assignPs����	�	�#�*�*�R����a��1�3L�M��	�	�#�*�*�d�V�S�\�\�!�_�5�7H�I��	�	��J�J�����c�h�h�j�1�2�C�L�L��O�D�%�	
�	
�	�	��J�J�����c�i�i�k�2�3�S�X�X�c�3�9�9�;�5O�P�$�	
r!c	�8�[R"[R"S[R"55[R"5[R"S[R"555nURUS5 [R"[R"S[R"55[R"5[R"S[R"555nURUS5 g)NrBr�rWr.)r�	AugAssignr�r�r�r&r0)r�augs  r�test_augassign� ASTValidatorTests.test_augassign\s����m�m��H�H�S�#�(�(�*�%�s�w�w�y�#�(�(�3����
�2K�
��	
�	�	�#�0�1��m�m��H�H�S�#�)�)�+�&����	�3�8�8�C�����3M�
��	
�	�	�#�/�0r!c
��[R"S[R"55n[R"S[R"55n[R"5nUR[R"X//5S5 UR[R"[R"S[R"55X#//5S5 UR[R"U[R"S[R"55U//5S5 [R"[R"S[R"555nUR[R"XU//5S5 UR[R"XU/U/5S5 g)NrBr�zempty body on ForrWr.)rr�r0r�r=r&r�r�)rrBr��prXs     r�test_for�ASTValidatorTests.test_forfs���H�H�S�#�)�)�+�&���H�H�S�#�(�(�*�%���H�H�J���	�	�#�'�'�!��B�'�)<�=��	�	��G�G�C�H�H�S�#�(�(�*�-�q�#�r�:�<U�	
�	
�	�	��G�G�A�s�x�x��S�Y�Y�[�1�A�3��;�=U�	
�
�H�H�S�X�X�c�3�9�9�;�/�0���	�	�#�'�'�!���R�(�*B�C��	�	�#�'�'�!���a�S�)�+C�Dr!c
�^�UR[R"[R"S5//5S5 UR[R"[R"S[R
"55[R"5//5S5 UR[R"[R"S5[R"5/[R"[R"S[R
"555/5S5 g)Nr�zempty body on WhilerBr.)r&r�Whiler�r�r0r=r�r�s r�
test_while�ASTValidatorTests.test_whileus����	�	�#�)�)�C�L�L��O�R��4�6K�L��	�	��I�I�c�h�h�s�C�I�I�K�0�3�8�8�:�,��C�$�	
�	
�	�	��I�I����Q��#�(�(�*��������#�s�y�y�{�9S�0T�/U�
�
%�		
r!c�\�UR[R"[R"S5//5S5 [R"[R"S[R
"55[R"5//5nURUS5 [R"[R"S5[R"[R"S[R
"555//5nURUS5 [R"[R"S5[R"5/[R"[R"S[R
"555/5nURUS5 g)Nr�zempty body on IfrBr.)r&r�Ifr�r�r0r=r�)rrss  r�test_if�ASTValidatorTests.test_if�s����	�	�#�&�&����a��"�b�1�3E�F��F�F�3�8�8�C�����-����
�|�R�@���	�	�!�-�.��F�F�3�<�<��?�S�X�X�c�h�h�s�C�I�I�K�.H�%I�$J�B�O���	�	�!�-�.��F�F��L�L��O�c�h�h�j�\�C�H�H�S�X�X�c�3�9�9�;�5O�,P�+Q�
��	
�	�	�!�-�.r!c���[R"5nUR[R"/U/5S5 [R"[R
"S5S5nUR[R"U//5S5 [R"[R"S[R"55S5nUR[R"U/U/5S5 [R"[R
"S5[R"S[R"555nUR[R"U/U/5S5 g)Nzempty items on Withr�zempty body on WithrBr.rW)	rr=r&�Withr�r�r�r0r�)rrarss   r�	test_with�ASTValidatorTests.test_with�s����H�H�J���	�	�#�(�(�2��s�#�%:�;��L�L����a��$�/���	�	�#�(�(�A�3��#�%9�:��L�L����#�s�y�y�{�3�T�:���	�	�#�(�(�A�3���$�&>�?��L�L����a��#�(�(�3����
�*C�D���	�	�#�(�(�A�3���$�&?�@r!c���[R"S[R"S55nURUS5 [R"[R"S[R
"55S5nURUS5 [R"[R"S5[R"S[R
"555nURUS5 g)Nr�z!Raise with cause but no exceptionrBr.r�)rr�r�r&r�r0)r�rs  r�
test_raise�ASTValidatorTests.test_raise�s����I�I�d�C�L�L��O�,���	�	�!�8�9��I�I�c�h�h�s�C�I�I�K�0�$�7���	�	�!�-�.��I�I�c�l�l�1�o�s�x�x��S�Y�Y�[�'A�B���	�	�!�-�.r!c�D�[R"5n[R"///U/5nURUS5 [R"[R"[R
"S[R"555///U/5nURUS5 [R"U////5nURUS5 [R"U//U/U/5nURUS5 [R"U/[R"SS/5///5nURUS5 [R"[R
"S[R"55SU/5/nUR[R"U/U//5S5 [R"SSU/5/n[R"U/U[R"[R
"S[R"555/U/5nURUS5 [R"U/X1/[R"[R
"S[R"555/5nURUS5 g)Nzempty body on TryrBr.z-Try has neither except handlers nor finalbodyz%Try has orelse but no except handlers�empty body on ExceptHandlerr�)rr=�Tryr&r�r�r0�
ExceptHandler�rra�trXs    r�test_try�ASTValidatorTests.test_try�s����H�H�J���G�G�B��B���$���	�	�!�(�)��G�G�S�X�X�c�h�h�s�C�I�I�K�8�9�:�B��Q�C�H���	�	�!�-�.��G�G�Q�C��R��$���	�	�!�D�E��G�G�Q�C��a�S�1�#�&���	�	�!�<�=��G�G�Q�C�#�+�+�D�#�r�:�;�R��D���	�	�!�2�3�
�
�
�s�x�x��S�Y�Y�[�9�3���
D�E���	�	�#�'�'�1�#�q�"�b�)�+C�D�
�
�
�t�S�1�#�
.�/���G�G�Q�C��S�X�X�c�h�h�s�C�I�I�K�&@�A�B�Q�C�H���	�	�!�-�.��G�G�Q�C��C�#�(�(�3�8�8�C�����+E�"F�!G�H���	�	�!�-�.r!c�D�[R"5n[R"///U/5nURUS5 [R"[R"[R
"S[R"555///U/5nURUS5 [R"U////5nURUS5 [R"U//U/U/5nURUS5 [R"U/[R"SS/5///5nURUS5 [R"[R
"S[R"55SU/5/nUR[R"U/U//5S5 [R"SSU/5/n[R"U/U[R"[R
"S[R"555/U/5nURUS5 [R"U/X1/[R"[R
"S[R"555/5nURUS5 g)Nzempty body on TryStarrBr.z1TryStar has neither except handlers nor finalbodyz)TryStar has orelse but no except handlersrur�)rr=�TryStarr&r�r�r0rwrxs    r�
test_try_star�ASTValidatorTests.test_try_star�s����H�H�J���K�K��B��Q�C�(���	�	�!�,�-��K�K����#�(�(�3��	�	��"<�=�>��B���L���	�	�!�-�.��K�K���R��R�(���	�	�!�H�I��K�K���R�!��q�c�*���	�	�!�@�A��K�K���c�/�/��c�2�>�?��R�H���	�	�!�2�3�
�
�
�s�x�x��S�Y�Y�[�9�3���
D�E���	�	�#�+�+�q�c�1�b�"�-�/G�H�
�
�
�t�S�1�#�
.�/���K�K���Q����#�(�(�3��	�	��*D�!E� F���L���	�	�!�-�.��K�K���Q��c�h�h�s�x�x��S�Y�Y�[�/I�&J�%K�L���	�	�!�-�.r!c	��UR[R"[R"S[R"55S5S5 [R"[R"S[R
"55[R"S[R"555nURUS5 g)NrBr.r�)r&r�Assertr�r0r�)r�assrts  r�test_assert�ASTValidatorTests.test_assert�ss���	�	��J�J�s�x�x��S�Y�Y�[�1�4�8�:R�	
��
�
�3�8�8�C�����4�c�h�h�s�C�I�I�K�6P�Q���	�	�%�1�2r!c�P�UR[R"/5S5 g)Nzempty names on Import)r&rr�r�s r�test_import�ASTValidatorTests.test_import�����	�	�#�*�*�R�.�"9�:r!c���[R"S[R"SS5/S5nURUS5 UR[R"S/S5S5 g)NrBi���zNegative ImportFrom levelrzempty names on ImportFrom)rr�r�r&)r�imps  r�test_importfrom�!ASTValidatorTests.test_importfrom�sM���n�n�T�C�I�I�c�4�$8�#9�3�?���	�	�#�2�3��	�	�#�.�.��r�1�-�/J�Kr!c�P�UR[R"/5S5 g)Nzempty names on Global)r&r�Globalr�s r�test_global�ASTValidatorTests.test_global�r�r!c�P�UR[R"/5S5 g)Nzempty names on Nonlocal)r&r�Nonlocalr�s r�
test_nonlocal�ASTValidatorTests.test_nonlocal�s���	�	�#�,�,�r�"�$=�>r!c��[R"[R"S[R"555nUR	US5 g�NrBr.)rr�r�r0r&rws  r�	test_expr�ASTValidatorTests.test_expr�s0���H�H�S�X�X�c�3�9�9�;�/�0���	�	�!�-�.r!c	��[R"[R"5/5nURUS5 [R"[R"5[R"S5/5nURUS5 [R"[R"5[R"S5S/5nURUS5 [R"[R"5[R"S5[R
"S[R"55/5nURUS5 g)Nzless than 2 valuesr�r�rOrBr.)r�BoolOp�Andr%r�r�r0)rrWs  r�test_boolop�ASTValidatorTests.test_boolop�s����J�J�s�w�w�y�"�%���	�	�!�)�*��J�J�s�w�w�y�3�<�<��?�"3�4���	�	�!�)�*��J�J�s�w�w�y�3�<�<��?�D�"9�:���	�	�!�&�'��J�J�s�w�w�y�3�<�<��?�C�H�H�S�#�)�)�+�4N�"O�P���	�	�!�-�.r!c���[R"[R"5[R"S[R"555nURUS5 gr�)rrrr�r0r%)r�us  r�test_unaryop�ASTValidatorTests.test_unaryop�s8���K�K����	�3�8�8�C�����#=�>���	�	�!�-�.r!c
��[R"//S//S/5nUR[R"U[R"S[R
"555S5 SnUR
X R5 g)NrBr.c��[R"U[R"S[R"555$r;)r�Lambdar�r�r�s rr4�*ASTValidatorTests.test_lambda.<locals>.fac�s$���:�:�d�C�H�H�S�#�(�(�*�$=�>�>r!)rrr%r�r�r0r7)rr]r4s   r�test_lambda�ASTValidatorTests.test_lambda�s`���M�M�"�b�$��B��b�9���	�	�#�*�*�Q�����c�i�i�k� :�;�=U�V�	?�	
���c�9�9�-r!c��[R"S[R"55n[R"S[R"55nX!U4XU4XU44H&nUR	[R
"U6S5 M( g�NrBr�r.)rr�r�r0r%�IfExp)r�lr>rs    r�
test_ifexp�ASTValidatorTests.test_ifexp�sc���H�H�S�#�(�(�*�%���H�H�S�#�)�)�+�&���1�I��a�y�1��)�3�D��I�I�c�i�i��&�(@�A�4r!c�N�[R"/[R"S[R"55/5nUR	US5 [R"[R"S[R"55/S/5nUR	US5 g)NrBzsame number of keys as valuesrO)rr�r�r�r%)rr�s  r�	test_dict�ASTValidatorTests.test_dict�sj���H�H�R�#�(�(�3����
�3�4�5���	�	�!�4�5��H�H�c�h�h�s�C�H�H�J�/�0�4�&�9���	�	�!�&�'r!c���UR[R"S/5S5 [R"[R"S[R"55/5nURUS5 g�NrOrBr.)r%r�Setr�r0�rr>s  r�test_set�ASTValidatorTests.test_setsL���	�	�#�'�'�4�&�/�#4�5��G�G�S�X�X�c�3�9�9�;�/�0�1���	�	�!�-�.r!c	��URU"/5S5 [R"[R"S[R"55[R"S[R"55/S5nURU"U/5S5 [R"[R"S[R
"55[R"S[R
"55/S5nURU"U/5S5 [R"S[R
"55n[R"S[R"55n[R"X4S/S5nURU"U/5S5 [R"X4[R"S[R
"55/S5nURU"U/5S5 g)Nz comprehension with no generatorsrBrrWr.r�rO)r%rr�r�r�r0)rr4�grBr�s     r�_check_comprehension�&ASTValidatorTests._check_comprehensionsM���	�	�#�b�'�=�>�����H�H�S�#�(�(�*�%�s�x�x��S�X�X�Z�'@�"�a�
��	
�	�	�#�q�c�(�5�6�����H�H�S�#�)�)�+�&�����c�i�i�k�(B�B��
��	
�	�	�#�q�c�(�4�5��H�H�S�#�)�)�+�&���H�H�S�#�(�(�*�%�����a�T�F�A�.���	�	�#�q�c�(�-�.����a�S�X�X�c�3�9�9�;�%?�$@�!�D���	�	�#�q�c�(�4�5r!c	�^�[R"[R"S[R"55[R"S[R"55/S5nURT"[R"S[R"55U/5S5 U4SjnUR
U5 g)NrBrr.c�f>�T"[R"S[R"55U5$r;)rr�r0)�gensr4s �r�wrap�,ASTValidatorTests._simple_comp.<locals>.wraps!����s�x�x��S�Y�Y�[�1�4�8�8r!)rr�r�r0r�r%r�)rr4r�r�s `  r�_simple_comp�ASTValidatorTests._simple_comps~�������H�H�S�#�)�)�+�&�����c�h�h�j�(A�2�q�
��	
�	�	�#�c�h�h�s�C�I�I�K�0�1�#�6�8P�Q�	9�	
�!�!�$�'r!c�B�UR[R5 grG)r�r�ListCompr�s r�
test_listcomp�ASTValidatorTests.test_listcomp$s�����#�,�,�'r!c�B�UR[R5 grG)r�r�SetCompr�s r�test_setcomp�ASTValidatorTests.test_setcomp's�����#�+�+�&r!c�B�UR[R5 grG)r�r�GeneratorExpr�s r�test_generatorexp�#ASTValidatorTests.test_generatorexp*s�����#�*�*�+r!c���[R"[R"S[R"55[R"S[R"55/S5n[R
"[R"S[R"55[R"S[R"55U/5nUR
US5 [R
"[R"S[R"55[R"S[R"55U/5nUR
US5 SnURU5 g)Nr�rarrBr.c���[R"S[R"55n[R"S[R"55n[R"XU5$)NrBr�)rr�r��DictComp)�comps�k�vs   r�factory�0ASTValidatorTests.test_dictcomp.<locals>.factory6s?������c�h�h�j�)�A�����c�h�h�j�)�A��<�<��e�,�,r!)rr�r�r0r�r�r%r�)rr��cr�s    r�
test_dictcomp�ASTValidatorTests.test_dictcomp-s�������H�H�S�#�)�)�+�&�����c�h�h�j�(A�2�q�
��
�L�L����#�s�y�y�{�3�S�X�X�c�3�8�8�:�5N�QR�PS�T���	�	�!�-�.��L�L����#�s�x�x�z�2�C�H�H�S�#�)�)�+�4N�QR�PS�T���	�	�!�-�.�	-�
	
�!�!�'�*r!c	�<�UR[R"[R"S[R"555S5 UR[R
"[R"S[R"555S5 g)NrBzmust have Load)r%r�Yieldr�r0�	YieldFromr�s r�
test_yield�ASTValidatorTests.test_yield=sT���	�	�#�)�)�C�H�H�S�#�)�)�+�6�7�9I�J��	�	�#�-�-�����c�i�i�k� :�;�=M�Nr!c���[R"S[R"55n[R"U[R"5//5nURUS5 [R"U[R"5/[R"S5[R"S5/5nURUS5 [R"[R"S5[R"5/U/5nURU5 [R"U[R"5/[R"S5/5nURU5 g)NrBzno comparatorsr�r�z,different number of comparators and operands�blah)rr�r��Compare�Inr%r�)rr��comps   r�test_compare�ASTValidatorTests.test_compareAs����x�x��S�X�X�Z�(���{�{�4�#�&�&�(��R�0���	�	�$�(�)��{�{�4�#�&�&�(��c�l�l�1�o�s�|�|�A��-O�P���	�	�$�F�G��{�{�3�<�<��/�#�&�&�(��d�V�D���	�	�$���{�{�4�#�&�&�(��c�l�l�6�.B�-C�D���	�	�$�r!c��[R"S[R"55n[R"S[R"55/n[R"S[R"S[R"555/n[R"[R"S[R
"55X#5nUR
US5 [R"US/U5nUR
US5 [R"S[R"S[R
"555/n[R"XU5nUR
US5 g)NrBr�rAr�r.rO)rr�r�rLr�r0r%)rr�rr��call�bad_keywordss      r�	test_call�ASTValidatorTests.test_callLs����x�x��S�X�X�Z�(������c�h�h�j�)�*���K�K��S�X�X�c�3�8�8�:�%>�?�@���x�x�����c�i�i�k�2�D�C���	�	�$�0�1��x�x��t�f�h�/���	�	�$�)�*����C����#�s�y�y�{�)C�D�E���x�x��L�1���	�	�$�0�1r!c���[R"SS9n[R"SS[5 SSKJn SSS5 [R"SS9n[R"SS[5 "SS	[5n"S
S[5n"SS
[5nSH(nUR[R
"U55 M* U"5U"5U"54H,nUR[R
"U5S[S9 M. SSS5 URWVs/sHn[UR5PM sn/SQ5 g!,(df   GN =f!,(df   NY=fs snf)NTr+r�r�rr\r-c��\rSrSrSrg)�*ASTValidatorTests.test_num.<locals>.subinti`r8NrVr8r!r�subintr�`rpr!r�c��\rSrSrSrg)�,ASTValidatorTests.test_num.<locals>.subfloaticr8NrVr8r!r�subfloatr�crpr!r�c��\rSrSrSrg)�.ASTValidatorTests.test_num.<locals>.subcomplexifr8NrVr8r!r�
subcomplexr�frpr!r�)�0�hellozinvalid typer&)r7r7r7r7r7)r�r�r�r�rr�r�float�complexr%r@r.rr?)rr@r�r�r�r��objrAs        r�test_num�ASTValidatorTests.test_numXs��
�
$�
$�D�
1�T��#�#�H�b�2D�E��2��
$�
$�D�
1�T��#�#�H�b�2D�E�
��
�
�5�
�
�W�
�$���	�	�#�'�'�#�,�'�$��x���Z�\�9���	�	�#�'�'�#�,��I�	�F�:�2�"	
���%)�*�T��S����^�T�*�
�		
�+2�
1��2�
1��$
+s�#E�B<E#�'E4�
E �#
E1c���[R"[R"S[R"55S[R"55nURUS5 gr�)r�	Attributer�r0r�r%)rr9s  r�test_attribute� ASTValidatorTests.test_attributeys:���}�}�S�X�X�c�3�9�9�;�7��c�h�h�j�I���	�	�$�0�1r!c	��[R"[R"S[R"55[R"S5[R
"55nUR
US5 [R"S[R
"55n[R"U[R"S[R"55[R
"55nUR
US5 [R"S[R"55nUSS4SUS4SSU44HPn[R"U6nUR
[R"X%[R
"55S5 MR [R"/[R
"55nUR
[R"X%[R
"555 [R"U/[R
"55nUR
[R"X%[R
"55S5 g)NrBr�r.r�)	r�	Subscriptr�r0r�r�r%�Slice�Tuple)r�subrBr>r�sls      r�test_subscript� ASTValidatorTests.test_subscript}se���m�m�C�H�H�S�#�)�)�+�6����Q������T���	�	�#�/�0��H�H�S�#�(�(�*�%���m�m�A�s�x�x��S�Y�Y�[�9�3�8�8�:�F���	�	�#�/�0��H�H�S�#�)�)�+�&����d�O�d�A�t�_�t�T�1�o�E�D����D�!�B��I�I�c�m�m�A�3�8�8�:�6�8P�Q�F��Y�Y�r�3�8�8�:�
&���	�	�#�-�-��s�x�x�z�2�3�
�Y�Y��s�C�H�H�J�
'���	�	�#�-�-��s�x�x�z�2�4L�Mr!c	�v�[R"[R"[R"S[R"55[R
"55/[R
"55n[R"U/[R"S55nURUS5 g)NrBr�rW)	r�List�Starredr�r�r0rXr�r&)rr��assigns   r�test_starred�ASTValidatorTests.test_starred�sk���x�x�
�[�[����#�s�x�x�z�2�C�I�I�K�
@�A�3�9�9�;�
�����T�F�C�L�L��O�4���	�	�&�3�4r!c	��URU"S/[R"55S5 URU"[R"S[R"55/[R"55S5 gr�)r%rr�r�r0)rr4s  r�	_sequence�ASTValidatorTests._sequence�sS���	�	�#�t�f�c�h�h�j�)�+<�=��	�	�����#�s�y�y�{�+�,�c�h�h�j�9�;S�	
r!c�B�UR[R5 grG)rrrr�s r�	test_list�ASTValidatorTests.test_list�s�����s�x�x� r!c�B�UR[R5 grG)rrrr�s r�
test_tuple�ASTValidatorTests.test_tuple�s�����s�y�y�!r!c��[R"SS9n[R"SS[5 SSKJn SSS5 [R"SS9n[R"SS[5 UR
[R
"S55 SSS5 URWVs/sHn[UR5PM snS	/5 g!,(df   N�=f!,(df   NW=fs snf)
NTr+r�r�r)r�r-r�r=)
r�r�r�r�rr�r%r.rr?)rr@r�rAs    r�test_nameconstant�#ASTValidatorTests.test_nameconstant�s���
�
$�
$�D�
1�T��#�#�H�b�2D�E�(�2��
$�
$�D�
1�T��#�#�H�b�2D�E��I�I�c�&�&�q�)�*�2�	
���%)�*�T��S����^�T�*�m�
�	
�2�
1��2�
1��

+s�#C�AC'�-C8�
C$�'
C5�cpuc�`�[RR[R5n[R
"U5Vs/sHo"R
S5(dMUPM nnURSS/5 UH�nURU5 [RRX5n[USSS9nUR5nSSS5 [R"WU5n[XrS5 SSS5 M� gs snf!,(df   NC=f!,(df   M�=f)Nz.pyztest/test_grammar.pyztest/test_unpack_ex.pyrq�utf-8��encodingre)�os�path�dirnamer�__file__�listdir�endswith�extendro�join�open�readrzrp)r�stdlib�fnrNr��fpr:r�s        r�test_stdlib_validates�'ASTValidatorTests.test_stdlib_validates�s�����������.�� �j�j��0�G�0��K�K��4F��0��G�
���,�.F�G�H��F����f�%��W�W�\�\�&�1���"�c�G�4���W�W�Y�F�5��i�i���+�����(�&�%���H�
5�4��&�%�s0�D�#D�+D�?D
�+D�
D�D�
D-	r�rBT�carterr�r�.r��stringr�)�rest�lol�legit)�patterns�	kwd_attrs�kwd_patternsr�r�xxx�_c
�J�[R"S[R"55nURH�nUR	[R
"USS95 [R"U[R"U[R"5/S9/S9n[R"U5n[R"U//5nUR[5 [USS5 SSS5 SSS5 M� g!,(df   N=f!,(df   M�=f)NrBr�r�)rJr�)�subjectr�r�re)rr�r��_MATCH_PATTERNSroro�MatchrMr=r�r�r=r�rp)r�name_xrJrr�s     r�test_match_validation_pattern�/ASTValidatorTests.test_match_validation_pattern	s������#�s�x�x�z�*���+�+�G����c�h�h�w�q�9�:��y�y�"��>�>�'������M�N����0�0��6�����T�F�B�/���&�&�z�2��F�H�f�5�3�;�:�,�3�2��;�:�s%�BD�D�-D�
D�D�
D"	r8)NrerG)PrWrrXrYr�r�r%r&r~r7r?rGrPrTrYr^rbrfrjrnrrrzr~r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrr�requires_resourcer+rr��
constant_1�
MatchValue�	pattern_1�
constant_x�	pattern_x�
constant_truer��pattern_truer�r��name_carterr�r0�
MatchSequence�MatchMappingr	�
MatchClass�	MatchStar�MatchAs�MatchOrr9r<rZr8r!rr%r%�s���2�Z�2�$�*�$��6�0
�d.�(*�2
�:T�


�1�
E�
�	/�A�/�/�(/�(3�;�L�
;�?�/�/�/�.�B�(�/�
6�"	(�(�'�,�+� O�	�
2�
�B2�
N�5�
�!�"�
� 
���u�%�
)�&�
)����a��J����z�*�I����c�"�J����z�*�I��L�L��&�M��%�%�d�+�L��(�(�8�S�X�X�Z�0�K�	����M�M��
�
�c�h�h�s�C�I�I�K�8�#�s�x�x�z�J�����
�
�	
�	����M�M��
�
�c�h�h�s�C�H�H�J�7��c�i�i�k�J�����
�
�	
�	���s�|�|�C�(�)����s�|�|�D�)�*����s�|�|�I�.�/����8�$����3�-�-�h�7�8�9����3�,�,�c�.@�.@��.J�-K�L�M�N����*�m�4�y�k�B����
�J�'�)�Y�)?�f�	
�	���
�C�K�K��������
�(C�S�X�X�Z�P�Q�
�	�"��	
�
	����M�M�#�-�-�
�C�����D�c�3�8�8�:�V����		
�	����"���	�{�	
�	����"��)��	
�	�����(�(��2�3���		
�	����3�=�=�?�"3�r�PR�	
�	����"��#�-�-�/�AR�	
�	������h�#��		
�	���3�=�=��0�1�2�����!����B�����Y�K� ����Y�	�3�+=�+=�e�+D�E�F�������
�
�3�����3�=�=��-�.�/�����R�c�*�IE�O�N6r!r%c�n�\rSrSrSrSrSrSrSrSr	Sr
\RS	5r
S
rSrSrg
)�
ConstantTestsi	c��[R"S5nURSRn[R"US9n[R
"XC5 XBRSl[
USS5n0n[XV5 US$)Nzx = 123rrEryrerB)rrzr�r3r�r�rpre)rr3r}r�new_noder�rs       r�compile_constant�ConstantTests.compile_constant	sp���y�y��#���y�y��|�!�!���<�<�e�,�����(�)�%�	�	�!����t�Z��0��
���T���#�w�r!c���UR[5nUR/SQ5 SSS5 UR[	WR
5S5 g!,(df   N4=f)Nr�z%got an invalid type in Constant: list)r=r@rQr.rr�)rr�s  r�test_validation�ConstantTests.test_validation-	sH��
�
�
�y�
)�R��!�!�)�,�*�����R�\�\�*�,S�T�*�
)�s�A�
A&c���SSS[S[54H=nURUS9 URU5nUR	X!5 SSS5 M? g!,(df   MQ=f)NFTr!)�const)r�r�rorQr)rrWr3s   r�test_singletons�ConstantTests.test_singletons2	sU���E�4��3�	��D�E����E��*��-�-�e�4���
�
�e�+�+�*�E�*�*�s�#A�
A&	c	�J�Sn[S15n[S5HnUS4n[US15nM SSSSS	[S
5[S5UU4	nUH=nURUS9 UR	U5nURXe5 SSS5 M? g!,(df   MQ=f)
N�r�r�r�r;rKg�^@y�^@�unicode�bytesrr�rE)r�r rrorQr.)r�nested_tuple�nested_frozensetrr�r3�results       r�test_values�ConstantTests.test_values8	s�����$�a�S�>���1�X�E�(�!�,�L�(�*:�A�)>�?���
������'�N��k�"���

���E����E��*��.�.�u�5��� � ��/�+�*��*�*�s�##B�
B"	c��[R"S5nURSRSn[R"SS9n[R
"X25 X1RSRS'UR
[5n[USS5 SSS5 UR[WR5S5 g!,(df   N4=f)N�x = 1rr�rEr.rez6expression which can't be assigned to in Store context)rrzr��targetsr�r�r=r�rpr.rr�)rr}rH�
new_targetr�s     r�test_assign_to_constant�%ConstantTests.test_assign_to_constantN	s����y�y��!�����1��%�%�a�(���\�\��*�
����*�-�",�	�	�!����Q��
�
�
�z�
*�b��D�(�F�+�+���������G�	
�+�
*�s�
C	�	
Cc�|�[R"S5nUR[R"U5S5 g)Nz'docstring'
x = 1�	docstring)rrzr.r�r�s  rr�� ConstantTests.test_get_docstring]	s,���y�y�-�.������*�*�4�0�+�>r!c���[USS5n/n[R"U5H@nURS:XdURS:XdM%UR	UR
5 MB U$)Nryre�
LOAD_CONST�RETURN_CONST)rp�dis�get_instructions�opnamer��argval)rr}�co�consts�instrs     r�get_load_const�ConstantTests.get_load_consta	sZ���T�:�v�
.�����)�)�"�-�E��|�|�|�+�u�|�|�~�/M��
�
�e�l�l�+�.��
r!c��/SQnSRUVs/sHnSRU5PM sn5nUS-
nUR[S45 [R
"U5nUR
URU5U5 [URU5H?upR[R"US9n[R"XeR5 XelMA UR
URU5U5 gs snf)N)	NTF�|g@y@r\r]r�r�zx={!r}z
x = ...rE)
r%r�r$r�rrzr.rvrnr�r�r�r3)rrtrWr�r}r
rPs       r�test_load_const�ConstantTests.test_load_constk	s���R���y�y�f�E�f�U�(�/�/�%�0�f�E�F�������
�
�x��&�'��y�y��������,�,�T�2�F�;�!����F�3�M�F��|�|�%�0�H����h���5�#�L�	4�	
����,�,�T�2�F�;��Fs�Dc��[R"S5nURSRn[R"SS9n[R
"X2R5 X2l[R"SS9n[R
"XBR5 XBlUR[R"U5S5 g)Nr�rr�rEy4@y$@4@)
rrzr�r3r�r�r�r�r.rt)rr}�binop�new_left�	new_rights     rr��ConstantTests.test_literal_eval	s����y�y��!���	�	�!��"�"���<�<�b�)�����(�J�J�/��
��L�L�s�+�	����)�[�[�1�������)�)�%�0�(�;r!c��[R"SSS9RnURURS5 URUR
S5 [R"SSS9RnURURS5 URUR
S5 [R"SSS9RnURURS5 URUR
S5 [R"SSS9RnURURS	5 URUR
S5 g)
Nz"x"rgr�rBzu"x"r�zr"x"zb"x"�x)rrzr�r.r3rm)rr�s  r�test_string_kind�ConstantTests.test_string_kind�	s����I�I�e�&�)�.�.��������#�&��������&��I�I�f�6�*�/�/��������#�&��������%��I�I�f�6�*�/�/��������#�&��������&��I�I�f�6�*�/�/��������$�'��������&r!r8N)rWrrXrYrQrTrXrargr�rvrrRrzr�r�rZr8r!rrNrN	sJ���U�
,�0�,

�?��
���<��<�&<�'r!rNc���\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr Sr!S r"S!r#g")#�EndPositionTestsi�	c�t�URURU5 URURU5 grG)r.r�r�)rr0r�r�s    r�_check_end_pos�EndPositionTests._check_end_pos�	s.������,�,�j�9�����0�0�.�Ar!c�P�UR[R"X5U5 grG)r.r�get_source_segment)rr:r0�contents    r�_check_content�EndPositionTests._check_content�	s������/�/��A�7�Kr!c�\�[R"U5RSR$)Nr)rrzr�r3r�s  r�_parse_value�EndPositionTests._parse_value�	s#���y�y��|� � ��#�)�)�)r!c��SnURU5nURXRS5 URXRRSS5 URXRRS5 g)Nzlambda x, *y: Noner�rrBr�)r�r�r�rr?)rr>�lams   rr��EndPositionTests.test_lambda�	s`�� ������"�����A�x�x��0����A�x�x�}�}�Q�/��5����A�x�x����4r!c�D�[S5R5n[R"U5RSnURUSS5 UR
XRSS5 UR
XRRSS5 UR
XRRSRS5 UR
XRRS5 UR
XRRRS	5 g)
Nz�
            def func(x: int,
                     *args: str,
                     z: float = 0,
                     **kwargs: Any) -> bool:
                return True
            rr��zreturn Truezx: intrzkwargs: Any�Any)
rr�rrzr�r�r�r�
annotationr�rr>�fdefs   r�
test_func_def�EndPositionTests.test_func_def�	s�����
����
	
��y�y��|� � ��#�����D�!�R�(����A�y�y��|�]�;����A�y�y�~�~�a�0�(�;����A�y�y�~�~�a�0�;�;�U�C����A�y�y���
�>����A�y�y���9�9�5�Ar!c��SnURU5nURXRS5 URXRSRS5 URXRSRS5 g)Nzfunc(x, y=2, **kw)r�r�2r��kw)r�r�r�r�r3�rr>r�s   rr��EndPositionTests.test_call�	si�� ��� � ��#�����A�y�y�&�1����A�}�}�Q�/�5�5�s�;����A�}�}�Q�/�5�5�t�<r!c��SnURU5nURXRS5 URUSS5 g)Nzx[0]()zx[0]r�r�)r�r�r�r�r�s   r�test_call_noargs�!EndPositionTests.test_call_noargs�	s=����� � ��#�����A�y�y�&�1����D�!�Q�'r!c��[S5R5n[R"U5RSnURUSS5 UR
XRSS5 UR
XRSS5 g)Nz?
            class C(A, B):
                x: int = 0
        rr;�r��Bz
x: int = 0)rr�rrzr�r�r�rL�rr>�cdefs   r�test_class_def�EndPositionTests.test_class_def�	sy����

��U�W�	
��y�y��|� � ��#�����D�!�R�(����A�z�z�!�}�c�2����A�y�y��|�\�:r!c��Sn[R"U5RSnURXRSR
S5 g)Nz$class S(metaclass=abc.ABCMeta): passrzabc.ABCMeta)rrzr�r�r�r3r�s   r�
test_class_kw�EndPositionTests.test_class_kw�	s>��2���y�y��|� � ��#�����A�}�}�Q�/�5�5�}�Er!c���[S5R5n[R"U5RSnURUSS5 URURSS5 g)Nzh
            x = """Some multi-line text.

            It goes on starting from same indent."""
        rr��(�rr�rrzr�r�r3�rr>r
s   r�test_multi_line_str�$EndPositionTests.test_multi_line_str�	s_����

��U�W�		
�
���1��"�"�1�%�����F�A�r�*����F�L�L�!�R�0r!c���[S5R5n[R"U5RSnURUSS5 URURSS5 g)NzB
            x = "first part" \
            "second part"
        rr;r�r�r�s   r�test_continued_str�#EndPositionTests.test_continued_str�	s_����

��U�W�	
����1��"�"�1�%�����F�A�r�*����F�L�L�!�R�0r!c�F�[S5R5n[R"U5nURSnURSnURSnURSnURSnURUSS5 URUSS	5 URUS	S
5 URUSS5 URUSS5 UR
XRS
5 UR
XRSS5 UR
XRSRS5 UR
XRS5 UR
XRSS5 UR
XRSRS5 g)Na
            while True:
                pass

            if one():
                x = None
            elif other():
                y = None
            else:
                z = None

            for x, y in stuff:
                assert True

            try:
                raise RuntimeError
            except TypeError as e:
                pass

            pass
        rr�r;r�r�rr�r�r�r��r�zx = Nonezother()�x, yzraise RuntimeErrorr@)rr�rrzr�r�r�r�r�rH�handlersr)rr>r��
while_loop�if_stmt�for_loop�try_stmt�	pass_stmts        r�test_suites�EndPositionTests.test_suites�	sc��
��

�(�U�W�)	
�*�i�i��l���X�X�a�[�
��(�(�1�+���8�8�A�;���8�8�A�;���H�H�Q�K�	����J��1�-����G�Q��+����H�b�"�-����H�b�!�,����I�r�1�-����A����7����A�|�|�A��
�;����A�~�~�a�0�5�5�y�A����A����7����A�}�}�Q�/�1E�F����A�0�0��3�8�8�+�Fr!c��SnURU5nURSRnURXS5 g)Nzx = f"abc {x + y} abc"r�zx + y)r�r�r3r��rr>�fstrr}s    r�test_fstring�EndPositionTests.test_fstring$
s:��$��� � ��#�����A��$�$�����A�g�.r!c� �[S5R5nURU5nURSRnURUSS5 UR
XRS5 UR
XRS5 g)Nz�
            f"""Some multi-line text.
            {
            arg_one
            +
            arg_two
            }
            It goes on..."""
        r�r�r��arg_one�arg_two)	rr�r�r�r3r�r�r�r�r�s    r�test_fstring_multi_line�(EndPositionTests.test_fstring_multi_line*
s|����

��U�W�	
�� � ��#�����A��$�$�����E�1�a�(����A�z�z�9�5����A�{�{�I�6r!c���[S5R5n[R"U5RSnURUSS5 URURSSS5 g)NzT
            from x.y.z import (
                a, b, c as c
            )
        rr�r�r;r�)rr�rrzr�r�r�)rr>r�s   r�test_import_from_multi_line�,EndPositionTests.test_import_from_multi_line:
sc����

��U�W�		
�
�i�i��l����"�����C��A�&����C�I�I�a�L�!�R�0r!c��SnSn[S5R5n[URXU45upEnUR	XR
S5 UR	XR
RS5 UR	X%RRS5 UR	X%RRS5 UR	X6RRSRS	5 UR	X6RRS
RS5 URUSS5 g)
Nz
f()[1, 2] [0]zx[ a.b: c.d]zN
            x[ a.b: f () ,
               g () : c.d
              ]
        z	f()[1, 2]z1, 2za.bzc.dr�f ()r��g ()r�)rr��mapr�r�r3r�r�r��eltsr�)r�s1�s2�sm�i1�i2r�s       r�test_slices�EndPositionTests.test_slicesD
s���
��
��
��
��U�W�		�
��*�*�R�R�L�9�
������B���+�6����B������7����B������6����B������6����B���
�
�a� 0� 6� 6��?����B���
�
�a� 0� 6� 6��?����B��1�%r!c�:�[S5R5nURU5nURUSS5 UR	XR
S5 UR	XRS5 UR	XRR
S5 g)NzF
            (1 * 2 + (3 ) +
                 4
            )
        r;r��4z1 * 2 + (3 )�3)rr�r�r�r�r�r�)rr>r}s   r�
test_binop�EndPositionTests.test_binopU
s�����

��U�W�		
�
�!�!�!�$�����E�1�a�(����A�{�{�C�0����A�z�z�>�:����A�z�z�/�/��5r!c���[S5R5n[R"U5RSR
nUR
USS5 URXRSS5 g)Nz{
            if (one_condition and
                    (other_condition or yet_another_one)):
                pass
        rr;�,r�z"other_condition or yet_another_one)	rr�rrzr�r�r�r�r�)rr>�bops   rr��EndPositionTests.test_boolopa
sh����

��U�W�		
�
�i�i��l����"�'�'�����C��B�'����A�z�z�!�}�.R�Sr!c�
�SnSnSn[S5R5n[URXX445upVpxUR	XS5 UR	X&S5 UR	X7S5 URUSS	5 g)
Nzx = () ;z	x = 1 , ;zx = (1 , 2 ) ;z?
            x = (
                a, b,
            )
        r-z1 ,z(1 , 2 )r�r�)rr�r�r�r�r�)	rr�r��s3r��t1�t2�t3�tms	         r�test_tuples�EndPositionTests.test_tuplesk
s���
��
��
��
��
��U�W�		�
�T�.�.���0@�A�������B�D�)����B�E�*����B�J�/����B��1�%r!c��SnURU5nURXU5 URXRSS5 g)Nz
func(x. y .z)rzx. y .z)r�r�rr�s   r�test_attribute_spaces�&EndPositionTests.test_attribute_spacesz
s?����� � ��#�����A�Q�'����A�y�y��|�Y�7r!c��Sn[R"U5RSRnUR	[U5RS5 URXS5 SU-n[R"U5RSRRnUR	[U5RS5 URX2S5 g)Nz( ( ( a + b ) ) )rr�za + b�await )rrzr�r3r.rrWr�)rr>r�r�s    r�test_redundant_parenthesis�+EndPositionTests.test_redundant_parenthesis�
s������I�I�a�L���a� �&�&������a��)�)�7�3����A�'�*�
��\���I�I�b�M���q�!�'�'�-�-������a��)�)�7�3����B�7�+r!c�&�SnUH�up#URU5 [R"U5RSRnUR[
U5RU5 URX$U5 SU-n[R"U5RSRRnUR[
U5RU5 URXTU5 SSS5 M� g!,(df   GM=f)N))z( ( ( a ) ) ) ( )r�)z( ( ( a ) ) ) ( b )r�)z( ( ( a ) ) ) [ b ]r)z( ( ( a ) ) ) . br�rr�)	rorrzr�r3r.rrWr�)rrNr>ryr�r�s      r�(test_trailers_with_redundant_parenthesis�9EndPositionTests.test_trailers_with_redundant_parenthesis�
s���
���D�A����a���I�I�a�L�%�%�a�(�.�.��� � ��a��!1�!1�1�5��#�#�A�!�,���\���I�I�b�M�&�&�q�)�/�/�5�5��� � ��a��!1�!1�1�5��#�#�B�1�-�!��� ��s�CD�
D	c��SnSnURU5nURU5nURXRSS5 URXRSS5 URXRSS5 URX$RSS	5 URX$RSS
5 g)Nz[{}, {1, }, {1, 2,} ]z{a: b, f (): g () ,}rz{}r�z{1, }r;z{1, 2,}r�r�)r�r�r�r�r�)rr�r��c1�c2s     r�
test_displays�EndPositionTests.test_displays�
s���
$��
#��
�
�
�r�
"��
�
�
�r�
"�����B����
�D�1����B����
�G�4����B����
�I�6����B����
�F�3����B�	�	�!��f�5r!c��[S5R5nURU5nURUSS5 UR	XR
SRS5 UR	XRR
SRS5 UR	XRR
SRSS5 UR	XRR
SRS5 g)	Nza
            x = [{x for x, y in stuff
                  if cond.x} for stuff in things]
        r;�%r�things�stuffzcond.xr�)
rr�r�r�r��
generatorsrI�elt�ifsrH)rr>�cmps   r�test_comprehensions�$EndPositionTests.test_comprehensions�
s�����

��U�W�	
�����"�����C��B�'����A�~�~�a�0�5�5�x�@����A�w�w�1�1�!�4�9�9�7�C����A�w�w�1�1�!�4�8�8��;�X�F����A�w�w�1�1�!�4�;�;�V�Dr!c� �[S5R5n[R"U5RSnURXRSRS5 URXRSRS5 g)NzT
            async def f():
                yield x
                await y
        rzyield xr�zawait y)rr�rrzr�r�r3r�s   r�test_yield_await�!EndPositionTests.test_yield_await�
ss����

��U�W�		
�
�y�y��|� � ��#�����A�y�y��|�1�1�9�=����A�y�y��|�1�1�9�=r!c���[S5R5n[S5R5nURU5nUR[R
"XR5U5 g)NzD
            x = (
                a, b,
            ) + ()
        z;
            (
                a, b,
            )
        )rr�r�r.rr�r�)r�s_orig�s_tupler}s    r�test_source_segment_multi�*EndPositionTests.test_source_segment_multi�
sk����
��U�W�		�
��
��U�W�		�
�!�!�&�)������/�/��
�
�C�W�Mr!c���[S5R5nSn[R"U5RSnUR[R"XRSSS9U5 g)Nuf
            class C:
                def fun(self) -> None:
                    "ЖЖЖЖЖ"
        u/    def fun(self) -> None:
        "ЖЖЖЖЖ"rT��padded�rr�rrzr�r.r�)rr
�s_methodr�s    r�test_source_segment_padded�+EndPositionTests.test_source_segment_padded�
sf����
��U�W�		�
I���y�y�� �%�%�a�(������"�"�6�9�9�Q�<��E�x�	
r!c��Sn[R"U5Rup#pEnURXS5 URXS5 URXS5 URXS5 URXS5 g)Nz!v = 1
w = 1
x = 1

y = 1
z = 1
zv = 1zw = 1rdzy = 1zz = 1)rrzr�r�)rr>r�rArBr�r�s       r�test_source_segment_endings�,EndPositionTests.test_source_segment_endings�
sp��7���	�	�!��)�)�
��a�A����A�'�*����A�'�*����A�'�*����A�'�*����A�'�*r!c���[S5R5nSn[R"U5RSnUR[R"XRSSS9U5 g)Nzb
            class C:
              	  def fun(self) -> None:
              	      pass
        z+  	  def fun(self) -> None:
  	      passrTrr)rr>rr�s    r�test_source_segment_tabs�)EndPositionTests.test_source_segment_tabs�
sb����

��U�W�		
�
I���y�y��|� � ��#������/�/��9�9�Q�<��M�x�Xr!c�D�Sn[R"U5Rup#nURXS5 URXS5 URXS5 Sn[R"U5RSnURXUR	55 g)Nz3def f():
  pass
def g():
  pass
def h():
  pass
zdef f():
  passzdef g():
  passzdef h():
  passz"def f():
  a = 1
  b = 2
  c = 3
r)rrzr�r��rstrip)rr>r!r��hs     r�test_source_segment_newlines�-EndPositionTests.test_source_segment_newlines�
s���J���)�)�A�,�#�#���a����A�"4�5����A�"4�5����A�"6�7�5���I�I�a�L���a� �����A�!�(�(�*�-r!c��Sn[R"U5Rup#pEU?U?U?U?UR[R"X55 UR[R"X55 UR[R"X55 UR[R"X55 g)Nzv = 1
w = 1
x = 1

y = 1
)	rrzr�r(r�r)r�rar�)rr>r�rArBr�s      r� test_source_segment_missing_info�1EndPositionTests.test_source_segment_missing_info�
s���0���Y�Y�q�\�&�&�
��a�
�H�
�L�
�L�
�����#�0�0��6�7����#�0�0��6�7����#�0�0��6�7����#�0�0��6�7r!r8N)$rWrrXrYr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrr!rZr8r!rr�r��	s���B�L�*�
5�B� =�(�;�F�
1�1�*G�X/�7� 1�&�"
6�T�
&�8�,�.�"	6�
E�>�N�

�+�	Y�	.�
8r!r�c��\rSrSrSrSrg)�BaseNodeVisitorCasesic��^�"U4SjSUR5n[R"[S55nU"5n/m[R
"SS9n[R"SS[5 URU5 SSS5 URT/SQ5 URWVs/sHn[UR5PM sn/S	Q5 g!,(df   N[=fs snf)
Nc�R>�\rSrSrU4SjrU4SjrU4SjrU4SjrU4SjrSr	g)	�=BaseNodeVisitorCases.test_old_constant_nodes.<locals>.Visitoric�V>�TRURSUR45 g)Nr�)r�r(r2�rr�logs  �r�	visit_Num�GBaseNodeVisitorCases.test_old_constant_nodes.<locals>.Visitor.visit_Num�����
�
�D�K�K�����7�8r!c�V>�TRURSUR45 g)Nr��r�r(r>r)s  �r�	visit_Str�GBaseNodeVisitorCases.test_old_constant_nodes.<locals>.Visitor.visit_Str	r-r!c�V>�TRURSUR45 g)Nr�r/r)s  �r�visit_Bytes�IBaseNodeVisitorCases.test_old_constant_nodes.<locals>.Visitor.visit_Bytess����
�
�D�K�K��$�&�&�9�:r!c�V>�TRURSUR45 g)Nr�)r�r(r3r)s  �r�visit_NameConstant�PBaseNodeVisitorCases.test_old_constant_nodes.<locals>.Visitor.visit_NameConstants����
�
�D�K�K�����D�Er!c�B>�TRURSS45 g)Nr�.)r�r(r)s  �r�visit_Ellipsis�LBaseNodeVisitorCases.test_old_constant_nodes.<locals>.Visitor.visit_Ellipsiss����
�
�D�K�K��S�9�:r!r8N)
rWrrXrYr+r0r3r6r9rZ)r*s�r�Visitorr's"���
9�
9�
;�
F�
;�
;r!r;z�            i = 42
            f = 4.25
            c = 4.25j
            s = 'string'
            b = b'bytes'
            t = True
            n = None
            e = ...
            Tr+r-r�))r�r�r9)r;r�r3)r�r�r4)r�r�r.)r�r�r])r�r�T)r�r�N)rr�.)
�+visit_Num is deprecated; add visit_Constantr9r<r9r<r9z+visit_Str is deprecated; add visit_Constantr;z-visit_Bytes is deprecated; add visit_Constantr;�4visit_NameConstant is deprecated; add visit_Constantr=z0visit_Ellipsis is deprecated; add visit_Constant)�
visitor_classrrzrr�r�r�r��visitr.rr?)rr;r��visitorr@rAr*s      @r�test_old_constant_nodes�,BaseNodeVisitorCases.test_old_constant_nodess����	;�d�(�(�	;� �i�i��	�	
�
���)����
�
$�
$�D�
1�T��#�#�H�b�2D�E��M�M�#��2�	
����	
�	
�	
���%)�*�T��S����^�T�*�
�	
�!2�
1��"
+s�.C�/C*�
C'r8N)rWrrXrYrArZr8r!rr$r$s��@
r!r$c�,�\rSrSr\R
rSrg)�NodeVisitorTestsiGr8N)rWrrXrYr�NodeVisitorr>rZr8r!rrDrDGs���O�O�Mr!rDc�P�\rSrSr\R
rSrSrSr	Sr
SrSrSr
g	)
�NodeTransformerTestsiKc��[R"[U55n[R"[U55nU"5n[R"UR	U55nURXu5 grG)rrzrr�r?�assertASTEqual)r�tranformer_class�initial_code�
expected_code�initial_ast�expected_ast�
tranformer�
result_asts        r�assertASTTransformation�,NodeTransformerTests.assertASTTransformationNsY���i�i��|� 4�5���y�y��
�!6�7��%�'�
��.�.�z�/?�/?��/L�M�
����J�5r!c�b�SnSn"SS[R5nURX1U5 g)Nzdef func(arg) -> SomeType: ...zdef func(arg): ...c�6�\rSrSrS\R
4SjrSrg)�ENodeTransformerTests.test_node_remove_single.<locals>.SomeTypeRemoveri]rc�J�URU5 URS:XagU$)N�SomeType)�
generic_visitr�r�s  r�
visit_Name�PNodeTransformerTests.test_node_remove_single.<locals>.SomeTypeRemover.visit_Name^s$���"�"�4�(��7�7�j�(���r!r8N)rWrrXrYrr�rYrZr8r!r�SomeTypeRemoverrU]���
�s�x�x�
r!r[�r�NodeTransformerrQ)rr�r�r[s    r�test_node_remove_single�,NodeTransformerTests.test_node_remove_singleWs0��/��'��	�c�1�1�	�	
�$�$�_�H�Er!c�b�SnSn"SS[R5nURX1U5 g)NzM
        def func(arg):
            print(arg)
            yield arg
        �7
        def func(arg):
            print(arg)
        c�6�\rSrSrS\R
4SjrSrg)�ENodeTransformerTests.test_node_remove_from_list.<locals>.YieldRemoverisrc�|�URU5 [UR[R5(agU$rG)rXrr3rr�r�s  r�
visit_Expr�PNodeTransformerTests.test_node_remove_from_list.<locals>.YieldRemover.visit_Exprts-���"�"�4�(��d�j�j�#�)�)�4�4���r!r8N)rWrrXrYrr�rfrZr8r!r�YieldRemoverrdsr\r!rhr])rr�r�rhs    r�test_node_remove_from_list�/NodeTransformerTests.test_node_remove_from_listfs4����
��	�3�.�.�	�	
�$�$�\��Br!c�b�SnSn"SS[R5nURX1U5 g)Nz0
        class DSL(Base, kw1=True): ...
        zE
        class DSL(Base, kw1=True, kw2=True, kw3=False): ...
        c�6�\rSrSrS\R
4SjrSrg)�BNodeTransformerTests.test_node_return_list.<locals>.ExtendKeywordsi�rc��URU5 URS:XaWU[R"S[R"S55[R"S[R"S55/$U$)N�kw1�kw2T�kw3F)rXrrrLr�r�s  r�
visit_keyword�PNodeTransformerTests.test_node_return_list.<locals>.ExtendKeywords.visit_keyword�s^���"�"�4�(��8�8�u�$�����E�3�<�<��+=�>����E�3�<�<��+>�?���
�r!r8N)rWrrXrYrrLrrrZr8r!r�ExtendKeywordsrm�s��
�#�+�+�
r!rtr])rr�r�rts    r�test_node_return_list�*NodeTransformerTests.test_node_return_list|s4������		�S�0�0�		�	
�$�$�^�8�Dr!c�b�SnSn"SS[R5nURX1U5 g)Nrbz5
        def func(arg):
            log(arg)
        c�6�\rSrSrS\R
4SjrSrg)�9NodeTransformerTests.test_node_mutate.<locals>.PrintToLogi�rc���URU5 [UR[R5(a+URR
S:XaSURlU$)N�printr*)rXrr�rr�r�r�s  r�
visit_Call�DNodeTransformerTests.test_node_mutate.<locals>.PrintToLog.visit_Call�sD���"�"�4�(��d�i�i����2�2�t�y�y�|�|�w�7N�#(�D�I�I�L��r!r8N�rWrrXrYrr�r|rZr8r!r�
PrintToLogry�r\r!rr]�rr�r�rs    r�test_node_mutate�%NodeTransformerTests.test_node_mutate�s4������
	��,�,�	�	
�$�$�Z�x�@r!c�b�SnSn"SS[R5nURX1U5 g)NrbzH
        def func(arg):
            logger.log(arg, debug=True)
        c�6�\rSrSrS\R
4SjrSrg)�:NodeTransformerTests.test_node_replace.<locals>.PrintToLogi�rc
���URU5 [UR[R5(a�URR
S:Xa�[R"[R"[R"S[R"5S9S[R"5S9UR[R"S[R"S55/S9$U$)	Nr{�loggerr�r*)r9r��debugT)r�rr�)rXrr�rr�r�r�r�r�rrLr�r�s  rr|�ENodeTransformerTests.test_node_replace.<locals>.PrintToLog.visit_Call�s����"�"�4�(��d�i�i����2�2�t�y�y�|�|�w�7N��8�8� �]�]��H�H�X�3�8�8�:�>�!&� #���
��
"�Y�Y�"%�+�+�g�s�|�|�D�7I�"J�!K����r!r8Nr~r8r!rrr��s��
�s�x�x�
r!rr]r�s    r�test_node_replace�&NodeTransformerTests.test_node_replace�s4������

	��,�,�
	�	
�$�$�Z�x�@r!r8N)rWrrXrYrr^r>rQr_rirur�r�rZr8r!rrGrGKs0���'�'�M�6�
F�C�,E�*A�&Ar!rGc�V�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rg)�ASTConstructorTestsi�c�.�[R"5nURUR/5 URUR/5 UR[S5 [R"US9nSSS5 UR[WS55 URUR/5 [R"SUS9nURURS5 URUR/5 g!,(df   N�=f)NzDFunctionDef\.__init__ missing 1 required positional argument: 'name'r�rr�)rr)rrr.rrr�r�r<rzrer#r)rrrs   r�test_FunctionDef�$ASTConstructorTests.test_FunctionDef�s����}�}���������B�'�����)�)�2�.�
�
"�
"��S�
��?�?��-�D�	
�
	
�����v�.�/�����,�,�b�1����E��5��������E�*�����,�,�b�1�
�
�s�$D�
Dc��[R"S5nURURS5 UR	UR
[R5 [R"S[R"55nURURS5 UR	UR
[R5 [R"S[R"5S9nURURS5 UR	UR
[R5 UR[S5 [R"5nSSS5 g!,(df   g=f)NrBr�z;Name\.__init__ missing 1 required positional argument: 'id')rr�r.r�r�r�r�r0�Delr�r�)rr�name2�name3s    r�test_expr_context�%ASTConstructorTests.test_expr_context�s����x�x��}��������#�&����d�h�h����1�����c�i�i�k�*��������3�'����e�i�i����3�����#�'�'�)�,��������3�'����e�i�i����1�
�
"�
"��J�
��H�H�J�E�	
�
�
�s�E0�0
E>c��"SS[R5nU"5nURX!5 URUR05 g)Nc��\rSrSrSrg)�GASTConstructorTests.test_custom_subclass_with_no_fields.<locals>.NoIniti�r8NrVr8r!r�NoInitr��r\r!r�)rrr�r.r<)rr�r�s   r�#test_custom_subclass_with_no_fields�7ASTConstructorTests.test_custom_subclass_with_no_fields�s=��	�S�W�W�	��h�����c�*�������r�*r!c��"SS[R5nU"5nUR[5 UR SSS5 U"SS9nURURS5 g!,(df   N1=f)Nc��\rSrSrSrSrg)�BASTConstructorTests.test_fields_but_no_field_types.<locals>.Fieldsi��r]r8N)rWrrXrYr$rZr8r!r�Fieldsr��s���Gr!r�r�r�)rrr=r>r]r.)rr�r�s   r�test_fields_but_no_field_types�2ASTConstructorTests.test_fields_but_no_field_types�s[��	�S�W�W�	��h��
�
�
�~�
.��E�E�/��q�k���������"�/�
.�s�
A.�.
A<c��"SS[R5nU"5nURURS5 U"SS9nUR	URS5 g)Nc�<�\rSrSr%SrS\S-0rSr\S-\S'Sr	g)�AASTConstructorTests.test_fields_and_types.<locals>.FieldsAndTypesi�r�r]Nr8)
rWrrXrYr$r�_field_typesr]rrZr8r!r�FieldsAndTypesr��s#���G���t��,�L� �A�s�T�z� r!r�r�r�)rrrr]r.)rr�r�s   r�test_fields_and_types�)ASTConstructorTests.test_fields_and_types�sL��	!�S�W�W�	!�
����
�
�c�e�e�T�"��q�!���������"r!c� �"SS[R5nU"SSS9nURURS5 URURS5 UR[S5 U"SS9nSSS5 g!,(df   g=f)	Nc��\rSrSrSrSrg)�;ASTConstructorTests.test_custom_attributes.<locals>.MyAttrsi�r]rWr8N)rWrrXrY�_attributesrZr8r!r�MyAttrsr�s��$�Kr!r�r�r;r�z8MyAttrs.__init__ got an unexpected keyword argument 'c'.r�)r�)rrr.r]rWr�r�)rr�r�s   r�test_custom_attributes�*ASTConstructorTests.test_custom_attributessw��	%�c�g�g�	%���Q����������"��������"�
�
"�
"��G�
��A�,�C�	
�
�
�s�/A?�?
B
c�^�"SS[R5nUR[S5 U"5nSSS5 UR	[
5 WR SSS5 U"SS9nURURS5 g!,(df   N[=f!,(df   NB=f)Nc� �\rSrSrSrS\0rSrg)�UASTConstructorTests.test_fields_and_types_no_default.<locals>.FieldsAndTypesNoDefaultir�r]r8N�rWrrXrYr$rr�rZr8r!r�FieldsAndTypesNoDefaultr�s���G���:�Lr!r�zOFieldsAndTypesNoDefault\.__init__ missing 1 required positional argument: 'a'\.r�r�)rrr�r�r=r>r]r.)rr�r�s   r� test_fields_and_types_no_default�4ASTConstructorTests.test_fields_and_types_no_defaults���	&�c�g�g�	&��
"�
"��^�
�*�+�C�	
�
�
�
�~�
.��E�E�/�%��*���������"�
�
��
/�
.�s�B
�
B�
B�
B,c��"SS[R5nUR[S5 U"5nSSS5 UR	WR
S5 UR	URS5 U"SSS9nURUR
S5 URURS5 g!,(df   N�=f)Nc�P�\rSrSr%SrS\S-0rSr\S-\S'Sr	\S-\S'Sr
g)�LASTConstructorTests.test_incomplete_field_types.<locals>.MoreFieldsThanTypesi r�r]NrWr8)rWrrXrYr$rr�r]rrWrZr8r!r�MoreFieldsThanTypesr� s1�� �G���t��,�L� �A�s�T�z� � �A�s�T�z� r!r�z;Field 'b' is missing from MoreFieldsThanTypes\._field_typesr�r;r�)rrr�r�rr]rWr.)rr�r�s   r�test_incomplete_field_types�/ASTConstructorTests.test_incomplete_field_typess���	!�#�'�'�	!��
"�
"��J�
�&�'�C�	
�
	
�
�
�c�e�e�T�"��
�
�c�e�e�T�"�!�A��+���������"��������"�
�
�s�B8�8
Cc��"SS[R5nUR[S5 U"5nSSS5 g!,(df   g=f)Nc� �\rSrSrSrS\0rSrg)�GASTConstructorTests.test_malformed_fields_with_bytes.<locals>.BadFieldsi3)s@����������������������������������������������������������������r]r8Nr�r8r!r�	BadFieldsr�3s��#�G���:�Lr!r�zField b'\\xff\\xff.*' .*)rrr�r�)rr�r�s   r� test_malformed_fields_with_bytes�4ASTConstructorTests.test_malformed_fields_with_bytes2s:��	&����	&�
�
"�
"�#5�7R�
S��+�C�T�
S�
S�s�A�
Ac��"SS[R5nU"5nURURS5 UR	UR
/5 g)Nc�T�\rSrSr%Sr\S-\\S.rSr	\S-\
S'\\\
S'Srg)�EASTConstructorTests.test_complete_field_types.<locals>._AllFieldTypesi<r�Nr]rWr8)rWrrXrYr$rr,rr�r]rrZr8r!r�_AllFieldTypesr�<s0�� �G�!$�t��$�s�)�<�L� �A�s�T�z� ��C�y�Lr!r�)rrrr]r.rW)rr�r�s   r�test_complete_field_types�-ASTConstructorTests.test_complete_field_types;sB��	�S�W�W�	�����
�
�c�e�e�T�"��������#r!c��SnUR[5 UR[U5 [R
"S0[
5S0D6 SSS5 SSS5 "SS5nUR[S5 [R
"S0U"S5S0D6 SSS5 g!,(df   N^=f!,(df   Ng=f!,(df   g=f)	Nz1got an unexpected keyword argument <object objectr�c�&�\rSrSrSrSrSrSrg)�7ASTConstructorTests.test_non_str_kwarg.<locals>.FakeStriPc��XlgrGrE)rr3s  rrd�@ASTConstructorTests.test_non_str_kwarg.<locals>.FakeStr.__init__Qs��"�
r!c�,�[UR5$rG)�hashr3r�s r�__hash__�@ASTConstructorTests.test_non_str_kwarg.<locals>.FakeStr.__hash__Ts���D�J�J�'�'r!c�N�[U[5=(a URU:H$rG)rrr3)r�others  r�__eq__�>ASTConstructorTests.test_non_str_kwarg.<locals>.FakeStr.__eq__Ws��!�%��-�E�$�*�*��2E�Er!rEN)rWrrXrYrdr�r�rZr8r!r�FakeStrr�Ps��
#�
(�
Fr!r�z got multiple values for argumentr�r8)rB)r=r@r�r�rr�rrN)r�warn_msgr�s   r�test_non_str_kwarg�&ASTConstructorTests.test_non_str_kwargHs���F�����i�(��!�!�"4�h�?��H�H�'���#��'�
@�
)�
	F�	F��
#�
#�I�/Q�
R��H�H�1�W�T�]�C�0�1�S�
R�
@�?��
)�(��S�
R�s.�B9�!B(�B9�C
�(
B6	�2B9�9
C�

Cr8N)rWrrXrYr�r�r�r�r�r�r�r�r�r�r�rZr8r!rr�r��s9��
2��&+�#�	#��
#�#�&�$�2r!r�c�,�\rSrSrSrSrSrSrSrg)�ModuleStateTestsi^c��SnSnSn[XU[RS9n[XBU5nURU[R
5 g)Nzx + 1ryrg)�flags)rprrqr��types�CodeType)rr��filenamer�rus     r�check_ast_module�!ModuleStateTests.check_ast_modulebsI���������4�4�s�7H�7H�I���x�4�0�����d�E�N�N�3r!c�F�[R"[RSS5 [RS	SSKn[RS	SSKnUR5 SSS5 AA[R"5 UR5 g!,(df   N6=f)N�_astr)r�	swap_item�sys�modulesr�r�r`)r�ast1r[s   r�test_reload_module�#ModuleStateTests.test_reload_moduleosp��
�
�
�s�{�{�F�D�
9����F�#�����F�#���!�!�#�:�
����������:�
9�s�;B�
B c�^�[5mU4Sjn[R"[RSS5 [RS	[R
"[SU5 UR5 URS[R5 SSK	nURUT5 SSS5 SSS5 g!,(df   N=f!,(df   g=f)Nc�.>�T[RU'T$rG)r�r�)rrr��lazy_mods   �r�	my_import�4ModuleStateTests.test_sys_modules.<locals>.my_import�s��� (�C�K�K����Or!r��
__import__r)rrr�r�r�r�r�r��assertNotInr�r)rr�r�r�s   @r�test_sys_modules�!ModuleStateTests.test_sys_modules�s�����8��	��
�
�s�{�{�F�D�
9����F�#��"�"�8�\�9�E��%�%�'�� � �����5���
�
�d�H�-�F�:�
9�F�E��:�
9�s$�.C�&AB>�-C�>
C	�C�
Cc�j�[S5n[R"U5nURUS5 g)Nap
            import _ast
            import ast
            import gc
            import sys
            import types

            # Create _ast.AST subclasses instances and call PyAST_Check()
            ast_tree = compile('x+1', '<string>', 'eval',
                               flags=ast.PyCF_ONLY_AST)
            code = compile(ast_tree, 'string', 'eval')
            if not isinstance(code, types.CodeType):
                raise AssertionError

            # Unloading the _ast module must not crash.
            del ast, _ast
            del sys.modules['ast'], sys.modules['_ast']
            gc.collect()
        r)rr�run_in_subinterpr.)rr�r�s   r�test_subinterpreter�$ModuleStateTests.test_subinterpreter�s5����
��&�&�&�t�,������a� r!r8N)	rWrrXrYr�r�r�r�rZr8r!rr�r�^s��4� �$.�,!r!r�c��\rSrSrSrSrg)�ASTMainTestsi�c��Sn[R"[R"U5SS9n[R"5n[
RRUS5n[USSS9nURU5 SSS5 [R"SS	U5upgSSS5 URWRS
5 URUR5URR!S5R55 URUR"S5 g!,(df   N�=f!,(df   N�=f)
Nzprint(1, 2, 3)r�r�ztest_module.pyrArrz-mrr!�utf8r)rrorzr�temp_dirrrr%r&�writer�run_python_until_endr.�err�
splitlines�out�decode�rc)rr�r��tmp_dirr�r!r�r6s        r�test_cli_file_input� ASTMainTests.test_cli_file_input�s������8�8�C�I�I�d�O�A�6��
�
�
�
!�W��w�w�|�|�G�-=�>�H��h��g�6�!�����
�7�"�7�7��e�X�N�F�C�	"�	
������#�&�����,�,�.������v�0F�0Q�0Q�0S�T��������#�
7�6��"�
!�s$�,D:�-D)�?"D:�)
D7	�3D:�:
Er8N)rWrrXrYrrZr8r!rr�r��s��$r!r�c�\�[R"U5[R"U5:H$rG)rro)r�r�s  r�comparer�s���8�8�D�>�S�X�X�e�_�,�,r!c
��\rSrSr\R
"5\R"5\R"5\R"5\R"5\R"5\R"5\R"5\R"5\R"5\R"5\R "5S.r\R$"5\R&"5\R("5S.rSrSrSr\R2"S5\R2"S54SjrS	rS
rSrSrS
rSr Sr!Sr"Sr#Sr$Sr%Sr&g)�ASTOptimizationTestsi�)�+�-r��/�%z<<z>>�|r>�&z//z**)�~rrc�P�[R"[R"US9/S9$)NrEr�)rr�r�)rr%s  r�	wrap_expr�ASTOptimizationTests.wrap_expr�s���z�z����t� 4�5�6�6r!c�,�[R"U/S9$)Nr�)rr�)r�	statements  r�wrap_statement�#ASTOptimizationTests.wrap_statement�s���z�z�	�{�+�+r!c��[R"USS9n[R"USS9nUR[XB5[R"U5S[R"U535 UR[XR5[R"U5S[R"U535 UR[XS5[R"U5S[R"U535 g)Nr�r�r�z must equal z must not equal )rrzr�rrorz)rr��non_optimized_target�optimized_target�non_optimized_tree�optimized_trees      r�
assert_ast�ASTOptimizationTests.assert_ast�s��� �Y�Y�t�b�9�����4�!�4��	
����&�=��x�x�,�-�.�l��x�x�*�+�,�
.�	
�	
����N�9��x�x�,�-�.�.>��x�x�*�+�,�
.�	
�	
����N�6��x�x�(�)�*�,��x�x��'�(�
*�	
r!r�c�F�[R"X RUUS9$)Nr�)rr�r})rrr�r�s    r�create_binop�!ASTOptimizationTests.create_binop�s���9�9�$�:�:�g�+>�e�L�Lr!c��SnURR5nUHnX-nURURU55nUR[R
"[
U5S95nURUUUS9 URXEU5 SSS5 M� SnURURS[R"[R
"SS9/S9[R
"SS955nUR[R
"[
U555nURXU5 g!,(df   GM/=f)	Nz1 %s 1rE��result_coderrz(1,) * 3r�r��r�r�)
r}r�rr$rr�rgror!r)rr��	operatorsr�r(rrs       r�test_folding_binop�'ASTOptimizationTests.test_folding_binop�s#�����J�J�O�O�%�	��B��)�K�#'�>�>�$�2C�2C�B�2G�#H� �#�~�~�c�l�l��k�AR�.S�T�����'�%9�!1���
����CS�T������#�~�~�d�.?�.?��S�Y�Y�UX�Ua�Ua�hi�Uj�Tk�El�nq�nz�nz�BC�oD�/E� F���>�>�#�,�,�t�D�z�*B�C������4D�E���s�D>�>
E	c�j^�SnTRR5nU4SjnUHxnX-nTRU"U55nTR[R"[U555nTR
UUUS9 TRXVU5 SSS5 Mz g!,(df   M�=f)Nz%s1c�p>�[R"TRU[R"S5S9$)Nr��r�r)rrrhr�)rrs �r�create_unaryop�AASTOptimizationTests.test_folding_unaryop.<locals>.create_unaryop
s%����;�;�$�,�,�w�"7����a��Q�Qr!r')rhr�rrr�rgror!)rr�r*r0r�r(rrs`       r�test_folding_unaryop�)ASTOptimizationTests.test_folding_unaryop
s�������L�L�%�%�'�	�	R��B��)�K�#'�>�>�.��2D�#E� �#�~�~�c�l�l�4��;L�.M�N�����'�%9�!1���
����CS�T����
��s�B#�#
B2	c�@^�Sn[R"5[R"5S.m[R"5[R"5S.nU4SjnTR5H�nX-nUR
U"U55nUR
[R"[R"S5X$/[R"SS9/S95nURUUUS	9 URXVU5 SSS5 M� g!,(df   M�=f)
Nznot (1 %s (1,)))�in�is)r6r5c
��>�[R"[R"5[R"[R"SS9TU/[R
"[R"SS9/S9/S9S9$)Nr�rEr)�r��ops�comparatorsr/)rrrr�r�r)rr*s �r�create_notop�;ASTOptimizationTests.test_folding_not.<locals>.create_notop3
sY����;�;�#�'�'�)�S�[�[��\�\��*��w�'�(� �Y�Y�S�\�\��-B�,C�D�E�6��
r!r�r[rEr8r')rr��Is�IsNot�NotInr�rr�r�ror!)	rr��
opt_operatorsr;r�r(rrr*s	        @r�test_folding_not�%ASTOptimizationTests.test_folding_not(
s���� ���&�&�(��&�&�(�
�	�
�)�)�+��)�)�+�
�
�
	��.�.�"�B��)�K�#'�>�>�,�r�2B�#C� �#�~�~�������a��}�7H�6I�X[�Xd�Xd�ko�Xp�Wq�r� �����'�%9�!1���
����CS�T���#���s�.D�
D	c��SnUR[R"[R"SS9[R"5[R
"[R"SS9/S9S95nUR[R"[R"[R"SS9SS	9/S
95nURXU5 g)Nz'%s' % (a,)z%srEr])r�r)r��s)r3�
conversion)r�)
rrr�r��Modrr��	JoinedStr�FormattedValuer!�rr�rrs    r�test_folding_format�(ASTOptimizationTests.test_folding_formatH
s�����#�~�~��I�I��\�\��-��7�7�9��i�i�c�h�h�#�&6�%7�8�
:� 
�� �>�>��M�M��&�&�S�X�X��-=�#�N��
�
��	
����4D�Er!c���SnUR[R"[R"S5/S95nUR[R"SS95nUR	XU5 g)Nz(1,)r�r)r[rE)rrrr�r!rIs    r�test_folding_tuple�'ASTOptimizationTests.test_folding_tuple\
sQ����#�~�~�c�i�i�c�l�l�1�o�=N�.O�P���>�>�#�,�,�T�*B�C������4D�Er!c
�d�SnS[R"54S[R"54/nSS[RS4SS[R[S	154/nUH�upEpgUH�up�UR
[R"[R"S	5U	/U"[R"S	5/S
9/S95n
UR
[R"[R"S	5U	/[R"US9/S95nURXXE4-X�5 M� M� g)
Nz
1 %s %s1%sr5znot in�[�]r[�{�}r�r)r8rE)
rr�r?rr�r�rr�r�r!)rr�r*�bracesr�r��non_optimized_comparator�optimized_comparatorr�rrrs            r�test_folding_comparator�,ASTOptimizationTests.test_folding_comparatord
s	�����C�F�F�H�%��#�)�)�+�'>�?�	�
�#�s�x�x��&�
�#�s�w�w�	�1�#��/�
��LR�G�D�1�%���'+�~�~�c�k�k����a��t�f�!9����Q��?P�!Q� R�7�(�$�$(�>�>�#�+�+����a��t�f�!$���4H�!I� J�3�$� �����D�'8� 8�:N�a�&�LRr!c��SnSS[RS4SS[R[S154/nUGHup4pVUR	[R
"[R"S[R"5S	9U"[R"S5/S
9[R"5/S95nUR	[R
"[R"S[R"5S	9[R"US9[R"5/S95nURXU4-Xx5 GM	 g)
Nzfor _ in %s1%s: passrPrQr[rRrSr�r6r�r))rHrIr�rE)rrr�r�rr�r�r0r�r=r!)	rr�rTr�r��ast_cls�optimized_iterrrs	         r�test_folding_iter�&ASTOptimizationTests.test_folding_iterw
s���%��
�#�s�x�x��&�
�#�s�w�w�	�1�#��/�
��
5;�0�D��#'�#6�#6�s�w�w��x�x�3�C�I�I�K�8��3�<�<��?�"3�4��h�h�j�\�8�$� �
 $�2�2�3�7�7��x�x�3�C�I�I�K�8��\�\��7��h�h�j�\�4� ��
�O�O�D�%�=�0�2F�Y�5;r!c
�(�SnUR[R"[R"[R"SS9/S9[R"SS9S95nUR[R"SS95nURXU5 g)Nz(1,)[0]r�rEr)r)r3r�)rrrrr�r!rIs    r�test_folding_subscript�+ASTOptimizationTests.test_folding_subscript�
sl����#�~�~��M�M��	�	����1�0E�/F� G�s�|�|�bc�Od�e� 
�� �>�>�#�,�,�Q�*?�@������4D�Er!c�P�SnURS5nSS[R4SS[R4SS[R4/nUH�upEnX-nUR[R"S[R"5[R"5/U"U[R"S	5S
9/S95nUR[R"S[R"5[R"5/U"XRS
9/S95n	URXyU5 M� g)Nzdef foo[%s = 1 + 1](): passrr��**P�P�*Ts�Tsr�r;�r�
default_value)rrr�rM)r$r�TypeVar�	ParamSpec�TypeVarTuplerr<rr=r�r!�
rr��unoptimized_binop�unoptimized_type_paramsrr�
type_paramr(rrs
          r�'test_folding_type_param_in_function_def�<ASTOptimizationTests.test_folding_type_param_in_function_def�
s��,�� �-�-�c�2��
�#�s�{�{�#�
�C����'�
�D�#�*�*�+�#
��'>�"�D�
��+�K�#�2�2����������(�(�*��!+��S�\�\�RS�_�!U� V�	� ��$(�#6�#6����������(�(�*��!+��!W� X�	�$� �
�O�O�K�?O�P�%'>r!c
��SnURS5nSS[R4SS[R4SS[R4/nUH�upEnX-nUR[R"S[R"5/U"U[R"S	5S
9/S95nUR[R"S[R"5/U"XRS
9/S95n	URXyU5 M� g)Nzclass foo[%s = 1 + 1]: passrr�rbrcrdrer�r;rf)rr�rM)
r$rrhrirjrr�r=r�r!rks
          r�$test_folding_type_param_in_class_def�9ASTOptimizationTests.test_folding_type_param_in_class_def�
s���,�� �-�-�c�2��
�#�s�{�{�#�
�C����'�
�D�#�*�*�+�#
��'>�"�D�
��+�K�#�2�2������(�(�*��!+��S�\�\�RS�_�!U� V�� ��$(�#6�#6������(�(�*��!+��!W� X��$� �
�O�O�K�?O�P�!'>r!c��SnURS5nSS[R4SS[R4SS[R4/nUH�upEnX-nUR[R"[R"S[R"5S	9U"U[R"S
5S9/[R"SS
9S95nUR[R"[R"S[R"5S	9U"XRS9/[R"SS
9S95n	URXyU5 M� g)Nztype foo[%s = 1 + 1] = 1rr�rbrcrdrer�r�r;rfr�rE)rrMr3)r$rrhrirjr�	TypeAliasr�r0r�r!rks
          r�%test_folding_type_param_in_type_alias�:ASTOptimizationTests.test_folding_type_param_in_type_alias�
s��)�� �-�-�c�2��
�#�s�{�{�#�
�C����'�
�D�#�*�*�+�#
��'>�"�D�
��+�K�#�2�2��
�
����U��	�	��<�!+��S�\�\�RS�_�!U� V��,�,�Q�/�� ��$(�#6�#6��
�
����U��	�	��<�!+��!W� X��,�,�Q�/��$� �
�O�O�K�?O�P�!'>r!r8N)'rWrrXrYrr�r��Mult�DivrF�LShift�RShift�BitOr�BitXor�BitAnd�FloorDiv�Powr}�Invertr�USubrhrrr!r�r$r+r2rArJrMrWr\r_rorrrvrZr8r!rr
r
�s��
�W�W�Y�
�W�W�Y�
�X�X�Z�
�W�W�Y�
�W�W�Y��j�j�l��j�j�l�
�Y�Y�[�
�Z�Z�\�
�Z�Z�\��l�l�n��g�g�i�

�E� �Z�Z�\�
�X�X�Z�
�X�X�Z��G�7�,�
�4*-���a�����Q��M�F�.U�&U�@F�(F�b�&Z�*F�Q�<Q�8Qr!r
�__main__)6rr�rcrorrrBr�rar��unittestr�r^�	functoolsrrr0�ImportErrorr�r�test.support.import_helperr�test.supportrr�test.support.ast_helperr	�test.test_ast.utilsr
�test.test_ast.snippetsrrr
rrr�TestCaserrTrmr%rNr�r$rDrGr�rRr�r�rr
rW�mainr8r!r�<module>r�s���
���
��	�	�
�����������:�1�0�(���
E7��!�!�E7�P MM��!�!�MM�`{=�h�'�'�{=�|c	6��)�)�c	6�L@'�H�%�%�@'�F`8�x�(�(�`8�FB
�B
�J$�+�X�->�->�$�rA�<�)=�x�?P�?P�rA�j[2�(�+�+�[2�|	���O!�x�(�(�O!��O!�d$�8�$�$�$�"-�eQ�8�,�,�eQ�P	�z���M�M�O���un�����s�F*�*F6�5F6

Youez - 2016 - github.com/yon3zu
LinuXploit