
     -ib                       S r SSKJr  SSKrSSKJrJr  SSKJr  SSK	r	SSK
JrJrJr  SSKrSSKJr  SSKJr  SSKJs  Jr  SS	KJrJrJrJrJrJrJrJ r J!r!J"r"J#r#J$r$J%r%J&r&  SS
K'J(r(J)r)  SSK*J+r+  SSK,J-r-  S-S jr.S-S jr/S-S jr0S r1S r2\2" \0\/\.\(5      4   S.S jjr3S r4\4" \55      r6\4" \75      r8\9" S S \:" \5       5        5       5      r;\;4S jr<\9" S \; 5       5      r=\<" \R|                  5      r?\<" \R                  5      rA\<" \R                  5      rC\<" \R                  5      rE\<" \R                  5      rG\<" \R                  5      rI\<" \R                  5      rK\<" \R                  5      rM\<" \R                  5      rO\<" \R                  5      rQ\<" \R                  5      rS\<" \R                  5      rT\<" \R                  5      rV\9" / SQ5      rW\9" / SQ5      rX\A\?-  \Q-  \S-  \T-  \V-  \E-  \X-  \W-
  rY\=\Y-
  \W-  rZ\Y\Z-  r[S\[ 3r\\[(       a   \\5       eS/S jr]\" S5      r^S0S jr_S r`\ \%S.raS  rb\_" \Y5      \b" \a5       " S! S"\R                  5      5       5       rd\9" / S#Q5      re\9" \\-   5      rf\_" \Y\e-  \G\9" / S$Q5      -  -
  5       " S% S&\d5      5       rg\_" \Y\e-  \9" S'/5      -  5       " S( S)\d5      5       rh " S* S+5      ri\h\gS,.rjg)1z
:func:`~pandas.eval` parsers.
    )annotationsN)partialreduce	iskeyword)CallableClassVarTypeVar)UndefinedVariableError)is_string_dtype)ARITH_OPS_SYMSBOOL_OPS_SYMSCMP_OPS_SYMS	LOCAL_TAGMATHOPS
REDUCTIONSUNARY_OPS_SYMSBinOpConstantFuncNodeOpTermUnaryOpis_term)clean_backtick_quoted_tokstokenize_string)Scope)printingc                "    U u  pXS:X  a  S4$ U4$ )a4  
Rewrite the assignment operator for PyTables expressions that use ``=``
as a substitute for ``==``.

Parameters
----------
tok : tuple of int, str
    ints correspond to the all caps constants in the tokenize module

Returns
-------
tuple of int, str
    Either the input or token or the replacement values
=== toktoknumtokvals      O/var/www/html/venv/lib/python3.13/site-packages/pandas/core/computation/expr.py_rewrite_assignr(   3   s"     NFS=444f44    c                    U u  pU[         R                  :X  a3  US:X  a  [         R                  S4$ US:X  a  [         R                  S4$ X4$ X4$ )a>  
Replace ``&`` with ``and`` and ``|`` with ``or`` so that bitwise
precedence is changed to boolean precedence.

Parameters
----------
tok : tuple of int, str
    ints correspond to the all caps constants in the tokenize module

Returns
-------
tuple of int, str
    Either the input or token or the replacement values
&and|or)tokenizeOPNAMEr#   s      r'   _replace_booleansr2   F   sS     NFS===%''s]==$&&~>r)   c                p    U u  pU[         R                  :X  a  US:X  a  [         R                  [        4$ X4$ )a  
Replace local variables with a syntactically valid name.

Parameters
----------
tok : tuple of int, str
    ints correspond to the all caps constants in the tokenize module

Returns
-------
tuple of int, str
    Either the input or token or the replacement values

Notes
-----
This is somewhat of a hack in that we rewrite a string such as ``'@a'`` as
``'__pd_eval_local_a'`` by telling the tokenizer that ``__pd_eval_local_``
is a ``tokenize.OP`` and to replace the ``'@'`` symbol with it.
@)r/   r0   r   r#   s      r'   _replace_localsr5   _   s4    ( NF3{{I%%>r)   c                   ^ ^ U U4S j$ )z
Compose 2 callables.
c                     > T" T" U 0 UD65      $ Nr"   )argskwargsfgs     r'   <lambda>_compose2.<locals>.<lambda>}   s    1Q%7%7#8r)   r"   )r;   r<   s   ``r'   	_compose2r?   y   s     98r)   c                 N    [        U 5      S:  d   S5       e[        [        U 5      $ )z
Compose 2 or more callables.
   z.At least 2 callables must be passed to compose)lenr   r?   )funcss    r'   _composerD      s'     u:>KKK>)U##r)   c                   ^ [        T5      (       d   S5       e[        R                  " U4S j[        U 5       5       5      $ )a  
