
    d                        d Z ddlZddlT ddlmZmZ ddlmZmZm	Z	 dLddd	d
Z
d ZdMdddZd Zd ZdNdZd Zd ZdOdZd Zd ZdddZd Z G d de          Z G d de          Z eed          s(d  Zd! Z eee          e_         eee          e_          G d" d#e!          Z"d$ Z# G d% d&ee"'          Z$ G d( d)ee"'          Z% G d* d+ee"'          Z& G d, d-ee"'          Z' G d. d/ee"'          Z(e$e)e*e+fe%e,fe&e-fe' e!d          e.fe( e!d0          fiZ/e$e.fiZ0e.d- e!d          d-e)d&e*d&e+d&e,d)e-d+ e!d0          d/iZ1 G d1 d2e2          Z3 G d3 d4e3          Z4 G d5 d6e3          Z5 ee6d7          sd8 Z7d9 Z8 ee7e8          e6_9         G d: d;e:          Z; G d< d=e<          Z= G d> d?e<          Z> G d@ dAe<          Z?dB e@ejA        jB        dz             z   ZC e	e           G dC dD                      ZDdEZEdFZFg eEeFR ZG G dG dHe          ZHdI ZIdJ ZJeKdKk    r eJ             dS dS )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
|t          z  }t          |t                    r|\  }}|dk    sJ |}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moder   r   flagsmajorminors             /croot/python-split_1694437901252/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib/python3.11/ast.pyparser   !   sx     E $##/5)) &uzzzz		 68T5$35 5 5 5    c                     t          | t                    r$t          |                     d          d          } t          | t                    r| j        } d fdfdfd |           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r   c                 f    d}t          | dd           x}r|d| z  }t          |d| z             )Nzmalformed node or stringlinenoz	 on line : )getattr
ValueError)nodemsglnos      r   _raise_malformed_nodez+literal_eval.<locals>._raise_malformed_nodeC   sL    ($$///3 	%$s$$$C}D}},---r   c                     t          | t                    r(t          | j                  t          t
          t          fvr |            | j        S N)r   Constanttypevalueintfloatcomplex)r'   r*   s    r   _convert_numz"literal_eval.<locals>._convert_numH   sJ    $)) 	(T$*-=-=c5RYEZ-Z-Z!!$'''zr   c                     t          | t                    rQt          | j        t          t          f          r0 | j                  }t          | j        t                    r|
 S | S  |           S r,   )r   UnaryOpopUAddUSuboperand)r'   r9   r3   s     r   _convert_signed_numz)literal_eval.<locals>._convert_signed_numL   sq    dG$$ 	!DGdD\)J)J 	!"l4<00G$'4(( ! y  y |D!!!r   c           	         t          | t                    r| j        S t          | t                    r"t	          t          | j                            S t          | t                    r"t          t          | j                            S t          | t                    r"t          t          | j                            S t          | t                    rRt          | j        t                    r8| j        j        dk    r(| j        | j        cxk    rg k    rn nt                      S t          | t"                    rxt%          | j                  t%          | j                  k    r |            t+          t-          t          | j                  t          | j                                      S t          | t.                    rt          | j        t2          t4          f          ru | j                  } | j                  }t          |t:          t<          f          r9t          |t>                    r$t          | j        t2                    r||z   S ||z
  S  |           S )Nset) r   r-   r/   Tupler   mapeltsListlistSetr<   CallfuncNameidargskeywordsDictlenkeysvaluesdictzipBinOpr6   AddSubleftrightr0   r1   r2   )r'   rR   rS   _convertr3   r:   r*   s      r   rT   zliteral_eval.<locals>._convertT   s*   dH%% 	(:e$$ 	(Xty11222d## 	(Hdi00111c"" 	(s8TY//000t$$ 	(DIt)D)D 	(ile##	T](H(H(H(Hb(H(H(H(H(H55Ld## 	(49~~T[!1!111%%d+++C$)44$+668 8 9 9 9e$$ 	(DGc3Z)H)H 	(&&ty11D L,,E$e-- (*UG2L2L (dgs++ (%<'%<'""4(((r   )r   strr   lstrip
Expressionbody)node_or_stringrT   r3   r:   r*   s    @@@@r   literal_evalrZ   6   s     .#&& J~44U;;&III.*-- -',. . .
    " " " " ") ) ) ) ) ) ) )4 8N###r   T)indentc                    dfd	t          | t                    st          d| j        j        z            t          t
                    sdz   |           d         S )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.
    r   c                    dz  dz  z   }dz  z   }nd}d}t          | t                    rzt          |           }g }d}}| j        D ]}	 t	          | |          }	n# t
          $ r d}Y "w xY w|	t	          ||d          d}< |	          \  }	}
|o|
}|r|                    |d|	           l|                    |	           rt| j        rm| j        D ]e}	 t	          | |          }	n# t
          $ r Y  w xY w|	t	          ||d          8 |	          \  }	}
|o|
}|                    |d|	           f|r;t          |          d	k    r(| j	        j
        d
d                    |          d| fS | j	        j
        d
||                    |          ddfS t          | t                    r.| sdS d||                    fd| D                       ddfS t          |           dfS )N   
z,
 , T.=r   ()F)z[]T[c              3   <   K   | ]} |          d          V  dS r   N ).0x_formatlevels     r   	<genexpr>z(dump.<locals>._format.<locals>.<genexpr>   s4      /S/S50A0A!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    `         r   rk   zdump.<locals>._format}   s   QJEFUN*F&5.(CCFCdC   %	\t**CDI&H ' '#D$//EE%   #HH =WS$%<%<%D#H 'u 5 5v%0&	 'KK444 78888KK&&&&! 
9d&6 
9 , 	9 	9D! 'd 3 3) ! ! ! !}dC)@)@)H $+GE5$9$9ME6 ) 4fIKK444 78888 WSYY!^^#'>#:#:#:DIIdOOOOLRVhVV!%!8!8!8&&#((4....QSXXXd## 	\ "!z"%vsxx/S/S/S/S/Sd/S/S/S'S'S'S'STV[[[Dzz4s$   A%%A43A4&C77
DDzexpected AST, got %rN )r   )r   ro   	TypeErrorrt   ru   rU   )r'   r~   r   r[   rk   s    ```@r   dumpr   q   s    .  .  .  .  .  .  .  .  . ` dC   J.1HHIII*VS"9"9v74==r   c                     dD ]]}||j         v rR|| j         v rIt          ||d          }|%t          ||          r&|                    d          rt	          | ||           ^| 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_)rs   r%   hasattr
startswithsetattr)new_nodeold_nodeattrr/   s       r   copy_locationr      s    
 G / /8'''DH4H,H,HHdD11E  $'' !,0OOF,C,C ! $...Or   c                 0    fd | dddd           | 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| j         v rt          | d          s|| _        n| j        }d| j         v r t          | dd           || _        n| j        }d| j         v rt          | d          s|| _        n| j        }d| j         v r t          | dd           || _        n| j        }t          |           D ]} |||||           d S )Nr#   r   r   r   )rs   r   r#   r%   r   r   r   iter_child_nodes)r'   r#   r   r   r   child_fixs         r   r   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 	Hr   r^   r   rh   )r'   r   s    @r   fix_missing_locationsr      s@    H H H H H. 	Dq!QKr   r^   c                    t          |           D ]y}t          |t                    rt          |dd          |z   |_        1d|j        v rt          |dd          |z   |_        d|j        v rt          |dd          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#   r   r   )walkr   
TypeIgnorer%   r#   rs   r   )r'   nr   r   s       r   increment_linenor      s     d . . eZ(( 	"5(A66:ELu((("5(A66:ELE---&ulA>>>K)A~EKr   c              #   h   K   | j         D ]'}	 |t          | |          fV  # t          $ r Y $w xY wdS )zs
    Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields``
    that is present on *node*.
    N)rp   r%   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  SdS )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   r   ro   rA   )r'   r|   r   items       r   r   r     s      
 #4((  eeS!! 	KKKKt$$ 	  dC(( JJJ r   c                    t          | t          t          t          t          f          st          d| j        j        z            | j        r t          | j        d         t                    sdS | j        d         j
        } t          | t                    r| j        }n9t          | t                    r"t          | j
        t                    r| j
        }ndS |rddl}|                    |          }|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 docstringsr   N)r   AsyncFunctionDefFunctionDefClassDefModuler   rt   ru   rX   Exprr/   Strsr-   rU   inspectcleandoc)r'   cleantextr   s       r   get_docstringr     s     d-{HfMNN N2T^5LLMMM9 DIaL$77 t9Q<D$ v	D(	#	# 
4:s(C(C zt &%%Kr   c                 D   d}g }d}|t          |           k     ro| |         }||z  }|dz  }|dk    r)|t          |           k     r| |         dk    r
|dz  }|dz  }|dv r|                    |           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.
    r   r`   r^   r_   z
)rJ   rr   )r   idxlines	next_linecs        r   _splitlines_no_ffr   3  s    
 CEI
