
    &VfH4                     j    d dl mZmZ d dlZd dlZ G d de          Z G d de          Zd Zd ZdS )	    )	AstToGAst	GAstToAstNc                       e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd ZdS )
Ast2ToGAstc                 `    t          j        |                     |j                  g           }|S N)gastModule_visitbodyselfnodenew_nodes      F/var/www/html/software/conda/lib/python3.11/site-packages/gast/ast2.pyvisit_ModulezAst2ToGAst.visit_Module	   s.    ;KK	""
 
     c                 >   t          j        |                     |j                  |                     |j                  |                     |j                  |                     |j                  d d           }t          j        ||           d x|_        |_	        |S r   )
r	   FunctionDefr   nameargsr   decorator_listcopy_location
end_linenoend_col_offsetr   s      r   visit_FunctionDefzAst2ToGAst.visit_FunctionDef   s    #KK	""KK	""KK	""KK+,,
 
 	8T***8<<h5r   c           	      <   t          j        |                     |j                  |                     |j                  g |                     |j                  |                     |j                            }t          j        ||           d x|_        |_	        |S r   )
r	   ClassDefr   r   basesr   r   r   r   r   r   s      r   visit_ClassDefzAst2ToGAst.visit_ClassDef   s    =KK	""KK
##KK	""KK+,,
 
 	8T***8<<h5r   c                     t          j        |                     |j                  |                     |j                  d           }t          j        ||           d x|_        |_        |S r   )r	   Assignr   targetsvaluer   r   r   r   s      r   visit_AssignzAst2ToGAst.visit_Assign+   sb    ;KK%%KK
##
 
 	8T***8<<h5r   c                 <   t          j        |                     |j                  |                     |j                  |                     |j                  |                     |j                  g           }t          j        ||           d x|_        |_	        |S r   )
r	   Forr   targetiterr   orelser   r   r   r   s      r   	visit_ForzAst2ToGAst.visit_For6   s    8KK$$KK	""KK	""KK$$
 
 	8T***8<<h5r   c                 0   t          j        t          j        |                     |j                  |                     |j                            g|                     |j                  d           }t          j        ||           d x|_        |_	        |S r   )
r	   Withwithitemr   context_exproptional_varsr   r   r   r   r   s      r   
visit_WithzAst2ToGAst.visit_WithB   s    9]D-..D.//   KK	""
 
 	8T***8<<h5r   c                    |                      |j                  }|                      |j                  }|                      |j                  }|}|:t	          j        ||gg           }t	          j        ||           d x|_        |_        |t	          j	        |dt	          j
                              }t	          j        ||           d x|_        |_        t	          j        ||gg           }t	          j        ||           d x|_        |_        t	          j        |d           }t	          j        ||           d x|_        |_        |S )Nwith_traceback)r   typeinsttbackr	   Callr   r   r   	AttributeLoadRaise)r   r   ntypeninstntbackwhatattrr   s           r   visit_RaisezAst2ToGAst.visit_RaiseO   s8   DI&&DI&&TZ((9UUGR00DtT***488DOd1>$(8$)++FFDtT***488DOd19 D
 tT***488DOd1:dD))8T***8<<h5r   c                 
   t          j        |                     |j                  |                     |j                  |                     |j                  g           }t          j        ||           d x|_        |_        |S r   )	r	   Tryr   r   handlersr*   r   r   r   r   s      r   visit_TryExceptzAst2ToGAst.visit_TryExceptn   ss    8KK	""KK&&KK$$	
 
 	8T***8<<h5r   c                     t          j        |                     |j                  g g |                     |j                            }t          j        ||           d x|_        |_        |S r   )r	   rB   r   r   	finalbodyr   r   r   r   s      r   visit_TryFinallyzAst2ToGAst.visit_TryFinallyy   se    8KK	""KK''	
 
 	8T***8<<h5r   c                     t          j        |                     |j                  |                     |j                  d d           }t          j        ||           d x|_        |_        |S r   )r	   Namer   idctxr   r   r   r   s      r   
visit_NamezAst2ToGAst.visit_Name   se    9KK  KK!!	
 
 	8T***8<<h5r   c                     t          j        |j        d           }t          j        ||           d x|_        |_        |S r   )r	   Constantnr   r   r   r   s      r   	visit_NumzAst2ToGAst.visit_Num   E    =F
 
 	8T***8<<h5r   c                    |                      |j                  }t          j        |                      |j                  ||                      |j                            }t          j        ||           d x|_        |_        |S r   )	r   slicer	   	Subscriptr$   rK   r   r   r   )r   r   	new_slicer   s       r   visit_SubscriptzAst2ToGAst.visit_Subscript   su    KK
++	>KK
##KK!!
 

 	8T***8<<h5r   c                     t          j        t          d           }t          j        ||           d x|_        |_        |S r   )r	   rN   Ellipsisr   r   r   r   s      r   visit_EllipsiszAst2ToGAst.visit_Ellipsis   sC    =
 
 	8T***8<<h5r   c                 6    |                      |j                  S r   )r   r$   )r   r   s     r   visit_IndexzAst2ToGAst.visit_Index   s    {{4:&&&r   c                     |                      |j                  }t          j        |t          j                              }t          j        ||           d x|_        |_        |S r   )r   dimsr	   Tupler9   r   r   r   )r   r   new_dimsr   s       r   visit_ExtSlicezAst2ToGAst.visit_ExtSlice   sT    ;;ty)):h	448T***8<<h5r   c                     t          j        |j        d           }t          j        ||           d x|_        |_        |S r   )r	   rN   sr   r   r   r   s      r   	visit_StrzAst2ToGAst.visit_Str   rQ   r   c                 `   |j         ret          j        |                     |j                   t          j                              }t          j        ||           d x|_        |_        |g}ng }|j        r/t          j	        d |                     |j                            g}ng }t          j
        |                     |j                  |                     |j                  |z   |                     |j                  |z             }t          j        ||           d x|_        |_        |S r   )starargsr	   Starredr   r9   r   r   r   kwargskeywordr7   funcr   keywords)r   r   starstarredrg   r   s         r   