Compose a collection of tokenization functions.

Parameters
----------
source : str
    A Python source code string
f : callable
    This takes a tuple of (toknum, tokval) as its argument and returns a
    tuple with the same structure but possibly different elements. Defaults
    to the composition of ``_rewrite_assign``, ``_replace_booleans``, and
    ``_replace_locals``.

Returns
-------
str
    Valid Python source code

Notes
-----
The `f` parameter can be any callable that takes *and* returns input of the
form ``(toknum, tokval)``, where ``toknum`` is one of the constants from
the ``tokenize`` module and ``tokval`` is a string.
zf must be callablec              3  4   >#    U  H  nT" U5      v   M     g 7fr8   r"   ).0xr;   s     r'   	<genexpr>_preparse.<locals>.<genexpr>   s     E-Dqtt-Ds   )callabler/   
untokenizer   sourcer;   s    `r'   	_preparserO      s5    < A;;,,,;E_V-DEEEr)   c                   ^  U 4S j$ )zG
Factory for a type checking function of type ``t`` or tuple of types.
c                0   > [        U R                  T5      $ r8   )
isinstancevalue)rH   ts    r'   r=   _is_type.<locals>.<lambda>   s    Z+r)   r"   )rT   s   `r'   _is_typerV      s     ,+r)   c              #     #    U  H?  n[        U[        5      (       d  M  [        U[        R                  5      (       d  M;  Uv   MA     g 7fr8   )rR   type
issubclassastAST)rG   nodes     r'   rI   rI      s6      9$ 	",T377"; 	D9s   A	A	 	A	c              #  B   #    U  H  n[        [        U5      v   M     g 7fr8   )getattrrZ   )rG   names     r'   rI   rI      s     9d##s   c                2   ^  U 4S jU 5       n[        U5      $ )z=
Filter out AST nodes that are subclasses of ``superclass``.
c              3  b   >#    U  H$  n[        UT5      (       d  M  UR                  v   M&     g 7fr8   )rY   __name__)rG   r\   
superclasss     r'   rI    _filter_nodes.<locals>.<genexpr>   s      VIDD*9U-$--Is   //)	frozenset)rc   	all_nodes
node_namess   `  r'   _filter_nodesrh      s     WIVJZ  r)   c              #  8   #    U  H  oR                   v   M     g 7fr8   )rb   rG   rH   s     r'   rI   rI      s     ;
1JJ
   )AssignModuleExpr)YieldGeneratorExpIfExpDictCompSetCompReprLambdaSetr[   IsIsNotz$cannot both support and not support c                   ^  U 4S jnU$ )zN
Return a function that raises a NotImplementedError with a passed node name.
c                "   > [        ST S35      e)N'z' nodes are not implemented)NotImplementedError)selfr9   r:   	node_names      r'   r;    _node_not_implemented.<locals>.f  s    !Ai[0K"LMMr)   r"   )r~   r;   s   ` r'   _node_not_implementedr      s    
N Hr)   _Tc                   ^  SU 4S jjnU$ )zs
Decorator to disallow certain nodes from parsing. Raises a
NotImplementedError instead.

Returns
-------
callable
c                   > SU l         T H5  n[        U5      nSU 3nU =R                   U4-  sl         [        XU5        M7     U $ )Nr"   visit_)unsupported_nodesr   setattr)clsr\   
new_methodr_   nodess       r'   
disalloweddisallow.<locals>.disallowed  sN     "D.t4JD6?D!!dW,!Cz*  
r)   )r   type[_T]returnr   r"   )r   r   s   ` r'   disallowr     s    	 r)   c                   ^ ^ U U4S jnU$ )zc
Return a function to create an op class with its symbol already passed.

Returns
-------
callable
c                $   > [        TT/UQ70 UD6$ )zj
Return a partial function with an Op subclass with an operator already passed.

