
    0VhW                     	   d dl Zd dlZd dlmZmZmZmZmZm	Z	 d dlm
Z
mZmZmZmZ d dlmZmZ 	 d dlmZ 	 d dlmZ 	 d dlmZ d Zg dddefffdddefffdddefffdddefffdddefffdddefffdddefffdddefffdddefffd d!defffd"d#defffd$d%defffd&d'defffd(d)defffd*d+defffd,d-defffd.d-defffd/d0defffd1d0defffd2d3defffd4d3defffd5d6defffd7d8defffd9d:defffd;d:defffd<d=defffd>d?defffd@dAdefffdBdCdefffdDd?defffdEd?defffdFddefffdGddefffdHddefffdIddefffdJdKdefffdLdMdefffdNdOdefffdPdQdefffdRdSdefffdTd0defffdUdVdefffdWdXdefffdYdZdefffd[dZdefffd\d]defffd^dZdefffd_ddefffd`ddefffdaddefffdbdcdefffdddedefffdfddefffdgdhdefffdidjdefffdkdldefffdmdndefffdodpdefffdqdrdefffdsdtdefffdudvdefffdwdvdefffdxddefffdyddefffdzddefffd{ddefffd|ddefffd}ddefffd~dde
fffdddefffdddefffddde	fffddde	fffddde	fffddde	fffddde	fffddde	fffddde	fffddde	fffddde	fffddde	fffddde	fffddde	fffddde	fffdddeefffdddeefffdddeefffdddeefffdddefffdddefffdddefffdddefffdddefffdddefffdddefffdddefffdddefffdddefffdddefffdddefffdddefffdddefffdddefffdddefffdddefffdddefffdddefffdddefffdddefffdddefffdddefffdddefffdddefffdddefffdddefffdddefffdddefffZeD ]  \  ZZ eege   ej2                  j4                  dk(  rddlmZmZ ej2                  j4                  dk(  rddlmZmZ d ZdÄ Z dĄ Z!ddńZ"dƄ Z#dǄ Z$ddȄZ%ej2                  j4                  dk(  r&ej2                  jL                  dk\  rejN                  Z'y	 	 ddʄZ'y# e$ r  G d de      ZY w xY w# e$ r  G d	 d
e      ZY w xY w# e$ r  G d de      ZY w xY w)    N)boolopcmpopexcepthandlerexprexpr_contextoperator)slicestmtunaryopmodAST)iter_child_nodeswalk)
TypeIgnorec                       e Zd Zy)r   N__name__
__module____qualname__     9/home/dcms/DCMS/lib/python3.12/site-packages/gast/gast.pyr   r   
       r   r   )patternc                       e Zd Zy)r   Nr   r   r   r   r   r      r   r   r   )
type_paramc                       e Zd Zy)r   Nr   r   r   r   r   r      r   r   r   c                 v      fd}t        t        j                  t            t	         |||d             y )Nc                    t        |      t              kD  r$t        dj                  t                          t        t        |            D ]  }t	        | |   ||           |r| j
                  j                  |       y y )Nz4{} constructor takes at most {} positional arguments)len	TypeErrorformatrangesetattr__dict__update)selfargskwargsiFieldsNames       r   create_nodez_make_node.<locals>.create_node    s{    t9s6{"FtS[)+ +
 s4y! 	.AD&)T!W-	.MM  ( r   )__init___fields_attributes)r$   _sysmodulesr   type)r,   r+   
