Sindbad~EG File Manager

Current Path : /proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/
Upload File :
Current File : //proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/test_unparse.cpython-312.opt-2.pyc

�

'Μg�n��F�	ddlZddlZddlZddlZddlZddlZddlmZd�Z	dZ
dZdZdZ
dZd	Zd
ZdZdZd
ZdZdZdZdZGd�deej0�ZGd�de�ZGd�de�ZGd�dej0�ZGd�de�Zedk(rej>�yy)�N)�ASTTestMixinc�z�	tj|�5}|j�cddd�S#1swYyxYw�N)�tokenize�open�read)�filename�streams  �./usr/local/lib/python3.12/test/test_unparse.py�read_pyfilers*��7�	���x�	 �F��{�{�}�
!�	 �	 �s�1�:zQdef f():
    for x in range(10):
        break
    else:
        y = 2
    z = 3
zIdef g():
    while True:
        break
    else:
        y = 2
    z = 3
zQfrom . import fred
from .. import barney
from .australia import shrimp as prawns
zzdef f():
    x = 1
    def g():
        nonlocal x
        x = 2
        y = 7
        def h():
            nonlocal x, y
zOtry:
    1 / 0
except ZeroDivisionError as e:
    raise ArithmeticError from e
z@f1(arg)
@f2
class Foo: pass
z=if cond1:
    suite1
elif cond2:
    suite2
else:
    suite3
z,if cond1:
    suite1
elif cond2:
    suite2
zctry:
    suite1
except ex1:
    suite2
except ex2:
    suite3
else:
    suite4
finally:
    suite5
zetry:
    suite1
except* ex1:
    suite2
except* ex2:
    suite3
else:
    suite4
finally:
    suite5
zwith f():
    suite1
zwith f() as x:
    suite1
z$with f() as x, g() as y:
    suite1
)�zclass foo:
    zdef foo():
    zasync def foo():
    c�4�eZdZd�Zefd�Zdd�Zdd�Zdd�Zy)�ASTTestCasec��|j||��5tj|fi|��}tj|�}tj|fi|��}|j	||�ddd�y#1swYyxYw)N)�code1�ast_parse_kwargs)�subTest�ast�parse�unparse�assertASTEqual)�selfr�kwargs�ast1�code2�ast2s      r�check_ast_roundtripzASTTestCase.check_ast_roundtrip�sc��
