
    MhO                    V   % S r SSKJr  SSKrSSKJr  SSKrSSKrSSK	J
r
  SSKJr  SSKJr  SSKJr  \(       a  SSKr\(       a  SS	KJr  SqS
\S'   / qS\S'   \qSqS\S'   SqS\S'   1 Sk1 SkS.rSrS3S4S jjrS5S6S jjrS rS7S jr S r!0 \RD                  S_\RF                  S_\RH                  S_\RJ                  S_\RL                  S_\RN                  S_\RP                  S_\RR                  S_\RT                  S_\RV                  S_\RX                  S_\RZ                  S_\R\                  S_\R^                  S_\R`                  S_\R$                  S _\Rb                  S!_\Rd                  S"\Rf                  S#\Rh                  S$\Rj                  S%\Rl                  S%\Rn                  S&\Rp                  S&\Rr                  S'\Rt                  S'\;S\Rx                  S0Er=S( r>S) r?\" \
" S*5      5        S+ r@S&S%S'S,.rAS7S- jrBS3S8S. jjrCS3S8S/ jjrDS3S4S0 jjrES9S1 jrFS:S2 jrGg);zL
Expressions
-----------

Offer fast expression evaluation through numexpr

    )annotationsN)TYPE_CHECKING)
get_option)find_stack_level)	roperator)NUMEXPR_INSTALLED)FuncTypezbool | None
_TEST_MODE
list[bool]_TEST_RESULTzFuncType | None	_evaluate_where>   boolint32int64float32float64>   r   r   r   )evaluatewherei@B c                |    [         (       a  U q[        (       a  [        O[        q[        (       a  [
        qg [        qg N)r   USE_NUMEXPR_evaluate_numexpr_evaluate_standardr   _where_numexpr_where_standardr   vs    U/var/www/html/env/lib/python3.13/site-packages/pandas/core/computation/expressions.pyset_use_numexprr    -   s+     
 &1[!6HI*{^FF    c                    [         (       a;  [        (       a/  U c  [        R                  " 5       n [        R                  " U 5        g g g r   )r   r   nedetect_number_of_coresset_num_threads)ns    r   set_numexpr_threadsr'   :   s7     [[9))+A
1 )r!   c                >    [         (       a  [        S5        U " X#5      $ )z
Standard evaluation.
F)r
   _store_test_result)opop_strabs       r   r   r   C   s     z5!a8Or!   c                    Ubr  UR                   [        :  a^  [        5       nX#4 H/  n[        US5      (       d  M  XVR                  R
                  1-  nM1     [        U5      (       a  [        U   U:  a  gg)z,return a boolean if we WILL be using numexprdtypeTF)size_MIN_ELEMENTSsethasattrr/   namelen_ALLOWED_DTYPES)r*   r+   r,   r-   dtype_checkdtypesos          r   _can_use_numexprr:   L   sc    66M!"uFV1g&&ww||n,F  v;;/+">&"Hr!   c                   S n[        XX#S5      (       a]  U R                  R                  S5      R                  S5      nU(       a  X2p2UnUn [        R
                  " SU S3XgS.SS9nU(       a  X2p2[        (       a  [        US L5        Uc  [        XX#5      nU$ ! [         a     N>[         a    [        XU5      (       a   NZe f = f)	Nr   _rza_value z b_value)a_valueb_valuesafe
local_dictcasting)r:   __name__strip
startswithr#   r   	TypeErrorNotImplementedError_bool_arith_fallbackr
   r)   r   )r*   r+   r,   r-   resultis_reversedr>   r?   s           r   r   r   _   s    FA*55kk'',77<q	[[6((+'.CF qz6-.~#B5M)  	 " 	#Fq11		s   B 
C'CC+*-/z**z==z!=z<=<z>=>&|^c                0    [         R                  " XU5      $ r   )npr   )condr,   r-   s      r   r   r      s    88DQr!   c                    S n[        S SXS5      (       a  [        R                  " SXUS.SS9nUc  [        XU5      nU$ )Nr   z#where(cond_value, a_value, b_value))
cond_valuer>   r?   r@   rA   )r:   r#   r   r   )rW   r,   r-   rJ   s       r   r   r      sL    FgqW551&*QG
 ~ !,Mr!   zcompute.use_numexprc                     U R                   [        :H  $ ! [         a#    [        U [        [        R
                  45      s $ f = fr   )r/   r   AttributeError
isinstancerV   bool_)xs    r   _has_bool_dtyper_      s:    /ww$ /!dBHH-../s    *AA)rL   rM   rN   c           	         [        U5      (       aX  [        U5      (       aH  U [        ;   a>  [        R                  " S[	        U 5       S[	        [        U    5       S3[        5       S9  gg)z
Check if we should fallback to the python `_evaluate_standard` in case
of an unsupported operation by numexpr, which is the case for some
boolean ops.
z'evaluating in Python space because the z> operator is not supported by numexpr for the bool dtype, use z	 instead.)
stacklevelTF)r_   _BOOL_OP_UNSUPPORTEDwarningswarnreprr   )r+   r,   r-   s      r   rI   rI      sh     qoa00))MM9$v, H089:)E ,-	 r!   c                X    [         U    nUb  U(       a  [        XX5      $ [        XX5      $ )z
Evaluate and return the expression of the op on a and b.

Parameters
----------
op : the actual operand
a : left operand
b : right operand
use_numexpr : bool, default True
    Whether to try to use numexpr.
)_op_str_mappingr   r   )r*   r,   r-   use_numexprr+   s        r   r   r      s1     R FR..b!//r!   c                R    [         c   eU(       a  [        XU5      $ [        XU5      $ )z
Evaluate the where condition cond on a and b.

Parameters
----------
cond : np.ndarray[bool]
a : return if cond is True
b : return if cond is False
use_numexpr : bool, default True
    Whether to try to use numexpr.
)r   r   )rW   r,   r-   rh   s       r   r   r      s+     !,6$1M/$12MMr!   c                    U q / qg)z
Keeps track of whether numexpr was used.

Stores an additional ``True`` for every successful use of evaluate with
numexpr since the last ``get_test_result``.
N)r
   r   r   s    r   set_test_moderk     s     JLr!   c                >    U (       a  [         R                  U 5        g g r   )r   append)used_numexprs    r   r)   r)     s    L) r!   c                     [         n / q U $ )z)
Get test result and reset test_results.
)r   )ress    r   get_test_resultrq     s    
 CLJr!   )T)r   r   returnNoner   )rr   rs   )rr   r   )rh   r   )rn   r   rr   rs   )rr   r   )H__doc__
__future__r   operatortypingr   rc   numpyrV   pandas._configr   pandas.util._exceptionsr   pandas.corer   pandas.core.computation.checkr   numexprr#   pandas._typingr	   r
   __annotations__r   r   r   r   r6   r1   r    r'   r   r:   r   addraddmulrmulsubrsubtruedivrtruedivfloordiv	rfloordivmodrmodpowrpoweqleltgegtand_rand_or_ror_xorrxordivmodrdivmodrg   r   r   r_   rb   rI   r   r   rk   r)   rq    r!   r   <module>r      sd   #      % 4 ! ;'
K j !	? !  A) 
@&&R!LL#!NNC! LL#! NNC	!
 LL#! NNC! c! ! t! ! LL$!  NND!!" LL$#!$ NND%!& KK'!( KK)!* KK+!, KKKKKKMM3OOSLL#NNCLL#NNC
DtA!H 
$ 
01 2/ !s5 $0(N 	*
r!   