AttributesBasesr-   s   ``   r   
_make_noder6      s;    

) DLL")#!+-./r   Module)bodytype_ignoresr   Interactive)r8   
ExpressionFunctionType)argtypesreturnsSuiteFunctionDef)namer(   r8   decorator_listr>   type_commenttype_paramslineno
col_offset
end_linenoend_col_offsetAsyncFunctionDefClassDef)rA   baseskeywordsr8   rB   rD   Return)valueDelete)targetsAssign)rQ   rO   rC   	TypeAlias)rA   rD   rO   	AugAssign)targetoprO   	AnnAssign)rU   
annotationrO   simplePrint)destvaluesnlFor)rU   iterr8   orelserC   AsyncForWhile)testr8   r`   IfWith)itemsr8   rC   	AsyncWithMatch)subjectcasesRaise)exccauseTry)r8   handlersr`   	finalbodyTryStarAssert)rc   msgImport)names
ImportFrom)moduleru   levelExec)r8   globalslocalsGlobalNonlocalExprPassBreakContinueBoolOp)rV   r\   	NamedExpr)rU   rO   BinOp)leftrV   rightUnaryOp)rV   operandLambda)r(   r8   IfExpDict)keysr\   Set)eltsListComp)elt
generatorsSetCompDictComp)keyrO   r   GeneratorExpAwaitYield	YieldFromCompare)r   opscomparatorsCall)funcr(   rM   ReprFormattedValue)rO   
conversionformat_spec	JoinedStr)r\   Constant)rO   kind	Attribute)rO   attrctx	Subscript)rO   r	   r   Starred)rO   r   r,   )idr   rX   rC   List)r   r   TupleLoadStoreDelAugLoadAugStoreParamSlice)lowerupperstepAndOrAddSubMultMatMultDivModPowLShiftRShiftBitOrBitXorBitAndFloorDivInvertNotUAddUSubEqNotEqLtLtEGtGtEIsIsNotInNotIncomprehension)rU   r_   ifsis_asyncExceptHandler)r3   rA   r8   	arguments)r(   posonlyargsvararg
kwonlyargskw_defaultskwargdefaultskeyword)argrO   alias)rA   asnamewithitem)context_exproptional_vars
match_case)r   guardr8   
MatchValueMatchSingletonMatchSequence)patternsMatchMapping)r   r   rest
MatchClass)clsr   	kwd_attrskwd_patterns	MatchStar)rA   MatchAs)r   rA   MatchOrtype_ignore)rF   tagTypeVar)rA   bound	ParamSpecTypeVarTuple      )ast_to_gastgast_to_ast   c                  >    t        t        j                  | i |      S N)r   _astparse)r(   r)   s     r   r  r    s    tzz426233r   c                     ddl m}  ||       S )Nr   )unparse)unparserr  )gast_objr  s     r   r  r    s    !8r   c                 b    t        | t              rt        |       } t        j                  |       S r  )
isinstancer   r   r  literal_eval)node_or_strings    r   r
  r
    s'    .#&$^4^,,r   c                    t        | t        t        t        f      s"t	        d| j
                  j                  z        | j                  rt        | j                  d   t              rt        | j                  d   j                  t              rj|rEdd l}| j                  d   j                  }|j                  t        ||j                  d               S | j                  d   j                  j                  S y y y )Nz%r can't have docstringsr   )r	  r@   rK   r7   r!   	__class__r   r8   r~   rO   r   inspectcleandocgetattrr/   s)nodecleanr  holders       r   get_docstringr    s    d[(F;<2T^^5L5LLMMyyZ		!d3$))A,$$h/YYq\''F##GFFNN14E$FGGyy|!!### 0 4yr   c           	          dD ]D  }||j                   v s|| j                   v s!t        ||      s.t        | |t        ||             F | S )z
    Copy source location (`lineno`, `col_offset`, `end_lineno`, and
    `end_col_offset` attributes) from *old_node* to *new_node* if possible,
    and return *new_node*.
    rE   )r0   hasattrr$   r  )new_nodeold_noder   s      r   copy_locationr    sS     G =8'''DH4H4H,Hx&HdGHd$;<= Or   c                 *    fd | dddd       | S )a{  
    When you compile a node tree with compile(), the compiler expects lineno
    and col_offset attributes for every node that supports them.  This is
    rather tedious to fill in for generated nodes, so this helper adds these
    attributes recursively where not already set, by setting them to the values
    of the parent node.  It works recursively starting at *node*.
    c                    d| j                   v r t        | d      s|| _        n| j                  }d| j                   v r t        | d      s|| _        n| j                  }d| j                   v r t        | d      s|| _        n| j                  }d| j                   v r t        | d      s|| _        n| j
                  }t        |       D ]  } |||||        y )NrF   rH   rG   rI   )r0   r  rF   rH   rG   rI   r   )r  rF   rG   rH   rI   child_fixs         r   r  z#fix_missing_locations.<locals>._fix  s    t'''4*$4+++4.",!__
4+++4.",!__
t///4!12&4#!%!4!4%d+ 	HE
JG	Hr   r   r   r   )r  r  s    @r   fix_missing_locationsr    s     H. 	q!QKr   c                     t        |       D ]Q  }d|j                  v rt        |dd      xs d|z   |_        d|j                  v s9t        |dd      xs d|z   |_        S | S )z
    Increment the line number and end line number of each node in the tree
    starting at *node* by *n*. This is useful to "move code" to a different
    location in a file.
    rF   r   rH   )r   r0   r  rF   rH   )r  nr  s      r   increment_linenor"    sq     d Ju(((#E8Q7<1AEL5,,, '|Q ? D1IE	J
 Kr      c                     dfd	t        | t              s"t        d| j                  j                  z        t        t
              sdz   |       d   S )a?  
        Return a formatted dump of the tree in node.  This is mainly useful for
        debugging purposes.  If annotate_fields is true (by default),
        the returned string will show the names and the values for fields.
        If annotate_fields is false, the result string will be more compact by
        omitting unambiguous field names.  Attributes such as line
        numbers and column offsets are not dumped by default.  If this is wanted,
        include_attributes can be set to true.  If indent is a non-negative
        integer or string, then the tree will be pretty-printed with that indent
        level. None (the default) selects the single line representation.
        If show_empty is False, then empty lists and fields that are None
        will be omitted from the output for better readability.
        r   c                 h   dz  dz  z   }dz  z   }nd}d}t        | t              rt        |       }g }g }d}}| j                  D ]  }		 t	        | |	      }