�\�\���\�
?��9�9�U�-�f�-�D��K�K��%�E��9�9�U�-�f�-�D�����d�+�	@�
?�
?�s�AA1�1A:c��|j|��5|j|tj|�ddd�y#1swYyxYw)N)�node)r�assertRaisesrr)rr�raisess   r�
check_invalidzASTTestCase.check_invalid�s2��
�\�\�t�\�
$����f�c�k�k�4�8�%�
$�
$�s	�">�ANc�f�|xs|}tjtj|��}||fSr)rrr�rrrs   r�
get_sourcezASTTestCase.get_source�s,���������C�I�I�e�,�-���e�|��c��|j||�\}}|j||��5|j||�ddd�y#1swYyxYw�N)rr)r%r�assertEqualr$s   r�check_src_roundtripzASTTestCase.check_src_roundtrip�sB�����u�e�4���u�
�\�\��U�\�
3����U�E�*�4�
3�
3���A�Ac��|j||�\}}|j||��5|j||�ddd�y#1swYyxYwr()r%r�assertNotEqualr$s   r�check_src_dont_roundtripz$ASTTestCase.check_src_dont_roundtrip�sB�����u�e�4���u�
�\�\��U�\�
3�����u�-�4�
3�
3�r+r)	�__name__�
__module__�__qualname__r�
ValueErrorr"r%r*r.�r&rrr�s ��,�*4�9��
+�
.r&rc�,�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d �Z"d!�Z#d"�Z$d#�Z%d$�Z&d%�Z'd&�Z(d'�Z)d(�Z*d)�Z+d*�Z,d+�Z-d,�Z.d-�Z/d.�Z0d/�Z1d0�Z2y1)2�UnparseTestCasec�$�|jd�|jd�|jd�|jd�|jd�|jd�|jd�|jd�|jd	�|jd
�|jd�|jd�|jd
�|jd�|jd�|jd�y)Nzf'a'zf'{{}}'zf'{{5}}'z	f'{{5}}5'z	f'X{{}}X'zf'{a}'zf'{ {1:2}}'zf'a{a}a'zf'a{a}{a}a'zf'a{a}a{a}a'zf'{a!r}x{a!s}12{{}}{a!a}'z	f'{a:10}'zf'{a:100_000{10}}'zf'{a!r:10}'z
f'{a:a{b}10}'zRf'a{b}{c!s}{d!r}{e!a}{f:a}{g:a{b}}{h!s:a}{j!s:{a}b}{k!s:a{b}c}{l!a:{b}c{d}}{x+y=}'�r�rs r�
test_fstringszUnparseTestCase.test_fstrings�s���� � ��(�� � ��+�� � ��,�� � ��-�� � ��-�� � ��*�� � ��/�� � ��,�� � ��/�� � ��0�� � �!<�=�� � ��-�� � �!5�6�� � ��/�� � ��1�� � �<�	
r&c��|jd�|jd�|jd�|jd�y)Nz
f'{f"{0}"*3}'z
f'{f"{y}"*3}'zf''zf"""'end' "quote\""""r7r8s r�test_fstrings_special_charsz+UnparseTestCase.test_fstrings_special_chars�s=��� � �!5�6�� � �!5�6�� � ��+�� � �!=�>r&c���|jd�|jd�|jd�|jd�|jd�|jd�|jd�y)Nzf'''{"'"}'''z%f'''-{f"""*{f"+{f'.{x}.'}+"}*"""}-'''z4f'''-{f"""*{f"+{f'.{x}.'}+"}*"""}-'single quote\''''zf"""{'''
'''}"""zf"""{g('''
''')}"""z	f"a\r\nb"zf"\u2028{'x'}"r7r8s r�test_fstrings_complicatedz)UnparseTestCase.test_fstrings_complicated�sk��� � �!3�4�� � �!R�S�� � �!b�c�� � �!:�;�� � �!=�>�� � �!2�3�� � �!6�7r&c�H�|jd�|jd�y)Nz0f" something { my_dict["key"] } something else "z!f"{f"{f"{f"{f"{f"{1+1}"}"}"}"}"}"r7r8s r�test_fstrings_pep701z$UnparseTestCase.test_fstrings_pep701�s ��� � �!S�T�� � �!D�Er&c�j�|jd�|jd�|jd�y)Nzu'foo'zr'foo'zb'foo'r7r8s r�test_stringszUnparseTestCase.test_strings�s,��� � ��*�� � ��*�� � ��*r&c�&�|jd�y)Nzdel x, y, zr7r8s r�test_del_statementz"UnparseTestCase.test_del_statement�s��� � ��/r&c�H�|jd�|jd�y)Nz45 << 2z13 >> 7r7r8s r�test_shiftszUnparseTestCase.test_shifts�s��� � ��+�� � ��+r&c�.�|jt�yr)r�for_elser8s r�
test_for_elsezUnparseTestCase.test_for_else�s��� � ��*r&c�.�|jt�yr)r�
while_elser8s r�test_while_elsezUnparseTestCase.test_while_else����� � ��,r&c��|jd�|jd�|jd�|jd�|jd�y)Nz(-1)**7z(-1.)**8z(-1j)**6znot True or FalsezTrue or not Falser7r8s r�test_unary_parensz!UnparseTestCase.test_unary_parens�sJ��� � ��+�� � ��,�� � ��,�� � �!4�5�� � �!4�5r&c�&�|jd�y)Nz3 .__abs__()r7r8s r�test_integer_parensz#UnparseTestCase.test_integer_parens�s��� � ��0r&c��|jd�|jd�|jd�|jd�y)N�1e1000z-1e1000�1e1000jz-1e1000jr7r8s r�test_huge_floatzUnparseTestCase.test_huge_float�s:��� � ��*�� � ��+�� � ��+�� � ��,r&c���|jtjtjtjtd�����tjd��y)N�nan��valuez1e1000 - 1e1000)rrrr�Constant�floatr8s r�test_nanzUnparseTestCase.test_nan�s?������I�I�c�k�k�#�,�,�U�5�\�"B�C�D��I�I�'�(�	
r&c�l�|jtd��|jtd��y)Ni�l����)r�strr8s r�test_min_intzUnparseTestCase.test_min_int�s&��� � ��Z��1�� � ��Z��1r&c��|jd�|jd�|jd�|jd�y)N�7jz-7j�0jz-0jr7r8s r�test_imaginary_literalsz'UnparseTestCase.test_imaginary_literals�s:��� � ��&�� � ��'�� � ��&�� � ��'r&c�&�|jd�y)Nz(lambda: int)()r7r8s r�test_lambda_parenthesesz'UnparseTestCase.test_lambda_parentheses����� � �!2�3r&c�H�|jd�|jd�y)Nz
1 < 4 <= 5za is b is c is not dr7r8s r�test_chained_comparisonsz(UnparseTestCase.test_chained_comparisonss��� � ��.�� � �!7�8r&c��|jd�|jd�|jd�|jd�|jd�|jd�|jd�|jd�|jd	�|jd
�|jd�|jd�y)
Nz
def f(): passzdef f(a): passzdef f(b = 2): passzdef f(a, b): passzdef f(a, b = 2): passzdef f(a = 5, b = 2): passzdef f(*, a = 1, b = 2): passzdef f(*, a = 1, b): passzdef f(*, a, b = 2): passz&def f(a, b = None, *, c, **kwds): passz'def f(a=2, *args, c=5, d, **kwds): passzdef f(*args, **kwargs): passr7r8s r�test_function_argumentsz'UnparseTestCase.test_function_argumentss���� � ��1�� � �!1�2�� � �!5�6�� � �!4�5�� � �!8�9�� � �!<�=�� � �!?�@�� � �!;�<�� � �!;�<�� � �!I�J�� � �!J�K�� � �!?�@r&c�.�|jt�yr)r�relative_importr8s r�test_relative_importz$UnparseTestCase.test_relative_import���� � ��1r&c�.�|jt�yr)r�nonlocal_exr8s r�
test_nonlocalzUnparseTestCase.test_nonlocal���� � ��-r&c�.�|jt�yr)r�
raise_fromr8s r�test_raise_fromzUnparseTestCase.test_raise_fromrLr&c�&�|jd�y)Nzb'123'r7r8s r�
test_byteszUnparseTestCase.test_bytess��� � ��*r&c��|jd�|jd�|jd�|jd�|jd�y)Nzdef f(a : int): passzdef f(a: int = 5): passzdef f(*args: [int]): passzdef f(**kwargs: dict): passzdef f() -> None: passr7r8s r�test_annotationsz UnparseTestCase.test_annotationssM��� � �!7�8�� � �!:�;�� � �!<�=�� � �!>�?�� � �!8�9r&c�&�|jd�y)Nz{'a', 'b', 'c'}r7r8s r�test_set_literalz UnparseTestCase.test_set_literal&rer&c	���|jtjtjtjg����tjd��y)N)�eltsz{*()})rrrr�Setr8s r�test_empty_setzUnparseTestCase.test_empty_set)s:������I�I�c�k�k�#�'�'�r�"2�3�4��I�I�g��	
r&c�&�|jd�y)Nz{x for x in range(5)}r7r8s r�test_set_comprehensionz&UnparseTestCase.test_set_comprehension/s��� � �!8�9r&c�&�|jd�y)Nz{x: x*x for x in range(10)}r7r8s r�test_dict_comprehensionz'UnparseTestCase.test_dict_comprehension2s��� � �!>�?r&c�.�|jt�yr)r�class_decoratorr8s r�test_class_decoratorsz%UnparseTestCase.test_class_decorators5rmr&c�&�|jd�y)Nz(class A(metaclass=type, *[], **{}): passr7r8s r�test_class_definitionz%UnparseTestCase.test_class_definition8s��� � �!K�Lr&c�X�|jt�|jt�yr)r�elif1�elif2r8s r�
test_elifszUnparseTestCase.test_elifs;s��� � ��'�� � ��'r&c�.�|jt�yr)r�try_except_finallyr8s r�test_try_except_finallyz'UnparseTestCase.test_try_except_finally?s��� � �!3�4r&c�.�|jt�yr)r�try_except_star_finallyr8s r�test_try_except_star_finallyz,UnparseTestCase.test_try_except_star_finallyBs��� � �!8�9r&c��|jd�|jd�|jd�|jd�y)Nza, *b, c = seqza, (*b, c) = seqza, *b[0], c = seqza, *(b, c) = seqr7r8s r�test_starred_assignmentz'UnparseTestCase.test_starred_assignmentEs>��� � �!1�2�� � �!3�4�� � �!4�5�� � �!3�4r&c�.�|jt�yr)r�with_simpler8s r�test_with_simplez UnparseTestCase.test_with_simpleKrqr&c�.�|jt�yr)r�with_asr8s r�test_with_aszUnparseTestCase.test_with_asNs��� � ��)r&c�.�|jt�yr)r�with_two_itemsr8s r�test_with_two_itemsz#UnparseTestCase.test_with_two_itemsQs��� � ��0r&c�H�|jd�|jd�y)Nz{**{'y': 2}, 'x': 1}z{**{'y': 2}, **{'x': 1}}r7r8s r�test_dict_unpacking_in_dictz+UnparseTestCase.test_dict_unpacking_in_dictTs ��� � �!<�=�� � �!@�Ar&c�4�|jd�|jd�|jd�|jd�|jd�|jd�|jd�|jd�|jd	�|jd
�|jd�|jd�|jd
�|jd�|jd�|jd�|jd�|jd�|jd�|jd�|jd�|jd�|jd�|jd�y)Nza[i]za[i,]za[i, j]za[(*a,)]za[*a]za[b, *a]za[*a, c]za[b, *a, c]�	a[*a, *a]za[b, *a, *a]za[*a, b, *a]za[*a, *a, b]za[b, *a, *a, c]z	a[(a:=b)]za[(a:=b,c)]�a[()]za[i:j]za[:j]za[i:]za[i:j:k]za[:j:k]za[i::k]za[i:j,]z	a[i:j, k]r7r8s r�test_sliceszUnparseTestCase.test_slicesYsS��� � ��(�� � ��)�� � ��+�� � ��,�� � ��)�� � ��,�� � ��,�� � ��/�� � ��-�� � ��0�� � ��0�� � ��0�� � �!2�3�� � ��-�� � ��/�� � ��)�� � ��*�� � ��)�� � ��)�� � ��,�� � ��+�� � ��+�� � ��+�� � ��-r&c�x�|jtjdtjd�����y)N�X��id)�exc�cause)r"r�Raise�Namer8s r�test_invalid_raisez"UnparseTestCase.test_invalid_raisets$�����3�9�9��S�X�X��5E�F�Gr&c��|jtjtjd��tjd��g���y)N�testr�rW)�values)r"r�	JoinedStrr�rYr8s r�test_invalid_fstring_valuez*UnparseTestCase.test_invalid_fstring_valuews9������M�M��H�H��'��L�L�v�.��
�	
r&c	��|jtjtjtjd��dd���d�y)Nz\\rW���)rX�
conversion�format_specz{'\\\\'})r)rr�FormattedValuerYr8s r�test_fstring_backslashz&UnparseTestCase.test_fstring_backslash�s@���������.�.�&)�l�l��&@�+-�,0���*�
	+r&c�N�|jtjd���y)NrW)r"r�	YieldFromr8s r�test_invalid_yield_fromz'UnparseTestCase.test_invalid_yield_from�s�����3�=�=�t�4�5r&c�J�tjdtjd��g��}|jtj|�d�tjdtjd��gd��}|jtj|�d�y)N�mod�x)�name)�module�nameszfrom mod import x)r�r��level)r�
