+
    xȇi8                    b   R t ^ RIHt ^ RIHt ^ RIHt ^ RIt^ RIHtH	t	 ^ RI
t^ RIHt ^ RIHtHt ^ RIHu Ht ^ RIHtHt ^ R	IHt ^ R
IHtHt ]'       d   ^ RIHtHtH t  R't!R(t"R)t#]"]#,           t$Rt% ! R R4      t& ! R R]&4      t'RRRRRR/t( ! R R4      t)R t*R t+R*t,]PZ                  ]P\                  ]P^                  ]P`                  ]Pb                  ]Pd                  ]*]+3t3]4! ]5! ],]3RR7      4      t6R+t7]Pp                  ]Pr                  ]Pp                  ]Pr                  3t:]4! ]5! ]7]:RR7      4      t;R,t<]Pz                  ]P|                  ]P~                  ]P                  ]P                  ]P                  ]P                  3tD]4! ]5! ]<]DRR7      4      tE/ tF]6];]E3 F  tG]FP                  ]G4       K  	  R R ltI ! R R ])4      tJR-tK]P                  ]P                  ]P                  ]P                  3tO]4! ]5! ]K]ORR7      4      tP ! R! R"])4      tQ ! R# R$])4      tR ! R% R&4      tSR# ).z
Operator classes for eval.
)annotations)datetime)partialN)TYPE_CHECKINGLiteral)	Timestamp)is_list_like	is_scalar)ensure_decodedresult_type_many)DEFAULT_GLOBALS)pprint_thingpprint_thing_encoded)CallableIterableIterator__pd_eval_local_c                  D  a  ] tR t^Lt$ RV 3R lltR]R&   RR R llt]R R l4       tR R	 lt	R
 t
R R ltR tR R lt]R R l4       t]R 4       t]t]R R l4       t]R R l4       t]R 4       t]P(                  R R l4       t]R 4       t]R R l4       tRtV ;t# )Termc                	l   < \        V\        4      '       g   \        MT p\        \        V`  pV! V4      # N)
isinstancestrConstantsuperr   __new__)clsnameenvsideencodingklasssupr_new	__class__s   &&&&&  k/Users/max/.openclaw/workspace/postharvest/venv/lib/python3.14/site-packages/pandas/core/computation/ops.pyr   Term.__new__M   s,     *4 5 53u-    boolis_localc                   V ^8  d   QhRR/#    returnNone )formats   "r$   __annotate__Term.__annotate__T   s     ! !t !r&   c                	    Wn         W n        W0n        \        V4      pVP	                  \
        4      ;'       g
    V\        9   V n        V P                  4       V n	        W@n
        R # r   )_namer   r   r   