Returns
-------
callable
)r   )r}   r\   r9   r:   op_class	op_symbols       r'   r;   _op_maker.<locals>.f0  s     x<T<V<<r)   r"   )r   r   r;   s   `` r'   	_op_makerr   '  s    = Hr)   )binaryunaryc                   ^  U 4S jnU$ )z1
Decorator to add default implementation of ops.
c                   > TR                  5        HN  u  p[        X S35      n[        X S35      nU H'  nXE   nUc  M  [        X%5      n[        U SU 3U5        M)     MP     U $ )N_ops_op_nodes_mapr   )itemsr^   r   r   )	r   op_attr_namer   opsops_mapopop_nodemade_op
op_classess	           r'   r;   add_ops.<locals>.fE  sv    &0&6&6&8"L#t45Cc^=#ABG!+&'5GC6'!3W=	  '9 
r)   r"   )r   r;   s   ` r'   add_opsr   @  s    
	 Hr)   c                  ,   \ rS rSr% Sr\rS\S'   \r	S\S'   \
\-   \-   rSr\" \" \\5      5      r\rSr\" \" \\5      5      r\R.                  \R0                  \R2                  \R4                  \R0                  \R0                  \R4                  \R4                  0rS\S	'   \4S'S
 jjrS rS rS r S r!S(S jr"S r#S r$  S)S jr%S r&S r'S*S jr(S*S jr)S*S jr*S*S jr+S*S jr,S*S jr-\-r.S r/S*S jr0S+S jr1S r2S  r3S,S! jr4S" r5S# r6S$ r7S% r8S&r9g)-BaseExprVisitoriS  z
Custom ast walker. Parsers of other engines should subclass this class
if necessary.

Parameters
----------
env : Scope
engine : str
parser : str
preparser : callable
zClassVar[type[Term]]
const_type	term_type)GtLtGtELtEEqNotEqInNotInBitAndBitOrAndOrAddSubMultDivPowFloorDivMod)UAddUSubInvertNotztuple[str, ...]r   c                B    Xl         X l        X0l        X@l        S U l        g r8   )envengineparser	preparserassigner)r}   r   r   r   r   s        r'   __init__BaseExprVisitor.__init__  s    "r)   c                |   [        U[        5      (       a<  U R                  U5      n [        R                  " [        R
                  " U5      5      nS[        U5      R                   3n[        X5      nU" U40 UD6$ ! [         a3  n[        S UR                  5        5       5      (       a  SUl	        UeS nAff = f)Nc              3  8   #    U  H  n[        U5      v   M     g 7fr8   r   rj   s     r'   rI   (BaseExprVisitor.visit.<locals>.<genexpr>  s     ;]y||]rk   z4Python keyword not valid identifier in numexpr queryr   )rR   strr   rZ   fix_missing_locationsparseSyntaxErroranysplitmsgrX   rb   r^   )r}   r\   r:   cleanemethodvisitors          r'   visitBaseExprVisitor.visit  s    dC  NN4(E0051AB $t*--./$'t&v&&  ;U[[];;;RAEs   *A> >
B;.B66B;c                    [        UR                  5      S:w  a  [        S5      eUR                  S   nU R                  " U40 UD6$ )NrA   z#only a single expression is allowedr   )rB   bodyr   r   )r}   r\   r:   exprs       r'   visit_ModuleBaseExprVisitor.visit_Module  s?    tyy>QCDDyy|zz$)&))r)   c                <    U R                   " UR                  40 UD6$ r8   r   rS   r}   r\   r:   s      r'   
visit_ExprBaseExprVisitor.visit_Expr  s    zz$**///r)   c                   UR                   n[        U5      n[        U5      (       Ga  [        U5      (       a  XPR                  ;   a  [	        [
        X#45      u  pg[	        [        X#45      u  pU(       d  U(       d  U(       d  U	(       a  U R                  U   " 5       nU	(       aA  U R                  R                  UR                  /5      n
U R                  XR                  5      nU(       aA  U R                  R                  UR                  /5      n
U R                  XR                  5      nU R                  U5      nXX#4$ r8   )r   rX   r   rewrite_mapmap_is_list_is_strr   add_tmprS   r   r   )r}   r\   leftrightop_instanceop_type	left_list
right_listleft_str	right_strr_   r   s               r'   _rewrite_membership_op&BaseExprVisitor._rewrite_membership_op  s    gg{# 4==WU^^;K;K0K$'4-$@!I"%g}"=H J(i"..w79 xx''6tXX6xx''5~~dHH5ZZ$++r)   Nc                    Uc  U R                  UR                  SS9nUc  U R                  UR                  SS9nU R                  XU5      u  pEp#XEX#4$ )Nr   )sider   )r   r   r   r   )r}   r\   r   r   r   r   s         r'   _maybe_transform_eq_ne&BaseExprVisitor._maybe_transform_eq_ne  sZ    <::diif:5D=JJtzzJ8E$($?$?E$R!dT((r)   c                   [         R                  " [         R                  5      nUR                  (       a  [	        US5      (       au  UR                  (       dd  UR
                  U:X  aT  U R                  R                  [         R                  " UR                  5      5      nU R                  X@R                  5      nUR                  (       a  [	        US5      (       au  UR                  (       dd  UR
                  U:X  aT  U R                  R                  [         R                  " UR                  5      5      nU R                  X@R                  5      nX4$ )NrS   )
npdtypefloat32	is_scalarhasattrreturn_typer   r   rS   r   )r}   r   r   f32r_   s        r'   _maybe_downcast_constants)BaseExprVisitor._maybe_downcast_constants  s    hhrzz"NNg&&OO!!S( 88##BJJtzz$:;D>>$1DOOw''NN  C' 88##BJJu{{$;<DNN42E{r)   c                |    UR                  U R                  U R                  U R                  U R                  U5      $ r8   )evaluater   r   r   r   )r}   binopeval_in_pythons      r'   _maybe_evalBaseExprVisitor._maybe_eval  s0     ~~HHdkk4;;
 	
r)   c           	        U" X45      nUR                   (       a3  [        SUR                   SUR                   SUR                   S35      eU R                  S:w  aS  UR                  [
        ;   a  [        USS5      (       d  [        USS5      (       a  U R                  XpR                  5      $ UR                  U;   a  U R                  Xu5      $ U R                  S:w  at  [        USS 5      [        :X  dK  [        [        USS 5      5      (       d0  [        USS 5      [        :X  d  [        [        USS 5      5      (       a  U R                  XuU-   5      $ U$ )	Nz unsupported operand type(s) for z: 'z' and 'r{   pytablesis_datetimeFr   )has_invalid_return_type	TypeErrorr   rX   r   r   r^   r  
binary_opsobjectr   )r}   r   r   lhsrhsr  maybe_eval_in_pythonress           r'   _maybe_evaluate_binop%BaseExprVisitor._maybe_evaluate_binop  s-    l&&2366( ;HH:WSXXJa1 
 ;;*$FFl"]E22sM511 ##C9966^###C88[[J&]D1V;"73t#DEE3t4>"73t#DEE ''>R-RSS
r)   c                t    U R                  U5      u  p4pVU R                  XV5      u  pVU R                  X4XV5      $ r8   )r   r   r  )r}   r\   r:   r   r   r   r   s          r'   visit_BinOpBaseExprVisitor.visit_BinOp  s<    $($?$?$E!d44TA))"DDr)   c                ~    U R                  UR                  5      nU R                  UR                  5      nU" U5      $ r8   )r   r   operand)r}   r\   r:   r   r  s        r'   visit_UnaryOpBaseExprVisitor.visit_UnaryOp  s0    ZZ **T\\*'{r)   c                R    U R                   " UR                  U R                  40 UD6$ r8   )r   idr   r   s      r'   
visit_NameBaseExprVisitor.visit_Name   s     ~~dggtxx:6::r)   c                N    U R                  UR                  U R                  5      $ r8   r   rS   r   r   s      r'   visit_NameConstant"BaseExprVisitor.visit_NameConstant$      tzz48844r)   c                N    U R                  UR                  U R                  5      $ r8   r  r   s      r'   	visit_NumBaseExprVisitor.visit_Num(  r"  r)   c                N    U R                  UR                  U R                  5      $ r8   r  r   s      r'   visit_ConstantBaseExprVisitor.visit_Constant+  r"  r)   c                    U R                   R                  UR                  5      nU R                  X0R                   5      $ r8   )r   r   sr   )r}   r\   r:   r_   s       r'   	visit_StrBaseExprVisitor.visit_Str/  s-    xx'~~dHH--r)   c                    U R                   R                  UR                   Vs/ s H#  o0R                  U5      " U R                   5      PM%     sn5      nU R	                  X@R                   5      $ s  snf r8   )r   r   eltsr   r   )r}   r\   r:   r   r_   s        r'   
visit_ListBaseExprVisitor.visit_List3  sQ    xx$)) L)QAtxx!8) LM~~dHH-- !Ms   *A0c                8    U R                  UR                  5      $ )zdf.index[4]r   r   s      r'   visit_IndexBaseExprVisitor.visit_Index9  s    zz$**%%r)   c                   SSK Jn  U R                  UR                  5      nU R                  UR                  5      nU" XPR
                  U R                  U R                  S9n UR                  U   nU R
                  R                  U5      n	U R                  XR
                  S9$ ! [         a-    U" X@R
                  U R                  U R                  S9nX   n Njf = f)Nr   )eval)
local_dictr   r   )r   )pandasr5  r   rS   slicer   r   r   AttributeErrorr   r   )
r}   r\   r:   pd_evalrS   slobjresultvr  r_   s
             r'   visit_SubscriptBaseExprVisitor.visit_Subscript=  s    *

