
    F\h;                        S r SSKrSSKrSSK7  SSKJrJr  SSKJrJ	r	J
r
  SQSSSS.S	 jjrS
 r SRSSS.S jjrS rS rSSS jrS rS rSTS jr\R(                  " S5      rSUS jrS rSS.S jrS r " S S\5      r " S S\5      rSrSr\" \ S 5      (       d(  S! r!S" r"S# r#S$ r$\%" \!\"5      \ l&        \%" \#\$5      \ l'         " S% S&\(5      r)S' r* " S( S)\ \)S*9r+ " S+ S,\ \)S*9r, " S- S.\ \)S*9r- " S/ S0\ \)S*9r. " S1 S2\ \)S*9r/\/r0\+\1\2\34\,\44\-\54\.\(" S5      \64\/\(" S35      40r7\+\640r8\6S0\(" S5      S0\1S)\2S)\3S)\4S,\5S.\(" S35      S20r9 " S4 S5\:5      r; " S6 S7\;5      r< " S8 S9\;5      r=\" \>S:5      (       d  S; r?S< r@\%" \?\@5      \>lA         " S= S>\B5      rC " S? S@\D5      rE " SA SB\D5      rF " SC SD\D5      rGSE\H" \R                  R                  S-   5      -   rK\
" \5       " SF SG5      5       rLSHrMSIrN/ \MQ\NQ7rO " SJ SK\5      rPSL rQSM V s0 s H  n U \R" 5       R                  U 5      _M     sn rTSN rUSO rV\WSP:X  a  \V" 5         ggs  sn f )Va  
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_enumF)type_commentsfeature_versionoptimizec          	          [         nUS:  a	  U[        -  nU(       a	  U[        -  nUc  SnO/[        U[        5      (       a  Uu  pxUS:w  a  [        SU 35      eUn[        XX&XES9$ )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.
r   r	      zUnsupported major version: )_feature_versionr   )PyCF_ONLY_ASTPyCF_OPTIMIZED_ASTPyCF_TYPE_COMMENTS
isinstancetuple
ValueErrorcompile)	sourcefilenamemoder
   r   r   flagsmajorminors	            /usr/lib/python3.13/ast.pyparser      s}     E!|####	OU	+	+&A::5'BCC6T$3H H    c                    ^^^^ [        U [        5      (       a  [        U R                  S5      SS9n [        U [        5      (       a  U R
                  n S mU4S jmU4S jmUUUU4S jmT" U 5      $ )a<  
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                 b    Sn[        U SS 5      =n(       a  USU 3-  n[        USU < 3-   5      e)Nzmalformed node or stringlinenoz	 on line : )getattrr   )nodemsglnos      r   _raise_malformed_node+literal_eval.<locals>._raise_malformed_nodeC   sB    ($$//3/Yse$$CD8},--r   c                    > [        U [        5      (       a(  [        U R                  5      [        [
        [        4;  a  T" U 5        U R                  $ N)r   Constanttypevalueintfloatcomplex)r&   r)   s    r   _convert_num"literal_eval.<locals>._convert_numH   s:    $))T$**-=c5RYEZ-Z!$'zzr   c                    > [        U [        5      (       a\  [        U R                  [        [        45      (       a7  T" U R
                  5      n[        U R                  [        5      (       a  U7$ U* $ T" U 5      $ r,   )r   UnaryOpopUAddUSuboperand)r&   r:   r3   s     r   _convert_signed_num)literal_eval.<locals>._convert_signed_numL   s^    dG$$DGGdD\)J)J"4<<0G$''4(( y  y D!!r   c           	        > [        U [        5      (       a  U R                  $ [        U [        5      (       a  [	        [        TU R                  5      5      $ [        U [        5      (       a  [        [        TU R                  5      5      $ [        U [        5      (       a  [        [        TU R                  5      5      $ [        U [        5      (       af  [        U R                  [        5      (       aG  U R                  R                  S:X  a-  U R                  U R                   s=:X  a  / :X  a   [        5       $   [        U ["        5      (       aq  [%        U R&                  5      [%        U R(                  5      :w  a  T" U 5        [+        [-        [        TU R&                  5      [        TU R(                  5      5      5      $ [        U [.        5      (       a  [        U R0                  [2        [4        45      (       a{  T" U R6                  5      nT" U R8                  5      n[        U[:        [<        45      (       a<  [        U[>        5      (       a'  [        U R0                  [2        5      (       a  X-   $ X-
  $ T" U 5      $ )Nset) r   r-   r/   Tupler   mapeltsListlistSetr>   CallfuncNameidargskeywordsDictlenkeysvaluesdictzipBinOpr7   AddSubleftrightr0   r1   r2   )r&   rT   rU   _convertr3   r;   r)   s      r   rV   literal_eval.<locals>._convertT   s   dH%%::e$$Xtyy122d##Hdii011c""s8TYY/00t$$DIIt)D)Diille#		T]](Hb(H5L )Id##499~T[[!11%d+C$))4$++68 9 9e$$DGGc3Z)H)H&tyy1D ,E$e--*UG2L2Ldggs++<'<'"4((r   )r   strr   lstrip
Expressionbody)node_or_stringrV   r3   r;   r)   s    @@@@r   literal_evalr]   6   sg     .#&&~44U;&I.*--',,.
") )4 N##r   )indent
show_emptyc                   ^^^^^ SUUUUU4S jjm[        U [        5      (       d"  [        SU R                  R                  -  5      eTb  [        T[
        5      (       d  ST-  mT" U 5      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.
If show_empty is False, then empty lists and fields that are None
will be omitted from the output for better readability.
r   c                 V  >^ Tb  TS-  mSTT-  -   nSTT-  -   nOSnSn[        U [        5      (       Ga  [        U 5      n/ n/ nSnTnU R                   H  n	 [	        X	5      n
U
c  [	        XIS5      c  SnM#  T(       dw  U
/ :X  aW  UR                  R                  U	[        5      n[	        USS5      [        L a#  U(       d  UR                  [        U
5      5        M  U(       d  UR                  U5        / nT" U
T5      u  pU=(       a    UnU(       a  UR                  U	< S	U
< 35        M  UR                  U
5        M     T(       ap  U R                  (       a_  U R                   HO  n	 [	        X	5      n
U
c  [	        XIS5      c  M!  T" U
T5      u  pU=(       a    UnUR                  U	< S	U
< 35        MQ     U(       aC  [        U5      S
::  a4  U R                  R                   < SSR#                  U5      < S3U(       + 4$ U R                  R                   < SU< UR#                  U5      < S3S4$ [        U [        5      (       a.  U (       d  gSU< UR#                  UU4S jU  5       5      < S3S4$ [        U 5      S4$ ! [
         a    Sn GM@  f = f! [
         a     GMA  f = f)N   
z,
 , T.
__origin__=r   ()F)z[]T[c              3   <   >#    U  H  nT" UT5      S    v   M     g7fr   N ).0x_formatlevels     r   	<genexpr>(dump.<locals>._format.<locals>.<genexpr>   s     /Sd50A!0Dds   ])r   ASTr.   _fieldsr%   AttributeError_field_typesgetobjectrC   appendreprextend_attributesrL   	__class____name__join)r&   rq   prefixsepclsrI   args_buffer	allsimplerJ   namer/   
field_typesimplerp   annotate_fieldsinclude_attributesr^   r_   s    `           r   rp   dump.<locals>._format   si   QJEFUN*F&5.(CFCdC  t*CDKI&H#D/E =WS%<%D#H!{%(%5%5%9%9$%G
":|SATI#+ + 2 24; ?$#K0&( 'u 5%0&	KK4 78KK&1 %2 "d&6&6 ,,D! ' 3 }C)@)H $+E5$9ME ) 4fIKK4 78 - SY!^#'>>#:#:DIIdOLRVhVV!%!8!8&#((4.QSXXXd##! %sxx/Sd/S'STV[[[Dz4Q & #H4 * ! !s$   J*JJJ
J('J(zexpected AST, got %r )r   )r   ru   	TypeErrorr   r   rX   )r&   r   r   r^   r_   rp   s    ````@r   dumpr   q   sb    $9  9 v dC  .1H1HHII*VS"9"9v4=r   c                     S Hj  nX!R                   ;   d  M  X R                   ;   d  M%  [        XS5      nUc*  [        X5      (       d  MF  UR                  S5      (       d  M^  [	        XU5        Ml     U $ )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_)r~   r%   hasattr
startswithsetattr)new_nodeold_nodeattrr/   s       r   copy_locationr      se    
 G'''D4H4H,HHD1E  ''DOOF,C,C. G Or   c                 ,   ^ U4S jmT" U SSSS5        U $ )ac  
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                   > SU R                   ;   a$  [        U S5      (       d  Xl        OU R                  nSU R                   ;   a!  [        U SS 5      c  X0l        OU R                  nSU R                   ;   a$  [        U S5      (       d  X l        OU R
                  nSU R                   ;   a!  [        U SS 5      c  X@l        OU R                  n[        U 5       H  nT" XQX#U5        M     g )Nr#   r   r   r   )r~   r   r#   r%   r   r   r   iter_child_nodes)r&   r#   r   r   r   child_fixs         r   r   #fix_missing_locations.<locals>._fix   s    t'''4**$4+++t\408",!__
4+++4..",!__
t///t-t4<&4#!%!4!4%d+E
G ,r   rb   r   rm   )r&   r   s    @r   fix_missing_locationsr      s     H. 	q!QKr   rb   c                 &   [        U 5       H  n[        U[        5      (       a  [        USS5      U-   Ul        M/  SUR
                  ;   a  [        USS5      U-   Ul        SUR
                  ;   d  Mf  [        USS5      =nc  Mx  X1-   Ul        M     U $ )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#   r~   r   )r&   nr   r   s       r   increment_linenor      s     d eZ(("5(A6:ELu((("5(A6:ELE---&ulA>>K)~E  Kr   c              #   t   #    U R                    H  n U[        X5      4v   M     g! [         a     M%  f = f7f)zg
Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields``
that is present on *node*.
N)rv   r%   rw   )r&   fields     r   iter_fieldsr     s=     
 	---   		s   8'8
5858c              #      #    [        U 5       H[  u  p[        U[        5      (       a  Uv   M   [        U[        5      (       d  M7  U H  n[        U[        5      (       d  M  Uv   M      M]     g7f)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   ru   rC   )r&   r   r   items       r   r   r     sS     
 #4(eS!!Kt$$dC((J 	 )s   ?A.A.!A.c                    [        U [        [        [        [        45      (       d"  [        SU R                  R                  -  5      eU R                  (       a"  [        U R                  S   [        5      (       d  gU R                  S   R                  n [        U [        5      (       a,  [        U R                  [        5      (       a  U R                  nOgU(       a  SSKnUR                  U5      nU$ )a+  
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   r   r   r[   Exprr/   r-   rX   inspectcleandoc)r&   cleantextr   s       r   get_docstringr   *  s     d-{HfMNN2T^^5L5LLMM99DIIaL$7799Q<D$!!jS&A&Azz%Kr   z(.*?(?:\r\n|\n|\r|$))c                     / n[        [        R                  U 5      S5       H$  u  p4Ub  X1:  a    U$ UR                  US   5        M&     U$ )zuSplit a string into lines ignoring form feed and other chars.

This mimics how the Python parser splits source code.
rb   r   )	enumerate_line_patternfinditerr{   )r   maxlineslinesr#   matchs        r   _splitlines_no_ffr   C  sT    
 E"=#9#9&#A1EF$5L 	U1X F Lr   c                 >    SnU  H  nUS;   a  X-  nM  US-  nM     U$ )z6Replace all chars except '\f\t' in a line with spaces.rd   z	r   rm   )r   resultcs      r   _pad_whitespacer   P  s/    F;KFcMF	 
 Mr   )paddedc                    UR                   b  UR                  c  gUR                  S-
  nUR                   S-
  nUR                  nUR                  n[        XS-   S9nXC:X  a"  Xs   R                  5       XV R                  5       $ U(       a-  [        Xs   R                  5       SU R                  5       5      nOSnXU   R                  5       US R                  5       -   n	Xt   R                  5       SU R                  5       n
XsS-   U nUR                  SU	5        UR                  U
5        SR                  U5      $ ! [         a     gf = f)a.  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.
Nrb   )r   rd   r   )r   r   r#   r   rw   r   encodedecoder   insertr{   r   )r   r&   r   r#   r   r   r   r   paddingfirstlasts              r   get_source_segmentr   [  s@   ??"d&9&9&Aq__q(
__
,, f!|<E}##%j@GGII!%-"6"6"8*"E"L"L"NOFm**,Z[9@@BBE##%o~6==?D(:&E	LLE	LL775>%  s   E  6E   
EEc              #      #    SSK Jn  U" U /5      nU(       a8  UR                  5       n UR                  [	        U 5      5        U v   U(       a  M7  gg7f)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   popleftr}   r   )r&   r   todos      r   r   r     sA      "$=D
||~$T*+
 $s   AAAc                   *    \ rS rSrSrS rS rS rSrg)NodeVisitori  a  
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                 p    SUR                   R                  -   n[        XU R                  5      nU" U5      $ )zVisit a node.visit_)r   r   r%   generic_visit)selfr&   methodvisitors       r   visitNodeVisitor.visit  s2    DNN333$(:(:;t}r   c                    [        U5       Hu  u  p#[        U[        5      (       a3  U H+  n[        U[        5      (       d  M  U R	                  U5        M-     MM  [        U[        5      (       d  Md  U R	                  U5        Mw     g)z9Called if no explicit visitor function exists for a node.N)r   r   rC   ru   r   )r   r&   r   r/   r   s        r   r   NodeVisitor.generic_visit  s^    '-LE%&&!D!$,,

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

5! .r   c                 t   UR                   n[        R                  [        U5      5      nUc1  [        R	                  5        H  u  pE[        X$5      (       d  M  Un  O   Ub7  SU-   n [        X5      nSS KnUR                  U S3[        S5        U" U5      $ U R                  U5      $ ! [         a     Nf = f)Nr   r   z" is deprecated; add visit_Constant   )r/   _const_node_type_namesry   r.   itemsr   r%   warningswarnDeprecationWarningrw   r   )	r   r&   r/   	type_namer   r   r   r   r   s	            r   visit_ConstantNodeVisitor.visit_Constant  s    

*..tE{;	399;	e)) $I <  	)F%!$/  (JK0!5t}$!!$'' " s   (B* *
B76B7rm   N)	r   
__module____qualname____firstlineno____doc__r   r   r   __static_attributes__rm   r   r   r   r     s    &"(r   r   c                       \ rS rSrSrS rSrg)NodeTransformeri  a  
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                    [        U5       H  u  p#[        U[        5      (       au  / nU Hg  n[        U[        5      (       a>  U R	                  U5      nUc  M.  [        U[        5      (       d  UR                  U5        MV  UR                  U5        Mi     XCS S & M  [        U[        5      (       d  M  U R	                  U5      nUc  [        X5        M  [        XU5        M     U$ r,   )	r   r   rC   ru   r   r}   r{   delattrr   )r   r&   r   	old_value
new_valuesr/   r   s          r   r   NodeTransformer.generic_visit  s     +D 1E)T**
&E!%-- $

5 1 =$!+E3!7!7&--e4$%%e, '  *!Is++::i0#D(D2% !2& r   rm   N)r   r   r   r   r   r   r   rm   r   r   r   r     s    !Fr   r   zN{name} is deprecated and will be removed in Python {remove}; use value insteadzU{name} is deprecated and will be removed in Python {remove}; use ast.Constant insteadr   c                 L    SSK nUR                  S[        SS9  U R                  $ )Deprecated. Use value instead.r   NAttribute nr      messageremover   _deprecated_DEPRECATED_VALUE_ALIAS_MESSAGEr/   r   r   s     r   	_n_getterr     ,    #B7 	 	
 zzr   c                 B    SS K nUR                  S[        SS9  Xl        g )Nr   r   r   r   r   r   r/   r   s      r   	_n_setterr    '    #B7 	 	
 
r   c                 L    SSK nUR                  S[        SS9  U R                  $ )r   r   NAttribute sr   r   r   r   s     r   	_s_getterr     r  r   c                 B    SS K nUR                  S[        SS9  Xl        g )Nr   r  r   r   r   r  s      r   	_s_setterr
  (  r  r   c                        \ rS rSrS rS rSrg)_ABCi2  c                     SU l         g )Nz3Deprecated AST node class. Use ast.Constant instead)r   )r   rI   s     r   __init___ABC.__init__4  s	    Or   c                    U [         ;   a&  SS KnUR                  SU R                   3[        SS9  [        U[        5      (       d  gU [         ;   aL   UR                  n[        U[         U    5      =(       a%    [        U[        R                  U S5      5      (       + $ [        R                  X5      $ ! [         a     gf = f)Nr   ast.r   r   Frm   )_const_typesr   r   r   _DEPRECATED_CLASS_MESSAGEr   r-   r/   _const_types_notry   rw   r.   __instancecheck__)r   instr   r/   s       r   r  _ABC.__instancecheck__7  s    ,  s''()1 ! 
 $)),


 ul3&78 I"5*:*>*>sB*GHH %%c00 " s   B2 2
B?>B?rm   N)r   r   r   r   r  r  r   rm   r   r   r  r  2  s    P1r   r  c                 j   U HY  nX0R                   ;  a  M  U R                   R                  U5      nU[        U5      :  d  M@  [        U R                   SU< 35      e   U [
        ;   a1  SS KnUR                  SU R                   3[        SS9  [        U0 UD6$ [        R                  " U /UQ70 UD6$ )Nz" got multiple values for argument r   r  r   r   )rv   indexrL   r   r   r  r   r   r   r  r-   __new__)r   rI   kwargskeyposr   s         r   _newr  M  s    kk!kk$T?s||n,NsgVWW  l3##$%/HQX 	 	
 (((C1$1&11r   c                       \ rS rSrSr\rSrg)Numi]  )r   rm   Nr   r   r   r   rv   r  r  r   rm   r   r   r   r   ]      GGr   r   )	metaclassc                       \ rS rSrSr\rSrg)Stria  srm   Nr!  rm   r   r   r%  r%  a  r"  r   r%  c                       \ rS rSrSr\rSrg)Bytesie  r&  rm   Nr!  rm   r   r   r)  r)  e  r"  r   r)  c                       \ rS rSr\rSrg)NameConstantii  rm   N)r   r   r   r   r  r  r   rm   r   r   r+  r+  i  s    Gr   r+  c                       \ rS rSrSrS rSrg)Ellipsisil  rm   c                     U [         L a(  SS KnUR                  S[        SS9  [	        S/UQ70 UD6$ [        R
                  " U /UQ70 UD6$ )Nr   zast.Ellipsisr   r   .)_ast_Ellipsisr   r   r  r-   r  )r   rI   r  r   s       r   r  Ellipsis.__new__o  sZ    -  (A' !  C1$1&115d5f55r   N)r   r   r   r   rv   r  r   rm   r   r   r-  r-  l  s    G6r   r-  .c                       \ rS rSrSrSrg)slicei  zDeprecated AST node class.rm   Nr   r   r   r   r   r   rm   r   r   r2  r2    s    $r   r2  c                       \ rS rSrSrS rSrg)Indexi  z@Deprecated AST node class. Use the index value directly instead.c                     U$ r,   rm   )r   r/   r  s      r   r  Index.__new__  s    r   rm   Nr   r   r   r   r   r  r   rm   r   r   r5  r5    s
    Jr   r5  c                   "    \ rS rSrSrSS jrSrg)ExtSlicei  z1Deprecated AST node class. Use ast.Tuple instead.rm   c                 >    [        [        U5      [        5       40 UD6$ r,   )r?   rC   Load)r   dimsr  s      r   r  ExtSlice.__new__  s    T$Z2622r   N)rm   r8  rm   r   r   r:  r:    s
    ;3r   r:  r=  c                     U R                   $ )zDeprecated. Use elts instead.rA   r   s    r   _dims_getterrB    s    yyr   c                     Xl         g r,   r@  r   r/   s     r   _dims_setterrE    s    	r   c                       \ rS rSrSrSrg)Suitei  /Deprecated AST node class.  Unused in Python 3.rm   Nr3  rm   r   r   rG  rG        9r   rG  c                       \ rS rSrSrSrg)AugLoadi  rH  rm   Nr3  rm   r   r   rK  rK    rI  r   rK  c                       \ rS rSrSrSrg)AugStorei  rH  rm   Nr3  rm   r   r   rM  rM    rI  r   rM  c                       \ rS rSrSrSrg)Parami  rH  rm   Nr3  rm   r   r   rO  rO    rI  r   rO  1ec                      \ rS rSrSr\" 5       r\" 5       r\" 5       r\" 5       r	\" 5       r
\" 5       r\" 5       r\" 5       r\" 5       r\r\" 5       r\" 5       r\" 5       r\" 5       r\" 5       r\" 5       r\" 5       r\" 5       r\" 5       rS rSrg)_Precedencei  z5Precedence table that originated from python grammar.c                 P     U R                  U S-   5      $ ! [         a    U s $ f = fNrb   )r   r   rA  s    r   next_Precedence.next  s.    	>>$(++ 	K	s    %%rm   N)r   r   r   r   r   r   
NAMED_EXPRTUPLEYIELDTESTORANDNOTCMPEXPRBORBXORBANDSHIFTARITHTERMFACTORPOWERAWAITATOMrU  r   rm   r   r   rR  rR    s    ?JFEFE6D	B
&C
&C
&C6D
C6D6DFEFE6DVFFEFE6Dr   rR  )'")z"""'''c                     ^  \ rS rSrSrS rS rS rS rSS jr	S r
\SS
 j5       r\S	S.S j5       r\S 5       rS rS rS rS rS rS rU 4S jrS rS rS rS rS rS rS rS rS rS rS r S  r!S! r"S" r#S# r$S$ r%S% r&S& r'S' r(S( r)S) r*S* r+S+ r,S, r-S- r.S. r/S/ r0S0 r1S1 r2S2 r3S3 r4S4 r5S5 r6S6 r7S7 r8S8 r9S9 r:S: r;S; r<S< r=S= r>S> r?S? r@\AS@SA.SB jrB\ASC.SD jrCSE rDSSF jrESG rFSH rGSI rHSJ rISK rJSL rKSM rLSN rMSO rNSP rOSQ rPSR rQSS rRST rSSU rTSVSWSXSYSZ.rU\VR                  \VR                  \VR                  \VR                  S[.rYS\ rZSXSYS]S^S_S`SaSbScSdSeSfSgSh.r[\VR                  \VR                  \VR                  \VR                  \VR                  \VR                  \VR                  \VR                  \VR                  \VR                  \VR                  \VR                  \VR                  Si.rc\d" Sj5      reSk rfSlSmSnSoSpSqSrSsStSuSv.
rgSw rhSxSySz.ri\VR                  \VR                  S{.rlS| rmS} rnS~ roS rpS rqS rrS rsS rtS ruS rvS rwS rxS ryS rzS r{S r|S r}S r~S rS rS rS rS rSrU =r$ )	_Unparseri  zMethods in this class recursively traverse an AST and
output source code for the abstract syntax; original formatting
is disregarded.c                 J    / U l         0 U l        0 U l        SU l        SU l        g )Nr   F)_source_precedences_type_ignores_indent_in_try_starrA  s    r   r  _Unparser.__init__  s(    !r   c                     [        U5      n U" [        U5      5        U H  nU" 5         U" U5        M     g! [         a     gf = f)z7Call f on each item in seq, calling inter() in between.N)iterrU  StopIteration)r   interfseqro   s        r   
interleave_Unparser.interleave  sG    3i	d3iL !   		s   7 
AAc                    ^  [        U5      S:X  a  U" US   5        T R                  S5        gT R                  U 4S jX5        g)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.rb   r   ,c                  &   > T R                  S5      $ Nre   writerA  s   r   <lambda>&_Unparser.items_view.<locals>.<lambda>      DJJt$4r   N)rL   r  r|  )r   	traverserr   s   `  r   
items_view_Unparser.items_view  s6     u:?eAhJJsOOO4iGr   c                 J    U R                   (       a  U R                  S5        gg)z8Adds a newline if it isn't the start of generated sourcerc   N)rp  r  rA  s    r   maybe_newline_Unparser.maybe_newline  s    <<JJt r   c                 f    U R                  5         U R                  SU R                  -  U-   5        g)zPIndent a piece of text and append it, according to the current
indentation levelz    N)r  r  rs  r   r   s     r   fill_Unparser.fill
  s*     	

6DLL(4/0r   c                 :    U R                   R                  U5        g)zAdd new source partsN)rp  r}   r  s     r   r  _Unparser.write  s    D!r   Nc              #   N   #    Uc  / nU R                   nXl         Uv   X l         g 7fr,   )rp  )r   bufferoriginal_sources      r   buffered_Unparser.buffered  s'     >F,,&s   #%extrac             #      #    U R                  S5        U(       a  U R                  U5        U =R                  S-  sl        Sv   U =R                  S-  sl        g7f)zA 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.
:rb   N)r  rs  )r   r  s     r   block_Unparser.block  s@      	

3JJus   AAc              #   X   #    U R                  U5        Sv   U R                  U5        g7f)zA context manager for preparing the source for expressions. It adds
*start* to the buffer and enters, after exit it adds *end*.Nr  )r   startends      r   delimit_Unparser.delimit,  s!     
 	

5

3s   (*c                 F    U(       a  U R                  X5      $ [        5       $ r,   )r  r   )r   r  r  	conditions       r   
delimit_if_Unparser.delimit_if5  s    <<++= r   c                 L    U R                  SSU R                  U5      U:  5      $ )z,Shortcut to adding precedence related parensrh   ri   )r  get_precedence)r   
precedencer&   s      r   require_parens_Unparser.require_parens;  s%    sC)<)<T)BZ)OPPr   c                 V    U R                   R                  U[        R                  5      $ r,   )rq  ry   rR  rZ  r   r&   s     r   r  _Unparser.get_precedence?  s!      $$T;+;+;<<r   c                 2    U H  nXR                   U'   M     g r,   )rq  )r   r  nodesr&   s       r   set_precedence_Unparser.set_precedenceB  s    D&0d# r   c                 R   [        U[        [        [        [        45      (       a  [        UR                  5      S:  a  gUR                  S   n[        U[        5      (       d  gUR                  n[        U[        5      (       a"  [        UR                  [        5      (       a  U$ gg)zIf a docstring node is found in the body of the *node* parameter,
return that docstring node, None otherwise.

Logic mirrored from ``_PyAST_GetDocString``.rb   Nr   )r   r   r   r   r   rL   r[   r   r/   r-   rX   r  s     r   get_raw_docstring_Unparser.get_raw_docstringF  s    
 #[(FC
 
^ayy|$%%zzdH%%*TZZ*E*EK +F%r   c                     U R                   R                  UR                  5      =(       d    UR                  nUb  SU 3$ g )Nz	 # type: )rr  ry   r#   type_comment)r   r&   comments      r   get_type_comment_Unparser.get_type_commentV  s?    $$((5J9J9Jwi(( r   c                    > [        U[        5      (       a  U H  nU R                  U5        M     g [        TU ]  U5        g r,   )r   rC   traversesuperr   )r   r&   r   r   s      r   r  _Unparser.traverse[  s4    dD!!d#  GM$r   c                 h    / U l         U R                  U5        SR                  U R                   5      $ )zzOutputs a source code string that, if converted back to an ast
(using ast.parse) will generate an AST equivalent to *node*rd   )rp  r  r   r  s     r   r   _Unparser.visite  s*     dwwt||$$r   c                     U R                  U5      =n(       a0  U R                  U5        U R                  UR                  SS  5        g U R                  UR                  5        g rT  )r  _write_docstringr  r[   )r   r&   	docstrings      r   "_write_docstring_and_traverse_body,_Unparser._write_docstring_and_traverse_bodyl  sL    //55I5!!),MM$))AB-(MM$))$r   c                     UR                    Vs0 s H  nUR                  SUR                   3_M     snU l        U R	                  U5        U R                  R                  5         g s  snf )Nignore)type_ignoresr#   tagrr  r  clear)r   r&   r  s      r   visit_Module_Unparser.visit_Modules  se     ++
+ MMVFJJ<00+
 	//5  "
s   $A'c                   ^  T R                  SS5         T R                  U 4S jT R                  UR                  5        S S S 5        T R	                  S5        T R                  UR
                  5        g ! , (       d  f       N;= f)Nrh   ri   c                  &   > T R                  S5      $ r  r  rA  s   r   r  ._Unparser.visit_FunctionType.<locals>.<lambda>~      

4(r    -> )r  r|  r  argtypesr  returnsr  s   ` r   visit_FunctionType_Unparser.visit_FunctionType{  sX    \\#s#OO($-- $
 	

6dll# $#s   ,A55
Bc                     U R                  5         U R                  [        R                  UR                  5        U R                  UR                  5        g r,   )r  r  rR  rY  r/   r  r  s     r   
visit_Expr_Unparser.visit_Expr  s5    		K--tzz:djj!r   c                 p   U R                  [        R                  U5         U R                  [        R                  UR
                  UR                  5        U R                  UR
                  5        U R                  S5        U R                  UR                  5        S S S 5        g ! , (       d  f       g = f)Nz := )	r  rR  rW  r  ri  targetr/   r  r  r  s     r   visit_NamedExpr_Unparser.visit_NamedExpr  sp      !7!7> 0 0$++tzzJMM$++&JJvMM$**%	 ?>>s   A=B''
B5c                 ~   ^  T R                  S5        T R                  U 4S jT R                  UR                  5        g )Nzimport c                  &   > T R                  S5      $ r  r  rA  s   r   r  (_Unparser.visit_Import.<locals>.<lambda>      

4 0r   )r  r|  r  namesr  s   ` r   visit_Import_Unparser.visit_Import  s(    		)0$--Lr   c                 F  ^  T R                  S5        T R                  SUR                  =(       d    S-  5        UR                  (       a  T R                  UR                  5        T R                  S5        T R	                  U 4S jT R
                  UR                  5        g )Nzfrom .r   z import c                  &   > T R                  S5      $ r  r  rA  s   r   r  ,_Unparser.visit_ImportFrom.<locals>.<lambda>  r  r   )r  r  rq   moduler|  r  r  r  s   ` r   visit_ImportFrom_Unparser.visit_ImportFrom  sd    		'

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

:0$--Lr   c                 X   U R                  5         UR                   HE  nU R                  [        R                  U5        U R                  U5        U R                  S5        MG     U R                  UR                  5        U R                  U5      =n(       a  U R                  U5        g g )N = )	r  targetsr  rR  rX  r  r  r/   r  )r   r&   r  r  s       r   visit_Assign_Unparser.visit_Assign  s    		llF 1 16:MM&!JJu # 	djj!0066<6JJ|$ 7r   c                    U R                  5         U R                  UR                  5        U R                  SU R                  UR
                  R                  R                     -   S-   5        U R                  UR                  5        g )Nr   z= )	r  r  r  r  binopr7   r   r   r/   r  s     r   visit_AugAssign_Unparser.visit_AugAssign  sZ    		dkk"

3DGG$5$5$>$>??$FGdjj!r   c                    U R                  5         U R                  SSUR                  (       + =(       a    [        UR                  [
        5      5         U R                  UR                  5        S S S 5        U R                  S5        U R                  UR                  5        UR                  (       a-  U R                  S5        U R                  UR                  5        g g ! , (       d  f       Ny= f)Nrh   ri   r$   r  )
r  r  r   r   r  rG   r  r  
annotationr/   r  s     r   visit_AnnAssign_Unparser.visit_AnnAssign  s    		__S#4;;'X:dkkSW;XYMM$++& Z

4doo&::JJuMM$**% 	 ZYs   C##
C1c                     U R                  S5        UR                  (       a-  U R                  S5        U R                  UR                  5        g g )Nreturnr   )r  r/   r  r  r  s     r   visit_Return_Unparser.visit_Return  s5    		(::JJsOMM$**% r   c                 &    U R                  S5        g )Npassr  r  s     r   
visit_Pass_Unparser.visit_Pass  s    		&r   c                 &    U R                  S5        g )Nbreakr  r  s     r   visit_Break_Unparser.visit_Break  s    		'r   c                 &    U R                  S5        g )Ncontinuer  r  s     r   visit_Continue_Unparser.visit_Continue  s    		*r   c                 ~   ^  T R                  S5        T R                  U 4S jT R                  UR                  5        g )Nzdel c                  &   > T R                  S5      $ r  r  rA  s   r   r  (_Unparser.visit_Delete.<locals>.<lambda>  r  r   )r  r|  r  r  r  s   ` r   visit_Delete_Unparser.visit_Delete  s(    		&0$--Nr   c                     U R                  S5        U R                  UR                  5        UR                  (       a-  U R	                  S5        U R                  UR                  5        g g )Nzassert re   )r  r  testr'   r  r  s     r   visit_Assert_Unparser.visit_Assert  sF    		)dii 88JJtMM$((# r   c                 ~   ^  T R                  S5        T R                  U 4S jT R                  UR                  5        g )Nzglobal c                  &   > T R                  S5      $ r  r  rA  s   r   r  (_Unparser.visit_Global.<locals>.<lambda>  r  r   r  r|  r  r  r  s   ` r   visit_Global_Unparser.visit_Global  s(    		)0$**djjIr   c                 ~   ^  T R                  S5        T R                  U 4S jT R                  UR                  5        g )Nz	nonlocal c                  &   > T R                  S5      $ r  r  rA  s   r   r  *_Unparser.visit_Nonlocal.<locals>.<lambda>  r  r   r  r  s   ` r   visit_Nonlocal_Unparser.visit_Nonlocal  s(    		+0$**djjIr   c                 h   U R                  [        R                  U5         U R                  S5        UR                  (       aV  U R                  S5        U R                  [        R                  UR                  5        U R                  UR                  5        S S S 5        g ! , (       d  f       g = f)Nawaitr   )r  rR  rh  r  r/   r  ri  r  r  s     r   visit_Await_Unparser.visit_Await  l      !2!2D9JJwzz

3##K$4$4djjAdjj) :99   A9B##
B1c                 h   U R                  [        R                  U5         U R                  S5        UR                  (       aV  U R                  S5        U R                  [        R                  UR                  5        U R                  UR                  5        S S S 5        g ! , (       d  f       g = f)Nyieldr   )r  rR  rY  r  r/   r  ri  r  r  s     r   visit_Yield_Unparser.visit_Yield  r!  r"  c                 \   U R                  [        R                  U5         U R                  S5        UR                  (       d  [        S5      eU R                  [        R                  UR                  5        U R                  UR                  5        S S S 5        g ! , (       d  f       g = f)Nzyield from z-Node can't be used without a value attribute.)	r  rR  rY  r  r/   r   r  ri  r  r  s     r   visit_YieldFrom_Unparser.visit_YieldFrom  sm      !2!2D9JJ}%:: !PQQ 0 0$**=MM$**% :99s   A3B
B+c                 V   U R                  S5        UR                  (       d  UR                  (       a  [        S5      eg U R	                  S5        U R                  UR                  5        UR                  (       a-  U R	                  S5        U R                  UR                  5        g g )Nraisez*Node can't use cause without an exception.r   z from )r  exccauser   r  r  r  s     r   visit_Raise_Unparser.visit_Raise  sn    		'xxzz #MOO

3dhh::JJx MM$**% r   c                    U R                  S5        U R                  5          U R                  UR                  5        S S S 5        UR                   H  nU R                  U5        M     UR
                  (       aE  U R                  S5        U R                  5          U R                  UR
                  5        S S S 5        UR                  (       aF  U R                  S5        U R                  5          U R                  UR                  5        S S S 5        g g ! , (       d  f       N= f! , (       d  f       Nw= f! , (       d  f       g = f)Ntryelsefinally)r  r  r  r[   handlersorelse	finalbody)r   r&   exs      r   do_visit_try_Unparser.do_visit_try  s    		%ZZ\MM$))$ --BMM"  ;;IIfdkk* >>IIi dnn-   \  s#   DD)2D:
D&)
D7:
Ec                 p    U R                   n SU l         U R                  U5        X l         g ! X l         f = f)NFrt  r8  r   r&   prev_in_try_stars      r   	visit_Try_Unparser.visit_Try  s7    ,,	1 %Dd# 0 0   - 5c                 p    U R                   n SU l         U R                  U5        X l         g ! X l         f = f)NTr;  r<  s      r   visit_TryStar_Unparser.visit_TryStar  s7    ,,	1 $Dd# 0 0r@  c                    U R                  U R                  (       a  SOS5        UR                  (       a,  U R                  S5        U R	                  UR                  5        UR
                  (       a,  U R                  S5        U R                  UR
                  5        U R                  5          U R	                  UR                  5        S S S 5        g ! , (       d  f       g = f)Nzexcept*exceptr    as )r  rt  r.   r  r  r   r  r[   r  s     r   visit_ExceptHandler_Unparser.visit_ExceptHandler  s    		t00)h?99JJsOMM$))$99JJvJJtyy!ZZ\MM$))$ \\s   /C
C"c                 (   U R                  5         UR                   H%  nU R                  S5        U R                  U5        M'     U R                  SUR                  -   5        [        US5      (       a  U R                  UR                  5        U R                  SSUR                  =(       d    UR                  S9   SnUR                   H/  nU(       a  U R                  S5        OS	nU R                  U5        M1     UR                   H/  nU(       a  U R                  S5        OS	nU R                  U5        M1     S S S 5        U R                  5          U R                  U5        S S S 5        g ! , (       d  f       N9= f! , (       d  f       g = f)
N@zclass type_paramsrh   ri   )r  Fre   T)r  decorator_listr  r  r   r   _type_params_helperrK  r  basesrJ   r  r  r  )r   r&   decocommaes        r   visit_ClassDef_Unparser.visit_ClassDef&  s'   ''DIIcNMM$ ( 			(TYY&'4''$$T%5%56__S#4::3N_OEZZJJt$ Ea    ]]JJt$ Ea  # P ZZ\33D9 \ PO \s   >BE2F2
F 
Fc                 (    U R                  US5        g )Ndef_function_helperr  s     r   visit_FunctionDef_Unparser.visit_FunctionDef@  s    dE*r   c                 (    U R                  US5        g )Nz	async defrV  r  s     r   visit_AsyncFunctionDef _Unparser.visit_AsyncFunctionDefC  s    dK0r   c                    U R                  5         UR                   H%  nU R                  S5        U R                  U5        M'     US-   UR                  -   nU R                  U5        [        US5      (       a  U R                  UR                  5        U R                  SS5         U R                  UR                  5        S S S 5        UR                  (       a,  U R                  S5        U R                  UR                  5        U R                  U R                  U5      S9   U R                  U5        S S S 5        g ! , (       d  f       N= f! , (       d  f       g = f)NrJ  r   rK  rh   ri   r  r  )r  rL  r  r  r   r   rM  rK  r  rI   r  r  r  r  r  )r   r&   fill_suffixrO  def_strs        r   rW  _Unparser._function_helperF  s    ''DIIcNMM$ ( #dii/		'4''$$T%5%56\\#s#MM$))$ $<<JJvMM$,,'ZZd33D9Z:33D9 ;: $#
 ;:s   'E&E
E
E c                    ^  UbM  [        U5      S:  a=  T R                  SS5         T R                  U 4S jT R                  U5        S S S 5        g g g ! , (       d  f       g = f)Nr   rj   rt   c                  &   > T R                  S5      $ r  r  rA  s   r   r  /_Unparser._type_params_helper.<locals>.<lambda>Z      

4(8r   )rL   r  r|  r  )r   rK  s   ` r   rM  _Unparser._type_params_helperW  sO    "s;'7!';c3' 8$--U (' (<"''s   "A
A!c                 0   U R                  UR                  5        UR                  (       a,  U R                  S5        U R                  UR                  5        UR                  (       a-  U R                  S5        U R                  UR                  5        g g )Nr$   r  )r  r   boundr  default_valuer  s     r   visit_TypeVar_Unparser.visit_TypeVar\  sa    

499::JJtMM$**%JJuMM$,,- r   c                     U R                  SUR                  -   5        UR                  (       a-  U R                  S5        U R                  UR                  5        g g )Nr   r  r  r   rh  r  r  s     r   visit_TypeVarTuple_Unparser.visit_TypeVarTuplee  sB    

3?#JJuMM$,,- r   c                     U R                  SUR                  -   5        UR                  (       a-  U R                  S5        U R                  UR                  5        g g )N**r  rl  r  s     r   visit_ParamSpec_Unparser.visit_ParamSpeck  sC    

4$))#$JJuMM$,,- r   c                     U R                  S5        U R                  UR                  5        U R                  UR                  5        U R                  S5        U R                  UR                  5        g )Nztype r  )r  r  r   rM  rK  r  r/   r  s     r   visit_TypeAlias_Unparser.visit_TypeAliasq  sN    		'dii   !1!12

5djj!r   c                 (    U R                  SU5        g )Nzfor _for_helperr  s     r   	visit_For_Unparser.visit_Forx  s    &r   c                 (    U R                  SU5        g )Nz
async for rw  r  s     r   visit_AsyncFor_Unparser.visit_AsyncFor{  s    t,r   c                 ~   U R                  U5        U R                  [        R                  UR                  5        U R                  UR                  5        U R                  S5        U R                  UR                  5        U R                  U R                  U5      S9   U R                  UR                  5        S S S 5        UR                  (       aF  U R                  S5        U R                  5          U R                  UR                  5        S S S 5        g g ! , (       d  f       Nf= f! , (       d  f       g = f)N in r  r2  )r  r  rR  rX  r  r  r  rw  r  r  r[   r5  )r   r  r&   s      r   rx  _Unparser._for_helper~  s    		$K--t{{;dkk"

6dii ZZd33D9Z:MM$))$ ;;;IIfdkk*   ;: s   !D7D.
D+.
D<c                    U R                  S5        U R                  UR                  5        U R                  5          U R                  UR                  5        S S S 5        UR
                  (       a  [        UR
                  5      S:X  a  [        UR
                  S   [        5      (       a  UR
                  S   nU R                  S5        U R                  UR                  5        U R                  5          U R                  UR                  5        S S S 5        UR
                  (       a=  [        UR
                  5      S:X  a$  [        UR
                  S   [        5      (       a  M  UR
                  (       aF  U R                  S5        U R                  5          U R                  UR
                  5        S S S 5        g g ! , (       d  f       GNp= f! , (       d  f       N= f! , (       d  f       g = f)Nzif rb   r   zelif r2  )	r  r  r  r  r[   r5  rL   r   Ifr  s     r   visit_If_Unparser.visit_If  s1   		%dii ZZ\MM$))$  kkc$++.!3
4;;q>SU8V8V;;q>DIIgMM$))$dii( 	 kkc$++.!3
4;;q>SU8V8V ;;IIfdkk*   \ 
 s#   G8GG%
G
G"%
G3c                    U R                  S5        U R                  UR                  5        U R                  5          U R                  UR                  5        S S S 5        UR
                  (       aF  U R                  S5        U R                  5          U R                  UR
                  5        S S S 5        g g ! , (       d  f       Nf= f! , (       d  f       g = f)Nzwhile r2  )r  r  r  r  r[   r5  r  s     r   visit_While_Unparser.visit_While  s    		(dii ZZ\MM$))$ ;;IIfdkk*   \ s   B9C
9
C

Cc                 $  ^  T R                  S5        T R                  U 4S jT R                  UR                  5        T R	                  T R                  U5      S9   T R                  UR                  5        S S S 5        g ! , (       d  f       g = f)Nzwith c                  &   > T R                  S5      $ r  r  rA  s   r   r  &_Unparser.visit_With.<locals>.<lambda>  r  r   r  r  r|  r  r   r  r  r[   r  s   ` r   
visit_With_Unparser.visit_With  s]    		'0$--LZZd33D9Z:MM$))$ ;::   B
Bc                 $  ^  T R                  S5        T R                  U 4S jT R                  UR                  5        T R	                  T R                  U5      S9   T R                  UR                  5        S S S 5        g ! , (       d  f       g = f)Nzasync with c                  &   > T R                  S5      $ r  r  rA  s   r   r  +_Unparser.visit_AsyncWith.<locals>.<lambda>  r  r   r  r  r  s   ` r   visit_AsyncWith_Unparser.visit_AsyncWith  s]    		- 0$--LZZd33D9Z:MM$))$ ;::r  Fquote_typesescape_special_whitespacec                  ^^^ U4S jnSR                  [        UT5      5      mUnST;   a  U Vs/ s H  of[        ;   d  M  UPM     nnU Vs/ s H  ofT;  d  M
  UPM     nnU(       d,  [        T5      m[	        U4S jU 5       TS   5      nTSS U/4$ T(       aD  UR                  U4S jS	9  US   S   TS   :X  a"  [        US   5      S
:X  d   eTSS S-   TS   -   mTU4$ s  snf s  snf )z{Helper for writing string literals, minimizing escapes.
Returns the tuple (string literal to write, possible quote types).
c                    > T(       d  U S;   a  U $ U S:X  d  U R                  5       (       d   U R                  S5      R                  S5      $ U $ )Nz
	\unicode_escapeascii)isprintabler   r   )r   r  s    r   escape_char2_Unparser._str_literal_helper.<locals>.escape_char  sD     -fDyxx 0188AAHr   rd   rc   c              3   >   >#    U  H  nTS    U;   d  M  Uv   M     g7frl   rm   )rn   qstrings     r   rr   0_Unparser._str_literal_helper.<locals>.<genexpr>  s     C[F1IN!![s   	r   rb   r	   c                    > U S   TS   :H  $ )Nr   r	   rm   )r  escaped_strings    r   r  /_Unparser._str_literal_helper.<locals>.<lambda>  s    qt~b7I/Ir   )r  r   Nr  )r   r@   _MULTI_QUOTESr|   rU  sortrL   )	r   r  r  r  r  possible_quotesr  quoter  s	    ` `    @r   _str_literal_helper_Unparser._str_literal_helper  s
   	 [&!9:%>!*9P/Q-=Oq/OP&5Qo.9P1oQ &\FC[CVAYOE!B<%((  %I J q!!$r(::?1-.!333!/!4t!;nR>P!P..# QQs   C%C%	C*C*r  c                ^    U R                  XS9u  pUS   nU R                  U U U 35        g)zKWrite string literal value with a best effort attempt to avoid backslashes.r  r   N)r  r  )r   r  r  
quote_types       r   _write_str_avoiding_backslashes)_Unparser._write_str_avoiding_backslashes  s:    "66v6W ^


j\&*67r   c                    U R                  S5        / nUR                   H]  nU R                  5        nU R                  U5        S S S 5        UR	                  SR                  W5      [        U[        5      45        M_     / n[        [        5      nSnU H  u  p8U(       a9  U R                  UUSS9u  p9[        U	5      R                  U5      (       a  Sn  OfU	nONSU;   a&  U V
s/ s H  o[        ;   d  M  U
PM     nn
U(       d   eU V
s/ s H  oU;  d  M
  U
PM     n	n
U	(       a  U	nUR	                  U5        M     U(       az  S/nUR                  5         U Ha  u  p8U(       aD  [        SU-   5      nS	nUR!                  U5      (       d   [        U5      5       eU[#        U5      S
 nUR	                  U5        Mc     SR                  U5      nUS   nU R                  U U U 35        g ! , (       d  f       GN= fs  sn
f s  sn
f )Nrz  rd   FTr  rc   rl  rk  z'"r	   r   )r  rN   r  _write_fstring_innerr{   r   r   r-   rC   _ALL_QUOTESr  r>   
isdisjointr  r  r|   r   rL   )r   r&   fstring_partsr/   r  new_fstring_partsr  fallback_to_repris_constantnew_quote_typesr  expected_prefixr  s                r   visit_JoinedStr_Unparser.visit_JoinedStr  s   

3[[EF))%0 !  *UH"=> ! ;' "/E)-)A)A +.2 *B *&
 '22;??'+$-5=.9"Pk-=O1kK"P&&;.9"Lke^1k"L""1K$$U+' #0*  !'K##%&3" u-E&+O ++O<<Id5kI<!#o"6r:E!((/ '4 )* ^


j\%56[ !, #Q #Ms#   G-%G?6G?	HH-
G<	c                 `   [        U[        5      (       a#  UR                   H  nU R                  X2S9  M     g [        U[        5      (       a  [        UR
                  [        5      (       a  UR
                  R                  SS5      R                  SS5      nU(       aH  UR                  SS5      nUR                  SS	5      nUR                  S
S5      nUR                  SS5      nU R                  U5        g [        U[        5      (       a  U R                  U5        g [        SU< 35      e)Nis_format_spec{z{{}z}}r  z\\rj  z\'rk  z\"rc   z\nz"Unexpected node inside JoinedStr, )r   	JoinedStrrN   r  r-   r/   rX   replacer  FormattedValuevisit_FormattedValuer   )r   r&   r  r/   s       r   r  _Unparser._write_fstring_inner  s    dI&&))%)O %h''Jtzz3,G,GJJ&&sD199#tDEdF3c51c51dE2JJun--%%d+A$JKKr   c                   ^  U 4S jnT R                  SS5         U" UR                  5      nUR                  S5      (       a  T R                  S5        T R                  U5        UR                  S:w  a'  T R                  S[        UR                  5       35        UR                  (       a+  T R                  S5        T R                  UR                  SS	9  S S S 5        g ! , (       d  f       g = f)
Nc                    > [        T5      " 5       nUR                  [        R                  R	                  5       U 5        UR                  U 5      $ r,   )r.   r  rR  rZ  rU  r   )innerunparserr   s     r   unparse_inner5_Unparser.visit_FormattedValue.<locals>.unparse_inner'  s<    Dz|H##K$4$4$9$9$;UC>>%((r   r  r  r   r	   !r  Tr  )r  r/   r   r  
conversionchrformat_specr  )r   r&   r  exprs   `   r   r  _Unparser.visit_FormattedValue&  s    	)
 \\#s# ,Ds##

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

Qs4??3456

3))$*:*:4)P $##s   B>C!!
C/c                 :    U R                  UR                  5        g r,   )r  rH   r  s     r   
visit_Name_Unparser.visit_Name8  s    

477r   c                     U R                  5         UR                  S:X  a  U R                  S5        U R                  UR                  [
        S9  g )Nur  )r  kindr  r  r/   r  r  s     r   r  _Unparser._write_docstring;  s9    		99JJsO,,TZZ],Sr   c           
      
   [        U[        [        45      (       aN  U R                  [	        U5      R                  S[        5      R                  SS[         S[         S35      5        g U R                  [	        U5      5        g )Ninfnanrh   -ri   )r   r1   r2   r  r|   r  _INFSTRrD  s     r   _write_constant_Unparser._write_constantA  sb    eeW-.. JJU(!G9AgYa 89 JJtE{#r   c                 ~   UR                   n[        U[        5      (       a8  U R                  SS5         U R	                  U R
                  U5        S S S 5        g USL a  U R                  S5        g UR                  S:X  a  U R                  S5        U R                  UR                   5        g ! , (       d  f       g = f)Nrh   ri   ....r  )r/   r   r   r  r  r  r  r  )r   r&   r/   s      r   r   _Unparser.visit_ConstantM  s    

eU##c3' 4 4e< ('c\JJuyyC

3  , ('s   B..
B<c                    ^  T R                  SS5         T R                  U 4S jT R                  UR                  5        S S S 5        g ! , (       d  f       g = f)Nrj   rt   c                  &   > T R                  S5      $ r  r  rA  s   r   r  &_Unparser.visit_List.<locals>.<lambda>[  r  r   )r  r|  r  rA   r  s   ` r   
visit_List_Unparser.visit_ListY  s6    \\#s#OO4dmmTYYO $##   ,A		
Ac                     U R                  SS5         U R                  UR                  5        UR                   H  nU R                  U5        M     S S S 5        g ! , (       d  f       g = f)Nrj   rt   r  r  elt
generatorsr   r&   gens      r   visit_ListComp_Unparser.visit_ListComp]  F    \\#s#MM$((#c" ' $##   A A
A*c                     U R                  SS5         U R                  UR                  5        UR                   H  nU R                  U5        M     S S S 5        g ! , (       d  f       g = f)Nrh   ri   r  r  s      r   visit_GeneratorExp_Unparser.visit_GeneratorExpc  r  r  c                     U R                  SS5         U R                  UR                  5        UR                   H  nU R                  U5        M     S S S 5        g ! , (       d  f       g = f)Nr  r  r  r  s      r   visit_SetComp_Unparser.visit_SetCompi  r  r  c                 2   U R                  SS5         U R                  UR                  5        U R                  S5        U R                  UR                  5        UR
                   H  nU R                  U5        M     S S S 5        g ! , (       d  f       g = f)Nr  r  r$   )r  r  r  r  r/   r  r  s      r   visit_DictComp_Unparser.visit_DictCompo  sb    \\#s#MM$((#JJtMM$**%c" '	 $##s   A,B
Bc                 @   UR                   (       a  U R                  S5        OU R                  S5        U R                  [        R                  UR
                  5        U R                  UR
                  5        U R                  S5        U R                  " [        R                  R                  5       UR                  /UR                  Q76   U R                  UR                  5        UR                   H%  nU R                  S5        U R                  U5        M'     g )Nz async for z for r   if )is_asyncr  r  rR  rX  r  r  rZ  rU  rw  ifs)r   r&   	if_clauses      r   visit_comprehension_Unparser.visit_comprehensionw  s    ==JJ}%JJwK--t{{;dkk"

6K,,113TYYJJdii IJJvMM)$ "r   c                 8   U R                  [        R                  U5         U R                  [        R                  R	                  5       UR
                  UR                  5        U R                  UR
                  5        U R                  S5        U R                  UR                  5        U R                  S5        U R                  [        R                  UR                  5        U R                  UR                  5        S S S 5        g ! , (       d  f       g = f)Nr  z else )
r  rR  rZ  r  rU  r[   r  r  r  r5  r  s     r   visit_IfExp_Unparser.visit_IfExp  s      !1!148 0 0 5 5 7DIINMM$))$JJvMM$))$JJx  0 0$++>MM$++& 988s   C!D
Dc                    ^  UR                   (       aG  T R                  SS5         T R                  U 4S jT R                  UR                   5        S S S 5        g T R	                  S5        g ! , (       d  f       g = f)Nr  r  c                  &   > T R                  S5      $ r  r  rA  s   r   r  %_Unparser.visit_Set.<locals>.<lambda>  rd  r   z{*()})rA   r  r|  r  r  r  s   ` r   	visit_Set_Unparser.visit_Set  sP    99c3' 8$--S ('
 JJw ('s   ,A,,
A:c           	         ^ ^ U 4S jmU U4S jnT R                  SS5         T R                  U 4S jU[        UR                  UR                  5      5        S S S 5        g ! , (       d  f       g = f)Nc                 l   > TR                  U 5        TR                  S5        TR                  U5        g Nr$   r  r  )kvr   s     r   write_key_value_pair2_Unparser.visit_Dict.<locals>.write_key_value_pair  s'    MM!JJtMM!r   c                    > U u  pUcC  TR                  S5        TR                  [        R                  U5        TR	                  U5        g T" X5        g )Nrp  )r  r  rR  r_  r  )r   r  r  r   r  s      r   
write_item(_Unparser.visit_Dict.<locals>.write_item  sG    DAy 

4 ##K$4$4a8a $Q*r   r  r  c                  &   > T R                  S5      $ r  r  rA  s   r   r  &_Unparser.visit_Dict.<locals>.<lambda>  r  r   )r  r|  rP   rM   rN   )r   r&   r  r  s   `  @r   
visit_Dict_Unparser.visit_Dict  sK    	
		+ \\#s#OO(*c$))T[[6Q $##s   6A!!
A/c                 (   U R                  SS[        UR                  5      S:H  =(       d"    U R                  U5      [        R
                  :  5         U R                  U R                  UR                  5        S S S 5        g ! , (       d  f       g = f)Nrh   ri   r   )r  rL   rA   r  rR  rX  r  r  r  s     r   visit_Tuple_Unparser.visit_Tuple  sg    __		NaP4#6#6t#<{?P?P#P

 OODMM4995
 
 
s   'B
B~not+r  )InvertNotr8   r9   )r  r  r   r  c                    U R                   UR                  R                  R                     nU R                  U   nU R                  X15         U R                  U5        U[        R                  La  U R                  S5        U R                  X1R                  5        U R                  UR                  5        S S S 5        g ! , (       d  f       g = fNr   )unopr7   r   r   unop_precedencer  r  rR  rf  r  r:   r  )r   r&   operatoroperator_precedences       r   visit_UnaryOp_Unparser.visit_UnaryOp  s    99TWW..778"228<  !4;JJx  #+*<*<<

3 3\\BMM$,,' <;;s   A,C
Cr   rJ  /%<<>>|^&//rp  )rR   rS   MultMatMultDivModLShiftRShiftBitOrBitXorBitAndFloorDivPow)r   r  r   rJ  r+  r,  r-  r.  r/  r0  r1  r2  rp  )rp  c                 <   U R                   UR                  R                  R                     nU R                  U   nU R                  X15         X R                  ;   a  UR                  5       nUnOUnUR                  5       nU R                  XAR                  5        U R                  UR                  5        U R                  SU S35        U R                  XQR                  5        U R                  UR                  5        S S S 5        g ! , (       d  f       g = fr$  )r  r7   r   r   binop_precedencer  binop_rassocrU  r  rT   r  r  rU   )r   r&   r'  r(  left_precedenceright_precedences         r   visit_BinOp_Unparser.visit_BinOp  s    ::dgg//889"33H=  !4;,,,"5":":"<#6 "5#6#;#;#= ;MM$))$JJ8*A' 0**=MM$**% <;;s   B6D
Dz==z!=<z<=>z>=iszis notinznot in)
EqNotEqLtLtEGtGtEIsIsNotInNotInc                    U R                  [        R                  U5         U R                  " [        R                  R	                  5       UR
                  /UR                  Q76   U R                  UR
                  5        [        UR                  UR                  5       HN  u  p#U R                  SU R                  UR                  R                     -   S-   5        U R                  U5        MP     S S S 5        g ! , (       d  f       g = fr$  )r  rR  r^  r  rU  rT   comparatorsr  rP   opsr  cmpopsr   r   )r   r&   orQ  s       r   visit_Compare_Unparser.visit_Compare	  s      $7 4 4 6		UDDTDTUMM$))$DHHd&6&67

3Q[[-A-A!BBSHIa  8 877s   CC<<
D
andor)AndOr)rZ  r[  c                 6  ^ ^^ T R                   UR                  R                  R                     nT R                  U   mUU 4S jnT R                  TU5         SU S3mT R                  UU 4S jX1R                  5        S S S 5        g ! , (       d  f       g = f)Nc                 l   > TR                  5       mTR                  TU 5        TR                  U 5        g r,   )rU  r  r  )r&   r(  r   s    r   increasing_level_traverse9_Unparser.visit_BoolOp.<locals>.increasing_level_traverse  s/    "5":":"< 3T:MM$r   r   c                  &   > TR                  T 5      $ r,   r  )r'  r   s   r   r  (_Unparser.visit_BoolOp.<locals>.<lambda>   s    DJJqMr   )boolopsr7   r   r   boolop_precedencer  r|  rN   )r   r&   r'  r`  r(  r'  s   `   @@r   visit_BoolOp_Unparser.visit_BoolOp  sw    << 1 1 : :;"44X>	    !4d;H:QAOO13LkkZ <;;s   (B


Bc                    U R                  [        R                  UR                  5        U R	                  UR                  5        [        UR                  [        5      (       a:  [        UR                  R                  [        5      (       a  U R                  S5        U R                  S5        U R                  UR                  5        g )Nr   r  )
r  rR  ri  r/   r  r   r-   r0   r  r   r  s     r   visit_Attribute_Unparser.visit_Attribute"  s{    K,,djj9djj! djj(++
4::;K;KS0Q0QJJsO

3

499r   c                    U R                  [        R                  UR                  5        U R	                  UR                  5        U R                  SS5         SnUR                   H/  nU(       a  U R                  S5        OSnU R	                  U5        M1     UR                   H/  nU(       a  U R                  S5        OSnU R	                  U5        M1     S S S 5        g ! , (       d  f       g = f)Nrh   ri   Fre   T)	r  rR  ri  rF   r  r  rI   r  rJ   )r   r&   rP  rQ  s       r   
visit_Call_Unparser.visit_Call-  s    K,,dii8dii \\#s#EYYJJt$ Ea   ]]JJt$ Ea  # $##s   BC""
C0c                    S nU R                  [        R                  UR                  5        U R	                  UR                  5        U R                  SS5         U" UR                  5      (       a1  U R                  U R                  UR                  R                  5        OU R	                  UR                  5        S S S 5        g ! , (       d  f       g = f)Nc                 H    [        U [        5      =(       a    U R                  $ r,   )r   r?   rA   )slice_values    r   is_non_empty_tuple5_Unparser.visit_Subscript.<locals>.is_non_empty_tuple@  s    ;. %$$r   rj   rt   )	r  rR  ri  r/   r  r  r2  r  rA   )r   r&   rq  s      r   visit_Subscript_Unparser.visit_Subscript?  s    	 	K,,djj9djj!\\#s#!$**--tzz?djj) $##s   A$C
Cc                     U R                  S5        U R                  [        R                  UR                  5        U R                  UR                  5        g )Nr   )r  r  rR  r_  r/   r  r  s     r   visit_Starred_Unparser.visit_StarredO  s7    

3K,,djj9djj!r   c                 &    U R                  S5        g )Nr  r  r  s     r   visit_Ellipsis_Unparser.visit_EllipsisT  s    

5r   c                 R   UR                   (       a  U R                  UR                   5        U R                  S5        UR                  (       a  U R                  UR                  5        UR                  (       a-  U R                  S5        U R                  UR                  5        g g )Nr  )lowerr  r  upperstepr  s     r   visit_Slice_Unparser.visit_SliceW  sb    ::MM$**%

3::MM$**%99JJsOMM$))$ r   c                     U R                  S5        U R                  UR                  5        U R                  5          UR                   H  nU R                  U5        M     S S S 5        g ! , (       d  f       g = f)Nzmatch )r  r  subjectr  cases)r   r&   cases      r   visit_Match_Unparser.visit_Matcha  sK    		(dll#ZZ\

d# # \\s   %A++
A9c                     U R                  UR                  5        UR                  (       a-  U R                  S5        U R                  UR                  5        g g r  )r  argr  r  r  s     r   	visit_arg_Unparser.visit_argh  s:    

488??JJtMM$//* r   c                    SnUR                   UR                  -   nS /[        U5      [        UR                  5      -
  -  UR                  -   n[	        [        X45      S5       H  u  pVUu  pxU(       a  SnOU R                  S5        U R                  U5        U(       a"  U R                  S5        U R                  U5        U[        UR                   5      :X  d  My  U R                  S5        M     UR                  (       d  UR                  (       a  U(       a  SnOU R                  S5        U R                  S5        UR                  (       av  U R                  UR                  R                  5        UR                  R                  (       a6  U R                  S5        U R                  UR                  R                  5        UR                  (       av  [        UR                  UR                  5       HR  u  pxU R                  S5        U R                  U5        U(       d  M0  U R                  S5        U R                  U5        MT     UR                  (       a  U(       a  SnOU R                  S5        U R                  S	UR                  R                  -   5        UR                  R                  (       a7  U R                  S5        U R                  UR                  R                  5        g g g )
NTrb   Fre   rg   z, /r   r$   rp  )posonlyargsrI   rL   defaultsr   rP   r  r  vararg
kwonlyargsr  r  kw_defaultskwarg)	r   r&   r   all_argsr  r  elementsads	            r   visit_arguments_Unparser.visit_argumentsn  s   ##dii/6S]S-??@4==P(X)@!DOEDA

4 MM!

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

5!  E ;;$//

4 JJsO{{

4;;??+;;))JJt$MM$++"8"89 ??DOOT-=-=>

4 a 1JJsOMM!$ ? ::

4 JJtdjjnn,-zz$$

4 djj334 % r   c                     UR                   c  U R                  S5        O,U R                  UR                   5        U R                  S5        U R                  UR                  5        g )Nrp  rg   )r  r  r  r/   r  s     r   visit_keyword_Unparser.visit_keyword  sC    88JJtJJtxx JJsOdjj!r   c                    U R                  [        R                  U5         U R                  S5        U R	                  5        nU R                  UR                  5        S S S 5        W(       a  U R                  " S/UQ76   U R                  S5        U R                  [        R                  UR                  5        U R                  UR                  5        S S S 5        g ! , (       d  f       N= f! , (       d  f       g = f)Nlambdar   r$   )	r  rR  rZ  r  r  r  rI   r  r[   )r   r&   r  s      r   visit_Lambda_Unparser.visit_Lambda  s      !1!148JJx Fdii( !

3((JJt 0 0$))<MM$))$ 98  98s$   "C1C A8C1 
C.	*C11
C?c                     U R                  UR                  5        UR                  (       a  U R                  SUR                  -   5        g g NrF  )r  r   asnamer  s     r   visit_alias_Unparser.visit_alias  s3    

499;;JJv+, r   c                     U R                  UR                  5        UR                  (       a-  U R                  S5        U R                  UR                  5        g g r  )r  context_exproptional_varsr  r  s     r   visit_withitem_Unparser.visit_withitem  s@    d''(JJvMM$,,- r   c                 `   U R                  S5        U R                  UR                  5        UR                  (       a,  U R	                  S5        U R                  UR                  5        U R                  5          U R                  UR                  5        S S S 5        g ! , (       d  f       g = f)Nzcase r  )r  r  patternguardr  r  r[   r  s     r   visit_match_case_Unparser.visit_match_case  sd    		'dll#::JJvMM$**%ZZ\MM$))$ \\s   :B
B-c                 :    U R                  UR                  5        g r,   )r  r/   r  s     r   visit_MatchValue_Unparser.visit_MatchValue  s    djj!r   c                 :    U R                  UR                  5        g r,   )r  r/   r  s     r   visit_MatchSingleton_Unparser.visit_MatchSingleton  s    TZZ(r   c                    ^  T R                  SS5         T R                  U 4S jT R                  UR                  5        S S S 5        g ! , (       d  f       g = f)Nrj   rt   c                  &   > T R                  S5      $ r  r  rA  s   r   r  /_Unparser.visit_MatchSequence.<locals>.<lambda>  r  r   )r  r|  r  patternsr  s   ` r   visit_MatchSequence_Unparser.visit_MatchSequence  s8    \\#s#OO($-- $##r  c                 N    UR                   nUc  SnU R                  SU 35        g )N_r   )r   r  )r   r&   r   s      r   visit_MatchStar_Unparser.visit_MatchStar  s'    yy<D

Qtf:r   c                 J  ^  U 4S jnT R                  SS5         UR                  nT R                  U 4S jU[        X1R                  SS95        UR
                  nUb,  U(       a  T R                  S5        T R                  SU 35        S S S 5        g ! , (       d  f       g = f)	Nc                 t   > U u  pTR                  U5        TR                  S5        TR                  U5        g r  r  )pairr  pr   s      r   write_key_pattern_pair<_Unparser.visit_MatchMapping.<locals>.write_key_pattern_pair  s.    DAMM!JJtMM!r   r  r  c                  &   > T R                  S5      $ r  r  rA  s   r   r  ._Unparser.visit_MatchMapping.<locals>.<lambda>  r  r   Tstrictre   rp  )r  rM   r|  rP   r  restr  )r   r&   r  rM   r  s   `    r   visit_MatchMapping_Unparser.visit_MatchMapping  s    	 \\#s#99DOO(&D--5
 99DJJt$

Rv;' $##s   A1B
B"c                   ^  T R                  [        R                  UR                  5        T R	                  UR                  5        T R                  SS5         UR                  nT R                  U 4S jT R                  U5        UR                  nU(       aG  U 4S jnU(       a  T R                  S5        T R                  U 4S jU[        X1R                  SS95        S S S 5        g ! , (       d  f       g = f)	Nrh   ri   c                  &   > T R                  S5      $ r  r  rA  s   r   r  ,_Unparser.visit_MatchClass.<locals>.<lambda>  r  r   c                 X   > U u  pTR                  U S35        TR                  U5        g )Nrg   )r  r  )r  r   r  r   s      r   write_attr_pattern6_Unparser.visit_MatchClass.<locals>.write_attr_pattern  s(    $(MDJJ$qz*MM'*r   re   c                  &   > T R                  S5      $ r  r  rA  s   r   r  r     s    DJJt,r   Tr  )r  rR  ri  r   r  r  r  r|  	kwd_attrsr  rP   kwd_patterns)r   r&   r  attrsr  s   `    r   visit_MatchClass_Unparser.visit_MatchClass  s    K,,dhh7dhh\\#s#}}HOO($-- NNE+
 JJt$,&00> $##s   BC**
C8c                    UR                   nUR                  nUc  U R                  S5        g Uc  U R                  UR                   5        g U R                  [        R
                  U5         U R                  [        R                  UR                  5        U R                  UR                  5        U R                  SUR                    35        S S S 5        g ! , (       d  f       g = f)Nr  rF  )	r   r  r  r  rR  rZ  r  r`  r  )r   r&   r   r  s       r   visit_MatchAs_Unparser.visit_MatchAs  s    yy,,<JJsO_JJtyy!$$[%5%5t<##KOOT\\Bdll+

T$))-. =<<s   -A$C
C(c                 B  ^  T R                  [        R                  U5         T R                  " [        R                  R	                  5       /UR
                  Q76   T R                  U 4S jT R                  UR
                  5        S S S 5        g ! , (       d  f       g = f)Nc                  &   > T R                  S5      $ )Nz | r  rA  s   r   r  )_Unparser.visit_MatchOr.<locals>.<lambda>  s    DJJu$5r   )r  rR  r`  r  rU  r  r|  r  r  s   ` r   visit_MatchOr_Unparser.visit_MatchOr  s`      $7 4 4 6GGOO5t}}dmmT 877s   A%B
B)rt  rs  rq  rp  rr  )rd   r,   )F)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%  r(  r.  r8  r>  rB  rG  rR  rX  r[  rW  rM  ri  rm  rq  rt  ry  r|  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%  rR  r]  rf  r&  r)  r  rd  re  rc  r`  ra  rb  rg  r?  	frozensetr@  rC  rV  rX  rd  r\  r[  re  rf  ri  rl  rs  rv  ry  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   __classcell__)r   s   @r   rn  rn    s   "
H
1" ' ' #    !Q=1 )
 %%#$"
&MM%"&&O$JJ**&
&.11	%:4+1:"V
..."'-++$+%% &1E$/L FQ 827hL&Q$T
$
-P####%' ,6 %cBD	O
( E" __  W%L&$ F! 4(G +{~~F[	!$* "
%$+15f"	%-
.%")((./U Ur   rn  c                 8    [        5       nUR                  U 5      $ r,   )rn  r   )ast_objr  s     r   unparser    s    {H>>'""r   )r   r%  r)  r+  r-  c                     U [         ;   a4  [         U    =[        5       U '   nSS KnUR                  SU  3[        SS9  U$ [        SU  S35      e)Nr   r  r   r   zmodule 'ast' has no attribute 'rj  )_deprecated_globalsglobalsr   r   r  rw   )r   r/   r   s      r   __getattr__r  !  s`    """5d";;	$%4&M#<W 	 	
 
:4&B
CCr   c                     SS K n U R                  SS9nUR                  SSSSS9  UR                  S	S
SSSS9  UR                  SSSSS9  UR                  SSSSS9  UR                  SS[        SSS9  UR	                  5       nUR
                  S:X  a+  Sn[        R                  R                  R                  5       nO;UR
                  n[        UR
                  S5       nUR                  5       nS S S 5        [        WX2R                  UR                  S 9n[        [        XbR                   UR"                  S!95        g ! , (       d  f       NU= f)"Nr   zpython -m ast)proginfile?r  z$the file to parse; defaults to stdin)nargsdefaulthelpz-mz--modeexec)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  z<stdin>rb)r
   )r   r^   )argparseArgumentParseradd_argumentr0   
parse_argsr  sysstdinr  readopenr   r   no_type_commentsprintr   r   r^   )r  parserrI   r   r   r  trees          r   mainr  ,  sO   $$/$:F
SC  E
h GG  I ,d=H  J
4\.  / jsAF  HD{{c!!&&({{$++t$[[]F %yy8M8MND	$t(?(?
TU %$s   !E
E__main__)z	<unknown>r  )TF)rb   )Tr,   )Xr   r  re_ast
contextlibr   r   enumr   r   r   r   r]   r   r   r   r   r   r   r   r   r   r   r   r   r   rz   r   r   r   r  r   r-   r   r  r  r
  propertyr   r'  r.   r  r  r   r%  r)  r+  r-  r/  r0   r1   r2   rX   bytesboolr  r  r   ru   r2  r5  r:  r?   rB  rE  r=  modrG  expr_contextrK  rM  rO  r|   
float_info
max_10_expr  rR  _SINGLE_QUOTESr  r  rn  r  r  popr  r  r  r   )r   s   0r   <module>r     s0  ,  	  2 , ,HtbH08$x 49Q EQh" F.	0 

34
 05 "J7(& 7(t8k 8x U    x )Y/HJ)Y/HJ14 162 (d (d H 8t 
6x4 
6  #ug	#	E84:t$tCyl $ 
 	.J	5U	7Iz	 %C %E 
3u 3 uf ,5EJ:C ::l ::| ::L : cnn//!34
4g  > ///rU rUh!# DC 	')--
C 
DV8 zF Ys   !I