startswith	LOCAL_TAGr   r(   _resolve_name_valuer    )selfr   r   r   r    tnames   &&&&& r$   __init__Term.__init__T   sN    
	D	((3OOu7O((* r&   c                   V ^8  d   QhRR/# r+   r,   r   r.   )r/   s   "r$   r0   r1   _   s     0 0C 0r&   c                	B    V P                   P                  \        R 4      # ) )r   replacer5   r8   s   &r$   
local_nameTerm.local_name^   s    yy  B//r&   c                   V ^8  d   QhRR/# r=   r.   )r/   s   "r$   r0   r1   b   s     ' '# 'r&   c                	,    \        V P                  4      # r   )r   r   rA   s   &r$   __repr__Term.__repr__b   s    DII&&r&   c                	    V P                   # r   valuer8   argskwargss   &*,r$   __call__Term.__call__e       zzr&   c                   V ^8  d   QhRR/# )r+   r,   r   r.   )r/   s   "r$   r0   r1   h   s      4 r&   c                	    V # r   r.   rK   s   &*,r$   evaluateTerm.evaluateh   s    r&   c                	   \        V P                  4      pV P                  pWP                  P                  9   d4   \        V P                  P                  V,          \        4      '       d   R pV P                  P                  WR7      pV P                  V4       \        VR4      '       d=   \        VP                  \        4      '       d   VP                  ^8  d   \        R4      hV# )F)r(   ndimz?N-dimensional objects, where N > 2, are not supported with eval)r   rB   r(   r   scoper   typeresolveupdatehasattrrV   intNotImplementedError)r8   rB   r(   ress   &   r$   r6   Term._resolve_namek   s    )
=='JHHNN:&-
 -
 Hhhz=C3Jsxx$=$=#((Q,%Q  
r&   c                   V ^8  d   QhRR/# r*   r.   )r/   s   "r$   r0   r1   |   s      t r&   c                    V P                   p\        V\        4      '       d(   V P                  P	                  V P
                  W!R7       Wn        R# )z
search order for local (i.e., @variable) variables:

scope, key_variable
[('locals', 'local_name'),
 ('globals', 'local_name'),
 ('locals', 'key'),
 ('globals', 'key')]
)	new_valueN)r   r   r   r   swapkeyrB   rJ   )r8   rJ   keys   && r$   rZ   Term.update|   s<     ii c3HHT__cC
r&   c                   V ^8  d   QhRR/# r+   r,   r'   r.   )r/   s   "r$   r0   r1      s     & &4 &r&   c                	,    \        V P                  4      # r   )r	   r7   rA   s   &r$   r	   Term.is_scalar   s    %%r&   c                	     V P                   P                  P                  #   \         dC     T P                   P                  u #   \         d    \	        T P                   4      u u # i ; ii ; ir   )r7   valuesdtypeAttributeErrorrX   rA   s   &r$   rX   	Term.type   s_    		);;%%+++ 	)){{(((! )DKK(()		)s,   " A/AA/ A+&A/*A++A/c                   V ^8  d   QhRR/# r=   r.   )r/   s   "r$   r0   r1      s     N NS Nr&   c                	h    \        V 4      P                   R V P                  : RV P                    R2# )z(name=z, type=))rX   __name__r   rA   s   &r$   rawTerm.raw   s.    t*%%&fTYYM1MMr&   c                   V ^8  d   QhRR/# rg   r.   )r/   s   "r$   r0   r1           8 8T 8r&   c                	     V P                   P                   p\        V\        \        P
                  34      #   \         d    T P                   p L9i ; ir   )rX   rm   
issubclassr   np
datetime64r8   ts   & r$   is_datetimeTerm.is_datetime   sF    			A !h677  			A	   8 AAc                	    V P                   # r   r7   rA   s   &r$   rJ   
Term.value   s    {{r&   c                   V ^8  d   QhRR/# r*   r.   )r/   s   "r$   r0   r1      s        $  r&   c                	    Wn         R # r   r   )r8   rb   s   &&r$   rJ   r      s    r&   c                	    V P                   # r   r3   rA   s   &r$   r   	Term.name       zzr&   c                   V ^8  d   QhRR/# )r+   r,   r\   r.   )r/   s   "r$   r0   r1      s        c  r&   c                	.    V P                   P                  # r   )r7   rV   rA   s   &r$   rV   	Term.ndim   s    {{r&   )r3   r7   r    r   r(   r   rJ   )NN)rr   
__module____qualname____firstlineno__r   __annotations__r:   propertyrB   rF   rN   rS   r6   rZ   r	   rX   return_typers   r}   rJ   setterr   rV   __static_attributes____classcell__r#   s   @r$   r   r   L   s    
 N! 0 0'"$ & & 
) 
) KN N 8 8   \\         r&   r   c                  8    ] tR t^tR t]R 4       tR R ltRtR# )r   c                	    V P                   # r   r   rA   s   &r$   r6   Constant._resolve_name   rP   r&   c                	    V P                   # r   rI   rA   s   &r$   r   Constant.name   r   r&   c                   V ^8  d   QhRR/# r=   r.   )r/   s   "r$   r0   Constant.__annotate__   s      # r&   c                	,    \        V P                  4      # r   )reprr   rA   s   &r$   rF   Constant.__repr__   s     DIIr&   r.   N)	rr   r   r   r   r6   r   r   rF   r   r.   r&   r$   r   r      s%       r&   r   not~and&or|c                      ] tR t^t$ RtR]R&   RR R lltR R ltR	 R
 lt]	R 4       t
]	R R l4       t]	R 4       t]	R R l4       t]	R R l4       tRtR# )Opz&
Hold an operator of arbitrary arity.
r   opNc               $    V ^8  d   QhRRRRRR/# )r+   r   r   operandszIterable[Term | Op]r,   r-   r.   )r/   s   "r$   r0   Op.__annotate__   s#     ! !3 !*= !QU !r&   c                	R    \         P                  W4      V n        W n        W0n        R # r   )_bool_op_mapgetr   r   r    )r8   r   r   r    s   &&&&r$   r:   Op.__init__   s    ""2*  r&   c                   V ^8  d   QhRR/# )r+   r,   r   r.   )r/   s   "r$   r0   r      s     # #( #r&   c                	,    \        V P                  4      # r   )iterr   rA   s   &r$   __iter__Op.__iter__   s    DMM""r&   c                   V ^8  d   QhRR/# r=   r.   )r/   s   "r$   r0   r      s     : :# :r&   c                x    R V P                    4       p\        RV P                   R2P                  V4      4      # )zG
Print a generic n-ary operator and its operands using infix notation.
c              3  @   "   T F  pR \        V4       R2x  K  	  R# 5i)(rq   N)r   ).0oprs   & r$   	<genexpr>Op.__repr__.<locals>.<genexpr>   s     E}Q|C()+}s    )r   r   r   join)r8   pareneds   & r$   rF   Op.__repr__   s5    
 Ft}}EayN//899r&   c                	    V P                   \        \        ,           9   d   \        P                  # \        R  \        P                  ! V 4       4       !  # )c              3  8   "   T F  qP                   x  K  	  R # 5ir   rX   r   terms   & r$   r   !Op.return_type.<locals>.<genexpr>   s     !J8I))8I   )r   CMP_OPS_SYMSBOOL_OPS_SYMSry   bool_r   comflattenrA   s   &r$   r   Op.return_type   s8     77|m3488O!JD8I!JKKr&   c                   V ^8  d   QhRR/# rg   r.   )r/   s   "r$   r0   r      s     D D Dr&   c                	    V P                   p\        \        P                  ! R 4      .4      pV P                  \
        8H  ;'       d	    W,
          # )object)operand_types	frozensetry   rl   r   r   )r8   typesobj_dtype_sets   &  r$   has_invalid_return_typeOp.has_invalid_return_type   s?    ""!288H#5"676)CCe.CCr&   c                	N    \        R  \        P                  ! V 4       4       4      # )c              3  8   "   T F  qP                   x  K  	  R # 5ir   r   r   s   & r$   r   #Op.operand_types.<locals>.<genexpr>   s     A/@t/@r   )r   r   r   rA   s   &r$   r   Op.operand_types   s    As{{4/@AAAr&   c                   V ^8  d   QhRR/# rg   r.   )r/   s   "r$   r0   r      s     C C4 Cr&   c                	    \         ;QJ d&    R  V P                   4       F  '       d   K   R# 	  R# ! R  V P                   4       4      # )c              3  8   "   T F  qP                   x  K  	  R # 5ir   )r	   )r   operands   & r$   r   Op.is_scalar.<locals>.<genexpr>   s     BM$$Mr   FT)allr   rA   s   &r$   r	   Op.is_scalar   s3    sBDMMBssBsBsBDMMBBBr&   c                   V ^8  d   QhRR/# rg   r.   )r/   s   "r$   r0   r      rv   r&   c                	     V P                   P                  p\        V\        \
        P                  34      #   \         d    T P                   p L9i ; ir   )r   rX   rm   rx   r   ry   rz   r{   s   & r$   r}   Op.is_datetime   sL    	!  %%A !h677  	!  A	!r   )r    r   r   r   )rr   r   r   r   __doc__r   r:   r   rF   r   r   r   r   r	   r}   r   r.   r&   r$   r   r      s     	G!