4::&

4::&hht{{4;;
	F#A xx"~~d~11  	((4;;t{{C A	s   $B' '4CCc                   UR                   nUb  U R                  U5      R                  nUR                  nUb  U R                  U5      R                  nUR                  nUb  U R                  U5      R                  n[        X4U5      $ )zdf.index[slice(4,6)])lowerr   rS   upperstepr8  )r}   r\   r:   rA  rB  rC  s         r'   visit_SliceBaseExprVisitor.visit_SliceQ  sx    

JJu%++E

JJu%++Eyy::d#))DU4((r)   c                   [        UR                  5      S:w  a  [        S5      e[        UR                  S   [        R
                  5      (       d  [        S5      eU R                  R                  c  [        S5      e U R                  " UR                  S   40 UD6n[        USU5      U l        U R                  c  [        S5      eU R                  " UR                  40 UD6$ ! [         a    UR                  S   R                  n Nlf = f)z
support a single assignment node, like

c = a + b

set the assigner at the top level, must be a Name node which
might or might not exist in the resolvers

rA   z#can only assign a single expressionr   z5left hand side of an assignment must be a single namez%cannot assign without a target objectr_   z@left hand side of an assignment must be a single resolvable name)rB   targetsr   rR   rZ   Namer   target
ValueErrorr   r   r  r^   r   rS   )r}   r\   r:   r   s       r'   visit_AssignBaseExprVisitor.visit_Assign_  s     t||!CDD$,,q/38844UVV88??"DEE	*zz$,,q/<V<H  &(;== R  zz$**/// & 	*||A))H	*s   ? C& &#DDc                   UR                   nUR                  nUR                  n[        U[        R
                  5      (       a]  U R                  U5      R                  n [        Xc5      nU R                  R                  U5      nU R                  XR                  5      $ [        S[        U5      R                    35      e! [         a5    [        U[        R                  5      (       a  UR                  U:X  a  Us $ e f = f)NzInvalid Attribute context )attrrS   ctxrR   rZ   Loadr   r^   r   r   r   r9  rH  r  rJ  rX   rb   )	r}   r\   r:   rN  rS   rO  resolvedr=  r_   s	            r'   visit_AttributeBaseExprVisitor.visit_Attribute}  s    yy

hhc388$$zz%(..HH+xx''*~~dHH55 5d3i6H6H5IJKK " eSXX..588t3C#O	s    A C ;D?Dc                z   [        UR                  [        R                  5      (       a6  UR                  R                  S:w  a  U R                  UR                  5      nOP[        UR                  [        R                  5      (       d  [        S5      e U R                  UR                  5      nUc"  [        SUR                  R                   35      e[        US5      (       a  UR                  n[        U[        5      (       aY  UR                   Vs/ s H  oPR                  U5      PM     nnUR                   (       a  [        SUR"                   S35      eU" U6 $ UR                   Vs/ s H#  oPR                  U5      " U R$                  5      PM%     nnUR                    H  n[        U[        R&                  5      (       d#  [        SUR                  R                   S35      eUR(                  (       d  MX  U R                  UR                  5      " U R$                  5      X7R(                  '   M     U R$                  R+                  U" U0 UD65      nU R-                  XR$                  S	9$ ! [         a3     [        UR                  R                  5      n GN! [         a    e f = ff = fs  snf s  snf )
N__call__z"Only named functions are supportedzInvalid function call rS   z
Function "z$" does not support keyword argumentsz keyword error in function call 'r{   )r_   r   )rR   funcrZ   	AttributerN  rR  rH  r
  r   r   r   r  rJ  r   rS   r9   keywordsr_   r   keywordargr   r   )	r}   r\   r   r:   r  rZ  new_argskeyr_   s	            r'   
visit_CallBaseExprVisitor.visit_Call  s!   dii//DIINNj4P&&tyy1CDIIsxx00@AAjj+ ;(7  3  ))Cc8$$3799=9C

39H=}} 
*NO  >! >BYYGYc

31YHG}}!#s{{33$ IILL>, 
 777&*jj&;DHH&EF77O % 88##C$<V$<=D>>t>::S * "499<<0C! 	" > Hs*   I3 J3.*J83
J0>J  J,,J0c                    U$ r8   r"   )r}   r   s     r'   translate_InBaseExprVisitor.translate_In  s    	r)   c           
         UR                   nUR                  n[        U5      S:X  aG  U R                  US   5      n[        R
                  " XQR                  US   S9nU R                  U5      $ UR                  n/ n[        X45       HM  u  pYU R                  [        R                  " U	/XpR                  U5      /S95      n
U	nUR                  U
5        MO     U R                  [        R                  " [        R                  " 5       US95      $ )NrA   r   )r   r   r   )comparatorsr   r   )r   values)r   rc  rB   r`  rZ   r   r   r   zipCompareappendBoolOpr   )r}   r\   r:   r   compsr   r  r   rd  compnew_nodes              r'   visit_CompareBaseExprVisitor.visit_Compare  s    hh   u:?""3q6*BII))58DE::e$$ yyCHBzzT@Q@QRT@U?VWH DMM(# ( zz#**	&ABBr)   c                ^    [        U[        [        45      (       a  U$ U R                  U5      $ r8   )rR   r   r   r   )r}   bops     r'   _try_visit_binop BaseExprVisitor._try_visit_binop  s&    cB:&&Jzz#r)   c                B   ^ ^ UU 4S jnTR                   n[        X45      $ )Nc                   > TR                  U 5      nTR                  U5      nTR                  TX#5      u  pEp#TR                  UTR                  X#5      $ r8   )rp  r   r  r   )rH   yr  r  r   r   r\   r}   s         r'   r   -BaseExprVisitor.visit_BoolOp.<locals>.visitor  sS    ''*C''*C%)%@%@s%P"B#--b$''3DDr)   )rd  r   )r}   r\   r:   r   operandss   ``   r'   visit_BoolOpBaseExprVisitor.visit_BoolOp  s    	E ;;g((r)   )r   r   r   r   r   r   None)NN))inznot in)r!   z!=<>z<=z>=)r   r   )r   r8  r8   ):rb   
__module____qualname____firstlineno____doc__r   r   __annotations__r   r   r   r   r   r  binary_op_nodesdictre  binary_op_nodes_mapr   	unary_opsunary_op_nodesunary_op_nodes_maprZ   r   r   r   r   r   rO   r   r   r   r   r   r   r   r  r  r  r  r  r   r$  r'  r+  r/  visit_Tupler2  r>  rD  rK  rR  r]  r`  rl  rp  rw  __static_attributes__r"   r)   r'   r   r   S  sH   
 (0J$/&*I#*->JO* s:?@I4Nc)^<= 			399		399	K '&6? '*0,6).	
" (?'RE

;555.. K&2()0<L(1;fC*
	)r)   r   )Dictrh  r   r   )rh  rW  r   r   Tuplec                  N   ^  \ rS rSr\" \\" \\\	5      S94 SU 4S jjjr
SrU =r$ )PandasExprVisitori  )r;   c                &   > [         TU ]  XX45        g r8   superr   r}   r   r   r   r   	__class__s        r'   r   PandasExprVisitor.__init__  s     	f8r)   r"   ry  )rb   r~  r  r  r   rO   rD   r5   r2   r   r   r  __classcell__r  s   @r'   r  r    s2     (9;UV

9 

9 
9r)   r  r   c                  :   ^  \ rS rSrSS j4 SU 4S jjjrSrU =r$ )PythonExprVisitori  c                    U $ r8   r"   rM   s     r'   r=   PythonExprVisitor.<lambda>  s    Fr)   c                "   > [         TU ]  XX4S9  g )N)r   r  r  s        r'   r   PythonExprVisitor.__init__  s     	fBr)   r"   r8   ry  )rb   r~  r  r  r   r  r  r  s   @r'   r  r    s     .KC	C Cr)   r  c                      \ rS rSr% SrS\S'   S\S'   S\S'       S         SS	 jjr\S
 5       rS r	SS jr
