Sh3ll
OdayForums


Server : Apache
System : Linux server1.cgrithy.com 3.10.0-1160.95.1.el7.x86_64 #1 SMP Mon Jul 24 13:59:37 UTC 2023 x86_64
User : nobody ( 99)
PHP Version : 8.1.23
Disable Function : NONE
Directory :  /opt/alt/python311/lib64/python3.11/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/alt/python311/lib64/python3.11/__pycache__/ast.cpython-311.pyc
�

�,d�����dZddlZddlTddlmZmZddlmZmZm	Z	dLddd	�d
�Z
d�ZdMdd
�d�Zd�Z
d�ZdNd�Zd�Zd�ZdOd�Zd�Zd�Zdd�d�Zd�ZGd�de��ZGd�de��Zeed��s(d �Zd!�Zeee��e_eee��e_ Gd"�d#e!��Z"d$�Z#Gd%�d&ee"�'��Z$Gd(�d)ee"�'��Z%Gd*�d+ee"�'��Z&Gd,�d-ee"�'��Z'Gd.�d/ee"�'��Z(e$e)e*e+fe%e,fe&e-fe'e!d��e.fe(e!d0��fiZ/e$e.fiZ0e.d-e!d��d-e)d&e*d&e+d&e,d)e-d+e!d0��d/iZ1Gd1�d2e2��Z3Gd3�d4e3��Z4Gd5�d6e3��Z5ee6d7��sd8�Z7d9�Z8ee7e8��e6_9Gd:�d;e:��Z;Gd<�d=e<��Z=Gd>�d?e<��Z>Gd@�dAe<��Z?dBe@ejAjBdz��zZCe	e��GdC�dD����ZDdEZEdFZFgeE�eF�RZGGdG�dHe��ZHdI�ZIdJ�ZJeKdKkreJ��dSdS)PaH
    ast
    ~~~

    The `ast` module helps Python applications to process trees of the Python
    abstract syntax grammar.  The abstract syntax itself might change with
    each Python release; this module helps to find out programmatically what
    the current grammar looks like and allows modifications of it.

    An abstract syntax tree can be generated by passing `ast.PyCF_ONLY_AST` as
    a flag to the `compile()` builtin function or by using the `parse()`
    function from this module.  The result will be a tree of objects whose
    classes all inherit from `ast.AST`.

    A modified abstract syntax tree can be compiled into a Python code object
    using the built-in `compile()` function.

    Additionally various helper functions are provided that make working with
    the trees simpler.  The main intention of the helper functions and this
    module in general is to provide an easy to use interface for libraries
    that work tightly with the python syntax (template engines for example).


    :copyright: Copyright 2008 by Armin Ronacher.
    :license: Python License.
�N)�*)�contextmanager�nullcontext)�IntEnum�auto�_simple_enum�	<unknown>�execF)�
type_comments�feature_versionc��t}|r
|tz}t|t��r|\}}|dksJ�|}n|�d}t	|||||���S)z�
    Parse the source into an AST node.
    Equivalent to compile(source, filename, mode, PyCF_ONLY_AST).
    Pass type_comments=True to get back type comments where the syntax allows.
    �N���)�_feature_version)�
PyCF_ONLY_AST�PyCF_TYPE_COMMENTS�
isinstance�tuple�compile)�source�filename�moderr�flags�major�minors        �*/opt/alt/python311/lib64/python3.11/ast.py�parser!sx��
�E��$�
�#�#���/�5�)�)��&���u���z�z�z�z����	�	 ����6�8�T�5�$3�5�5�5�5�c�������t|t��r$t|�d��d���}t|t��r|j}d���fd���fd������fd���|��S)aT
    Evaluate an expression node or a string containing only a Python
    expression.  The string or node provided may only consist of the following
    Python literal structures: strings, bytes, numbers, tuples, lists, dicts,
    sets, booleans, and None.

    Caution: A complex expression can overflow the C stack and cause a crash.
    z 	�eval�rc�f�d}t|dd��x}r|d|��z
}t|d|��z���)Nzmalformed node or string�linenoz	 on line �: )�getattr�
ValueError)�node�msg�lnos   r�_raise_malformed_nodez+literal_eval.<locals>._raise_malformed_nodeCsL��(���$��$�/�/�/�3�	%��$�s�$�$�$�C���}�D�}�}�,�-�-�-rc���t|t��r(t|j��tt
tfvr�|��|jS�N)r�Constant�type�value�int�float�complex)r'r*s �r�_convert_numz"literal_eval.<locals>._convert_numHsJ����$��)�)�	(�T�$�*�-=�-=�c�5�RY�EZ�-Z�-Z�!�!�$�'�'�'��z�rc����t|t��rQt|jttf��r0�|j��}t|jt��r|
S|S�|��Sr,)r�UnaryOp�op�UAdd�USub�operand)r'r9r3s  �r�_convert_signed_numz)literal_eval.<locals>._convert_signed_numLsq����d�G�$�$�	!��D�G�d�D�\�)J�)J�	!�"�l�4�<�0�0�G��$�'�4�(�(�
!� �y� � �y� ��|�D�!�!�!rc	����t|t��r|jSt|t��r"t	t�|j����St|t��r"tt�|j����St|t��r"tt�|j����St|t��rRt|jt��r8|jjdkr(|j|jcxkrgkrnnt��St|t"��rxt%|j��t%|j��kr�|��t+t-t�|j��t�|j������St|t.��r�t|jt2t4f��ru�|j��}�|j��}t|t:t<f��r9t|t>��r$t|jt2��r||zS||z
S�|��S)N�set) rr-r/�Tupler�map�elts�List�list�Setr<�Call�func�Name�id�args�keywords�Dict�len�keys�values�dict�zip�BinOpr6�Add�Sub�left�rightr0r1r2)r'rRrS�_convertr3r:r*s   ����rrTzliteral_eval.<locals>._convertTs*����d�H�%�%�	(��:��
��e�
$�
$�	(���X�t�y�1�1�2�2�2�
��d�
#�
#�	(���H�d�i�0�0�1�1�1�
��c�
"�
"�	(��s�8�T�Y�/�/�0�0�0���t�$�$�	(��D�I�t�)D�)D�	(��i�l�e�#�#��	�T�]�(H�(H�(H�(H�b�(H�(H�(H�(H�(H��5�5�L�
��d�
#�
#�	(��4�9�~�~��T�[�!1�!1�1�1�%�%�d�+�+�+���C��$�)�4�4���$�+�6�6�8�8�9�9�
9�
��e�
$�
$�	(��D�G�c�3�Z�)H�)H�	(�&�&�t�y�1�1�D� �L���,�,�E��$��e��-�-�
(�*�U�G�2L�2L�
(��d�g�s�+�+�(��%�<�'��%�<�'�"�"�4�(�(�(r)r�strr�lstrip�
Expression�body)�node_or_stringrTr3r:r*s @@@@r�literal_evalrZ6s��������.�#�&�&�J��~�4�4�U�;�;�&�I�I�I���.�*�-�-�-�'�,��.�.�.�
�����"�"�"�"�"�)�)�)�)�)�)�)�)�4�8�N�#�#�#rT)�indentc�������d����fd�	�t|t��std|jjz�����t�t
��sd�z��|��dS)a�
    Return a formatted dump of the tree in node.  This is mainly useful for
    debugging purposes.  If annotate_fields is true (by default),
    the returned string will show the names and the values for fields.
    If annotate_fields is false, the result string will be more compact by
    omitting unambiguous field names.  Attributes such as line
    numbers and column offsets are not dumped by default.  If this is wanted,
    include_attributes can be set to true.  If indent is a non-negative
    integer or string, then the tree will be pretty-printed with that indent
    level. None (the default) selects the single line representation.
    rc�������dz
�d��zz}d��zz}nd}d}t|t���rzt|��}g}d}�}|jD]�}	t	||��}	n#t
$rd}Y�"wxYw|	�t	||d���d}�<�|	���\}	}
|o|
}|r|�|�d|	�����l|�|	�����
rt|jrm|jD]e}	t	||��}	n#t
$rY� wxYw|	�t	||d����8�|	���\}	}
|o|
}|�|�d|	�����f|r;t|��d	kr(|j	j
�d
d�|���d�|fS|j	j
�d
|�|�|���d�dfSt|t��r.|sd
Sd|�|���fd�|D�����d�dfSt|��dfS)N��
z,
��, T.�=r�(�)F)z[]T�[c3�<�K�|]}�|���dV��dS�rN�)�.0�x�_format�levels  ��r�	<genexpr>z(dump.<locals>._format.<locals>.<genexpr>�s4�����/S�/S�����5�0A�0A�!�0D�/S�/S�/S�/S�/S�/Sr�])r�ASTr.�_fieldsr%�AttributeError�append�_attributesrJ�	__class__�__name__�joinrA�repr)r'rl�prefix�sep�clsrG�	allsimplerH�namer/�simplerk�annotate_fields�include_attributesr[s `         ����rrkzdump.<locals>._format}s��������Q�J�E��F�U�N�*�F��&�5�.�(�C�C��F��C��d�C� � �%	\��t�*�*�C��D��I�&�H���
'�
'���#�D�$�/�/�E�E��%����#�H��H������=�W�S�$��%<�%<�%D�#�H�� '���u� 5� 5�
��v�%�0�&�	��'��K�K�4�4�4��� 7�8�8�8�8��K�K��&�&�&�&�!�

9�d�&6�

9� �,�	9�	9�D�!� '��d� 3� 3����)�!�!�!� ��!�����}���d�C�)@�)@�)H� �$+�G�E�5�$9�$9�M�E�6� )� 4�f�I��K�K�4�4�4��� 7�8�8�8�8��
W�S��Y�Y�!�^�^�#'�>�#:�#:�#:�D�I�I�d�O�O�O�O�L�RV�h�V�V�!%��!8�!8�!8�&�&�#�(�(�4�.�.�.�.�Q�SX�X�X�
��d�
#�
#�	\��
"�!�z�
"�%�v�s�x�x�/S�/S�/S�/S�/S�d�/S�/S�/S�'S�'S�'S�'S�T�V[�[�[��D�z�z�4��s$�A%�%A4�3A4�&C7�7
D�Dzexpected AST, got %rN� )r)rro�	TypeErrorrtrurU)r'r~rr[rks ```@r�dumpr�qs�������. �. �. �. �. �. �. �. �. �`�d�C� � �J��.���1H�H�I�I�I�
��*�V�S�"9�"9���v����7�4�=�=���rc���dD]]}||jvrR||jvrIt||d��}|�%t||��r&|�d��rt	|||���^|S)z�
    Copy source location (`lineno`, `col_offset`, `end_lineno`, and `end_col_offset`
    attributes) from *old_node* to *new_node* if possible, and return *new_node*.
    )r#�
col_offset�
end_lineno�end_col_offsetN�end_)rsr%�hasattr�
startswith�setattr)�new_node�old_node�attrr/s    r�
copy_locationr��s���
G�/�/���8�'�'�'�D�H�4H�,H�,H��H�d�D�1�1�E�� ���$�'�'�!�,0�O�O�F�,C�,C�!���$��.�.�.���Orc�0���fd���|dddd��|S)a{
    When you compile a node tree with compile(), the compiler expects lineno and
    col_offset attributes for every node that supports them.  This is rather
    tedious to fill in for generated nodes, so this helper adds these attributes
    recursively where not already set, by setting them to the values of the
    parent node.  It works recursively starting at *node*.
    c���d|jvrt|d��s||_n|j}d|jvr t|dd���||_n|j}d|jvrt|d��s||_n|j}d|jvr t|dd���||_n|j}t|��D]}�|||||���dS)Nr#r�r�r�)rsr�r#r%r�r�r��iter_child_nodes)r'r#r�r�r��child�_fixs      �rr�z#fix_missing_locations.<locals>._fix�s����t�'�'�'��4��*�*�
%�$��������4�+�+�+��t�\�4�0�0�8�",����!�_�
��4�+�+�+��4��.�.�
-�",����!�_�
��t�/�/�/��t�-�t�4�4�<�&4��#�#�!%�!4��%�d�+�+�	H�	H�E��D���
�J��G�G�G�G�	H�	Hrr^rrh)r'r�s @r�fix_missing_locationsr��s@���H�H�H�H�H�.	�D��q�!�Q������Krr^c��t|��D]y}t|t��rt|dd��|z|_�1d|jvrt|dd��|z|_d|jvrt|dd��x}�
||z|_�z|S)z�
    Increment the line number and end line number of each node in the tree
    starting at *node* by *n*. This is useful to "move code" to a different
    location in a file.
    r#rr�)�walkr�
TypeIgnorer%r#rsr�)r'�nr�r�s    r�increment_linenor��s����d���
.�
.���e�Z�(�(�	�"�5�(�A�6�6��:�E�L���u�(�(�(�"�5�(�A�6�6��:�E�L��E�-�-�-�&�u�l�A�>�>�>��K�)�A�~�E����Krc#�hK�|jD]'}	|t||��fV��#t$rY�$wxYwdS)zs
    Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields``
    that is present on *node*.
    N)rpr%rq)r'�fields  r�iter_fieldsr��sf����
�����	����u�-�-�-�-�-�-�-���	�	�	��D�	�����s�"�
/�/c#��K�t|��D]R\}}t|t��r|V��t|t��r|D]}t|t��r|V���SdS)z�
    Yield all direct child nodes of *node*, that is, all fields that are nodes
    and all items of fields that are lists of nodes.
    N)r�rrorA)r'r|r��items    rr�r�s�����
#�4�(�(�����e��e�S�!�!�	��K�K�K�K�
��t�
$�
$�	��
�
���d�C�(�(���J�J�J���
�rc���t|ttttf��std|jjz���|jr t|jdt��sdS|jdj
}t|t��r|j}n9t|t��r"t|j
t��r|j
}ndS|rddl}|�|��}|S)aC
    Return the docstring for the given node or None if no docstring can
    be found.  If the node provided does not have docstrings a TypeError
    will be raised.

    If *clean* is `True`, all tabs are expanded to spaces and any whitespace
    that can be uniformly removed from the second line onwards is removed.
    z%r can't have docstringsrN)r�AsyncFunctionDef�FunctionDef�ClassDef�Moduler�rtrurX�Exprr/�Str�sr-rU�inspect�cleandoc)r'�clean�textr�s    r�
get_docstringr�s����d�-�{�H�f�M�N�N�N��2�T�^�5L�L�M�M�M��9���D�I�a�L�$�7�7���t��9�Q�<��D��$������v���	�D�(�	#�	#��
�4�:�s�(C�(C���z����t��&���������%�%���Krc�D�d}g}d}|t|��kro||}||z
}|dz
}|dkr)|t|��kr||dkr
|dz
}|dz
}|dvr|�|��d}|t|��k�o|r|�|��|S)z}Split a string into lines ignoring form feed and other chars.

    This mimics how the Python parser splits source code.
    rr`r^�
r_z
)rJrr)r�idx�lines�	next_line�cs     r�_splitlines_no_ffr�3s���
�C��E��I�

��F���
�
��3�K���Q��	��q�����9�9��s�6�{�{�*�*�v�c�{�d�/B�/B����I��1�H�C���;�;��L�L��#�#�#��I���F���
�
�� �
���Y�����Lrc�2�d}|D]}|dvr||z
}�|dz
}�|S)z6Replace all chars except '\f\t' in a line with spaces.r`z	r�rh)r�resultr�s   r�_pad_whitespacer�Ls:��
�F�
������;�;��a�K�F�F��c�M�F�F��Mr)�paddedc��	|j�|j�dS|jdz
}|jdz
}|j}|j}n#t$rYdSwxYwt|��}||kr4||���||����S|rBt||���d|������}nd}|||���|d����z}	||���d|����}
||dz|�}|�	d|	��|�
|
��d�|��S)aBGet source code segment of the *source* that generated *node*.

    If some location information (`lineno`, `end_lineno`, `col_offset`,
    or `end_col_offset`) is missing, return None.

    If *padded* is `True`, the first line of a multi-line statement will
    be padded with spaces to match its original position.
    Nr^r`r)r�r�r#r�rqr��encode�decoder��insertrrrv)rr'r�r#r�r�r�r��padding�first�lasts           r�get_source_segmentr�Ws�����?�"�d�&9�&A��4���q����_�q�(�
��_�
��,���������t�t�����
�f�%�%�E��V����V�}�#�#�%�%�j��&?�@�G�G�I�I�I�
��!�%��-�"6�"6�"8�"8��*��"E�"L�"L�"N�"N�O�O������e�F�m�*�*�,�,�Z�[�[�9�@�@�B�B�B�E����#�#�%�%�o�~�o�6�=�=�?�?�D��&��(�:�%�&�E�	�L�L��E����	�L�L�����
�7�7�5�>�>�s�5�"5�
A�Ac#�K�ddlm}||g��}|r>|���}|�t	|����|V�|�<dSdS)z�
    Recursively yield all descendant nodes in the tree starting at *node*
    (including *node* itself), in no specified order.  This is useful if you
    only want to modify nodes in place and don't care about the context.
    r)�dequeN)�collectionsr��popleft�extendr�)r'r��todos   rr�r�|s�����"�!�!�!�!�!��5�$��=�=�D�
���|�|�~�~�����$�T�*�*�+�+�+��
�
�
������rc�$�eZdZdZd�Zd�Zd�ZdS)�NodeVisitora<
    A node visitor base class that walks the abstract syntax tree and calls a
    visitor function for every node found.  This function may return a value
    which is forwarded by the `visit` method.

    This class is meant to be subclassed, with the subclass adding visitor
    methods.

    Per default the visitor functions for the nodes are ``'visit_'`` +
    class name of the node.  So a `TryFinally` node visit function would
    be `visit_TryFinally`.  This behavior can be changed by overriding
    the `visit` method.  If no visitor function exists for a node
    (return value `None`) the `generic_visit` visitor is used instead.

    Don't use the `NodeVisitor` if you want to apply changes to nodes during
    traversing.  For this a special visitor exists (`NodeTransformer`) that
    allows modifications.
    c�b�d|jjz}t|||j��}||��S)z
Visit a node.�visit_)rtrur%�
generic_visit)�selfr'�method�visitors    r�visitzNodeVisitor.visit�s3���D�N�3�3���$���(:�;�;���w�t�}�}�rc��t|��D]t\}}t|t��r0|D],}t|t��r|�|���-�Jt|t��r|�|���udS)z9Called if no explicit visitor function exists for a node.N)r�rrAror�)r�r'r�r/r�s     rr�zNodeVisitor.generic_visit�s���'��-�-�	"�	"�L�E�5��%��&�&�
"�!�)�)�D�!�$��,�,�)��
�
�4�(�(�(��)��E�3�'�'�
"��
�
�5�!�!�!��
	"�	"rc��|j}t�t|����}|�3t���D]\}}t||��r|}n�|�Td|z}	t
||��}ddl}|�|�d�td��||��S#t$rYnwxYw|�|��S)Nr�rz" is deprecated; add visit_Constant�)r/�_const_node_type_names�getr.�itemsrr%�warnings�warn�DeprecationWarningrqr�)	r�r'r/�	type_namerzr|r�r�r�s	         r�visit_ConstantzNodeVisitor.visit_Constant�s���
��*�.�.�t�E�{�{�;�;�	���3�9�9�;�;�
�
�	��T��e�S�)�)�� $�I��E��� ��	�)�F�
%�!�$��/�/�� �����
�
��K�K�K�0�!�5�5�5��w�t�}�}�$��
"�
�
�
���
�����!�!�$�'�'�'s�,B*�*
B7�6B7N)ru�
__module__�__qualname__�__doc__r�r�r�rhrrr�r��sK��������&���"�"�"�(�(�(�(�(rr�c��eZdZdZd�ZdS)�NodeTransformeraC
    A :class:`NodeVisitor` subclass that walks the abstract syntax tree and
    allows modification of nodes.

    The `NodeTransformer` will walk the AST and use the return value of the
    visitor methods to replace or remove the old node.  If the return value of
    the visitor method is ``None``, the node will be removed from its location,
    otherwise it is replaced with the return value.  The return value may be the
    original node in which case no replacement takes place.

    Here is an example transformer that rewrites all occurrences of name lookups
    (``foo``) to ``data['foo']``::

       class RewriteName(NodeTransformer):

           def visit_Name(self, node):
               return Subscript(
                   value=Name(id='data', ctx=Load()),
                   slice=Constant(value=node.id),
                   ctx=node.ctx
               )

    Keep in mind that if the node you're operating on has child nodes you must
    either transform the child nodes yourself or call the :meth:`generic_visit`
    method for the node first.

    For nodes that were part of a collection of statements (that applies to all
    statement nodes), the visitor may also return a list of nodes rather than
    just a single node.

    Usually you use the transformer like this::

       node = YourTransformer().visit(node)
    c���t|��D]�\}}t|t��r|g}|D]o}t|t��rC|�|��}|��/t|t��s|�|���Z|�|���p||dd�<��t|t��r9|�|��}|�t||����t|||����|Sr,)	r�rrAror�r�rr�delattrr�)r�r'r��	old_value�
new_valuesr/r�s       rr�zNodeTransformer.generic_visit�s�� +�D� 1� 1�	3�	3��E�9��)�T�*�*�
3��
�&�-�-�E�!�%��-�-�%� $�
�
�5� 1� 1�� �=�$�!+�E�3�!7�!7�%�&�-�-�e�4�4�4�$��%�%�e�,�,�,�,�)�	�!�!�!����I�s�+�+�
3��:�:�i�0�0���#��D�%�(�(�(�(��D�%��2�2�2���rN)rur�r�r�r�rhrrr�r��s.������!�!�F����rr�r�c��|jS)zDeprecated. Use value instead.�r/�r�s r�_getterr�s
���z�rc��||_dSr,r��r�r/s  r�_setterr�s
����
�
�
rc��eZdZd�Zd�ZdS)�_ABCc��d|_dS)Nz3Deprecated AST node class. Use ast.Constant instead)r�)rzrGs  r�__init__z
_ABC.__init__s
��O����rc�4�t|t��sdS|tvr^	|j}t|t|��o)t|t�|d����S#t$rYdSwxYwt�||��S)NFrh)	rr-�_const_typesr/�_const_types_notr�rqr.�__instancecheck__)rz�instr/s   rr�z_ABC.__instancecheck__s����$��)�)�	��5��,���
��
��
�u�l�3�&7�8�8�I�"�5�*:�*>�*>�s�B�*G�*G�H�H�H���"�
�
�
��u�u�
�����%�%�c�4�0�0�0s�A.�.
A<�;A<N)rur�r�r�r�rhrrr�r�s5������P�P�P�
1�
1�
1�
1�
1rr�c��|D]R}||jvr�|j�|��}|t|��krt|j�d|������S|t
vrt
|i|��St
j|g|�Ri|��S)Nz" got multiple values for argument )rp�indexrJr�rur�r-�__new__)rzrG�kwargs�key�poss     r�_newr�"s����X�X���c�k�!�!���k����$�$����T���?�?��s�|�V�V�s�V�V�W�W�W��
�l�����(��(�(�(���C�1�$�1�1�1�&�1�1�1rc��eZdZdZeZdS)�Num)r�N�rur�r�rpr�r�rhrrr�r�.��������G��G�G�Grr�)�	metaclassc��eZdZdZeZdS)r��r�Nr�rhrrr�r�2r�rr�c��eZdZdZeZdS)�Bytesr�Nr�rhrrrr6r�rrc��eZdZeZdS)�NameConstantN)rur�r�r�r�rhrrrr:s�������G�G�Grrc��eZdZdZd�ZdS)�Ellipsisrhc�^�|turtdg|�Ri|��Stj|g|�Ri|��S)N.)rr-r�)rzrGr�s   rr�zEllipsis.__new__@sJ���(�?�?��C�1�$�1�1�1�&�1�1�1����5�d�5�5�5�f�5�5�5rN)rur�r�rpr�rhrrrr=s(�������G�6�6�6�6�6rr.c��eZdZdZdS)�slicezDeprecated AST node class.N�rur�r�r�rhrrrr[s������$�$�$�$rrc��eZdZdZd�ZdS)�Indexz@Deprecated AST node class. Use the index value directly instead.c��|Sr,rh)rzr/r�s   rr�z
Index.__new__`s���rN�rur�r�r�r�rhrrrr^s)������J�J�����rrc��eZdZdZdd�ZdS)�ExtSlicez1Deprecated AST node class. Use ast.Tuple instead.rhc�P�tt|��t��fi|��Sr,)r=rA�Load)rz�dimsr�s   rr�zExtSlice.__new__es$���T�$�Z�Z����2�2�6�2�2�2rN)rhr
rhrrrrcs.������;�;�3�3�3�3�3�3rrrc��|jS)zDeprecated. Use elts instead.�r?r�s r�_dims_getterrms
���y�rc��||_dSr,rr�s  r�_dims_setterrqs
����	�	�	rc��eZdZdZdS)�Suite�/Deprecated AST node class.  Unused in Python 3.Nr	rhrrrrv�������9�9�9�9rrc��eZdZdZdS)�AugLoadrNr	rhrrrryrrrc��eZdZdZdS)�AugStorerNr	rhrrrr|rrrc��eZdZdZdS)�ParamrNr	rhrrr!r!rrr!�1ec��eZdZdZe��Ze��Ze��Ze��Ze��Z	e��Z
e��Ze��Ze��Z
e
Ze��Ze��Ze��Ze��Ze��Ze��Ze��Ze��Ze��Zd�ZdS)�_Precedencez5Precedence table that originated from python grammar.c�X�	|�|dz��S#t$r|cYSwxYw�Nr^)rtr&r�s r�nextz_Precedence.next�sA��	��>�>�$��(�+�+�+���	�	�	��K�K�K�	���s��)�)N)rur�r�r�r�
NAMED_EXPR�TUPLE�YIELD�TEST�OR�AND�NOT�CMP�EXPR�BOR�BXOR�BAND�SHIFT�ARITH�TERM�FACTOR�POWER�AWAIT�ATOMr'rhrrr$r$�s�������?�?�����J��D�F�F�E��D�F�F�E��4�6�6�D�	
����B�
�$�&�&�C�
�$�&�&�C�
�$�&�&�C��4�6�6�D�
�C��4�6�6�D��4�6�6�D��D�F�F�E��D�F�F�E��4�6�6�D�
�T�V�V�F��D�F�F�E��D�F�F�E��4�6�6�D�����rr$)�'�")z"""z'''c���eZdZdZdd�d�Zd�Zd�Zd�Zd�d	�Zd
�Z	e
d�d���Ze
dd
�d���Ze
d���Z
d�Zd�Zd�Zd�Zd�Zd�Z�fd�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-d0�Z.d1�Z/d2�Z0d3�Z1d4�Z2d5�Z3d6�Z4d7�Z5d8�Z6d9�Z7d:�Z8d;�Z9d<�Z:e;dd=�d>�Z<e;d?�d@�Z=dA�Z>dB�Z?dC�Z@dD�ZAdE�ZBdF�ZCdG�ZDdH�ZEdI�ZFdJ�ZGdK�ZHdL�ZIdM�ZJdN�ZKdO�ZLdP�ZMdQ�ZNdRdSdTdUdV�ZOePjQePjRePjRePjRdW�ZSdX�ZTdTdUdYdZd[d\d]d^d_d`dadbdcdd�
ZUePjVePjVePjWePjWePjWePjWePjXePjXePjYePjZePj[ePjWePj\de�
Z]e^df��Z_dg�Z`dhdidjdkdldmdndodpdqdr�
Zads�Zbdtdudv�ZcePjdePjedw�Zfdx�Zgdy�Zhdz�Zid{�Zjd|�Zkd}�Zld~�Zmd�Znd��Zod��Zpd��Zqd��Zrd��Zsd��Ztd��Zud��Zvd��Zwd��Zxd��Zyd��Zzd��Z{d��Z|d��Z}�xZ~S)��	_Unparserz�Methods in this class recursively traverse an AST and
    output source code for the abstract syntax; original formatting
    is disregarded.F��_avoid_backslashesc�Z�g|_i|_i|_d|_||_d|_dS)NrF)�_source�_precedences�
_type_ignores�_indentr@�_in_try_star)r�r@s  rr�z_Unparser.__init__�s6��������������"4���!����rc��t|��}	|t|����|D]}|��||���dS#t$rYdSwxYw)z7Call f on each item in seq, calling inter() in between.N)�iterr'�
StopIteration)r��inter�f�seqrjs     r�
interleavez_Unparser.interleave�s~���3�i�i��	�
�A�d�3�i�i�L�L�L��
�
���������!�����
�
���	�	�	��D�D�	���s�A�
A�Ac���t|��dkr(||d����d��dS���fd�||��dS)z�Traverse and separate the given *items* with a comma and append it to
        the buffer. If *items* is a single item sequence, a trailing comma
        will be added.r^r�,c�.����d��S�Nra��writer�s�r�<lambda>z&_Unparser.items_view.<locals>.<lambda>�����D�J�J�t�$4�$4�rN)rJrSrM)r��	traverserr�s`  r�
items_viewz_Unparser.items_view�sa����u�:�:��?�?��I�e�A�h�����J�J�s�O�O�O�O�O��O�O�4�4�4�4�i��G�G�G�G�Grc�B�|jr|�d��dSdS)z8Adds a newline if it isn't the start of generated sourcer_N)rBrSr�s r�
maybe_newlinez_Unparser.maybe_newline�s.���<�	��J�J�t������	�	rr`c�n�|���|�d|jz|z��dS)zXIndent a piece of text and append it, according to the current
        indentation levelz    N)rYrSrE�r�r�s  r�fillz_Unparser.fill�s:��	
�������
�
�6�D�L�(�4�/�0�0�0�0�0rc�:�|j�|��dS)zAdd new source partsN)rBr�r[s  rrSz_Unparser.write�s������D�!�!�!�!�!rNc#�DK�|�g}|j}||_|V�||_dSr,)rB)r��buffer�original_sources   r�bufferedz_Unparser.buffered�s2�����>��F��,���������&����r��extrac#�K�|�d��|r|�|��|xjdz
c_dV�|xjdzc_dS)aA context manager for preparing the source for blocks. It adds
        the character':', increases the indentation on enter and decreases
        the indentation on exit. If *extra* is given, it will be directly
        appended after the colon character.
        �:r^N)rSrE)r�rcs  r�blockz_Unparser.block�s^����	
�
�
�3�����	��J�J�u�����������
������������rc#�fK�|�|��dV�|�|��dS)z�A context manager for preparing the source for expressions. It adds
        *start* to the buffer and enters, after exit it adds *end*.NrR)r��start�ends   r�delimitz_Unparser.delimit�s6����
	
�
�
�5����
�����
�
�3�����rc�N�|r|�||��St��Sr,)rjr)r�rhri�	conditions    r�
delimit_ifz_Unparser.delimit_if�s(���	!��<�<��s�+�+�+��=�=� rc�^�|�dd|�|��|k��S)z,Shortcut to adding precedence related parensrcrd)rm�get_precedence)r��
precedencer's   r�require_parensz_Unparser.require_parenss+�����s�C��)<�)<�T�)B�)B�Z�)O�P�P�Prc�L�|j�|tj��Sr,)rCr�r$r+�r�r's  rroz_Unparser.get_precedences��� �$�$�T�;�+;�<�<�<rc�$�|D]}||j|<�
dSr,)rC)r�rp�nodesr's    r�set_precedencez_Unparser.set_precedences+���	1�	1�D�&0�D��d�#�#�	1�	1rc�F�t|ttttf��rt|j��dkrdS|jd}t|t��sdS|j}t|t��rt|jt��r|SdSdS)z�If a docstring node is found in the body of the *node* parameter,
        return that docstring node, None otherwise.

        Logic mirrored from ``_PyAST_GetDocString``.r^Nr)rr�r�r�r�rJrXr�r/r-rUrss  r�get_raw_docstringz_Unparser.get_raw_docstrings���
��#�[�(�F�C�
�
�	�
���^�^�a�
�
��4��y��|���$��%�%�	��4��z���d�H�%�%�	�*�T�Z��*E�*E�	��K�	�	�	�	rc�`�|j�|j��p|j}|�d|��SdS)Nz	 # type: )rDr�r#�type_comment)r�r'�comments   r�get_type_commentz_Unparser.get_type_comments>���$�(�(���5�5�J��9J����(�w�(�(�(��rc���t|t��r|D]}|�|���dSt���|��dSr,)rrA�traverse�superr�)r�r'r�rts   �rr~z_Unparser.traverse$sa����d�D�!�!�	 ��
$�
$���
�
�d�#�#�#�#�
$�
$�
�G�G�M�M�$�����rc�n�g|_|�|��d�|j��S)z�Outputs a source code string that, if converted back to an ast
        (using ast.parse) will generate an AST equivalent to *node*r`)rBr~rvrss  rr�z_Unparser.visit.s1������
�
�d�����w�w�t�|�$�$�$rc���|�|��x}r9|�|��|�|jdd���dS|�|j��dSr&)rx�_write_docstringr~rX)r�r'�	docstrings   r�"_write_docstring_and_traverse_bodyz,_Unparser._write_docstring_and_traverse_body5sm���/�/��5�5�5�I�	%��!�!�)�,�,�,��M�M�$�)�A�B�B�-�(�(�(�(�(��M�M�$�)�$�$�$�$�$rc��d�|jD��|_|�|��|j���dS)Nc�.�i|]}|jd|j����S)�ignore)r#�tag)rir�s  r�
<dictcomp>z*_Unparser.visit_Module.<locals>.<dictcomp>=s7��
�
�
��
�M�0�F�J�0�0�
�
�
r)�type_ignoresrDr��clearrss  r�visit_Modulez_Unparser.visit_Module<sW��
�
��+�
�
�
���	
�/�/��5�5�5��� � �"�"�"�"�"rc�
����dd��5���fd��j|j��ddd��n#1swxYwY��d����|j��dS)Nrcrdc�.����d��SrQrRr�s�rrTz._Unparser.visit_FunctionType.<locals>.<lambda>G�����
�
�4�(�(�r� -> )rjrMr~�argtypesrS�returnsrss` r�visit_FunctionTypez_Unparser.visit_FunctionTypeDs����
�\�\�#�s�
#�
#�	�	��O�O�(�(�(�(�$�-���
�
�
�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�
	
�
�
�6�����
�
�d�l�#�#�#�#�#s�%A	�	A
�A
c��|���|�tj|j��|�|j��dSr,)r\rvr$r*r/r~rss  r�
visit_Exprz_Unparser.visit_ExprMsD���	�	�������K�-�t�z�:�:�:��
�
�d�j�!�!�!�!�!rc�`�|�tj|��5|�tj|j|j��|�|j��|�d��|�|j��ddd��dS#1swxYwYdS)Nz := )	rqr$r(rvr:�targetr/r~rSrss  r�visit_NamedExprz_Unparser.visit_NamedExprRs���
�
 �
 ��!7��
>�
>�	&�	&����� 0�$�+�t�z�J�J�J��M�M�$�+�&�&�&��J�J�v�����M�M�$�*�%�%�%�		&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&����	&�	&�	&�	&�	&�	&s�A5B#�#B'�*B'c�z����d�����fd��j|j��dS)Nzimport c�.����d��SrQrRr�s�rrTz(_Unparser.visit_Import.<locals>.<lambda>[�����
�
�4� 0� 0�r)r\rMr~�namesrss` r�visit_Importz_Unparser.visit_ImportYs?����	�	�)�������0�0�0�0�$�-���L�L�L�L�Lrc�$����d����d|jpdz��|jr��|j����d�����fd��j|j��dS)Nzfrom �.rz import c�.����d��SrQrRr�s�rrTz,_Unparser.visit_ImportFrom.<locals>.<lambda>cr�r)r\rSrl�modulerMr~r�rss` r�visit_ImportFromz_Unparser.visit_ImportFrom]s�����	�	�'�����
�
�3�$�*�/��*�+�+�+��;�	$��J�J�t�{�#�#�#��
�
�:�������0�0�0�0�$�-���L�L�L�L�Lrc�f�|���|jD]L}|�tj|��|�|��|�d���M|�|j��|�|��x}r|�|��dSdS)N� = )	r\�targetsrvr$r)r~rSr/r|)r�r'r�rzs    r�visit_Assignz_Unparser.visit_Assignes����	�	�����l�	�	�F����� 1�6�:�:�:��M�M�&�!�!�!��J�J�u������
�
�d�j�!�!�!��0�0��6�6�6�<�	%��J�J�|�$�$�$�$�$�	%�	%rc��|���|�|j��|�d|j|jjjzdz��|�|j��dS)Nr�z= )	r\r~r�rS�binopr6rtrur/rss  r�visit_AugAssignz_Unparser.visit_AugAssignosh���	�	�����
�
�d�k�"�"�"��
�
�3���D�G�$5�$>�?�?�$�F�G�G�G��
�
�d�j�!�!�!�!�!rc���|���|�dd|jot|jt
����5|�|j��ddd��n#1swxYwY|�d��|�|j��|j	r1|�d��|�|j	��dSdS)Nrcrdr$r�)
r\rmr}rr�rEr~rS�
annotationr/rss  r�visit_AnnAssignz_Unparser.visit_AnnAssignus
���	�	����
�_�_�S�#�4�;��'X�:�d�k�SW�;X�;X�
Y�
Y�	'�	'��M�M�$�+�&�&�&�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'����	'�	'�	'�	'��
�
�4�����
�
�d�o�&�&�&��:�	&��J�J�u�����M�M�$�*�%�%�%�%�%�	&�	&s�A3�3A7�:A7c��|�d��|jr1|�d��|�|j��dSdS)N�returnr�)r\r/rSr~rss  r�visit_Returnz_Unparser.visit_ReturnsQ���	�	�(�����:�	&��J�J�s�O�O�O��M�M�$�*�%�%�%�%�%�	&�	&rc�0�|�d��dS)N�pass�r\rss  r�
visit_Passz_Unparser.visit_Pass�s���	�	�&�����rc�0�|�d��dS)N�breakr�rss  r�visit_Breakz_Unparser.visit_Break�s���	�	�'�����rc�0�|�d��dS)N�continuer�rss  r�visit_Continuez_Unparser.visit_Continue�s���	�	�*�����rc�z����d�����fd��j|j��dS)Nzdel c�.����d��SrQrRr�s�rrTz(_Unparser.visit_Delete.<locals>.<lambda>�r�r)r\rMr~r�rss` r�visit_Deletez_Unparser.visit_Delete�s?����	�	�&�������0�0�0�0�$�-���N�N�N�N�Nrc���|�d��|�|j��|jr1|�d��|�|j��dSdS)Nzassert ra)r\r~�testr(rSrss  r�visit_Assertz_Unparser.visit_Assert�sh���	�	�)�����
�
�d�i� � � ��8�	$��J�J�t�����M�M�$�(�#�#�#�#�#�	$�	$rc�z����d�����fd��j|j��dS)Nzglobal c�.����d��SrQrRr�s�rrTz(_Unparser.visit_Global.<locals>.<lambda>�r�r�r\rMrSr�rss` r�visit_Globalz_Unparser.visit_Global�s?����	�	�)�������0�0�0�0�$�*�d�j�I�I�I�I�Irc�z����d�����fd��j|j��dS)Nz	nonlocal c�.����d��SrQrRr�s�rrTz*_Unparser.visit_Nonlocal.<locals>.<lambda>�r�rr�rss` r�visit_Nonlocalz_Unparser.visit_Nonlocal�s?����	�	�+�������0�0�0�0�$�*�d�j�I�I�I�I�Irc�X�|�tj|��5|�d��|jrT|�d��|�tj|j��|�|j��ddd��dS#1swxYwYdS)N�awaitr�)rqr$r9rSr/rvr:r~rss  r�visit_Awaitz_Unparser.visit_Await�����
�
 �
 ��!2�D�
9�
9�	*�	*��J�J�w�����z�
*��
�
�3�����#�#�K�$4�d�j�A�A�A��
�
�d�j�)�)�)�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*����	*�	*�	*�	*�	*�	*��A1B�B#�&B#c�X�|�tj|��5|�d��|jrT|�d��|�tj|j��|�|j��ddd��dS#1swxYwYdS)N�yieldr�)rqr$r*rSr/rvr:r~rss  r�visit_Yieldz_Unparser.visit_Yield�r�r�c�L�|�tj|��5|�d��|jstd���|�tj|j��|�|j��ddd��dS#1swxYwYdS)Nzyield from z-Node can't be used without a value attribute.)	rqr$r*rSr/r&rvr:r~rss  r�visit_YieldFromz_Unparser.visit_YieldFrom�s���
�
 �
 ��!2�D�
9�
9�	&�	&��J�J�}�%�%�%��:�
R� �!P�Q�Q�Q����� 0�$�*�=�=�=��M�M�$�*�%�%�%�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&����	&�	&�	&�	&�	&�	&s�A+B�B� Bc�<�|�d��|js|jrtd���dS|�d��|�|j��|jr1|�d��|�|j��dSdS)N�raisez*Node can't use cause without an exception.r�z from )r\�exc�causer&rSr~rss  r�visit_Raisez_Unparser.visit_Raise�s����	�	�'�����x�	��z�
P� �!N�O�O�O��F��
�
�3�����
�
�d�h�����:�	&��J�J�x� � � ��M�M�$�*�%�%�%�%�%�	&�	&rc��|�d��|���5|�|j��ddd��n#1swxYwY|jD]}|�|���|jr[|�d��|���5|�|j��ddd��n#1swxYwY|jr^|�d��|���5|�|j��ddd��dS#1swxYwYdSdS)N�try�else�finally)r\rfr~rX�handlers�orelse�	finalbody)r�r'�exs   r�do_visit_tryz_Unparser.do_visit_try�s����	�	�%����
�Z�Z�\�\�	%�	%��M�M�$�)�$�$�$�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%����	%�	%�	%�	%��-�	�	�B��M�M�"������;�	+��I�I�f���������
+�
+��
�
�d�k�*�*�*�
+�
+�
+�
+�
+�
+�
+�
+�
+�
+�
+����
+�
+�
+�
+��>�	.��I�I�i� � � ������
.�
.��
�
�d�n�-�-�-�
.�
.�
.�
.�
.�
.�
.�
.�
.�
.�
.�
.����
.�
.�
.�
.�
.�
.�	.�	.s5�A�A�A�+C�C�C�
D5�5D9�<D9c�t�|j}	d|_|�|��||_dS#||_wxYw)NF�rFr��r�r'�prev_in_try_stars   r�	visit_Tryz_Unparser.visit_Try�sO���,��	1� %�D�����d�#�#�#� 0�D����� 0�D��0�0�0�0��.�	7c�t�|j}	d|_|�|��||_dS#||_wxYw)NTr�r�s   r�
visit_TryStarz_Unparser.visit_TryStar�sO���,��	1� $�D�����d�#�#�#� 0�D����� 0�D��0�0�0�0r�c��|�|jrdnd��|jr/|�d��|�|j��|jr/|�d��|�|j��|���5|�|j��ddd��dS#1swxYwYdS)Nzexcept*�exceptr�� as )r\rFr.rSr~r|rfrXrss  r�visit_ExceptHandlerz_Unparser.visit_ExceptHandler�s���	�	�t�0�>�)�)�h�?�?�?��9�	%��J�J�s�O�O�O��M�M�$�)�$�$�$��9�	"��J�J�v�����J�J�t�y�!�!�!�
�Z�Z�\�\�	%�	%��M�M�$�)�$�$�$�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%����	%�	%�	%�	%�	%�	%s�C�C�Cc��|���|jD],}|�d��|�|���-|�d|jz��|�dd|jp|j���5d}|jD]1}|r|�d��nd}|�|���2|jD]1}|r|�d��nd}|�|���2	ddd��n#1swxYwY|�	��5|�
|��ddd��dS#1swxYwYdS)	N�@zclass rcrd)rlFraT)rY�decorator_listr\r~r|rm�basesrHrSrfr�)r�r'�deco�comma�es     r�visit_ClassDefz_Unparser.visit_ClassDef�s����������'�	 �	 �D��I�I�c�N�N�N��M�M�$������	�	�(�T�Y�&�'�'�'�
�_�_�S�#�4�:�3N���_�
O�
O�
	!�
	!��E��Z�
!�
!���!��J�J�t�$�$�$�$� �E��
�
�a� � � � ��]�
!�
!���!��J�J�t�$�$�$�$� �E��
�
�a� � � � �
!�
	!�
	!�
	!�
	!�
	!�
	!�
	!�
	!�
	!�
	!�
	!����
	!�
	!�
	!�
	!��Z�Z�\�\�	:�	:��3�3�D�9�9�9�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:����	:�	:�	:�	:�	:�	:s%�
A5D�D�D�+E�E�Ec�2�|�|d��dS)N�def��_function_helperrss  r�visit_FunctionDefz_Unparser.visit_FunctionDefs�����d�E�*�*�*�*�*rc�2�|�|d��dS)Nz	async defr�rss  r�visit_AsyncFunctionDefz _Unparser.visit_AsyncFunctionDef
s�����d�K�0�0�0�0�0rc��|���|jD],}|�d��|�|���-|dz|jz}|�|��|�dd��5|�|j��ddd��n#1swxYwY|jr/|�d��|�|j��|�	|�
|�����5|�|��ddd��dS#1swxYwYdS)Nr�r�rcrdr�rb)rYr�r\r~r|rjrGr�rSrfr|r�)r�r'�fill_suffixr��def_strs     rr�z_Unparser._function_helper
s����������'�	 �	 �D��I�I�c�N�N�N��M�M�$�������#�d�i�/���	�	�'����
�\�\�#�s�
#�
#�	%�	%��M�M�$�)�$�$�$�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%����	%�	%�	%�	%��<�	(��J�J�v�����M�M�$�,�'�'�'�
�Z�Z�d�3�3�D�9�9�Z�
:�
:�	:�	:��3�3�D�9�9�9�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:����	:�	:�	:�	:�	:�	:s$�B(�(B,�/B,�D5�5D9�<D9c�2�|�d|��dS)Nzfor ��_for_helperrss  r�	visit_Forz_Unparser.visit_Fors�������&�&�&�&�&rc�2�|�d|��dS)Nz
async for r�rss  r�visit_AsyncForz_Unparser.visit_AsyncFors������t�,�,�,�,�,rc��|�|��|�tj|j��|�|j��|�d��|�|j��|�|�	|�����5|�|j
��ddd��n#1swxYwY|jr^|�d��|���5|�|j��ddd��dS#1swxYwYdSdS)N� in rbr�)r\rvr$r)r�r~rSrHrfr|rXr�)r�r\r's   rr�z_Unparser._for_helper"s����	�	�$�������K�-�t�{�;�;�;��
�
�d�k�"�"�"��
�
�6�����
�
�d�i� � � �
�Z�Z�d�3�3�D�9�9�Z�
:�
:�	%�	%��M�M�$�)�$�$�$�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%����	%�	%�	%�	%��;�	+��I�I�f���������
+�
+��
�
�d�k�*�*�*�
+�
+�
+�
+�
+�
+�
+�
+�
+�
+�
+�
+����
+�
+�
+�
+�
+�
+�	+�	+s$�-C�C�C�D7�7D;�>D;c��|�d��|�|j��|���5|�|j��ddd��n#1swxYwY|jr�t
|j��dkr�t|jdt��r�|jd}|�d��|�|j��|���5|�|j��ddd��n#1swxYwY|jr8t
|j��dkr t|jdt����|jr^|�d��|���5|�|j��ddd��dS#1swxYwYdSdS)Nzif r^rzelif r�)	r\r~r�rfrXr�rJr�Ifrss  r�visit_Ifz_Unparser.visit_If/sa���	�	�%�����
�
�d�i� � � �
�Z�Z�\�\�	%�	%��M�M�$�)�$�$�$�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%����	%�	%�	%�	%��k�	)�c�$�+�.�.�!�3�3�
�4�;�q�>�SU�8V�8V�3��;�q�>�D��I�I�g�����M�M�$�)�$�$�$������
)�
)��
�
�d�i�(�(�(�
)�
)�
)�
)�
)�
)�
)�
)�
)�
)�
)����
)�
)�
)�
)�	�k�	)�c�$�+�.�.�!�3�3�
�4�;�q�>�SU�8V�8V�3��;�	+��I�I�f���������
+�
+��
�
�d�k�*�*�*�
+�
+�
+�
+�
+�
+�
+�
+�
+�
+�
+�
+����
+�
+�
+�
+�
+�
+�	+�	+s6�A+�+A/�2A/�D,�,D0�3D0�&G�G�Gc��|�d��|�|j��|���5|�|j��ddd��n#1swxYwY|jr^|�d��|���5|�|j��ddd��dS#1swxYwYdSdS)Nzwhile r�)r\r~r�rfrXr�rss  r�visit_Whilez_Unparser.visit_WhileAsK���	�	�(�����
�
�d�i� � � �
�Z�Z�\�\�	%�	%��M�M�$�)�$�$�$�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%����	%�	%�	%�	%��;�	+��I�I�f���������
+�
+��
�
�d�k�*�*�*�
+�
+�
+�
+�
+�
+�
+�
+�
+�
+�
+�
+����
+�
+�
+�
+�
+�
+�	+�	+s$�A+�+A/�2A/�&C�C�Cc�2����d�����fd��j|j������|�����5��|j��ddd��dS#1swxYwYdS)Nzwith c�.����d��SrQrRr�s�rrTz&_Unparser.visit_With.<locals>.<lambda>Mr�rrb�r\rMr~r�rfr|rXrss` r�
visit_Withz_Unparser.visit_WithKs�����	�	�'�������0�0�0�0�$�-���L�L�L�
�Z�Z�d�3�3�D�9�9�Z�
:�
:�	%�	%��M�M�$�)�$�$�$�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%����	%�	%�	%�	%�	%�	%��$B�B�Bc�2����d�����fd��j|j������|�����5��|j��ddd��dS#1swxYwYdS)Nzasync with c�.����d��SrQrRr�s�rrTz+_Unparser.visit_AsyncWith.<locals>.<lambda>Sr�rrbrrss` r�visit_AsyncWithz_Unparser.visit_AsyncWithQs�����	�	�-� � � ����0�0�0�0�$�-���L�L�L�
�Z�Z�d�3�3�D�9�9�Z�
:�
:�	%�	%��M�M�$�)�$�$�$�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%����	%�	%�	%�	%�	%�	%r��quote_types�escape_special_whitespacec�������fd�}d�t|������|}d�vrd�|D��}�fd�|D��}|s>t����t�fd�|D���d��}�dd	�|gfS�rb|��fd
����|dd�d	kr1t|d��dksJ��d
d	�dz�d	z��|fS)z�Helper for writing string literals, minimizing escapes.
        Returns the tuple (string literal to write, possible quote types).
        c����s|dvr|S|dks|���s(|�d���d��S|S)Nz
	�\�unicode_escape�ascii)�isprintabler�r�)r�rs �r�escape_charz2_Unparser._str_literal_helper.<locals>.escape_char]sU���-�
��f������D�y�y��
�
���y��x�x� 0�1�1�8�8��A�A�A��Hrr`r_c�$�g|]
}|tv�|��Srh)�
_MULTI_QUOTES)ri�qs  r�
<listcomp>z1_Unparser._str_literal_helper.<locals>.<listcomp>js"��P�P�P�Q�Q�-�=O�=O�q�=O�=O�=Orc���g|]}|�v�|��	Srhrh)rir�escaped_strings  �rrz1_Unparser._str_literal_helper.<locals>.<listcomp>ks#���Q�Q�Q���.�9P�9P�1�9P�9P�9Prc3�0�K�|]}�d|v�|V��dSrgrh)rir�strings  �rrmz0_Unparser._str_literal_helper.<locals>.<genexpr>qs+�����C�C��F�1�I��N�N�!�N�N�N�N�C�Crrr^rc�(��|d�dkS)Nrrrh)rr!s �rrTz/_Unparser._str_literal_helper.<locals>.<lambda>us���q��t�~�b�7I�/I�r)r�rNr)rvr>rwr'�sortrJ)r�r#rrr�possible_quotes�quoter!s ` `   @r�_str_literal_helperz_Unparser._str_literal_helperWsU�����	�	�	�	�	�����[�&�!9�!9�:�:��%���>�!�!�P�P�/�P�P�P�O�Q�Q�Q�Q�o�Q�Q�Q���	)��&�\�\�F��C�C�C�C�[�C�C�C�V�A�Y�O�O�E��!�B�$�<�%��(�(��	Q�� � �%I�%I�%I�%I� �J�J�J��q�!�!�$��r�(:�:�:��?�1�-�.�.�!�3�3�3�3�!/����!4�t�!;�n�R�>P�!P����.�.r�rc��|�||���\}}|d}|�|�|�|����dS)zKWrite string literal value with a best effort attempt to avoid backslashes.r)rN)r(rS)r�r#r�
quote_types    r�_write_str_avoiding_backslashesz)_Unparser._write_str_avoiding_backslashes}sP��"�6�6�v�;�6�W�W���� ��^�
��
�
�j�6�&�6�*�6�6�7�7�7�7�7rc�0�|�d��|jri|���5}|�|��ddd��n#1swxYwY|�d�|����Sg}|jD]�}|���5}|�|��ddd��n#1swxYwY|�d�|��t|t��f����g}tt��}|D]5\}}|�|||���\}}|�|���6d�|��}|d}|�|�|�|����dS)NrKr`rr)
rSr@ra�_write_fstring_innerr,rvrLrrrr-rA�_ALL_QUOTESr()	r�r'r_�
fstring_partsr/�new_fstring_partsr�is_constantr+s	         r�visit_JoinedStrz_Unparser.visit_JoinedStr�s!���
�
�3�����"�	I������
0�F��)�)�$�/�/�/�
0�
0�
0�
0�
0�
0�
0�
0�
0�
0�
0����
0�
0�
0�
0��7�7�������H�H�H��
��[�	�	�E������
1�F��)�)�%�0�0�0�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1����
1�
1�
1�
1�� � �������*�U�H�"=�"=�>�
�
�
�
����;�'�'��"/�	,�	,��E�;�!%�!9�!9��'�*5�":�"�"��E�;�

�$�$�U�+�+�+�+����)�*�*�� ��^�
��
�
�j�5�%�5��5�5�6�6�6�6�6s#�A�A�A�%C�C	�C	c���t|t��r!|jD]}|�|���dSt|t��r`t|jt��rF|j�dd���dd��}|�|��dSt|t��r|�
|��dStd|�����)N�{z{{�}z}}z"Unexpected node inside JoinedStr, )r�	JoinedStrrLr.r-r/rU�replacerS�FormattedValue�visit_FormattedValuer&�r�r'r/s   rr.z_Unparser._write_fstring_inner�s����d�I�&�&�
	L���
1�
1���)�)�%�0�0�0�0�
1�
1�
��h�
'�
'�	L�J�t�z�3�,G�,G�	L��J�&�&�s�D�1�1�9�9�#�t�D�D�E��J�J�u������
��n�
-�
-�	L��%�%�d�+�+�+�+�+��J�$�J�J�K�K�Krc�
���fd�}��dd��5||j��}d|vrtd���|�d��r��d����|��|jdkr*��dt
|j������|jr/��d	����|j��ddd��dS#1swxYwYdS)
Nc����t���d���}|�tj���|��|�|��S)NTr?)r.rvr$r+r'r�)�inner�unparserr�s  �r�
unparse_innerz5_Unparser.visit_FormattedValue.<locals>.unparse_inner�sR���!�t�D�z�z�T�:�:�:�H��#�#�K�$4�$9�$9�$;�$;�U�C�C�C��>�>�%�(�(�(rr5r6rz5Unable to avoid backslash in f-string expression partr�r�!re)	rjr/r&r�rS�
conversion�chr�format_specr.)r�r'r@�exprs`   rr:z_Unparser.visit_FormattedValue�s_���	)�	)�	)�	)�	)�
�\�\�#�s�
#�
#�	<�	<� �=���,�,�D��t�|�|� �K�������s�#�#�
 ��
�
�3�����J�J�t������"�$�$��
�
�5�s�4�?�3�3�5�5�6�6�6���
<��
�
�3�����)�)�$�*:�;�;�;�	<�	<�	<�	<�	<�	<�	<�	<�	<�	<�	<�	<����	<�	<�	<�	<�	<�	<s�CC8�8C<�?C<c�:�|�|j��dSr,)rSrFrss  r�
visit_Namez_Unparser.visit_Name�s���
�
�4�7�����rc��|���|jdkr|�d��|�|jt
���dS)N�ur))r\�kindrSr,r/rrss  rr�z_Unparser._write_docstring�sL���	�	�����9�����J�J�s�O�O�O��,�,�T�Z�]�,�S�S�S�S�Src
��t|ttf��rb|�t	|���dt���ddt�dt�d�����dS|jr,t|t��r|�	|��dS|�t	|����dS)N�inf�nanrc�-rd)
rr1r2rSrwr8�_INFSTRr@rUr,r�s  r�_write_constantz_Unparser._write_constant�s����e�e�W�-�.�.�	$�
�J�J��U�������(�(���� 8�G� 8� 8�g� 8� 8� 8�9�9�
�
�
�
�
�
�
$�	$��E�3�)?�)?�	$��0�0��7�7�7�7�7��J�J�t�E�{�{�#�#�#�#�#rc��|j}t|t��rL|�dd��5|�|j|��ddd��dS#1swxYwYdS|dur|�d��dS|jdkr|�d��|�|j��dS)Nrcrd.�...rI)r/rrrjrWrPrSrJr;s   rr�z_Unparser.visit_Constant�s���
���e�U�#�#�	-����c�3�'�'�
=�
=����� 4�e�<�<�<�
=�
=�
=�
=�
=�
=�
=�
=�
=�
=�
=�
=����
=�
=�
=�
=�
=�
=�
�c�\�\��J�J�u�������y�C����
�
�3����� � ���,�,�,�,�,s�A�A �#A c�����dd��5���fd��j|j��ddd��dS#1swxYwYdS)Nrernc�.����d��SrQrRr�s�rrTz&_Unparser.visit_List.<locals>.<lambda>�rUr)rjrMr~r?rss` r�
visit_Listz_Unparser.visit_List�s����
�\�\�#�s�
#�
#�	P�	P��O�O�4�4�4�4�d�m�T�Y�O�O�O�	P�	P�	P�	P�	P�	P�	P�	P�	P�	P�	P�	P����	P�	P�	P�	P�	P�	P��%A
�
A�Ac���|�dd��5|�|j��|jD]}|�|���	ddd��dS#1swxYwYdS)Nrern�rjr~�elt�
generators�r�r'�gens   r�visit_ListCompz_Unparser.visit_ListComp����
�\�\�#�s�
#�
#�	#�	#��M�M�$�(�#�#�#���
#�
#���
�
�c�"�"�"�"�
#�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#����	#�	#�	#�	#�	#�	#��:A�A#�&A#c���|�dd��5|�|j��|jD]}|�|���	ddd��dS#1swxYwYdS)NrcrdrXr[s   r�visit_GeneratorExpz_Unparser.visit_GeneratorExp�r^r_c���|�dd��5|�|j��|jD]}|�|���	ddd��dS#1swxYwYdS)Nr5r6rXr[s   r�
visit_SetCompz_Unparser.visit_SetComp�r^r_c�6�|�dd��5|�|j��|�d��|�|j��|jD]}|�|���	ddd��dS#1swxYwYdS)Nr5r6r$)rjr~r�rSr/rZr[s   r�visit_DictCompz_Unparser.visit_DictComps���
�\�\�#�s�
#�
#�	#�	#��M�M�$�(�#�#�#��J�J�t�����M�M�$�*�%�%�%���
#�
#���
�
�c�"�"�"�"�
#�		#�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#����	#�	#�	#�	#�	#�	#s�A)B�B�Bc��|jr|�d��n|�d��|�tj|j��|�|j��|�d��|jtj���|j	g|j
�R�|�|j	��|j
D],}|�d��|�|���-dS)Nz async for z for r� if )�is_asyncrSrvr$r)r�r~r+r'rH�ifs)r�r'�	if_clauses   r�visit_comprehensionz_Unparser.visit_comprehension
s����=�	 ��J�J�}�%�%�%�%��J�J�w�������K�-�t�{�;�;�;��
�
�d�k�"�"�"��
�
�6�������K�,�1�1�3�3�T�Y�J���J�J�J�J��
�
�d�i� � � ���	%�	%�I��J�J�v�����M�M�)�$�$�$�$�	%�	%rc�,�|�tj|��5|�tj���|j|j��|�|j��|�d��|�|j��|�d��|�tj|j	��|�|j	��ddd��dS#1swxYwYdS)Nrgz else )
rqr$r+rvr'rXr�r~rSr�rss  r�visit_IfExpz_Unparser.visit_IfExps%��
�
 �
 ��!1�4�
8�
8�	'�	'����� 0� 5� 5� 7� 7���D�I�N�N�N��M�M�$�)�$�$�$��J�J�v�����M�M�$�)�$�$�$��J�J�x� � � ����� 0�$�+�>�>�>��M�M�$�+�&�&�&�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'����	'�	'�	'�	'�	'�	's�CD	�	D
�D
c����|jrU��dd��5���fd��j|j��ddd��dS#1swxYwYdS��d��dS)Nr5r6c�.����d��SrQrRr�s�rrTz%_Unparser.visit_Set.<locals>.<lambda>%s����
�
�4�(8�(8�rz{*()})r?rjrMr~rSrss` r�	visit_Setz_Unparser.visit_Set"s�����9�	 ����c�3�'�'�
T�
T���� 8� 8� 8� 8�$�-���S�S�S�
T�
T�
T�
T�
T�
T�
T�
T�
T�
T�
T�
T����
T�
T�
T�
T�
T�
T�

�J�J�w�����s�%A�A�Ac	������fd����fd�}��dd��5���fd�|t|j|j����ddd��dS#1swxYwYdS)Nc�����|����d����|��dS�Nr$�r~rS)�k�vr�s  �r�write_key_value_pairz2_Unparser.visit_Dict.<locals>.write_key_value_pair,s?����M�M�!�����J�J�t�����M�M�!�����rc����|\}}|�L��d����tj|����|��dS�||��dS)N�**)rSrvr$r0r~)r�rurvr�rws   ��r�
write_itemz(_Unparser.visit_Dict.<locals>.write_item1so����D�A�q��y��
�
�4� � � ��#�#�K�$4�a�8�8�8��
�
�a� � � � � �$�$�Q��*�*�*�*�*rr5r6c�.����d��SrQrRr�s�rrTz&_Unparser.visit_Dict.<locals>.<lambda>>r�r)rjrMrNrKrL)r�r'rzrws`  @r�
visit_Dictz_Unparser.visit_Dict+s�����	�	�	�	�	�
		+�		+�		+�		+�		+�		+��\�\�#�s�
#�
#�	�	��O�O�(�(�(�(�*�c�$�)�T�[�6Q�6Q�
�
�
�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s�3A$�$A(�+A(c��|�ddt|j��dkp"|�|��tjk��5|�|j|j��ddd��dS#1swxYwYdS)Nrcrdr)rmrJr?ror$r)rWr~rss  r�visit_Tuplez_Unparser.visit_TupleAs���
�_�_�����	�N�N�a��P�4�#6�#6�t�#<�#<�{�?P�#P�
�
�	6�	6�

�O�O�D�M�4�9�5�5�5�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6����	6�	6�	6�	6�	6�	6s�!A?�?B�B�~�not�+rN)�Invert�Notr7r8)r�rr�rNc��|j|jjj}|j|}|�||��5|�|��|tjur|�d��|�	||j
��|�|j
��ddd��dS#1swxYwYdS�Nr�)�unopr6rtru�unop_precedencerqrSr$r7rvr9r~)r�r'�operator�operator_precedences    r�
visit_UnaryOpz_Unparser.visit_UnaryOpQs����9�T�W�.�7�8��"�2�8�<��
�
 �
 �!4�d�
;�
;�	(�	(��J�J�x� � � �#�+�*<�<�<��
�
�3������� 3�T�\�B�B�B��M�M�$�,�'�'�'�	(�	(�	(�	(�	(�	(�	(�	(�	(�	(�	(�	(����	(�	(�	(�	(�	(�	(s�A.B;�;B?�B?rr��/�%�<<�>>�|�^�&�//ry)
rPrQ�Mult�MatMult�Div�Mod�LShift�RShift�BitOr�BitXor�BitAnd�FloorDiv�Pow)
r�rNrr�r�r�r�r�r�r�r�r�ry)ryc�(�|j|jjj}|j|}|�||��5||jvr|���}|}n|}|���}|�||j	��|�
|j	��|�d|�d���|�||j��|�
|j��ddd��dS#1swxYwYdSr�)
r�r6rtru�binop_precedencerq�binop_rassocr'rvrRr~rSrS)r�r'r�r��left_precedence�right_precedences      r�visit_BinOpz_Unparser.visit_BinOp~sQ���:�d�g�/�8�9��"�3�H�=��
�
 �
 �!4�d�
;�
;�	&�	&��4�,�,�,�"5�":�":�"<�"<��#6� � �"5��#6�#;�#;�#=�#=� �������;�;�;��M�M�$�)�$�$�$��J�J��8����'�'�'���� 0�$�*�=�=�=��M�M�$�*�%�%�%�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&����	&�	&�	&�	&�	&�	&s�B:D�D�Dz==z!=�<z<=�>z>=�iszis not�inznot in)
�Eq�NotEq�Lt�LtE�Gt�GtE�Is�IsNot�In�NotInc���|�tj|��5|jtj���|jg|j�R�|�|j��t|j	|j��D]J\}}|�
d|j|jj
zdz��|�|���K	ddd��dS#1swxYwYdSr�)rqr$r/rvr'rR�comparatorsr~rN�opsrS�cmpopsrtru)r�r'�or�s    r�
visit_Comparez_Unparser.visit_Compare�s&��
�
 �
 ���$�
7�
7�	!�	!��D���� 4� 4� 6� 6��	�U�D�DT�U�U�U�U��M�M�$�)�$�$�$��D�H�d�&6�7�7�
!�
!���1��
�
�3���Q�[�-A�!B�B�S�H�I�I�I��
�
�a� � � � �
!�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!����	!�	!�	!�	!�	!�	!s�B5C$�$C(�+C(�and�or)�And�Or)r�r�c������j|jjj}�j|���fd�}���|��5d|�d������fd�||j��ddd��dS#1swxYwYdS)Nc�����������|����|��dSr,)r'rvr~)r'r�r�s ��r�increasing_level_traversez9_Unparser.visit_BoolOp.<locals>.increasing_level_traverse�sD���"5�":�":�"<�"<����� 3�T�:�:�:��M�M�$�����rr�c�.�������Sr,rR)r�r�s��rrTz(_Unparser.visit_BoolOp.<locals>.<lambda>�s���D�J�J�q�M�M�r)�boolopsr6rtru�boolop_precedencerqrMrL)r�r'r�r�r�r�s`   @@r�visit_BoolOpz_Unparser.visit_BoolOp�s	������<��� 1� :�;��"�4�X�>��	 �	 �	 �	 �	 �	 ��
 �
 �!4�d�
;�
;�	[�	[��H����A��O�O�1�1�1�1�1�3L�d�k�Z�Z�Z�	[�	[�	[�	[�	[�	[�	[�	[�	[�	[�	[�	[����	[�	[�	[�	[�	[�	[s�	'A=�=B�Bc�~�|�tj|j��|�|j��t|jt��r4t|jjt��r|�d��|�d��|�|j	��dS)Nr�r�)
rvr$r:r/r~rr-r0rSr�rss  r�visit_Attributez_Unparser.visit_Attribute�s������K�,�d�j�9�9�9��
�
�d�j�!�!�!��d�j�(�+�+�	�
�4�:�;K�S�0Q�0Q�	��J�J�s�O�O�O��
�
�3�����
�
�4�9�����rc���|�tj|j��|�|j��|�dd��5d}|jD]1}|r|�d��nd}|�|���2|jD]1}|r|�d��nd}|�|���2	ddd��dS#1swxYwYdS)NrcrdFraT)	rvr$r:rDr~rjrGrSrH)r�r'r�r�s    r�
visit_Callz_Unparser.visit_Call�sC�����K�,�d�i�8�8�8��
�
�d�i� � � �
�\�\�#�s�
#�
#�
	!�
	!��E��Y�
!�
!���!��J�J�t�$�$�$�$� �E��
�
�a� � � � ��]�
!�
!���!��J�J�t�$�$�$�$� �E��
�
�a� � � � �
!�
	!�
	!�
	!�
	!�
	!�
	!�
	!�
	!�
	!�
	!�
	!�
	!����
	!�
	!�
	!�
	!�
	!�
	!s�A5C�C� Cc��d�}|�tj|j��|�|j��|�dd��5||j��r&|�|j|jj��n|�|j��ddd��dS#1swxYwYdS)Nc�:�t|t��o|jSr,)rr=r?)�slice_values r�is_non_empty_tuplez5_Unparser.visit_Subscript.<locals>.is_non_empty_tuple�s���;��.�.�%��$�
rrern)	rvr$r:r/r~rjrrWr?)r�r'r�s   r�visit_Subscriptz_Unparser.visit_Subscript�s��	�	�	�	
���K�,�d�j�9�9�9��
�
�d�j�!�!�!�
�\�\�#�s�
#�
#�	*�	*�!�!�$�*�-�-�
*�����
�t�z��?�?�?�?��
�
�d�j�)�)�)�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*����	*�	*�	*�	*�	*�	*s�AB7�7B;�>B;c��|�d��|�tj|j��|�|j��dS)Nr)rSrvr$r0r/r~rss  r�
visit_Starredz_Unparser.visit_Starred�sF���
�
�3�������K�,�d�j�9�9�9��
�
�d�j�!�!�!�!�!rc�0�|�d��dS)NrRrRrss  r�visit_Ellipsisz_Unparser.visit_Ellipsis�s���
�
�5�����rc�$�|jr|�|j��|�d��|jr|�|j��|jr1|�d��|�|j��dSdS)Nre)�lowerr~rS�upper�steprss  r�visit_Slicez_Unparser.visit_Slice�s����:�	&��M�M�$�*�%�%�%��
�
�3�����:�	&��M�M�$�*�%�%�%��9�	%��J�J�s�O�O�O��M�M�$�)�$�$�$�$�$�	%�	%rc��|�d��|�|j��|���5|jD]}|�|���	ddd��dS#1swxYwYdS)Nzmatch )r\r~�subjectrf�cases)r�r'�cases   r�visit_Matchz_Unparser.visit_Match�s����	�	�(�����
�
�d�l�#�#�#�
�Z�Z�\�\�	$�	$��
�
$�
$���
�
�d�#�#�#�#�
$�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$����	$�	$�	$�	$�	$�	$s� A2�2A6�9A6c��|�|j��|jr1|�d��|�|j��dSdSrs)rS�argr�r~rss  r�	visit_argz_Unparser.visit_arg�sV���
�
�4�8�����?�	+��J�J�t�����M�M�$�/�*�*�*�*�*�	+�	+rc�8�d}|j|jz}dgt|��t|j��z
z|jz}t	t||��d��D]�\}}|\}}|rd}n|�d��|�|��|r*|�d��|�|��|t|j��kr|�d����|js|j	r�|rd}n|�d��|�d��|jr_|�|jj
��|jjr4|�d��|�|jj��|j	rvt|j	|j��D][\}}|�d��|�|��|r*|�d��|�|���\|j
r~|rd}n|�d��|�d	|j
j
z��|j
jr8|�d��|�|j
j��dSdSdS)
NTr^Frarbz, /rr$ry)�posonlyargsrGrJ�defaults�	enumeraterNrSr~�vararg�
kwonlyargsr�r��kw_defaults�kwarg)	r�r'r��all_argsr�r��elements�a�ds	         r�visit_argumentsz_Unparser.visit_argumentss������#�d�i�/���6�S��]�]�S���-?�-?�?�@�4�=�P��(��X�x�)@�)@�!�D�D�	"�	"�O�E�8��D�A�q��
!�����
�
�4� � � ��M�M�!�����
!��
�
�3�����
�
�a� � � ���D�,�-�-�-�-��
�
�5�!�!�!���;�
	:�$�/�
	:��
!�����
�
�4� � � ��J�J�s�O�O�O��{�
:��
�
�4�;�?�+�+�+��;�)�:��J�J�t�$�$�$��M�M�$�+�"8�9�9�9��?�	%��D�O�T�-=�>�>�
%�
%���1��
�
�4� � � ��
�
�a� � � ��%��J�J�s�O�O�O��M�M�!�$�$�$���:�	5��
!�����
�
�4� � � ��J�J�t�d�j�n�,�-�-�-��z�$�
5��
�
�4� � � ��
�
�d�j�3�4�4�4�4�4�	5�	5�
5�
5rc���|j�|�d��n/|�|j��|�d��|�|j��dS)Nryrb)r�rSr~r/rss  r�
visit_keywordz_Unparser.visit_keyword4s\���8���J�J�t������J�J�t�x� � � ��J�J�s�O�O�O��
�
�d�j�!�!�!�!�!rc��|�tj|��5|�d��|���5}|�|j��ddd��n#1swxYwY|r|jdg|�R�|�d��|�tj|j��|�|j��ddd��dS#1swxYwYdS)N�lambdar�r$)	rqr$r+rSrar~rGrvrX)r�r'r_s   r�visit_Lambdaz_Unparser.visit_Lambda<sh��
�
 �
 ��!1�4�
8�
8�	%�	%��J�J�x� � � ������
)�F��
�
�d�i�(�(�(�
)�
)�
)�
)�
)�
)�
)�
)�
)�
)�
)����
)�
)�
)�
)��
)���
�3�(��(�(�(�(��J�J�t�������� 0�$�)�<�<�<��M�M�$�)�$�$�$�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%����	%�	%�	%�	%�	%�	%s6�*C.�A2�&C.�2A6	�6C.�9A6	�:A'C.�.C2�5C2c��|�|j��|jr|�d|jz��dSdS�Nr�)rSr|�asnamerss  r�visit_aliasz_Unparser.visit_aliasGsI���
�
�4�9�����;�	-��J�J�v���+�,�,�,�,�,�	-�	-rc��|�|j��|jr1|�d��|�|j��dSdSr�)r~�context_expr�
optional_varsrSrss  r�visit_withitemz_Unparser.visit_withitemLsY���
�
�d�'�(�(�(���	.��J�J�v�����M�M�$�,�-�-�-�-�-�	.�	.rc�^�|�d��|�|j��|jr/|�d��|�|j��|���5|�|j��ddd��dS#1swxYwYdS)Nzcase rg)r\r~�pattern�guardrSrfrXrss  r�visit_match_casez_Unparser.visit_match_caseRs����	�	�'�����
�
�d�l�#�#�#��:�	&��J�J�v�����M�M�$�*�%�%�%�
�Z�Z�\�\�	%�	%��M�M�$�)�$�$�$�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%����	%�	%�	%�	%�	%�	%s�:B"�"B&�)B&c�:�|�|j��dSr,)r~r/rss  r�visit_MatchValuez_Unparser.visit_MatchValue[s���
�
�d�j�!�!�!�!�!rc�:�|�|j��dSr,)rPr/rss  r�visit_MatchSingletonz_Unparser.visit_MatchSingleton^s�����T�Z�(�(�(�(�(rc�����dd��5���fd��j|j��ddd��dS#1swxYwYdS)Nrernc�.����d��SrQrRr�s�rrTz/_Unparser.visit_MatchSequence.<locals>.<lambda>dr�r)rjrMr~�patternsrss` r�visit_MatchSequencez_Unparser.visit_MatchSequenceas����
�\�\�#�s�
#�
#�	�	��O�O�(�(�(�(�$�-���
�
�
�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	rVc�L�|j}|�d}|�d|����dS)N�_r)r|rS)r�r'r|s   r�visit_MatchStarz_Unparser.visit_MatchStargs1���y���<��D��
�
�:�t�:�:�����rc
�L���fd�}��dd��5|j}���fd�|t||jd�����|j}|�/|r��d����d|����ddd��dS#1swxYwYdS)	Nc���|\}}��|����d����|��dSrsrt)�pairru�pr�s   �r�write_key_pattern_pairz<_Unparser.visit_MatchMapping.<locals>.write_key_pattern_pairnsH����D�A�q��M�M�!�����J�J�t�����M�M�!�����rr5r6c�.����d��SrQrRr�s�rrTz._Unparser.visit_MatchMapping.<locals>.<lambda>wr�rT��strictrary)rjrKrMrNr�restrS)r�r'r
rKrs`    r�visit_MatchMappingz_Unparser.visit_MatchMappingms���	�	�	�	�	��\�\�#�s�
#�
#�	(�	(��9�D��O�O�(�(�(�(�&��D�$�-��5�5�5�
�
�
�
�9�D����%��J�J�t�$�$�$��
�
�;��;�;�'�'�'�	(�	(�	(�	(�	(�	(�	(�	(�	(�	(�	(�	(����	(�	(�	(�	(�	(�	(s�A/B�B� Bc
������tj|j����|j����dd��5|j}���fd��j|��|j}|rK�fd�}|r��	d�����fd�|t||jd�����ddd��dS#1swxYwYdS)	Nrcrdc�.����d��SrQrRr�s�rrTz,_Unparser.visit_MatchClass.<locals>.<lambda>�r�rc�l��|\}}��|�d�����|��dS)Nrb)rSr~)rr�r�r�s   �r�write_attr_patternz6_Unparser.visit_MatchClass.<locals>.write_attr_pattern�s<���$(�M�D�'��J�J�$�z�z�z�*�*�*��M�M�'�*�*�*�*�*rrac�.����d��SrQrRr�s�rrTz,_Unparser.visit_MatchClass.<locals>.<lambda>�s���D�J�J�t�,�,�rTr)rvr$r:rzr~rjrrM�	kwd_attrsrSrN�kwd_patterns)r�r'r�attrsrs`    r�visit_MatchClassz_Unparser.visit_MatchClass�sY������K�,�d�h�7�7�7��
�
�d�h����
�\�\�#�s�
#�
#�	�	��}�H��O�O�(�(�(�(�$�-��
�
�
��N�E��
�+�+�+�+�+�
�%��J�J�t�$�$�$����,�,�,�,�&���t�0��>�>�>����	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s�A;C�C#�&C#c��|j}|j}|�|�d��dS|�|�|j��dS|�tj|��5|�tj|j��|�|j��|�d|j����ddd��dS#1swxYwYdS)Nrr�)	r|r�rSrqr$r+rvr1r~)r�r'r|r�s    r�
visit_MatchAsz_Unparser.visit_MatchAs�s���y���,���<��J�J�s�O�O�O�O�O�
�_��J�J�t�y�!�!�!�!�!��$�$�[�%5�t�<�<�
/�
/��#�#�K�O�T�\�B�B�B��
�
�d�l�+�+�+��
�
�-�$�)�-�-�.�.�.�
/�
/�
/�
/�
/�
/�
/�
/�
/�
/�
/�
/����
/�
/�
/�
/�
/�
/s�&AC�C�Cc� ����tj|��5�jtj���g|j�R����fd��j|j��ddd��dS#1swxYwYdS)Nc�.����d��S)Nz | rRr�s�rrTz)_Unparser.visit_MatchOr.<locals>.<lambda>�s���D�J�J�u�$5�$5�r)rqr$r1rvr'rrMr~rss` r�
visit_MatchOrz_Unparser.visit_MatchOr�s����
�
 �
 ���$�
7�
7�	U�	U��D���� 4� 4� 6� 6�G���G�G�G�G��O�O�5�5�5�5�t�}�d�m�T�T�T�	U�	U�	U�	U�	U�	U�	U�	U�	U�	U�	U�	U����	U�	U�	U�	U�	U�	Us�AB�B�
B)r`r,)rur�r�r�r�rMrWrYr\rSrrarfrjrmrqrorvrxr|r~r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr�rr	r
rr/r(r,r3r.r:rGr�rPr�rUr]rarcrerkrmrpr|r~r�r$r.r7r�r�r�r5r6r4r1r2r3r8r��	frozensetr�r�r�r�r�r-r,r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrr�
__classcell__)rts@rr>r>�s����������.3�"�"�"�"�"�
�
�
�H�H�H����
1�1�1�1�"�"�"��'�'�'��^�'��#������^������^��!�!�!�Q�Q�Q�=�=�=�1�1�1���� )�)�)�
 � � � � �%�%�%�%�%�%�#�#�#�$�$�$�"�"�"�
&�&�&�M�M�M�M�M�M�%�%�%�"�"�"�&�&�&�&�&�&����������O�O�O�$�$�$�J�J�J�J�J�J�*�*�*�*�*�*�&�&�&�
&�
&�
&�
.�
.�
.�1�1�1�1�1�1�	%�	%�	%�:�:�:�0+�+�+�1�1�1�
:�
:�
:�'�'�'�-�-�-�+�+�+�+�+�+�$+�+�+�%�%�%�%�%�%�&1�E�$/�$/�$/�$/�$/�LFQ�8�8�8�8�8�!7�!7�!7�FL�L�L�<�<�<�,���T�T�T�$�$�$�
-�
-�
-�P�P�P�#�#�#�#�#�#�#�#�#�#�#�#�%�%�%�'�'�'� � � ����,6�6�6��%��c�B�B�D���
�
�
�
�
�
�	��O�
(�
(�
(��������������
�
�E�"�
�
�
�
�
�
�
�
�
�
�
�����
�_�
�
�
�
�������� �9�W�%�%�L�&�&�&�$������������F�!�!�!��4�(�(�G� +��{�~�F�F��[�[�[�	�	�	�!�!�!�$*�*�*� "�"�"�
���%�%�%�$�$�$�+�+�+�15�15�15�f"�"�"�	%�	%�	%�-�-�-�
.�.�.�%�%�%�"�"�"�)�)�)�������(�(�(�(���./�/�/�U�U�U�U�U�U�Urr>c�H�t��}|�|��Sr,)r>r�)�ast_objr?s  r�unparser"�s���{�{�H��>�>�'�"�"�"rc��ddl}|�d���}|�d|�d���ddd	�
��|�ddd
dd���|�dddd���|�dddd���|�ddtdd���|���}|j5}|���}ddd��n#1swxYwYt||jj	|j
|j� ��}tt||j|j�!����dS)"Nrz
python -m ast)�prog�infile�rbr!�?rNz$the file to parse; defaults to stdin)r.�nargs�default�helpz-mz--moder
)r
�singler �	func_typez(specify what kind of code must be parsed)r)�choicesr*z--no-type-commentsT�store_falsez)don't add information about type comments)r)�actionr*z-az--include-attributes�
store_truez:include attributes such as line numbers and column offsets)r/r*z-iz--indentrz'indentation of nodes (number of spaces))r.r)r*)r)rr[)�argparse�ArgumentParser�add_argument�FileTyper0�
parse_argsr%�readrr|r�no_type_comments�printr�rr[)r1�parserrGr%r�trees      r�mainr;�s����O�O�O�
�
$�
$�/�
$�
:�
:�F�
����x�'8�'8�d�'8�'C�'C�3� #�C��E�E�E�����h�� G�G��I�I�I����,�d�=�H��J�J�J�
����4�\�.��/�/�/�����j�s�A�F��H�H�H������D�	
��������������������������������)�4�9�D�DY�Z�Z�Z�D�	�$�t��(?���
T�
T�
T�U�U�U�U�Us�C0�0C4�7C4�__main__)r	r
)TF)r^)T)Lr��sys�_ast�
contextlibrr�enumrrrrrZr�r�r�r�r�r�r�r�r�r�r��objectr�r�r�r-r�r��propertyr�r�r.r�r�r�r�rrrr0r1r2rU�bytes�boolr�r�r�rorrrr=rrr�modr�expr_contextrrr!rw�
float_info�
max_10_exprOr$�_SINGLE_QUOTESrr/r>r"r;rurhrr�<module>rJsH����4�
�
�
�����2�2�2�2�2�2�2�2�,�,�,�,�,�,�,�,�,�,�5��t�5�5�5�5�5�*8$�8$�8$�v@��@�@�@�@�@�F���" � � �F����.	�	�	��������4���2���05�"�"�"�"�"�J���7(�7(�7(�7(�7(�&�7(�7(�7(�t8�8�8�8�8�k�8�8�8�x�w�x����,���������'�7�+�+�H�J���'�7�+�+�H�J�1�1�1�1�1�4�1�1�1�(
2�
2�
2������(�d����������(�d����������H�����������8�t�����6�6�6�6�6�x�4�6�6�6�6��#�u�g�	��#��	�E�8��4�4��:�:�t�$��t�t�C�y�y�l����$����
	�.��D��J�J����	�5��U���	�7��D��I�I�z�	��%�%�%�%�%�C�%�%�%������E����
3�3�3�3�3�u�3�3�3��w�u�f���6���������,��5�5�E�J�:�:�:�:�:�C�:�:�:�:�:�:�:�:�l�:�:�:�:�:�:�:�:�|�:�:�:�:�:�:�:�:�L�:�:�:����c�n�/�!�3�4�4�
4��
��g�������������>���
�/��/��/�/��}U�}U�}U�}U�}U��}U�}U�}U�~#�#�#�
V�V�V�0�z����D�F�F�F�F�F��r

ZeroDay Forums Mini