#: L L D D
 B B C C 8 8r&   r   c                     V P                  V4      #   \         d>    \        T 4      '       d&    TP                  T 4      u #   \         d     Mi ; iY9   u # i ; i)zT
Compute the vectorized membership of ``x in y`` if possible, otherwise
use Python.
isinrm   r   xys   &&r$   _inr     sY    
vvay ??vvay ! vs2    AA AAAAAAc                     V P                  V4      ( #   \         d?    \        T 4      '       d'    TP                  T 4      ( u #   \         d     Mi ; iY9  u # i ; i)zX
Compute the vectorized membership of ``x not in y`` if possible,
otherwise use Python.
r   r   s   &&r$   _not_inr     s^    
q	z ??q	z!! zs2    AAAAAAAAT)strictc                   V ^8  d   QhRR/# rg   r.   )r/   s   "r$   r0   r0   I  s     ! !D !r&   c                "    \        V \        4      # r   )r   r   )objs   &r$   is_termr   I  s    c4  r&   c                  \   a  ] tR tRtRtR V 3R lltR tR R ltR R	 ltR
 R lt	Rt
V ;t# )BinOpiM  zl
Hold a binary operator and its operands.

Parameters
----------
op : str
lhs : Term or Op
rhs : Term or Op
c                    V ^8  d   QhRRRR/# )r+   r   r   r,   r-   r.   )r/   s   "r$   r0   BinOp.__annotate__X  s      3 T r&   c                	.  < \         SV `  WV34       W n        W0n        V P	                  4        V P                  4         \        V,          V n        R#   \         d6   p\        \        P                  4       4      p\        R T: RT 24      ThRp?ii ; i)zInvalid binary operator , valid operators are N)r   r:   lhsrhs_disallow_scalar_only_bool_opsconvert_values_binary_ops_dictfuncKeyErrorlistkeys
ValueError)r8   r   r   r   errr  r#   s   &&&&  r$   r:   BinOp.__init__X  s    3Z(++-	(,DI 	(--/0D*2&0FtfM	s    A B0BBc                h    V P                  V4      pV P                  V4      pV P                  W#4      # )z
Recursively evaluate an expression in Python space.