visit_CallzAst2ToGAst.visit_Call   s   = 	<DM : :DIKKHHDtT***488DOd1fGGG; 	l4T[)A)ABBCFFF9KK	""KK	""W,KK&&/
 

 	8T***8<<h5r   c                    t          j        |                     |j                  |                     |j                  |                     |j                  d          }t          j        ||           d x|_        |_        |S )Nr   )r(   r)   ifsis_async)	r	   comprehensionr   r(   r)   ro   r   r   r   r   s      r   visit_comprehensionzAst2ToGAst.visit_comprehension   sy    %;;t{++TY''DH%%	
 
 
 	8T***8<<h5r   c                 $   |j         r,t          j        |j         t          j                              }nd }|j        r,t          j        |j        t          j                              }nd }|j         r,t          j        |j         t          j                              }nd }t          j        |                     |j                  g |                     |          g g |                     |          |                     |j	                            }|S r   )
varargastrI   Paramkwargr	   	argumentsr   r   defaultsr   r   rt   rw   r   s        r   visit_argumentszAst2ToGAst.visit_arguments   s    ; 	Xdk39;;77FFF: 	HTZ55EEE; 	Xdk39;;77FFF>KK	""KKKKKK&&
 
 r   c                     t          j        |                     |j                  |                     |j                            }d x|_        |_        d x|_        |_        |S r   )	r	   aliasr   r   asnamelineno
col_offsetr   r   r   s      r   visit_aliaszAst2ToGAst.visit_alias   s[    :KK	""KK$$
 
 154(-8<<h5r   N)__name__
__module____qualname__r   r   r    r%   r+   r1   r@   rD   rG   rL   rP   rV   rY   r[   r`   rc   rm   rr   r{   r    r   r   r   r      s@             	 	 	
 
 
    >	 	 		 	 		 	 	  	 	 	  ' ' '      .	 	 	  8    r   r   c                   h    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd ZdS )
GAstToAst2c                 ^    t          j        |                     |j                            }|S r   )ru   r
   r   r   r   s      r   r   zGAstToAst2.visit_Module  s$    :dkk$)4455r   c                    t          j        |                     |j                  |                     |j                  |                     |j                  |                     |j                            }|j        j        rt          j        |j        j        |           |j        j	        rt          j        |j        j	        |           t          j        ||           |S r   )
ru   r   r   r   r   r   r   rt   r   rw   r   s      r   r   zGAstToAst2.visit_FunctionDef  s    ?KK	""KK	""KK	""KK+,,	
 
 9 	6di.5559? 	5diot444(D)))r   c                    t          j        |                     |j                  |                     |j                  |                     |j                  |                     |j                            }t          j        ||           |S r   )ru   r   r   r   r   r   r   r   r   s      r   r    zGAstToAst2.visit_ClassDef"  sr    <KK	""KK
##KK	""KK+,,	
 
 	(D)))r   c                     t          j        |                     |j                  |                     |j                            }t          j        ||           |S r   )ru   r"   r   r#   r$   r   r   s      r   r%   zGAstToAst2.visit_Assign-  sO    :KK%%KK
##
 

 	(D)))r   c                    t          j        |                     |j                  |                     |j                  |                     |j                  |                     |j                            }t          j        ||           |S r   )ru   r'   r   r(   r)   r   r*   r   r   s      r   r+   zGAstToAst2.visit_For6  sq    7KK$$KK	""KK	""KK$$	
 
 	(D)))r   c                    t          j        |                     |j        d         j                  |                     |j        d         j                  |                     |j                            }t          j        ||           |S )Nr   )ru   r-   r   itemsr/   r0   r   r   r   s      r   r1   zGAstToAst2.visit_WithA  sn    8KK
1233KK
1344KK	""
 

 	(D)))r   c                    t          |j        t          j                  rt          |j        j        t          j                  r_|j        j        j        dk    rJ|                     |j        j        j                  }|                     |j        j	        d                   }n|                     |j                  }d }t          j        |d |          }t          j        ||           |S )Nr3   r   )
isinstanceexcr	   r7   ri   r8   r?   r   r$   r   ru   r:   r   )r   r   raised	tracebackr   s        r   r@   zGAstToAst2.visit_RaiseJ  s    dh	** 	dhmT^44	8=!111[[!455FDHM!$455II[[**FI9VT955(D)))r   c                    |j         rFt          j        |                     |j                  |                     |j                             }n^t          j        |                     |j                  |                     |j                  |                     |j                            }t          j        ||           |S r   )	rF   ru   
TryFinallyr   r   	TryExceptrC   r*   r   r   s      r   	visit_TryzGAstToAst2.visit_TryW  s    > 
	~DI&&DN++ HH
 }DI&&DM**DK(( H
 	(D)))r   c                     t          j        |                     |j                  |                     |j                            }t          j        ||           |S r   )ru   rI   r   rJ   rK   r   r   s      r   rL   zGAstToAst2.visit_Nameh  sO    8KK  KK!!
 
 	(D)))r   c                 @   t          |j        t          t          t          t
          t          f          rt          j        |j                  }n;|j        t          u rt          j	                    }nt          j
        |j                  }t          j        ||           |S r   )r   r$   boolintlongfloatcomplexru   NumrX   Strr   r   s      r   visit_ConstantzGAstToAst2.visit_Constantp  sw    dj4dE7"CDD 	+wtz**HHZ8##|~~HHwtz**H(D)))r   c                     d t          |j        t          j                  r,t	          j         fd|j        j        D                       }n#                      |j                            }t	          j        ||j                   t	          j	                             |j
                  |                     |j                            }t	          j        ||           d x|_        |_        |S )Nc                 z    t          | t          j        t          j        f          r| S t          j        |           S r   )r   ru   SlicerX   Index)rb   s    r   adjust_slicez0GAstToAst2.visit_Subscript.<locals>.adjust_slice{  s0    !ci677 $y||#r   c                 L    g | ] }                      |                    !S r   )r   ).0eltr   r   s     r   
<listcomp>z.GAstToAst2.visit_Subscript.<locals>.<listcomp>  sE     &B &B &B*- '3l4;;s3C3C&D&D &B &B &Br   )r   rS   r	   r^   ru   ExtSliceeltsr   r   rT   r$   rK   r   r   )r   r   rU   r   r   s   `   @r   rV   zGAstToAst2.visit_Subscriptz  s   	$ 	$ 	$
 dj$*-- 	> &B &B &B &B &B15&B &B &B C CII %T[[%<%<==I)TZ000=KK
##KK!!
 

 	(D)))8<<h5r   c           	      ^   |j         rGt          |j         d         t          j                  r"|j         d d         }|j         d         j        }n	|j         }d }|j        r4|j        d         j        "|j        d d         }|j        d         j        }n	|j        }d }t          j        | 	                    |j
                  | 	                    |          | 	                    |          | 	                    |          | 	                    |                    }t          j        ||           |S )N)r   r   r	   rf   r$   rj   argru   r7   r   ri   r   )r   r   r   re   rj   rg   r   s          r   rm   zGAstToAst2.visit_Call  s   9 	DIbM4<@@ 	9SbS>Dy}*HH9DH= 	T]2.2:}SbS)H]2&,FF}HF8KK	""KKKK!!KK!!KK
 
 	(D)))r   c                     t          j        |j        t          j                              }t          j        ||           |S r   )ru   rI   r   rv   r   r   s      r   	visit_argzGAstToAst2.visit_arg  s3    8DHcikk22(D)))r   c                 ,   |j         o|j         j        }|j        o|j        j        }t          j        |                     |j                  |                     |          |                     |          |                     |j                            }|S r   )rt   rJ   rw   ru   rx   r   r   ry   rz   s        r   r{   zGAstToAst2.visit_arguments  sz    /
,tz}=KK	""KKKKKK&&	
 
 r   c                     t          j        |                     |j                  |                     |j                            }|S r   )ru   r}   r   r   r~   r   s      r   r   zGAstToAst2.visit_alias  s<    9KK	""KK$$
 
 r   N)r   r   r   r   r   r    r%   r+   r1   r@   r   rL   r   rV   rm   r   r{   r   r   r   r   r   r   
  s          
   	 	 	  	 	 	      "      ,  2  
 
 
    r   r   c                 D    t                                          |           S r   )r   visitr   s    r   ast_to_gastr         <<d###r   c                 D    t                                          |           S r   )r   r   r   s    r   gast_to_astr     r   r   )	astnr   r   ru   r	   r   r   r   r   r   r   r   <module>r      s    % % % % % % % % 



 A A A A A A A AHv v v v v v v vr$ $ $$ $ $ $ $r   