F

3KQ	q99s6{{**vc{d/B/BI1HC;;LL###I F

   YLr   c                 2    d}| D ]}|dv r||z  }|dz  }|S )z6Replace all chars except '\f\t' in a line with spaces.r`   z	r   rh   )r   resultr   s      r   _pad_whitespacer   L  s:    F  ;;aKFFcMFFMr   )paddedc                   	 |j         |j        dS |j        dz
  }|j         dz
  }|j        }|j        }n# t          $ r Y dS w xY wt          |           }||k    r4||                                         ||                                         S |rBt          ||                                         d|                                                   }nd}|||                                         |d                                         z   }	||                                         d|                                         }
||dz   |         }|	                    d|	           |
                    |
           d                    |          S )aB  Get 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   rq   r   encodedecoder   insertrr   rv   )r   r'   r   r#   r   r   r   r   paddingfirstlasts              r   get_source_segmentr   W  s   ?"d&9&A4q_q(
_
,   tt f%%EVV}##%%j&?@GGIII !%-"6"6"8"8*"E"L"L"N"NOOeFm**,,Z[[9@@BBBE##%%o~o6==??D&(:%&E	LLE	LL775>>s   5 "5 
AAc              #      K   ddl m}  || g          }|r>|                                } |                    t	          |                      | V  |<dS dS )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      r   r   r   |  s       "!!!!!5$==D
 ||~~$T**+++


      r   c                   $    e Zd ZdZd Zd Zd ZdS )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|j         j        z   }t          | || j                  } ||          S )zVisit a node.visit_)rt   ru   r%   generic_visit)selfr'   methodvisitors       r   visitzNodeVisitor.visit  s3    DN33$(:;;wt}}r   c                    t          |          D ]t\  }}t          |t                    r0|D ],}t          |t                    r|                     |           -Jt          |t                    r|                     |           udS )z9Called if no explicit visitor function exists for a node.N)r   r   rA   ro   r   )r   r'   r   r/   r   s        r   r   zNodeVisitor.generic_visit  s    '-- 	" 	"LE5%&& "! ) )D!$,, )

4((() E3'' "

5!!!	" 	"r   c                    |j         }t                              t          |                    }|3t                                          D ]\  }}t          ||          r|} n|Td|z   }	 t          | |          }dd l}|                    | dt          d            ||          S # t          $ r Y nw xY w|                     |          S )Nr   r   z" is deprecated; add visit_Constant   )r/   _const_node_type_namesgetr.   itemsr   r%   warningswarnDeprecationWarningrq   r   )	r   r'   r/   	type_namerz   r|   r   r   r   s	            r   visit_ConstantzNodeVisitor.visit_Constant  s   
*..tE{{;;	399;;  	TeS))  $IE  	)F%!$//  KKK0!5 5 5wt}}$ "    !!$'''s   ,B* *
B76B7N)ru   
__module____qualname____doc__r   r   r   rh   r   r   r   r     sK         &  " " "( ( ( ( (r   r   c                       e Zd ZdZd ZdS )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||d d <   t          |t                    r9|                     |          }|t          ||           t          |||           |S r,   )	r   r   rA   ro   r   r   rr   delattrr   )r   r'   r   	old_value
new_valuesr/   r   s          r   r   zNodeTransformer.generic_visit  s    +D 1 1 	3 	3E9)T** 3
& - -E!%-- % $

5 1 1 =$!+E3!7!7 %&--e444$%%e,,,,)	!!!Is++ 3::i00#D%((((D%222r   N)ru   r   r   r   r   rh   r   r   r   r     s.        ! !F    r   r   r   c                     | j         S )zDeprecated. Use value instead.r/   r   s    r   _getterr     s
    zr   c                     || _         d S r,   r   r   r/   s     r   _setterr     s    


r   c                       e Zd Zd Zd ZdS )_ABCc                     d| _         d S )Nz3Deprecated AST node class. Use ast.Constant instead)r   )rz   rG   s     r   __init__z_ABC.__init__  s    Or   c                 4   t          |t                    sdS | t          v r^	 |j        }t          |t          |                    o)t          |t                              | d                     S # t          $ r Y dS w xY wt                              | |          S )NFrh   )	r   r-   _const_typesr/   _const_types_notr   rq   r.   __instancecheck__)rz   instr/   s      r   r   z_ABC.__instancecheck__  s    $)) 	5,

 ul3&788 I"5*:*>*>sB*G*GHHH "   uu %%c4000s   A. .
A<;A<N)ru   r   r   r   r   rh   r   r   r   r     s5        P P P1 1 1 1 1r   r   c                     |D ]R}|| j         vr| j                             |          }|t          |          k     rt          | j         d|          S| t
          v rt          |i |S t          j        | g|R i |S )Nz" got multiple values for argument )rp   indexrJ   r   ru   r   r-   __new__)rz   rG   kwargskeyposs        r   _newr   "  s     X Xck!!k$$T??s|VVsVVWWW 
l((((C1$111&111r   c                       e Zd ZdZeZdS )Num)r   Nru   r   r   rp   r   r   rh   r   r   r   r   .          GGGGr   r   )	metaclassc                       e Zd ZdZeZdS )r   r   Nr   rh   r   r   r   r   2  r   r   r   c                       e Zd ZdZeZdS )Bytesr   Nr   rh   r   r   r  r  6  r   r   r  c                       e Zd ZeZdS )NameConstantN)ru   r   r   r   r   rh   r   r   r  r  :  s        GGGr   r  c                       e Zd ZdZd ZdS )Ellipsisrh   c                 ^    | t           u rt          dg|R i |S t          j        | g|R i |S )N.)r  r-   r   )rz   rG   r   s      r   r   zEllipsis.__new__@  sJ    (??C1$111&1115d555f555r   N)ru   r   r   rp   r   rh   r   r   r  r  =  s(        G6 6 6 6 6r   r  .c                       e Zd ZdZdS )slicezDeprecated AST node class.Nru   r   r   r   rh   r   r   r  r  [  s        $$$$r   r  c                       e Zd ZdZd ZdS )Indexz@Deprecated AST node class. Use the index value directly instead.c                     |S r,   rh   )rz   r/   r   s      r   r   zIndex.__new__`  s    r   Nru   r   r   r   r   rh   r   r   r  r  ^  s)        JJ    r   r  c                       e Zd ZdZddZdS )ExtSlicez1Deprecated AST node class. Use ast.Tuple instead.rh   c                 P    t          t          |          t                      fi |S r,   )r=   rA   Load)rz   dimsr   s      r   r   zExtSlice.__new__e  s$    T$ZZ226222r   N)rh   r  rh   r   r   r  r  c  s.        ;;3 3 3 3 3 3r   r  r  c                     | j         S )zDeprecated. Use elts instead.r?   r   s    r   _dims_getterr  m  s
    yr   c                     || _         d S r,   r  r   s     r   _dims_setterr  q  s    			r   c                       e Zd ZdZdS )Suite/Deprecated AST node class.  Unused in Python 3.Nr	  rh   r   r   r  r  v          9999r   r  c                       e Zd ZdZdS )AugLoadr  Nr	  rh   r   r   r  r  y  r  r   r  c                       e Zd ZdZdS )AugStorer  Nr	  rh   r   r   r  r  |  r  r   r  c                       e Zd ZdZdS )Paramr  Nr	  rh   r   r   r!  r!    r  r   r!  1ec                      e Zd ZdZ e            Z e            Z e            Z e            Z e            Z	 e            Z
 e            Z e            Z e            ZeZ e            Z e            Z e            Z e            Z e            Z e            Z e            Z e            Z e            Zd ZdS )_Precedencez5Precedence table that originated from python grammar.c                 X    	 |                      | dz             S # t          $ r | cY S w xY wNr^   )rt   r&   r   s    r   nextz_Precedence.next  sA    	>>$(+++ 	 	 	KKK	s    ))N)ru   r   r   r   r   