Parameters
----------
env : Scope

Returns
-------
object
    The result of an evaluated expression.
)r   r   r   )r8   r   leftrights   &&  r$   rN   BinOp.__call__j  s-     xx}yy%%r&   c                   V ^8  d   QhRR/# )r+   enginer   r.   )r/   s   "r$   r0   r   }  s     /( /(C /(r&   c                f   VR8X  d
   V ! V4      pMV P                   P                  VVVVVR7      pV P                  P                  VVVVVR7      pV P                  V9   d(   V P	                  VP
                  VP
                  4      pM^ RIHp	 V	! WW#R7      pVP                  V4      p
V! WR7      # )a  
Evaluate a binary operation *before* being passed to the engine.

Parameters
----------
env : Scope
engine : str
parser : str
term_type : type
eval_in_python : list

Returns
-------
term_type
    The "pre-evaluated" expression as an instance of ``term_type``
python)r  parser	term_typeeval_in_python)eval)
local_dictr  r  )r   )	r   rS   r   r   r   rJ   pandas.core.computation.evalr  add_tmp)r8   r   r  r  r  r  r^   r  r  r  r   s   &&&&&&     r$   rS   BinOp.evaluate}  s    " Xs)C 88$$#- % D HH%%#- & E ww.(ii

EKK8=4N{{3''r&   c                   V ^8  d   QhRR/# r*   r.   )r/   s   "r$   r0   r     s       r&   c                b  a  V 3R lpS P                   S P                  r2\        V4      '       d   VP                  '       d   \        V4      '       d   VP                  '       d   VP
                  p\        V\        \        34      '       d	   V! V4      p\        \        V4      4      pVP                  e   VP                  R4      pS P                  P                  V4       \        V4      '       d   VP                  '       d   \        V4      '       d   VP                  '       d   VP
                  p\        V\        \        34      '       d	   V! V4      p\        \        V4      4      pVP                  e   VP                  R4      pS P                   P                  V4       R# R# R# R# R# )z;
Convert datetimes to a comparable value in an expression.
c                t   < SP                   e   \        \        SP                   R7      pM\        pV! V 4      # )N)r    )r    r   r   r   )rJ   encoderr8   s   & r$   	stringify'BinOp.convert_values.<locals>.stringify  s-    }}(!"6O&5>!r&   NUTC)r   r   r   r}   r	   rJ   r   r\   floatr   r
   tz
tz_convertrZ   )r8   r  r   r   vs   f    r$   r   BinOp.convert_values  s   
	" 88TXXS3<<COOO		A!c5\**aL.+,AttLL'HHOOA3<<COOO		A!c5\**aL.+,AttLL'HHOOA BOO<r&   c                   V ^8  d   QhRR/# r*   r.   )r/   s   "r$   r0   r     s     N N Nr&   c                	   V P                   pV P                  pVP                  p\        VR V4      pVP                  p\        VR V4      pVP                  '       g   VP                  '       dq   V P
                  \        9   dZ   \        V\        \        P                  34      '       d'   \        V\        \        P                  34      '       g   \        R4      hR# R# R# )rX   z$cannot evaluate scalar only bool opsN)r   r   r   getattrr	   r   _bool_ops_dictrx   r'   ry   r   r]   )r8   r   r   rhs_rtlhs_rts   &    r$   r   $BinOp._disallow_scalar_only_bool_ops  s    hhhh 00]]]cmmm>) vbhh'788"6D"((+;<< &&LMM	 =	 * ,r&   )r   r   r   )rr   r   r   r   r   r:   rN   rS   r   r   r   r   r   s   @r$   r   r   M  s/     $&&/(bBN Nr&   r   c                  `   a  ] tR tRtRtR V 3R lltR R ltR R lt]R	 R
 l4       t	Rt
V ;t# )UnaryOpi  a  
Hold a unary operator and its operands.

Parameters
----------
op : str
    The token used to represent the operator.
operand : Term or Op
    The Term or Op operand to the operator.

Raises
------
ValueError
    * If no function associated with the passed operator token is found.
c                    V ^8  d   QhRRRR/# )r+   r   zLiteral['+', '-', '~', 'not']r,   r-   r.   )r/   s   "r$   r0   UnaryOp.__annotate__  s     	 	8 	d 	r&   c                	   < \         SV `  W34       W n         \        V,          V n        R#   \
         d   p\        R T: R\         24      ThRp?ii ; i)zInvalid unary operator r   N)r   r:   r   _unary_ops_dictr   r   r  UNARY_OPS_SYMS)r8   r   r   r  r#   s   &&& r$   r:   UnaryOp.__init__  sZ    Z(	'+DI 	)"/EnEUV	s   - AAAc                   V ^8  d   QhRR/# r+   r,   MathCallr.   )r/   s   "r$   r0   r,    s     " "x "r&   c                	F    V P                  V4      pV P                  V4      # r   )r   r   )r8   r   r   s   && r$   rN   UnaryOp.__call__  s    ,,s#yy!!r&   c                   V ^8  d   QhRR/# r=   r.   )r/   s   "r$   r0   r,    s     : :# :r&   c                	L    \        V P                   R V P                   R24      # )r   rq   )r   r   r   rA   s   &r$   rF   UnaryOp.__repr__  s"    twwiqa899r&   c                   V ^8  d   QhRR/# )r+   r,   znp.dtyper.   )r/   s   "r$   r0   r,    s      X r&   c                	h   V P                   pVP                  \        P                  ! R 4      8X  d   \        P                  ! R 4      # \	        V\
        4      '       dA   VP                  \        9   g   VP                  \        9   d   \        P                  ! R 4      # \        P                  ! R4      # )r'   r\   )	r   r   ry   rl   r   r   r   _cmp_ops_dictr%  )r8   r   s   & r$   r   UnaryOp.return_type  sr    ,,"((6"2288F##gr""JJ-'7::+G88F##xxr&   )r   r   )rr   r   r   r   r   r:   rN   rF   r   r   r   r   r   s   @r$   r*  r*    s0     	 	"