SS jrS r\S 5       rSrg)rn   i  z
Object encapsulating an expression.

Parameters
----------
expr : str
engine : str, optional, default 'numexpr'
parser : str, optional, default 'pandas'
env : Scope, optional, default None
level : int, optional, default 2
r   r   r   r   r   Nc                    Xl         U=(       d    [        US-   S9U l        X l        X0l        [
        U   " U R                  U R                  U R                  5      U l        U R                  5       U l        g )NrA   )level)	r   r   r   r   r   PARSERS_visitorr   terms)r}   r   r   r   r   r  s         r'   r   Expr.__init__  sU     	0%eai0$++t{{KZZ\
r)   c                0    [        U R                  SS 5      $ )Nr   )r^   r  r}   s    r'   r   Expr.assigner+  s    t}}j$77r)   c                8    U R                  U R                  5      $ r8   )r  r   r  s    r'   rU  Expr.__call__/  s    zz$((##r)   c                B    [         R                  " U R                  5      $ r8   )r   pprint_thingr  r  s    r'   __repr__Expr.__repr__2  s    $$TZZ00r)   c                ,    [        U R                  5      $ r8   )rB   r   r  s    r'   __len__Expr.__len__5  s    499~r)   c                L    U R                   R                  U R                  5      $ )z
Parse an expression.
)r  r   r   r  s    r'   r   
Expr.parse8  s     }}""499--r)   c                    [        U R                  5      (       a   [        U R                  R                  /5      $ [        S [        R
                  " U R                  5       5       5      $ )z!
Get the names in an expression.
c              3  8   #    U  H  oR                   v   M     g 7fr8   )r_   )rG   terms     r'   rI   Expr.names.<locals>.<genexpr>E  s     G/Ft/Frk   )r   r  re   r_   comflattenr  s    r'   names
Expr.names>  sG    
 4::djjoo.//Gs{{4::/FGGGr)   )r  r   r   r   r   r  )numexprr7  Nr   )
r   r   r   r   r   zScope | Noner  intr   rz  )r   r   )r   r  )rb   r~  r  r  r  r  r   propertyr   rU  r  r  r   r  r  r"   r)   r'   rn   rn     s    
 
JKK
   " " 	"
 " " 
" 8 8$1. H Hr)   rn   )pythonr7  )r$   tuple[int, str]r   r  )rN   r   r   r   )r~   r   r   zCallable[..., None])r   zset[str]r   zCallable[[type[_T]], type[_T]])kr  
__future__r   rZ   	functoolsr   r   rY  r   r/   typingr   r	   r
   numpyr   pandas.errorsr   pandas.core.dtypes.commonr   pandas.core.commoncorecommonr  pandas.core.computation.opsr   r   r   r   r   r   r   r   r   r   r   r   r   r   pandas.core.computation.parsingr   r   pandas.core.computation.scoper   pandas.io.formatsr   r(   r2   r5   r?   rD   rO   rV   listr   r   r   re   dir
_all_nodesrh   _all_node_namesmod
_mod_nodesstmt_stmt_nodesr   _expr_nodesexpr_context_expr_context_nodesboolop_boolop_nodesoperator_operator_nodesunaryop_unary_op_nodescmpop_cmp_op_nodescomprehension_comprehension_nodesexcepthandler_handler_nodes	arguments_arguments_nodes_keyword_nodesalias_alias_nodes_hacked_nodes_unsupported_expr_nodes_unsupported_nodes_base_supported_nodesintersection_msgr   r   r   r   _op_classesr   NodeVisitorr   _python_not_supported_numexpr_supported_callsr  r  rn   r  r"   r)   r'   <module>r     sr   # 
     0 5         0 &5&249$ *O=WFF
 	FD, D>
3-  9C9 
 )3 ! ;
;;377#
CHH%CHH%#C$4$45 cjj)-,cii($S%6%67 s001 / s{{+SYY' 67 $ $   	
    	  )+==N !$99	-l^<   T]0, 1& 

U)coo U)  U)p ""CD $Z'%9:  
//y!PQQS9 9	9 

4
4y%7I
IJC C KC:H :Hz '2C
Dr)   