
    Whg0                     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                   z    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S )
Ast2ToGAstc                 `    t          j        |                     |j                  g           }|S N)gastModule_visitbodyselfnodenew_nodes      O/var/www/html/movieo_spanner_bot/venv/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                  |                     |j                  |                     |j                  g           }t          j        ||           d x|_        |_	        |S r   )
r	   Forr   targetiterr   orelser   r   r   r   s      r   	visit_ForzAst2ToGAst.visit_For+   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_With7   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_RaiseD   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_TryExceptc   ss    8KK	""KK&&KK$$	
 
 	8T***8<<h5r   c                     t          j        |                     |j                  g g |                     |j                            }t          j        ||           d x|_        |_        |S r   )r	   r=   r   r   	finalbodyr   r   r   r   s      r   visit_TryFinallyzAst2ToGAst.visit_TryFinallyn   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	   	SubscriptvaluerF   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	   rI   Ellipsisr   r   r   r   s      r   visit_EllipsiszAst2ToGAst.visit_Ellipsis   sC    =
 
 	8T***8<<h5r   c                 6    |                      |j                  S r   )r   rP   )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	   Tupler4   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	   rI   sr   r   r   r   s      r   	visit_StrzAst2ToGAst.visit_Str   rL   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   r4   r   r   r   kwargskeywordr2   funcr   keywords)r   r   starstarredrc   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$   rk   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astrD   Paramkwargr	   	argumentsr   r   defaultsr   r   rp   rs   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   N)__name__
__module____qualname__r   r   r    r&   r,   r;   r?   rB   rG   rK   rR   rU   rW   r\   r_   ri   rn   rw    r   r   r   r      s"             
 
 
    >	 	 		 	 		 	 	  	 	 	  ' ' '      .	 	 	    r   r   c                   \    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S )
GAstToAst2c                 ^    t          j        |                     |j                            }|S r   )rq   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   )
rq   r   r   r   r   r   r   rp   r   rs   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   )rq   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                  |                     |j                  |                     |j                            }t          j        ||           |S r   )rq   r"   r   r#   r$   r   r%   r   r   s      r   r&   zGAstToAst2.visit_For  sq    7KK$$KK	""KK	""KK$$	
 
 	(D)))r   c                    t          j        |                     |j        d         j                  |                     |j        d         j                  |                     |j                            }t          j        ||           |S )Nr   )rq   r(   r   itemsr*   r+   r   r   r   s      r   r,   zGAstToAst2.visit_With$  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 )Nr.   r   )
isinstanceexcr	   r2   re   r3   r:   r   rP   r   rq   r5   r   )r   r   raised	tracebackr   s        r   r;   zGAstToAst2.visit_Raise-  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   )	rA   rq   
TryFinallyr   r   	TryExceptr>   r%   r   r   s      r   	visit_TryzGAstToAst2.visit_Try:  s    > 
	~DI&&DN++ HH
 }DI&&DM**DK(( H
 	(D)))r   c                     t          j        |                     |j                  |                     |j                            }t          j        ||           |S r   )rq   rD   r   rE   rF   r   r   s      r   rG   zGAstToAst2.visit_NameK  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   rP   boolintlongfloatcomplexrq   NumrT   Strr   r   s      r   visit_ConstantzGAstToAst2.visit_ConstantS  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   rq   SlicerT   Index)r^   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>d  sE     &B &B &B*- '3l4;;s3C3C&D&D &B &B &Br   )r   rN   r	   rZ   rq   ExtSliceeltsr   r   rO   rP   rF   r   r   )r   r   rQ   r   r   s   `   @r   rR   zGAstToAst2.visit_Subscript]  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	   rb   rP   rf   argrq   r2   r   re   r   )r   r   r   ra   rf   rc   r   s          r   ri   zGAstToAst2.visit_Calls  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   )rq   rD   r   rr   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   )rp   rE   rs   rq   rt   r   r   ru   rv   s        r   rw   zGAstToAst2.visit_arguments  sz    /
,tz}=KK	""KKKKKK&&	
 
 r   N)rx   ry   rz   r   r   r    r&   r,   r;   r   rG   r   rR   ri   r   rw   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   rq   r	   r   r}   r   r   r{   r   r   <module>r      s    % % % % % % % % 



 m m m m m m m m`f f f f f f f fR$ $ $$ $ $ $ $r   