:  r&   r*  c                  @   a  ] tR tRtR V 3R lltR tR R ltRtV ;t# )r3  i  c                   V ^8  d   QhRR/# r*   r.   )r/   s   "r$   r0   MathCall.__annotate__  s      d r&   c                	H   < \         SV `  VP                  V4       Wn        R # r   )r   r:   r   r   )r8   r   rL   r#   s   &&&r$   r:   MathCall.__init__  s    D)	r&   c                	    V P                    Uu. uF
  q"! V4      NK  	  ppV P                  P                  ! V!  # u upi r   )r   r   )r8   r   r   r   s   &&  r$   rN   MathCall.__call__  s6    &*mm4mBsGm4yy~~x(( 5s   ;c                   V ^8  d   QhRR/# r=   r.   )r/   s   "r$   r0   r?  $  s     @ @# @r&   c                	    \        \        V P                  4      p\        V P                   R RP                  V4       R24      # )r   ,rq   )mapr   r   r   r   r   )r8   r   s   & r$   rF   MathCall.__repr__$  s8    sDMM*twwiq();(<A>??r&   )r   )	rr   r   r   r   r:   rN   rF   r   r   r   s   @r$   r3  r3    s     )
@ @r&   r3  c                  .    ] tR tRtR R ltR R ltRtR# )FuncNodei)  c                    V ^8  d   QhRRRR/# )r+   r   r   r,   r-   r.   )r/   s   "r$   r0   FuncNode.__annotate__*  s     & &S &T &r&   c                	p    V\         9  d   \        R V R24      hWn        \        \        V4      V n        R# )"z" is not a supported functionN)MATHOPSr  r   r$  ry   r   )r8   r   s   &&r$   r:   FuncNode.__init__*  s2    wq&CDEE	B%	r&   c                   V ^8  d   QhRR/# r2  r.   )r/   s   "r$   r0   rL  0  s     $ $ $r&   c                	    \        W4      # r   )r3  )r8   rL   s   &*r$   rN   FuncNode.__call__0  s    ##r&   )r   r   N)rr   r   r   r   r:   rN   r   r.   r&   r$   rJ  rJ  )  s    &$ $r&   rJ  )sumprodminmax)sincostanexplogexpm1log1psqrtsinhcoshtanharcsinarccosarctanarccosharcsinharctanhabslog10floorceil)arctan2)><z>=z<=z==z!=inznot in)r   r   r   r   )+-*/z**z//%)rq  rr  r   r   )Tr   
__future__r   r   	functoolsr   operatortypingr   r   numpyry   pandas._libs.tslibsr   pandas.core.dtypes.commonr   r	   pandas.core.commoncorecommonr   pandas.core.computation.commonr
   r   pandas.core.computation.scoper   pandas.io.formats.printingr   r   collections.abcr   r   r   
REDUCTIONS_unary_math_ops_binary_math_opsrO  r5   r   r   r   r   r   r   r   gtltgeleeqne_cmp_ops_funcsdictzipr;  r   and_or__bool_ops_funcsr%  ARITH_OPS_SYMSaddsubmultruedivpowfloordivmod_arith_ops_funcs_arith_ops_dictr   drZ   r   r   r/  posneginvert_unary_ops_funcsr.  r*  r3  rJ  r.   r&   r$   <module>r     s6   #   
  )
 !   :
   +
.   
,
, 	p  p ft  sE3c238 38l   BKKKKKKKKKKKK	 S~dCD'==(,,x||Lc-FG6LLLLLLLLLL  s>+;DIJ 
	9AA 
:!UNB UNp (LL(,,Q s>+;DIJ-b -`@r @$ $r&   