NAMED_EXPRTUPLEYIELDTESTORANDNOTCMPEXPRBORBXORBANDSHIFTARITHTERMFACTORPOWERAWAITATOMr'  rh   r   r   r$  r$    s        ??JDFFEDFFE466D	B
$&&C
$&&C
$&&C466D
C466D466DDFFEDFFE466DTVVFDFFEDFFE466D    r   r$  )'")z"""z'''c                       e Zd ZdZdddZd Zd Zd Zdd	Zd
 Z	e
dd            Ze
ddd            Ze
d             Zd Zd Zd Zd Zd Zd Z f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% 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;dd=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ZOePjQ        ePjR        ePjR        ePjR        dWZSdX ZTdTdUdYdZd[d\d]d^d_d`dadbdcddZUePjV        ePjV        ePjW        ePjW        ePjW        ePjW        ePjX        ePjX        ePjY        ePjZ        ePj[        ePjW        ePj\        deZ] e^df          Z_dg Z`dhdidjdkdldmdndodpdqdr
Zads ZbdtdudvZcePjd        ePje        dw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} xZ~S )	_UnparserzMethods 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| _        d S )Nr   F)_source_precedences_type_ignores_indentr@  _in_try_star)r   r@  s     r   r   z_Unparser.__init__  s6    "4!r   c                     t          |          }	  |t          |                     |D ]} |              ||           dS # t          $ r Y dS w xY w)z7Call f on each item in seq, calling inter() in between.N)iterr'  StopIteration)r   interfseqrj   s        r   
interleavez_Unparser.interleave  s~    3ii	Ad3iiLLL   !   	 	 	DD	s   A 
AAc                      t          |          dk    r( ||d                                         d           dS                       fd||           dS )zTraverse 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>      DJJt$4$4 r   N)rJ   rS  rM  )r   	traverserr   s   `  r   
items_viewz_Unparser.items_view  sa     u::??IeAhJJsOOOOOOO4444iGGGGGr   c                 B    | j         r|                     d           dS dS )z8Adds a newline if it isn't the start of generated sourcer_   N)rB  rS  r   s    r   maybe_newlinez_Unparser.maybe_newline  s.    < 	JJt	 	r   r`   c                 n    |                                   |                     d| j        z  |z              dS )zXIndent a piece of text and append it, according to the current
        indentation levelz    N)rY  rS  rE  r   r   s     r   fillz_Unparser.fill  s:     	

6DL(4/00000r   c                 :    | j                             |           dS )zAdd new source partsN)rB  r   r[  s     r   rS  z_Unparser.write  s    D!!!!!r   Nc              #   D   K   |g }| j         }|| _         |V  || _         d S r,   )rB  )r   bufferoriginal_sources      r   bufferedz_Unparser.buffered  s2      >F,&r   extrac             #      K   |                      d           |r|                      |           | xj        dz  c_        dV  | xj        dz  c_        dS )a  A 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)rS  rE  )r   rc  s     r   blockz_Unparser.block  s^       	

3 	JJur   c              #   f   K   |                      |           dV  |                      |           dS )zA 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r   c                 N    |r|                      ||          S t                      S r,   )rj  r   )r   rh  ri  	conditions       r   
delimit_ifz_Unparser.delimit_if  s(     	!<<s+++== r   c                 ^    |                      dd|                     |          |k              S )z,Shortcut to adding precedence related parensrc   rd   )rm  get_precedence)r   
precedencer'   s      r   require_parensz_Unparser.require_parens  s+    sC)<)<T)B)BZ)OPPPr   c                 L    | j                             |t          j                  S r,   )rC  r   r$  r+  r   r'   s     r   ro  z_Unparser.get_precedence  s     $$T;+;<<<r   c                 $    |D ]}|| j         |<   d S r,   )rC  )r   rp  nodesr'   s       r   set_precedencez_Unparser.set_precedence  s+     	1 	1D&0Dd##	1 	1r   c                 F   t          |t          t          t          t          f          rt          |j                  dk     rdS |j        d         }t          |t                    sdS |j        }t          |t                    rt          |j        t                    r|S dS dS )zIf 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   )r   r   r   r   r   rJ   rX   r   r/   r-   rU   rs  s     r   get_raw_docstringz_Unparser.get_raw_docstring  s    
 #[(FC
 
 	^^a4y|$%% 	4zdH%% 	*TZ*E*E 	K	 	 	 	r   c                 `    | j                             |j                  p|j        }|d| S d S )Nz	 # type: )rD  r   r#   type_comment)r   r'   comments      r   get_type_commentz_Unparser.get_type_comment  s>    $((55J9J(w((( r   c                     t          |t                    r|D ]}|                     |           d S t                                          |           d S r,   )r   rA   traversesuperr   )r   r'   r   rt   s      r   r~  z_Unparser.traverse$  sa    dD!! 	  $ $d####$ $ GGMM$r   c                 n    g | _         |                     |           d                    | j                   S )zOutputs a source code string that, if converted back to an ast
        (using ast.parse) will generate an AST equivalent to *node*r`   )rB  r~  rv   rs  s     r   r   z_Unparser.visit.  s1     dwwt|$$$r   c                     |                      |          x}r9|                     |           |                     |j        dd                     d S |                     |j                   d S r&  )rx  _write_docstringr~  rX   )r   r'   	docstrings      r   "_write_docstring_and_traverse_bodyz,_Unparser._write_docstring_and_traverse_body5  sm    //555I 	%!!),,,MM$)ABB-(((((MM$)$$$$$r   c                     d |j         D             | _        |                     |           | j                                         d S )Nc                 .    i | ]}|j         d |j         S )ignore)r#   tag)ri   r  s     r   
<dictcomp>z*_Unparser.visit_Module.<locals>.<dictcomp>=  s7     
 
 
 M0FJ00
 
 
r   )type_ignoresrD  r  clearrs  s     r   visit_Modulez_Unparser.visit_Module<  sW    
 
+
 
 
 	//555  """""r   c                 
                          dd          5                        fd j        |j                   d d d            n# 1 swxY w Y                        d                                |j                   d S )Nrc   rd   c                  .                          d          S rQ  rR  r   s   r   rT  z._Unparser.visit_FunctionType.<locals>.<lambda>G      

4(( r    -> )rj  rM  r~  argtypesrS  returnsrs  s   ` r   visit_FunctionTypez_Unparser.visit_FunctionTypeD  s    \\#s## 	 	OO(((($-  	 	 	 	 	 	 	 	 	 	 	 	 	 	 	
 	

6dl#####s   %A		AAc                     |                                   |                     t          j        |j                   |                     |j                   d S r,   )r\  rv  r$  r*  r/   r~  rs  s     r   
visit_Exprz_Unparser.visit_ExprM  sD    		K-tz:::dj!!!!!r   c                 `   |                      t          j        |          5  |                     t          j        |j        |j                   |                     |j                   |                     d           |                     |j                   d d d            d S # 1 swxY w Y   d S )Nz := )	rq  r$  r(  rv  r:  targetr/   r~  rS  rs  s     r   visit_NamedExprz_Unparser.visit_NamedExprR  s      !7>> 	& 	& 0$+tzJJJMM$+&&&JJvMM$*%%%		& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	&s   A5B##B'*B'c                 z                           d                                 fd j        |j                   d S )Nzimport c                  .                          d          S rQ  rR  r   s   r   rT  z(_Unparser.visit_Import.<locals>.<lambda>[      

4 0 0 r   )r\  rM  r~  namesrs  s   ` r   visit_Importz_Unparser.visit_ImportY  s?    		)0000$-LLLLLr   c                 $                          d                                d|j        pdz             |j        r                     |j                                        d                                 fd j        |j                   d S )Nzfrom .r   z import c                  .                          d          S rQ  rR  r   s   r   rT  z,_Unparser.visit_ImportFrom.<locals>.<lambda>c  r  r   )r\  rS  rl   modulerM  r~  r  rs  s   ` r   visit_ImportFromz_Unparser.visit_ImportFrom]  s    		'