ImportFrom�aliasr)r)r�trees  r�test_import_from_level_nonez+UnparseTestCase.test_import_from_level_none�sp���~�~�U�3�9�9�#�3F�2G�H��������T�*�,?�@��~�~�U�3�9�9�#�3F�2G�t�T��������T�*�,?�@r&c�@�d}|D]}|jd|�d���y)N)
zthis ends with double quote"z"this includes a """triple quote"""�
z\r�	z\t�
z\nz	
\r	\t
\nz$""">>> content = """blabla""" <<<"""z	foo\n\x00z' \'\'\'""" ""\'\' \'u🐍⛎𩸽üéş^\\X\\BB⟿z'''r7)r�
docstrings�	docstrings   r�test_docstringszUnparseTestCase.test_docstrings�s,��
�
�$�I��$�$�s�9�+�S�%9�:�$r&c��|jtjdd��d�|jtjdd��d�y)N)�)rX�kindz(1,))r���z	(1, 2, 3))r*rrYr8s r�test_constant_tuplesz$UnparseTestCase.test_constant_tuples�s;��� � ����D�t�!D�f�M�� � ��L�L�y�t�4�k�	
r&c�8�dD]}|j|d���y)N)z	() -> intz(int, int) -> intz=(Callable[complex], More[Complex(call.to_typevar())]) -> None�	func_type)�moder7)r�
function_types  r�test_function_typez"UnparseTestCase.test_function_type�s#��
�M�

�$�$�]��$�E�
r&c�8�dD]}|j|d���y)N)z
a = 5 # type:za = 5 # type: intza = 5 # type: int and morez!def x(): # type: () -> None
	passz.def x(y): # type: (int) -> None and more
	passz'async def x(): # type: () -> None
	passz4async def x(y): # type: (int) -> None and more
	passzfor x in y: # type: int
	passz#async for x in y: # type: int
	passzwith x(): # type: int
	passz!async with x(): # type: int
	passT��
type_commentsr7�r�	statements  r�test_type_commentsz"UnparseTestCase.test_type_comments�s#��
�I�
�$�$�Y�d�$�C�
r&c�8�dD]}|j|d���y)N)
za = 5 # type: ignoreza = 5 # type: ignore and morezdef x(): # type: ignore
	passz'def x(y): # type: ignore and more
	passz#async def x(): # type: ignore
	passz-async def x(y): # type: ignore and more
	passz for x in y: # type: ignore
	passz&async for x in y: # type: ignore
	passzwith x(): # type: ignore
	passz$async with x(): # type: ignore
	passTr�r7r�s  r�test_type_ignorez UnparseTestCase.test_type_ignore�s#��
�I�
�$�$�Y�d�$�C�
r&N)3r/r0r1r9r;r=r?rArCrErHrKrNrPrTr[r^rbrdrgrirlrprtrvrxrzr~r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r3r&rr5r5�s���
�*?�8�F�+�
0�,�+�-�6�1�-�
�2�(�4�9�A�2�.�-�+�:�4�
�:�@�2�M�(�5�:�5�.�*�1�B�
.�6H�
�+�6�A�;�(
�F�D� 
Dr&r5c�\�eZdZ	d�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zy)�CosmeticTestCasec��|jd�|jd�|jd�|jd�|jd�|jd�|jd�|jd�|jd	�|jd
�|jd�|jd�|jd
�|jd�|jd�|jd�|jd�|jd�|jd�|jd�|jd�|jd�|jd�|jd�|jd�|jd�|jd�|jd�y)Nz(a := b)zawait xz
x if x else yzlambda x: xz1 + 1z	1 + 2 / 3z(1 + 2) / 3z(1 + 2) * 3 + 4 * (5 + 2)z(1 + 2) * 3 + 4 * (5 + 2) ** 2z~xzx and yz
x and y and zzx and (y and x)z(x and y) and zz(x ** y) ** z ** qzx >> yzx << yzx >> y and x >> zzx + y - z * q ^ t ** kzP * V if P and V else n * R * Tz"lambda P, V, n: P * V == n * R * Tzflag & (other | foo)z
not x == yzx == (not y)zyield xzyield from xzcall((yield x))zreturn x + (yield x)�r*r8s r�test_simple_expressions_parensz/CosmeticTestCase.test_simple_expressions_parens�s���� � ��,�� � ��+�� � ��1�� � ��/�� � ��)�� � ��-�� � ��/�� � �!<�=�� � �!A�B�� � ��&�� � ��+�� � ��1�� � �!2�3�� � �!2�3�� � �!5�6�� � ��*�� � ��*�� � �!4�5�� � �!9�:�� � �!B�C�� � �!E�F�� � �!7�8�� � ��.�� � ��0�� � ��+�� � ��0�� � �!2�3�� � �!7�8r&c�X�|jd�|jd�|jd�|jd�|jd�|jd�|jd�|jd�|jd	�|jd
�y)N�class X:
    passzclass X(A):
    passzclass X(A, B, C, D):
    passzclass X(x=y):
    passzclass X(metaclass=z):
    passzclass X(x=y, z=d):
    passzclass X(A, x=y):
    passzclass X(A, **kw):
    passzclass X(*args):
    passz"class X(*args, **kwargs):
    passr�r8s r�test_class_bases_and_keywordsz.CosmeticTestCase.test_class_bases_and_keywords�s���� � �!5�6�� � �!8�9�� � �!A�B�� � �!:�;�� � �!B�C�� � �!?�@�� � �!=�>�� � �!>�?�� � �!<�=�� � �!F�Gr&c��|jd�|jd�|jd�|jd�|jd�y)Nzf'-{f'*{f'+{f'.{x}.'}+'}*'}-'zf'\u2028{'x'}'zf'{x}\n'zf'{'\n'}\n'zf'{f'{x}\n'}\n'r�r8s rr9zCosmeticTestCase.test_fstringssK��� � �!@�A�� � �!2�3�� � ��-�� � ��1�� � �!4�5r&c�V�d}tD]}|D]}|j|�|����� y)N)