|
t	        ||	d      d}"s8|
|
g k(  r1t        | t        t        f      s|j                  t        |
             \|s|j                  |       g } |
      \  }
}|xr |}|r|j                  |	d|
       |j                  |
        rb| j                  rV| j                  D ]G  }		 t	        | |	      }
|
t	        ||	d        |
      \  }
}|xr |}|j                  |	d|
       I |r<t        |      d	k  r.| j                  j                  d
dj                  |      d| fS | j                  j                  d
||j                  |      ddfS t        | t               r&| syd||j                  fd| D              ddfS t        |       dfS # t
        $ r d}Y w xY w# t
        $ r Y w xY w)Nr   
z,
 z, T*   =r   ()F)z[]T[c              3   6   K   | ]  } |      d      yw)r   Nr   ).0x_formatrx   s     r   	<genexpr>z(dump.<locals>._format.<locals>.<genexpr>,  s     3WQGAu4Ea4H3Ws   ])r	  r   r3   r/   r  AttributeErrorr   r   appendreprextendr0   r    r  r   joinlist)r  rx   prefixsepr   r(   args_buffer	allsimplerM   rA   rO   rY   r0  annotate_fieldsinclude_attributesindent
show_emptys    `          r   r0  zdump.<locals>._format  sd   !
.fun,$$4j  	* LL +D! 'd 3 }dB)?)G#' &"]erk !+4(N1K L#**4;7 %K0&($+E5$9ME6 ) 4fItU$;<E*5+6 &$*:*: $ 0 0 	=%$+D$$7E !=WS$-C-K$(/u(=v$-$8&	tU$;<	= Ta'+~~'>'>		$PVZRZZZ%)^^%<%<fchhtnUW\\\D$'% #)3883WRV3W+WXZ___:t##U * !#' !8  . %$%s$   HH$H! H!$	H10H1zexpected AST, got %r )r   )r	  r   r!   r  r   str)r  r=  r>  r?  r@  r0  s    ````@r   dumprC    s\    $;	$ ;	$z $$2T^^5L5LLMMj&=6\Ft}Qr   )T)r   )TFNF)(sysr1   astr  r   r   r   r   r   r   r	   r
   r   r   r   r   r   r   ImportErrorr   r   r6   _nodesrA   descrversion_infomajorast2r   r   ast3r  r  r
  r  r  r  r"  minorrC  r   r   r   <module>rN     s     J J . . &
/4|
("sf56|
 YSF+,|
 IrC6*+	|

 -rC6:;|
 y"sf%&|
  5NW |
  ;<'	# $|
$  #K' %|
, 
I -|
2 I 3|
8 4I 9|
> 3K' ?|
D -L7 E|
J ?L7 K|
P (Hw Q|
V AFW W|
\ FK' ]|
b *Hw c|
h 
'EG i|
n /Gg o|
t 4L7 u|
z #L7 {|
@  Hw A|
F 9FW G|
L =FW M|
R  I S|
X 
I Y|
^ 1MG _|
d ,Gg e|
j 
I k|
p *K' q|
v jGg w|
| bKg }|
@ rLw A|
D "K' E|
P !I Q|
V 'I W|
\ 'Hw ]|
b #J c|
h !I i|
n *Hw o|
t !Gg u|
z YFW {|
@ (K' A|
F 'J G|
L 1K' M|
R ,8g  S|
Z zHw [|
` zHw a|
f :L7 g|
l 0J m|
r +Gg s|
x jGg y|
~ ?:! "|
F ;L7 G|
L #K' M|
R ,L7 S|
X -L7 Y|
^ "J _|
d 9Gg e|
j Gg k|
p Hw q|
z b"|o&'{|
| r2'(}|
~ Rl_%&|
@ R,)*A|
B "b</*+C|
D r2'(E|
J )Hx K|
T RfY U|
V 
BVIW|
\ Rh[!"]|
^ Rh[!"_|
` b"xk"#a|
b R(%&c|
d Rh[!"e|
f Rh[!"g|
h Rh[!"i|
j B$%k|
l B$%m|
n r2{#$o|
p B$%q|
r B$%s|
t "b8+&'u|
z B#(){|
| Rgs_%&}|
~ b"wo&'|
@ b"wo&'A|
F 
BUHG|
H r2x !I|
J 
BUHK|
L ReXM|
N 
BUHO|
P ReXQ|
R 
BUHS|
T r2x !U|
V 
BUHW|
X r2x !Y|
^ <b3&IJ_|
d /8%') *e|
p  89;cVE Fq|
x !I y|
B !Gv C|
L 3R#@AM|
R 0"sf=>S|
X JLJ  !Y|
^ 
9 
$ %_|
f }8z# $g|
n 27j" #o|
v D5J  !w|
~ 94:  |
F	 $4:  G	|
N	 2 O	|
Z	 R*ZM:;[	|
`	 #2  !a	|
h	 92  !i	|
p	 i2  !q	|
B
  KD%te a.a.4
-	$
 F aD$5$5$;$;r$A99D 8= %S o  S   #   S s3   R( R? S (R<;R<?SSS*)S*