3$*/*+++; 	$JJt{###

:0000$-LLLLLr   c                 f   |                                   |j        D ]L}|                     t          j        |           |                     |           |                     d           M|                     |j                   |                     |          x}r|                     |           d S d S )N = )	r\  targetsrv  r$  r)  r~  rS  r/   r|  )r   r'   r  rz  s       r   visit_Assignz_Unparser.visit_Assigne  s    		l 	 	F 16:::MM&!!!JJudj!!!00666< 	%JJ|$$$$$	% 	%r   c                     |                                   |                     |j                   |                     d| j        |j        j        j                 z   dz              |                     |j                   d S )Nr   z= )	r\  r~  r  rS  binopr6   rt   ru   r/   rs  s     r   visit_AugAssignz_Unparser.visit_AugAssigno  sh    		dk"""

3DG$5$>??$FGGGdj!!!!!r   c                    |                                   |                     dd|j         ot          |j        t
                              5  |                     |j                   d d d            n# 1 swxY w Y   |                     d           |                     |j                   |j	        r1|                     d           |                     |j	                   d S d S )Nrc   rd   r$   r  )
r\  rm  r}   r   r  rE   r~  rS  
annotationr/   rs  s     r   visit_AnnAssignz_Unparser.visit_AnnAssignu  s
   		__S#4;'X:dkSW;X;XYY 	' 	'MM$+&&&	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	'

4do&&&: 	&JJuMM$*%%%%%	& 	&s   A33A7:A7c                     |                      d           |j        r1|                     d           |                     |j                   d S d S )Nreturnr   )r\  r/   rS  r~  rs  s     r   visit_Returnz_Unparser.visit_Return  sQ    		(: 	&JJsOOOMM$*%%%%%	& 	&r   c                 0    |                      d           d S )Npassr\  rs  s     r   
visit_Passz_Unparser.visit_Pass  s    		&r   c                 0    |                      d           d S )Nbreakr  rs  s     r   visit_Breakz_Unparser.visit_Break  s    		'r   c                 0    |                      d           d S )Ncontinuer  rs  s     r   visit_Continuez_Unparser.visit_Continue  s    		*r   c                 z                           d                                 fd j        |j                   d S )Nzdel c                  .                          d          S rQ  rR  r   s   r   rT  z(_Unparser.visit_Delete.<locals>.<lambda>  r  r   )r\  rM  r~  r  rs  s   ` r   visit_Deletez_Unparser.visit_Delete  s?    		&0000$-NNNNNr   c                     |                      d           |                     |j                   |j        r1|                     d           |                     |j                   d S d S )Nzassert ra   )r\  r~  testr(   rS  rs  s     r   visit_Assertz_Unparser.visit_Assert  sh    		)di   8 	$JJtMM$(#####	$ 	$r   c                 z                           d                                 fd j        |j                   d S )Nzglobal c                  .                          d          S rQ  rR  r   s   r   rT  z(_Unparser.visit_Global.<locals>.<lambda>  r  r   r\  rM  rS  r  rs  s   ` r   visit_Globalz_Unparser.visit_Global  s?    		)0000$*djIIIIIr   c                 z                           d                                 fd j        |j                   d S )Nz	nonlocal c                  .                          d          S rQ  rR  r   s   r   rT  z*_Unparser.visit_Nonlocal.<locals>.<lambda>  r  r   r  rs  s   ` r   visit_Nonlocalz_Unparser.visit_Nonlocal  s?    		+0000$*djIIIIIr   c                 X   |                      t          j        |          5  |                     d           |j        rT|                     d           |                     t          j        |j                   |                     |j                   d d d            d S # 1 swxY w Y   d S )Nawaitr   )rq  r$  r9  rS  r/   rv  r:  r~  rs  s     r   visit_Awaitz_Unparser.visit_Await        !2D99 	* 	*JJwz *

3##K$4djAAAdj)))	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	*   A1BB#&B#c                 X   |                      t          j        |          5  |                     d           |j        rT|                     d           |                     t          j        |j                   |                     |j                   d d d            d S # 1 swxY w Y   d S )Nyieldr   )rq  r$  r*  rS  r/   rv  r:  r~  rs  s     r   visit_Yieldz_Unparser.visit_Yield  r  r  c                 L   |                      t          j        |          5  |                     d           |j        st          d          |                     t          j        |j                   |                     |j                   d d d            d S # 1 swxY w Y   d S )Nzyield from z-Node can't be used without a value attribute.)	rq  r$  r*  rS  r/   r&   rv  r:  r~  rs  s     r   visit_YieldFromz_Unparser.visit_YieldFrom  s      !2D99 	& 	&JJ}%%%: R !PQQQ 0$*===MM$*%%%	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	&s   A+BB Bc                 <   |                      d           |j        s|j        rt          d          d S |                     d           |                     |j                   |j        r1|                     d           |                     |j                   d S d S )Nraisez*Node can't use cause without an exception.r   z from )r\  exccauser&   rS  r~  rs  s     r   visit_Raisez_Unparser.visit_Raise  s    		'x 	z P !NOOOF

3dh: 	&JJx   MM$*%%%%%	& 	&r   c                    |                      d           |                                 5  |                     |j                   d d d            n# 1 swxY w Y   |j        D ]}|                     |           |j        r[|                      d           |                                 5  |                     |j                   d d d            n# 1 swxY w Y   |j        r^|                      d           |                                 5  |                     |j                   d d d            d S # 1 swxY w Y   d S d S )Ntryelsefinally)r\  rf  r~  rX   handlersorelse	finalbody)r   r'   exs      r   do_visit_tryz_Unparser.do_visit_try  s   		%ZZ\\ 	% 	%MM$)$$$	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	%- 	 	BMM"; 	+IIf + +dk***+ + + + + + + + + + + + + + +> 	.IIi    . .dn---. . . . . . . . . . . . . . . . . .	. 	.s5   AAA+CCCD55D9<D9c                 t    | j         }	 d| _         |                     |           || _         d S # || _         w xY w)NFrF  r  r   r'   prev_in_try_stars      r   	visit_Tryz_Unparser.visit_Try  sO    ,	1 %Dd### 0D 0D0000   . 	7c                 t    | j         }	 d| _         |                     |           || _         d S # || _         w xY w)NTr  r  s      r   visit_TryStarz_Unparser.visit_TryStar  sO    ,	1 $Dd### 0D 0D0000r  c                    |                      | j        rdnd           |j        r/|                     d           |                     |j                   |j        r/|                     d           |                     |j                   |                                 5  |                     |j                   d d d            d S # 1 swxY w Y   d S )Nzexcept*exceptr    as )r\  rF  r.   rS  r~  r|   rf  rX   rs  s     r   visit_ExceptHandlerz_Unparser.visit_ExceptHandler  s   		t0>))h???9 	%JJsOOOMM$)$$$9 	"JJvJJty!!!ZZ\\ 	% 	%MM$)$$$	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	%s   CCCc                    |                                   |j        D ],}|                     d           |                     |           -|                     d|j        z              |                     dd|j        p|j                  5  d}|j        D ]1}|r|                     d           nd}|                     |           2|j        D ]1}|r|                     d           nd}|                     |           2	 d d d            n# 1 swxY w Y   | 	                                5  | 
                    |           d d d            d S # 1 swxY w Y   d S )	N@zclass rc   rd   )rl  Fra   T)rY  decorator_listr\  r~  r|   rm  basesrH   rS  rf  r  )r   r'   decocommaes        r   visit_ClassDefz_Unparser.visit_ClassDef  s   ' 	  	 DIIcNNNMM$		(TY&'''__S#4:3N_OO 	! 	!EZ ! ! !JJt$$$$ Ea    ] ! ! !JJt$$$$ Ea    !	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! ZZ\\ 	: 	:33D999	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	:s%   
A5DDD+EEEc                 2    |                      |d           d S )Ndef_function_helperrs  s     r   visit_FunctionDefz_Unparser.visit_FunctionDef  s    dE*****r   c                 2    |                      |d           d S )Nz	async defr  rs  s     r   visit_AsyncFunctionDefz _Unparser.visit_AsyncFunctionDef
  s    dK00000r   c                    |                                   |j        D ],}|                     d           |                     |           -|dz   |j        z   }|                     |           |                     dd          5  |                     |j                   d d d            n# 1 swxY w Y   |j        r/|                     d           |                     |j                   | 	                    | 
                    |                    5  |                     |           d d d            d S # 1 swxY w Y   d S )Nr  r   rc   rd   r  rb  )rY  r  r\  r~  r|   rj  rG   r  rS  rf  r|  r  )r   r'   fill_suffixr  def_strs        r   r  z_Unparser._function_helper  s   ' 	  	 DIIcNNNMM$#di/		'\\#s## 	% 	%MM$)$$$	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	%< 	(JJvMM$,'''ZZd33D99Z:: 	: 	:33D999	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	:s$   B((B,/B,D55D9<D9c                 2    |                      d|           d S )Nzfor _for_helperrs  s     r   	visit_Forz_Unparser.visit_For  s    &&&&&r   c                 2    |                      d|           d S )Nz
async for r  rs  s     r   visit_AsyncForz_Unparser.visit_AsyncFor  s    t,,,,,r   c                    |                      |           |                     t          j        |j                   |                     |j                   |                     d           |                     |j                   |                     | 	                    |                    5  |                     |j
                   d d d            n# 1 swxY w Y   |j        r^|                      d           |                                 5  |                     |j                   d d d            d S # 1 swxY w Y   d S d S )N in rb  r  )r\  rv  r$  r)  r  r~  rS  rH  rf  r|  rX   r  )r   r\  r'   s      r   r  z_Unparser._for_helper"  s   		$K-t{;;;dk"""

6di   ZZd33D99Z:: 	% 	%MM$)$$$	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	%; 	+IIf + +dk***+ + + + + + + + + + + + + + + + + +	+ 	+s$   -CCCD77D;>D;c                    |                      d           |                     |j                   |                                 5  |                     |j                   d d d            n# 1 swxY w Y   |j        rt          |j                  dk    rt          |j        d         t                    r|j        d         }|                      d           |                     |j                   |                                 5  |                     |j                   d d d            n# 1 swxY w Y   |j        r8t          |j                  dk    r t          |j        d         t                    |j        r^|                      d           |                                 5  |                     |j                   d d d            d S # 1 swxY w Y   d S d S )Nzif r^   r   zelif r  )	r\  r~  r  rf  rX   r  rJ   r   Ifrs  s     r   visit_Ifz_Unparser.visit_If/  sa   		%di   ZZ\\ 	% 	%MM$)$$$	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% k 	)c$+..!33
4;q>SU8V8V3;q>DIIgMM$)$$$ ) )di((() ) ) ) ) ) ) ) ) ) ) ) ) ) )	 k 	)c$+..!33
4;q>SU8V8V3 ; 	+IIf + +dk***+ + + + + + + + + + + + + + + + + +	+ 	+s6   A++A/2A/D,,D03D0&GGGc                    |                      d           |                     |j                   |                                 5  |                     |j                   d d d            n# 1 swxY w Y   |j        r^|                      d           |                                 5  |                     |j                   d d d            d S # 1 swxY w Y   d S d S )Nzwhile r  )r\  r~  r  rf  rX   r  rs  s     r   visit_Whilez_Unparser.visit_WhileA  sK   		(di   ZZ\\ 	% 	%MM$)$$$	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	%; 	+IIf + +dk***+ + + + + + + + + + + + + + + + + +	+ 	+s$   A++A/2A/&CCCc                 2                          d                                 fd j        |j                                                             |                    5                       |j                   d d d            d S # 1 swxY w Y   d S )Nzwith c                  .                          d          S rQ  rR  r   s   r   rT  z&_Unparser.visit_With.<locals>.<lambda>M  r  r   rb  r\  rM  r~  r   rf  r|  rX   rs  s   ` r   
visit_Withz_Unparser.visit_WithK  s    		'0000$-LLLZZd33D99Z:: 	% 	%MM$)$$$	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	%   $BBBc                 2                          d                                 fd j        |j                                                             |                    5                       |j                   d d d            d S # 1 swxY w Y   d S )Nzasync with c                  .                          d          S rQ  rR  r   s   r   rT  z+_Unparser.visit_AsyncWith.<locals>.<lambda>S  r  r   rb  r  rs  s   ` r   visit_AsyncWithz_Unparser.visit_AsyncWithQ  s    		-   0000$-LLLZZd33D99Z:: 	% 	%MM$)$$$	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	%r  quote_typesescape_special_whitespacec                   fd}d                     t          |                    |}dv rd |D             }fd|D             }|s>t                    t          fd|D             d                   }dd	         |gfS rb|                    fd
           |d         d         d	         k    r1t          |d                   dk    sJ dd	         dz   d	         z   |fS )zHelper for writing string literals, minimizing escapes.
        Returns the tuple (string literal to write, possible quote types).
        c                     s| dv r| S | dk    s|                                  s(|                     d                              d          S | S )Nz
	\unicode_escapeascii)isprintabler   r   )r   r  s    r   escape_charz2_Unparser._str_literal_helper.<locals>.escape_char]  sU     - fDyyyxx 01188AAAHr   r`   r_   c                 $    g | ]}|t           v |S rh   )_MULTI_QUOTES)ri   qs     r   
<listcomp>z1_Unparser._str_literal_helper.<locals>.<listcomp>j  s"    PPPQQ-=O=Oq=O=O=Or   c                     g | ]}|v|	S rh   rh   )ri   r  escaped_strings     r   r  z1_Unparser._str_literal_helper.<locals>.<listcomp>k  s#    QQQ.9P9P19P9P9Pr   c              3   0   K   | ]}d          |v |V  dS rg   rh   )ri   r  strings     r   rm   z0_Unparser._str_literal_helper.<locals>.<genexpr>q  s+      CCF1INN!NNNNCCr   r   r^   r   c                 (    | d         d         k    S )Nr   r   rh   )r  r!  s    r   rT  z/_Unparser._str_literal_helper.<locals>.<lambda>u  s    qt~b7I/I r   )r   r   Nr  )rv   r>   rw   r'  sortrJ   )r   r#  r  r  r  possible_quotesquoter!  s    ` `   @r   _str_literal_helperz_Unparser._str_literal_helperW  sU   	 	 	 	 	 [&!9!9::%>!!PP/PPPOQQQQoQQQ 	) &\\FCCCC[CCCVAYOOE!B$<%(( 	Q  %I%I%I%I JJJ q!!$r(:::?1-..!3333!/!4t!;nR>P!P..r   r  c                    |                      ||          \  }}|d         }|                     | | |            dS )zKWrite string literal value with a best effort attempt to avoid backslashes.r)  r   N)r(  rS  )r   r#  r  
quote_types       r   _write_str_avoiding_backslashesz)_Unparser._write_str_avoiding_backslashes}  sP    "66v;6WW ^


j6&6*6677777r   c                 0   |                      d           | j        ri|                                 5 }|                     |           d d d            n# 1 swxY w Y   |                     d                    |                    S g }|j        D ]}|                                 5 }|                     |           d d d            n# 1 swxY w Y   |                    d                    |          t          |t                    f           g }t          t                    }|D ]5\  }}|                     |||          \  }}|                    |           6d                    |          }|d         }|                      | | |            d S )NrK  r`   r  r   )rS  r@  ra  _write_fstring_innerr,  rv   rL   rr   r   r-   rA   _ALL_QUOTESr(  )	r   r'   r_  fstring_partsr/   new_fstring_partsr  is_constantr+  s	            r   visit_JoinedStrz_Unparser.visit_JoinedStr  s!   

3" 	I 0F))$///0 0 0 0 0 0 0 0 0 0 0 0 0 0 077HHH [ 	 	E 1F))%0001 1 1 1 1 1 1 1 1 1 1 1 1 1 1  *UH"="=>    ;''"/ 	, 	,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!|j        D ]}|                     |           d S t          |t                    r`t          |j        t                    rF|j                            dd                              dd          }|                     |           d S t          |t                    r| 
                    |           d S t          d|          )N{z{{}z}}z"Unexpected node inside JoinedStr, )r   	JoinedStrrL   r.  r-   r/   rU   replacerS  FormattedValuevisit_FormattedValuer&   r   r'   r/   s      r   r.  z_Unparser._write_fstring_inner  s    dI&& 
	L 1 1))%00001 1h'' 	LJtz3,G,G 	LJ&&sD1199#tDDEJJun-- 	L%%d+++++J$JJKKKr   c                 
     fd}                      dd          5   ||j                  }d|v rt          d          |                    d          r                     d                                |           |j        dk    r*                     dt          |j                              |j        r/                     d	                                |j                   d d d            d S # 1 swxY w Y   d S )
Nc                      t                    d          }|                    t          j                                        |            |                    |           S )NTr?  )r.   rv  r$  r+  r'  r   )innerunparserr   s     r   unparse_innerz5_Unparser.visit_FormattedValue.<locals>.unparse_inner  sR    !tDzzT:::H##K$4$9$9$;$;UCCC>>%(((r   r5  r6  r  z5Unable to avoid backslash in f-string expression partr   r   !re  )	rj  r/   r&   r   rS  
conversionchrformat_specr.  )r   r'   r@  exprs   `   r   r:  z_Unparser.visit_FormattedValue  s_   	) 	) 	) 	) 	)
 \\#s## 	< 	< =,,Dt|| K   s##  

3JJt"$$

5s4?3355666 <

3))$*:;;;	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	<s   CC88C<?C<c                 :    |                      |j                   d S r,   )rS  rF   rs  s     r   
visit_Namez_Unparser.visit_Name  s    

47r   c                     |                                   |j        dk    r|                     d           |                     |j        t
                     d S )Nur)  )r\  kindrS  r,  r/   r  rs  s     r   r  z_Unparser._write_docstring  sL    		9JJsOOO,,TZ],SSSSSr   c           
         t          |t          t          f          rb|                     t	          |                              dt                                        ddt           dt           d                     d S | j        r,t          |t                    r| 	                    |           d S |                     t	          |                     d S )Ninfnanrc   -rd   )
r   r1   r2   rS  rw   r8  _INFSTRr@  rU   r,  r   s     r   _write_constantz_Unparser._write_constant  s    eeW-.. 	$ JJU(( 8G 8 8g 8 8 899    
 $ 	$E3)?)? 	$0077777JJtE{{#####r   c                    |j         }t          |t                    rL|                     dd          5  |                     | j        |           d d d            d S # 1 swxY w Y   d S |du r|                     d           d S |j        dk    r|                     d           |                     |j                    d S )Nrc   rd   ....rI  )r/   r   r   rj  rW  rP  rS  rJ  r;  s      r   r   z_Unparser.visit_Constant  s   
eU## 	-c3'' = = 4e<<<= = = = = = = = = = = = = = = = = =c\\JJuyC

3  ,,,,,s   AA #A c                                            dd          5                        fd j        |j                   d d d            d S # 1 swxY w Y   d S )Nre   rn   c                  .                          d          S rQ  rR  r   s   r   rT  z&_Unparser.visit_List.<locals>.<lambda>  rU  r   )rj  rM  r~  r?   rs  s   ` r   
visit_Listz_Unparser.visit_List  s    \\#s## 	P 	POO4444dmTYOOO	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P   %A

AAc                     |                      dd          5  |                     |j                   |j        D ]}|                     |           	 d d d            d S # 1 swxY w Y   d S )Nre   rn   rj  r~  elt
generatorsr   r'   gens      r   visit_ListCompz_Unparser.visit_ListComp      \\#s## 	# 	#MM$(### # #c""""#	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	#   :AA#&A#c                     |                      dd          5  |                     |j                   |j        D ]}|                     |           	 d d d            d S # 1 swxY w Y   d S )Nrc   rd   rX  r[  s      r   visit_GeneratorExpz_Unparser.visit_GeneratorExp  r^  r_  c                     |                      dd          5  |                     |j                   |j        D ]}|                     |           	 d d d            d S # 1 swxY w Y   d S )Nr5  r6  rX  r[  s      r   visit_SetCompz_Unparser.visit_SetComp  r^  r_  c                 6   |                      dd          5  |                     |j                   |                     d           |                     |j                   |j        D ]}|                     |           	 d d d            d S # 1 swxY w Y   d S )Nr5  r6  r$   )rj  r~  r   rS  r/   rZ  r[  s      r   visit_DictCompz_Unparser.visit_DictComp  s    \\#s## 	# 	#MM$(###JJtMM$*%%% # #c""""#		# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	#s   A)BBBc                    |j         r|                     d           n|                     d           |                     t          j        |j                   |                     |j                   |                     d            | j        t          j                                        |j	        g|j
        R   |                     |j	                   |j
        D ],}|                     d           |                     |           -d S )Nz async for z for r   if )is_asyncrS  rv  r$  r)  r  r~  r+  r'  rH  ifs)r   r'   	if_clauses      r   visit_comprehensionz_Unparser.visit_comprehension
  s    = 	 JJ}%%%%JJwK-t{;;;dk"""

6K,1133TYJJJJJdi    	% 	%IJJvMM)$$$$	% 	%r   c                 ,   |                      t          j        |          5  |                     t          j                                        |j        |j                   |                     |j                   |                     d           |                     |j                   |                     d           |                     t          j        |j	                   |                     |j	                   d d d            d S # 1 swxY w Y   d S )Nrg  z else )
rq  r$  r+  rv  r'  rX   r  r~  rS  r  rs  s     r   visit_IfExpz_Unparser.visit_IfExp  s%     !1488 	' 	' 0 5 5 7 7DINNNMM$)$$$JJvMM$)$$$JJx    0$+>>>MM$+&&&	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	's   CD		DDc                      |j         rU                     dd          5                        fd j        |j                    d d d            d S # 1 swxY w Y   d S                      d           d S )Nr5  r6  c                  .                          d          S rQ  rR  r   s   r   rT  z%_Unparser.visit_Set.<locals>.<lambda>%  s    

4(8(8 r   z{*()})r?   rj  rM  r~  rS  rs  s   ` r   	visit_Setz_Unparser.visit_Set"  s    9 	 c3'' 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
 JJws   %AAAc           	            fd fd}                      dd          5                        fd|t          |j        |j                             d d d            d S # 1 swxY w Y   d S )Nc                                          |                                d                                |           d S Nr$   r~  rS  )kvr   s     r   write_key_value_pairz2_Unparser.visit_Dict.<locals>.write_key_value_pair,  s?    MM!JJtMM!r   c                     | \  }}|L                     d                               t          j        |                               |           d S  ||           d S )N**)rS  rv  r$  r0  r~  )r   ru  rv  r   rw  s      r   
write_itemz(_Unparser.visit_Dict.<locals>.write_item1  so    DAqy 

4   ##K$4a888a     $$Q*****r   r5  r6  c                  .                          d          S rQ  rR  r   s   r   rT  z&_Unparser.visit_Dict.<locals>.<lambda>>  r  r   )rj  rM  rN   rK   rL   )r   r'   rz  rw  s   `  @r   
visit_Dictz_Unparser.visit_Dict+  s    	 	 	 	 	
		+ 		+ 		+ 		+ 		+ 		+ \\#s## 	 	OO((((*c$)T[6Q6Q  	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   3A$$A(+A(c                    |                      ddt          |j                  dk    p"|                     |          t          j        k              5  |                     | j        |j                   d d d            d S # 1 swxY w Y   d S )Nrc   rd   r   )rm  rJ   r?   ro  r$  r)  rW  r~  rs  s     r   visit_Tuplez_Unparser.visit_TupleA  s    __	NNaP4#6#6t#<#<{?P#P
 
 	6 	6
 OODM49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Notr7   r8   )r  r  r  rN  c                    | j         |j        j        j                 }| j        |         }|                     ||          5  |                     |           |t          j        ur|                     d           | 	                    ||j
                   |                     |j
                   d d d            d S # 1 swxY w Y   d S Nr   )unopr6   rt   ru   unop_precedencerq  rS  r$  r7  rv  r9   r~  )r   r'   operatoroperator_precedences       r   visit_UnaryOpz_Unparser.visit_UnaryOpQ  s    9TW.78"28<  !4d;; 	( 	(JJx    #+*<<<

3 3T\BBBMM$,'''	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	(s    A.B;;B?B?r   r  /%<<>>|^&//ry  )rP   rQ   MultMatMultDivModLShiftRShiftBitOrBitXorBitAndFloorDivPow)r  rN  r   r  r  r  r  r  r  r  r  r  ry  )ry  c                 (   | j         |j        j        j                 }| j        |         }|                     ||          5  || j        v r|                                }|}n|}|                                }|                     ||j	                   | 
                    |j	                   |                     d| d           |                     ||j                   | 
                    |j                   d d d            d S # 1 swxY w Y   d S r  )r  r6   rt   ru   binop_precedencerq  binop_rassocr'  rv  rR   r~  rS  rS   )r   r'   r  r  left_precedenceright_precedences         r   visit_BinOpz_Unparser.visit_BinOp~  sQ   :dg/89"3H=  !4d;; 	& 	&4,,,"5":":"<"<#6  "5#6#;#;#=#= ;;;MM$)$$$JJ8''' 0$*===MM$*%%%	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	&s    B:DDDz==z!=<z<=>z>=iszis notinznot in)
EqNotEqLtLtEGtGtEIsIsNotInNotInc                    |                      t          j        |          5   | j        t          j                                        |j        g|j        R   |                     |j                   t          |j	        |j                  D ]J\  }}| 
                    d| j        |j        j                 z   dz              |                     |           K	 d d d            d S # 1 swxY w Y   d S r  )rq  r$  r/  rv  r'  rR   comparatorsr~  rN   opsrS  cmpopsrt   ru   )r   r'   or  s       r   visit_Comparez_Unparser.visit_Compare  s&     $77 	! 	!D 4 4 6 6	UDDTUUUUMM$)$$$DHd&677 ! !1

3Q[-A!BBSHIIIa    !	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	!s   B5C$$C(+C(andor)AndOr)r  r  c                      j         |j        j        j                 } j        |          fd}                     |          5  d| d                      fd||j                   d d d            d S # 1 swxY w Y   d S )Nc                                                                          |                                |            d S r,   )r'  rv  r~  )r'   r  r   s    r   increasing_level_traversez9_Unparser.visit_BoolOp.<locals>.increasing_level_traverse  sD    "5":":"<"< 3T:::MM$r   r   c                  .                                    S r,   rR  )r   r   s   r   rT  z(_Unparser.visit_BoolOp.<locals>.<lambda>  s    DJJqMM r   )boolopsr6   rt   ru   boolop_precedencerq  rM  rL   )r   r'   r  r  r  r   s   `   @@r   visit_BoolOpz_Unparser.visit_BoolOp  s	   < 1 :;"4X>	  	  	  	  	  	    !4d;; 	[ 	[HAOO111113LdkZZZ	[ 	[ 	[ 	[ 	[ 	[ 	[ 	[ 	[ 	[ 	[ 	[ 	[ 	[ 	[ 	[ 	[ 	[s   	'A==BBc                 ~   |                      t          j        |j                   |                     |j                   t          |j        t                    r4t          |j        j        t                    r|                     d           |                     d           |                     |j	                   d S )Nr   r  )
rv  r$  r:  r/   r~  r   r-   r0   rS  r   rs  s     r   visit_Attributez_Unparser.visit_Attribute  s    K,dj999dj!!! dj(++ 	
4:;KS0Q0Q 	JJsOOO

3

49r   c                    |                      t          j        |j                   |                     |j                   |                     dd          5  d}|j        D ]1}|r|                     d           nd}|                     |           2|j        D ]1}|r|                     d           nd}|                     |           2	 d d d            d S # 1 swxY w Y   d S )Nrc   rd   Fra   T)	rv  r$  r:  rD   r~  rj  rG   rS  rH   )r   r'   r  r  s       r   
visit_Callz_Unparser.visit_Call  sC   K,di888di   \\#s## 	! 	!EY ! ! !JJt$$$$ Ea    ] ! ! !JJt$$$$ Ea    !	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	!s   A5CC Cc                    d }|                      t          j        |j                   |                     |j                   |                     dd          5   ||j                  r&|                     | j        |j        j                   n|                     |j                   d d d            d S # 1 swxY w Y   d S )Nc                 :    t          | t                    o| j        S r,   )r   r=   r?   )slice_values    r   is_non_empty_tuplez5_Unparser.visit_Subscript.<locals>.is_non_empty_tuple  s    ;.. %$r   re   rn   )	rv  r$  r:  r/   r~  rj  r  rW  r?   )r   r'   r  s      r   visit_Subscriptz_Unparser.visit_Subscript  s    	 	 	 	K,dj999dj!!!\\#s## 	* 	*!!$*-- *tz????dj)))	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	*s   AB77B;>B;c                     |                      d           |                     t          j        |j                   |                     |j                   d S )Nr   )rS  rv  r$  r0  r/   r~  rs  s     r   visit_Starredz_Unparser.visit_Starred  sF    

3K,dj999dj!!!!!r   c                 0    |                      d           d S )NrR  rR  rs  s     r   visit_Ellipsisz_Unparser.visit_Ellipsis  s    

5r   c                 $   |j         r|                     |j                    |                     d           |j        r|                     |j                   |j        r1|                     d           |                     |j                   d S d S )Nre  )lowerr~  rS  uppersteprs  s     r   visit_Slicez_Unparser.visit_Slice  s    : 	&MM$*%%%

3: 	&MM$*%%%9 	%JJsOOOMM$)$$$$$	% 	%r   c                     |                      d           |                     |j                   |                                 5  |j        D ]}|                     |           	 d d d            d S # 1 swxY w Y   d S )Nzmatch )r\  r~  subjectrf  cases)r   r'   cases      r   visit_Matchz_Unparser.visit_Match  s    		(dl###ZZ\\ 	$ 	$
 $ $d####$	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$s    A22A69A6c                     |                      |j                   |j        r1|                      d           |                     |j                   d S d S rs  )rS  argr  r~  rs  s     r   	visit_argz_Unparser.visit_arg  sV    

48? 	+JJtMM$/*****	+ 	+r   c                 8   d}|j         |j        z   }d gt          |          t          |j                  z
  z  |j        z   }t	          t          ||          d          D ]\  }}|\  }}|rd}n|                     d           |                     |           |r*|                     d           |                     |           |t          |j                   k    r|                     d           |j        s|j	        r|rd}n|                     d           |                     d           |j        r_|                     |j        j
                   |j        j        r4|                     d           |                     |j        j                   |j	        rvt          |j	        |j                  D ][\  }}|                     d           |                     |           |r*|                     d           |                     |           \|j        r~|rd}n|                     d           |                     d	|j        j
        z              |j        j        r8|                     d           |                     |j        j                   d S d S d S )
NTr^   Fra   rb   z, /r   r$   ry  )posonlyargsrG   rJ   defaults	enumeraterN   rS  r~  vararg
kwonlyargsr  r  kw_defaultskwarg)	r   r'   r   all_argsr  r   elementsads	            r   visit_argumentsz_Unparser.visit_arguments  s   #di/6S]]S-?-??@4=P(Xx)@)@!DD 	" 	"OE8DAq !

4   MM! !

3a   D,----

5!!! ; 
	:$/ 
	: !

4   JJsOOO{ :

4;?+++;) :JJt$$$MM$+"8999 ? 	%DOT-=>> % %1

4   a    %JJsOOOMM!$$$ : 	5 !

4   JJtdjn,---z$ 5

4   dj344444	5 	55 5r   c                     |j         |                     d           n/|                     |j                    |                     d           |                     |j                   d S )Nry  rb   )r  rS  r~  r/   rs  s     r   visit_keywordz_Unparser.visit_keyword4  s\    8JJtJJtx   JJsOOOdj!!!!!r   c                    |                      t          j        |          5  |                     d           |                                 5 }|                     |j                   d d d            n# 1 swxY w Y   |r | j        dg|R   |                     d           |                     t          j        |j                   |                     |j                   d d d            d S # 1 swxY w Y   d S )Nlambdar   r$   )	rq  r$  r+  rS  ra  r~  rG   rv  rX   )r   r'   r_  s      r   visit_Lambdaz_Unparser.visit_Lambda<  sh     !1488 	% 	%JJx    )Fdi((() ) ) ) ) ) ) ) ) ) ) ) ) ) ) )
3(((((JJt 0$)<<<MM$)$$$	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	%s6   *C.A2&C.2A6	6C.9A6	:A'C..C25C2c                     |                      |j                   |j        r|                      d|j        z              d S d S Nr  )rS  r|   asnamers  s     r   visit_aliasz_Unparser.visit_aliasG  sI    

49; 	-JJv+,,,,,	- 	-r   c                     |                      |j                   |j        r1|                     d           |                      |j                   d S d S r  )r~  context_exproptional_varsrS  rs  s     r   visit_withitemz_Unparser.visit_withitemL  sY    d'((( 	.JJvMM$,-----	. 	.r   c                 ^   |                      d           |                     |j                   |j        r/|                     d           |                     |j                   |                                 5  |                     |j                   d d d            d S # 1 swxY w Y   d S )Nzcase rg  )r\  r~  patternguardrS  rf  rX   rs  s     r   visit_match_casez_Unparser.visit_match_caseR  s    		'dl###: 	&JJvMM$*%%%ZZ\\ 	% 	%MM$)$$$	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	%s   :B""B&)B&c                 :    |                      |j                   d S r,   )r~  r/   rs  s     r   visit_MatchValuez_Unparser.visit_MatchValue[  s    dj!!!!!r   c                 :    |                      |j                   d S r,   )rP  r/   rs  s     r   visit_MatchSingletonz_Unparser.visit_MatchSingleton^  s    TZ(((((r   c                                            dd          5                        fd j        |j                   d d d            d S # 1 swxY w Y   d S )Nre   rn   c                  .                          d          S rQ  rR  r   s   r   rT  z/_Unparser.visit_MatchSequence.<locals>.<lambda>d  r  r   )rj  rM  r~  patternsrs  s   ` r   visit_MatchSequencez_Unparser.visit_MatchSequencea  s    \\#s## 	 	OO(((($-  	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	rV  c                 L    |j         }|d}|                     d|            d S )N_r   )r|   rS  )r   r'   r|   s      r   visit_MatchStarz_Unparser.visit_MatchStarg  s1    y<D

:t::r   c           
      L     fd}                      dd          5  |j        }                      fd|t          ||j        d                     |j        }|/|r                     d                                d|            d d d            d S # 1 swxY w Y   d S )	Nc                     | \  }}                     |                               d                                |           d S rs  rt  )pairru  pr   s      r   write_key_pattern_pairz<_Unparser.visit_MatchMapping.<locals>.write_key_pattern_pairn  sH    DAqMM!JJtMM!r   r5  r6  c                  .                          d          S rQ  rR  r   s   r   rT  z._Unparser.visit_MatchMapping.<locals>.<lambda>w  r  r   Tstrictra   ry  )rj  rK   rM  rN   r  restrS  )r   r'   r
  rK   r  s   `    r   visit_MatchMappingz_Unparser.visit_MatchMappingm  s   	 	 	 	 	 \\#s## 	( 	(9DOO((((&D$-555  
 9D %JJt$$$

;;;'''	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	(s   A/BB Bc           
                                t          j        |j                                        |j                                        dd          5  |j        }                      fd j        |           |j        }|rK fd}|r 	                    d                                 fd|t          ||j        d                     d d d            d S # 1 swxY w Y   d S )	Nrc   rd   c                  .                          d          S rQ  rR  r   s   r   rT  z,_Unparser.visit_MatchClass.<locals>.<lambda>  r  r   c                 l    | \  }}                     | d                               |           d S )Nrb   )rS  r~  )r  r   r  r   s      r   write_attr_patternz6_Unparser.visit_MatchClass.<locals>.write_attr_pattern  s<    $(MD'JJ$zzz***MM'*****r   ra   c                  .                          d          S rQ  rR  r   s   r   rT  z,_Unparser.visit_MatchClass.<locals>.<lambda>  s    DJJt,, r   Tr  )rv  r$  r:  rz   r~  rj  r  rM  	kwd_attrsrS  rN   kwd_patterns)r   r'   r  attrsr  s   `    r   visit_MatchClassz_Unparser.visit_MatchClass  sY   K,dh777dh\\#s## 	 	}HOO(((($-   NE + + + + +
  %JJt$$$,,,,&t0>>>  	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   A;CC#&C#c                    |j         }|j        }||                     d           d S ||                     |j                    d S |                     t          j        |          5  |                     t          j        |j                   |                     |j                   |                     d|j                     d d d            d S # 1 swxY w Y   d S )Nr  r  )	r|   r  rS  rq  r$  r+  rv  r1  r~  )r   r'   r|   r  s       r   visit_MatchAsz_Unparser.visit_MatchAs  s   y,<JJsOOOOO_JJty!!!!!$$[%5t<< / /##KOT\BBBdl+++

-$)--.../ / / / / / / / / / / / / / / / / /s   &ACCCc                                            t          j        |          5    j        t          j                                        g|j        R                         fd j        |j                   d d d            d S # 1 swxY w Y   d S )Nc                  .                          d          S )Nz | rR  r   s   r   rT  z)_Unparser.visit_MatchOr.<locals>.<lambda>  s    DJJu$5$5 r   )rq  r$  r1  rv  r'  r  rM  r~  rs  s   ` r   visit_MatchOrz_Unparser.visit_MatchOr  s      $77 	U 	UD 4 4 6 6GGGGGOO5555t}dmTTT	U 	U 	U 	U 	U 	U 	U 	U 	U 	U 	U 	U 	U 	U 	U 	U 	U 	Us   ABB
B)r`   r,   )ru   r   r   r   r   rM  rW  rY  r\  rS  r   ra  rf  rj  rm  rq  ro  rv  rx  r|  r~  r   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r  r	  r  r  r/  r(  r,  r3  r.  r:  rG  r  rP  r   rU  r]  ra  rc  re  rk  rm  rp  r|  r~  r  r$  r.  r7  r  r  r  r5  r6  r4  r1  r2  r3  r8  r  	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  r  r  r  r  r  r  __classcell__)rt   s   @r   r>  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: : :' ' '- - -+ + ++ + +$+ + +% % %% % % &1E$/ $/ $/ $/ $/L FQ 8 8 8 8 8!7 !7 !7FL L L< < <,  T T T$ $ $
- 
- 
-P P P# # ## # ## # ## # #% % %' ' '       ,6 6 6 %cBBD	 O
( 
( 
(  E" _   9W%%L& & &$  F! ! ! 4((G +{~FF[ [ [	 	 	! ! !$* * * " " "
  % % %$ $ $+ + +15 15 15f" " "	% 	% 	%- - -
. . .% % %" " ") ) )    ( ( ((  ./ / /U U U U U U Ur   r>  c                 H    t                      }|                    |           S r,   )r>  r   )ast_objr?  s     r   unparser"    s    {{H>>'"""r   c                     dd l } |                     d          }|                    d|                     d          ddd	
           |                    ddddd           |                    dddd           |                    dddd           |                    ddt          dd           |                                }|j        5 }|                                }d d d            n# 1 swxY w Y   t          ||j        j	        |j
        |j                   }t          t          ||j        |j        !                     d S )"Nr   zpython -m ast)proginfilerbr!   ?rN  z$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--indentr   z'indentation of nodes (number of spaces))r.   r)  r*  )r   )r   r[   )argparseArgumentParseradd_argumentFileTyper0   
parse_argsr%  readr   r|   r   no_type_commentsprintr   r   r[   )r1  parserrG   r%  r   trees         r   mainr;    s   OOO$$/$::F
x'8'8d'8'C'C3 #C  E E E h GG  I I I ,d=H  J J J
4\.  / / / jsAF  H H HD	               )49DDYZZZD	$t(?
T
T
TUUUUUs   C00C47C4__main__)r	   r
   )TF)r^   )T)Lr   sys_ast
contextlibr   r   enumr   r   r   r   rZ   r   r   r   r   r   r   r   r   r   r   r   objectr   r   r   r-   r   r   propertyr   r   r.   r   r   r   r   r  r  r  r0   r1   r2   rU   bytesboolr   r   r   ro   r  r  r  r=   r  r  r  modr  expr_contextr  r  r!  rw   
float_info
max_10_exprO  r$  _SINGLE_QUOTESr  r/  r>  r"  r;  ru   rh   r   r   <module>rJ     sH   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(t8 8 8 8 8k 8 8 8x wx ,     '7++HJ'7++HJ1 1 1 1 14 1 1 1(
2 
2 
2    (d        (d        H        8t    6 6 6 6 6x4 6 6 6 6 #ug	#	E844::t$ttCyyl $ 
 	.DJJ	5U	7DIIz	 % % % % %C % % %    E   
3 3 3 3 3u 3 3 3 wuf 6     ,55EJ: : : : :C : : :: : : : :l : : :: : : : :| : : :: : : : :L : : : cn/!344
4g       > ////}U }U }U }U }U }U }U }U~# # #
V V V0 zDFFFFF r   