z"""simple doc string"""z7"""A more complex one
            with some newlines"""z,"""Foo bar baz

            empty newline"""z"""With some 	"""z"""Foo "bar" baz """z"""\r"""z""""""z	"""'''"""z"""''''''"""u""""🐍⛎𩸽üéş^\\X\\BB⟿"""z"""end in single 'quote'"""z'''end in double "quote"'''z#"""almost end in double "quote".""")�docstring_prefixesr*)rr��prefixr�s    rr�z CosmeticTestCase.test_docstrings
s6��
�
�&)�F�'�	��(�(�F�8�I�;�)?�@�(�)r&c�|�d}tD]1}|D]*}|�|��}|j|�|j|��,�3y)N)za = """false"""z("""false""" + """unless its optimized"""z1 + 1
"""false"""z"f"""no, top level but f-fstring""")r�rr.)r�docstrings_negativer��negative�srcs     r�test_docstrings_negative_casesz/CosmeticTestCase.test_docstrings_negative_cases"sL��
��)�F�/�� ���
�+���(�(��-��-�-�c�2�0�)r&c�p�dD]}|j|�d���dD]}|j|�d���y)N)�+�-�~�1)�notz 1r�)rr�s  r�test_unary_op_factorz%CosmeticTestCase.test_unary_op_factor4s>��%�F��$�$��x�q�\�2�&��F��$�$��x�r�]�3�r&c���|jd�|jd�|jd�|jd�|jd�|jd�|jd�|jd�|jd	�|jd
�|jd�|jd�|jd
�|jd�y)Nr�za[1]za[1, 2]za[*a,]za[1, *a]za[*a, 2]za[1, *a, 2]r�za[1, *a, *a]za[*a, 1, *a]za[*a, *a, 1]za[1, *a, *a, 2]z
a[1:2, *a]z
a[*a, 1:2]r�r8s rr�zCosmeticTestCase.test_slices:s���� � ��)�� � ��(�� � ��+�	
� � ��*�� � ��,�� � ��,�� � ��/�� � ��-�� � ��0�� � ��0�� � ��0�� � �!2�3�� � ��.�� � ��.r&c��|jd�|jd�|jd�|jd�|jd�|jd�|jd�|jd�y)	Nzlambda: somethingzfour = lambda: 2 + 2zlambda x: x * 2zsquare = lambda n: n ** 2zlambda x, y: x + yzadd = lambda x, y: x + yz lambda x, y, /, z, q, *, u: Nonezlambda x, *y, **z: Noner�r8s r�test_lambda_parametersz'CosmeticTestCase.test_lambda_parametersMsz��� � �!4�5�� � �!7�8�� � �!2�3�� � �!<�=�� � �!5�6�� � �!;�<�� � �!C�D�� � �!:�;r&c��dD]I\}}dD]?}|j||��5|j|j|���ddd��A�Ky#1swY�NxYw)N))zsingle assignmentz{target} = foo)zmultiple assignmentz{target} = {target} = bar)zfor loopzfor {target} in foo:
    pass)zasync for loopz#async for {target} in foo:
    pass)�aza,za, bza, *b, cza, (b, c), dza, (b, c, d), *eza, (b, *c, d), eza, (b, *c, (d, e), f), gz[a]z[a, b]z
[a, *b, c]z[a, [b, c], d]z[a, [b, c, d], *e]z[a, [b, *c, d], e]z[a, [b, *c, [d, e], f], g]za, [b, c], dz[a, b, (c, d), (e, f)]za, b, [*c], d, e)�source_type�target)r�)rr*�format)rr��sourcer�s    r�test_star_expr_assign_targetz-CosmeticTestCase.test_star_expr_assign_targetWs]��$
��K����(�\�\�k�&�\�I��,�,�V�]�]�&�]�-I�J�J�I�)�
$
�4J�I�s�"A�Ac���|jd�|jd�|jd�|jd�|jd�|jd�|jd�y)Nz() = []z[] = ()z'() = [a] = c, = [d] = e, f = () = g = hz
a = b = c = dza, b = c, d = e, f = gz[a, b] = [c, d] = [e, f] = gza, b = [c, d] = e, f = gr�r8s r�%test_star_expr_assign_target_multiplez6CosmeticTestCase.test_star_expr_assign_target_multipleush��� � ��+�� � ��+�� � �!J�K�� � ��1�� � �!9�:�� � �!?�@�� � �!;�<r&c�X�|jd�|jd�|jd�|jd�|jd�|jd�|jd�|jd�|jd	�|jd
�y)Nzf"'''{1}\"\"\"" zf"'''{1}""\"" zf'"""{1}''' zf'"""{1}""\"' zf"'''{"\n"}""\"" zf'"""{"\n"}''' zf'"""{"\n"}""\"' zf'''"""''\'{"\n"}''' zf'''"""''\'{"\n\"'"}''' z'f'''"""''\'{"""\n\"'''""" '''\n'''}''' r7r8s r�test_multiquote_joined_stringz.CosmeticTestCase.test_multiquote_joined_string~s���� � �!;�<�� � �!6�7�� � �!4�5�� � �!7�8�� � �!:�;�� � �!8�9�� � �!;�<�� � �!?�@�� � �!C�D�� � �!U�Vr&c��ddl}|jd�}|jt|�5|j	d�ddd�|j	d�|j	d�|jt|�5|j	d�ddd�|j	d�|j	d�y#1swY�~xYw#1swY�8xYw)	Nrzinvalid escape sequence '\ 'z
f"{x:\ }" z
f"{x:\n}" zf"{x:\\ }" zf"{x:\\\ }" zf"{x:\\\n}" z
f"{x:\\\\ }" )�re�escape�assertWarnsRegex�
SyntaxWarningr)rr�msgs   r�test_backslash_in_format_specz.CosmeticTestCase.test_backslash_in_format_spec�s�����i�i�7�8��
�
"�
"�=�#�
6��$�$�%6�7�7�� � �!2�3�� � �!4�5�
�
"�
"�=�#�
6��$�$�%:�;�7�� � �!6�7�� � �!8�9�7�
6��7�
6�s�B;�>C�;C�Cc���|jd�|jd�|jd�|jd�|jd�|jd�y)Nz	f"{x:'}" z
f"{x:\'}" zf"{x:\\'}" zf'\'{x:"}' zf'\'{x:\"}' z
f'\'{x:\\"}' r7r8s r�test_quote_in_format_specz*CosmeticTestCase.test_quote_in_format_spec�s[��� � ��1�� � �!2�3�� � �!4�5�� � �!3�4�� � �!5�6�� � �!7�8r&N)r/r0r1r�r�r9r�r�r�r�r�rrrrr
r3r&rr�r��sJ��K�9�<
H�6�A�03�$4�/�&<�K�<=�W�
:�9r&r�c�8�eZdZ	d�Zd�Zd�Zd�Zd�Zd�Zd�Z	y)	�ManualASTCreationTestCasec���tjdggtj�gg��}tj|�|j	tj
|�d�y)Nr�)r��bases�keywords�body�decorator_listr�)r�ClassDef�Pass�fix_missing_locationsr)r�rrs  r�
test_classz$ManualASTCreationTestCase.test_class�sI���|�|��B��3�8�8�:�,�_a�b���!�!�$�'�������T�*�,@�Ar&c
��tjdggtj�ggtjd�g��}tj|�|jtj|�d�y)Nr��T)r�rrrr�type_paramszclass X[T]:
    pass)rrr�TypeVarrr)rrs  r�test_class_with_type_paramsz5ManualASTCreationTestCase.test_class_with_type_params�sZ���|�|��B��3�8�8�:�,�_a�*-�+�+�c�*:�);�=���!�!�$�'�������T�*�,C�Dr&c��tjdtjggdggdg��tj�ggd��}tj|�|jtj|�d�y)N�f��posonlyargs�args�vararg�
kwonlyargs�kw_defaults�kwarg�defaults�r�r#rr�returnszdef f():
    pass)r�FunctionDef�	argumentsrrr)rrs  r�
test_functionz'ManualASTCreationTestCase.test_function�sj���������2�B�t�PR�`b�jn�y{�|��(�(�*����
��	�!�!�$�'�������T�*�,@�Ar&c�0�tjdtjggdggdg��tj�ggdtjd�g��}tj
|�|j
tj|�d�y)Nr r!r�r�r#rrr*rzdef f[T]():
    pass)rr+r,rrrr)rrs  r�test_function_with_type_paramsz8ManualASTCreationTestCase.test_function_with_type_params�sy���������2�B�t�PR�`b�jn�y{�|��(�(�*�������S�)�*�

��	�!�!�$�'�������T�*�,C�Dr&c
�Z�tjdtjggdggdg��tj�ggdtjdtj
d���g��}tj|�|jtj|�d�y)Nr r!r�int)�boundr/zdef f[T: int]():
    pass)	rr+r,rrr�rr)rrs  r�(test_function_with_type_params_and_boundzBManualASTCreationTestCase.test_function_with_type_params_and_bound�s����������2�B�t�PR�`b�jn�y{�|��(�(�*�������S������@�A�

��	�!�!�$�'�������T�*�,H�Ir&c��tjdtjggdggdg��tj�ggd��}tj|�|jtj|�d�y)Nr r!r)zasync def f():
    pass)r�AsyncFunctionDefr,rrr)rrs  r�test_async_functionz-ManualASTCreationTestCase.test_async_function�sl���#�#�����2�B�t�PR�`b�jn�y{�|��(�(�*����
��	�!�!�$�'�������T�*�,F�Gr&c�0�tjdtjggdggdg��tj�ggdtjd�g��}tj
|�|j
tj|�d�y)Nr r!rr/zasync def f[T]():
    pass)rr6r,rrrr)rrs  r�$test_async_function_with_type_paramsz>ManualASTCreationTestCase.test_async_function_with_type_params�s{���#�#�����2�B�t�PR�`b�jn�y{�|��(�(�*�������S�)�*�

��	�!�!�$�'�������T�*�,I�Jr&N)
r/r0r1rrr-r0r4r7r9r3r&rrr�s/��T�B�
E�	B�
E�
J�	H�
Kr&rc�|�eZdZ	eje�jdzZeedzfZhd�Z	dZ
ed��Zd�Z
y)�DirectoryTestCasez..r�>
�test_ast.py�
test_patma.py�test_syntax.py�test_compile.py�test_fstring.py�test_grammar.py�test_tokenize.py�test_type_alias.py�test_asdl_parser.py�test_type_params.pyNc���|j�|jS|jD��cgc]C}|jd�D]-}|jj	d�s|j���/�E}}}tjjd�sT|D�chc]}|j|jvr|��}}ttj|d��}t||z�}||_|Scc}}wcc}w)Nz*.py�bad�cpu�
)�_files_to_test�test_directories�globr��
startswith�resolver��support�is_resource_enabled�run_always_files�set�random�sample�list)�cls�	directory�item�items�tests_to_run_alwayss     r�
files_to_testzDirectoryTestCase.files_to_test�s������)��%�%�%�!�1�1�
�1�	�!���v�.���9�9�'�'��.�
�L�L�N�.�
�1�	�
��|�|�/�/��6�49�#F�E�D�#'�9�9��0D�0D�#D�$(�E��#F���
�
�e�R�0�1�E���!4�4�5�E�#������/
��#Fs�AC/�!C5c� �|j�D]o}tjjrt	d|j����|j
|��5t|�}|j|�ddd��qy#1swY�|xYw)NzTesting )r	)	r[r�rO�verbose�print�absoluterrr)rrXr�s   r�
test_fileszDirectoryTestCase.test_filesso���&�&�(�D��|�|�#�#������� 1�2�3����t��,�$�T�*���(�(��0�-�,�	)�-�,�s�B�B
	)r/r0r1�pathlib�Path�__file__�parent�lib_dirrKrQrJ�classmethodr[r`r3r&rr;r;�sV��D��g�l�l�8�$�+�+�d�2�G���6�!1�2��,��
�N�����<1r&r;�__main__) �unittest�test.supportr�rarSrr�test.support.ast_helperrrrGrJrkrorsr�r�r�r�r�r�r�r�r��TestCaserr5r�rr;r/�mainr3r&r�<module>rms�������
��
�0�����
���	���
���	��	��������
��
��
��.�,�� 1� 1�.�6tD�k�tD�n	L9�{�L9�^FK�� 1� 1�FK�R21��21�j�z���H�M�M�O�r&

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists