+
    xȇi'                    z   R t ^ RIHt ^ RIHt ^ RIt^ RIt^ RIHt ^ RI	t	^ RI
t
^ RIt^ RIt^ RIHt ^ RIt^ RIHt ^ RIHt ]! R4      t]! R	4      t ! R
 R]]]3,          4      tR R R lltR R ltR R ltR]R]P
                  RRRRR]R]R]P:                  R]P:                  /tR R lt ! R R4      t R# )!z
Module for scope operations
)annotations)ChainMapN)StringIO)TypeVar)	Timestamp)UndefinedVariableError_KT_VTc                  2    ] tR t^tRtR R ltR R ltRtR# )DeepChainMapzr
Variant of ChainMap that allows direct updates to inner scopes.

Only works when all passed mapping are mutable.
c               $    V ^8  d   QhRRRRRR/# )   keyr   valuer	   returnNone )formats   "m/Users/max/.openclaw/workspace/postharvest/venv/lib/python3.14/site-packages/pandas/core/computation/scope.py__annotate__DeepChainMap.__annotate__"   s!     " "s "3 "4 "    c                	p    V P                    F  pW9   g   K  W#V&    R # 	  W P                   ^ ,          V&   R # N)maps)selfr   r   mappings   &&& r   __setitem__DeepChainMap.__setitem__"   s1    yyG~$ ! "		!Sr   c                    V ^8  d   QhRRRR/# )r   r   r   r   r   r   )r   s   "r   r   r   )   s      s t r   c                T    V P                    F  pW9   g   K  W!  R# 	  \        V4      h)z4
Raises
------
KeyError
    If `key` doesn't exist.
N)r   KeyError)r   r   r   s   && r   __delitem__DeepChainMap.__delitem__)   s+     yyG~L ! smr   r   N)__name__
__module____qualname____firstlineno____doc__r   r"   __static_attributes__r   r   r   r   r      s    " r   r   c                    V ^8  d   QhRRRR/# )r   levelintr   Scoper   )r   s   "r   r   r   7   s     
 



r   c                0    \        V ^,           VVVVR7      # )z.Ensure that we are grabbing the correct scope.)global_dict
local_dict	resolverstarget)r-   )r+   r/   r0   r1   r2   s   &&&&&r   ensure_scoper3   7   s$     	 r   c                   V ^8  d   QhRR/# r   r   strr   )r   s   "r   r   r   D   s      C r   c                V     \        V 4      p\        V4      #   \         d    T p Li ; i)zv
Replace a number with its hexadecimal representation. Used to tag
temporary variables with their calling scope's id.
)ord	TypeErrorhex)xhexins   & r   	_replacerr=   D   s2    A
 u:	  s    ((c                   V ^8  d   QhRR/# r5   r   )r   s   "r   r   r   T   s     3 3 3r   c                    \         P                  ! R\        V 4      4      pRP                  V Uu. uF  p\	        V4      NK  	  up4      # u upi )z,Return the padded hexadecimal id of ``obj``.z@P )structpackidjoinr=   )objpackedr;   s   &  r   _raw_hex_idrG   T   s=     [[r#w'F77&1&QIaL&1221s   Ar   datetimeTrueTFalseFlisttupleinfInfc                   V ^8  d   QhRR/# r5   r   )r   s   "r   r   r   g   s      s r   c                d    \        4       p\        P                  ! WR7       VP                  4       # )z
Return a prettier version of obj.

Parameters
----------
obj : object
    Object to pretty print

Returns
-------
str
    Pretty print object repr
)stream)r   pprintgetvalue)rE   sios   & r   _get_pretty_stringrU   g   s#     *C
MM#"<<>r   c                      ] tR t^zt$ Rt. ROtR]R&   R]R&   R]R&   R]R&   RR
 R lltR R lt]	R R l4       t
R R ltR R R lltR R ltR R ltR R lt]	R R l4       t]	R R l4       tRtR	# )!r-   a  
Object to hold scope, with a few bells to deal with some custom syntax
and contexts added by pandas.

Parameters
----------
level : int
global_dict : dict or None, optional, default None
local_dict : dict or Scope or None, optional, default None
resolvers : list-like or None, optional, default None
target : object

Attributes
----------
level : int
scope : DeepChainMap
target : object
temps : dict
r+   r1   scopetempsr,   r   dictNc                    V ^8  d   QhRRRR/# r   r+   r,   r   r   r   )r   s   "r   r   Scope.__annotate__   s     & &&	&r   c                	   V^,           V n         \        \        P                  4       4      V n        WPn        \        V\        4      '       d`   V P                  P                  VP                  4       VP
                  e   VP
                  V n        V P                  VP                   4       \        P                  ! V P                   4      p V P                  P                  Ve   TMVP                  P                  4       4      p\        V4      V n        \        V\        4      '       gJ   V P                  P                  Ve   TMVP                  P                  4       4      p\        V4      V n        ?\        V\        4      '       d'   V\        VP                   P"                  4      ,          p\        V!  V n        / V n        R#   ?i ; i)   N)r+   r   DEFAULT_GLOBALScopyrW   r2   
isinstancer-   update_updatesys	_getframe	new_child	f_globalsf_localsrL   r1   r   rX   )	r   r+   r/   r0   r1   r2   framescope_globalscope_locals	   &&&&&&   r   __init__Scope.__init__   sZ    QY
 "/"6"6"89
j%((JJj../  ,(//LL))*djj)	  ::// + 7U__RRTL &l3DJj%00"jj22#-#9Zu~~SSU *+6
 j%((z338899I%y1
 s   B(G	 	Gc                   V ^8  d   QhRR/# r5   r   )r   s   "r   r   r\      s     R R# Rr   c                	    \        \        V P                  P                  4       4      4      p\        \        V P                  P                  4       4      4      p\        V 4      P                   R V RV R2# )z(scope=z, resolvers=))rU   rK   rW   keysr1   typer$   )r   
scope_keysres_keyss   &  r   __repr__Scope.__repr__   s\    'TZZ__->(?@
%d4>>+>+>+@&ABt*%%&gj\hZqQQr   c                   V ^8  d   QhRR/# )r   r   boolr   )r   s   "r   r   r\      s     ) )t )r   c                >    \        \        V P                  4      4      # )z
Return whether we have any extra scope.

For example, DataFrames pass Their columns as resolvers during calls to
``DataFrame.eval()`` and ``DataFrame.query()``.

Returns
-------
hr : bool
)rx   lenr1   r   s   &r   has_resolversScope.has_resolvers   s     C'((r   c                    V ^8  d   QhRRRR/# )r   r   r6   is_localrx   r   )r   s   "r   r   r\      s     %E %E3 %E$ %Er   c                j    V'       d   V P                   V,          # V P                  '       d   V P                  V,          # V'       g   V P                  '       d   Q hV P                   V,          #   \         d7     T P                  T,          u #   \         d   p\        Y4      ThRp?ii ; ii ; i)a  
Resolve a variable name in a possibly local context.

Parameters
----------
key : str
    A variable name
is_local : bool
    Flag indicating whether the variable is local or not (prefixed with
    the '@' symbol)

Returns
-------
value : object
    The value of a particular variable
N)rW   r|   r1   r!   rX   r   )r   r   r   errs   &&& r   resolveScope.resolve   s    "	Ezz#& !!!~~c**  (:(:(:::::c?" 	EE zz#& E,S;DE	EsP   A1 A1 A1 A1 A1 
A1 A1 1B2=BB2B.B))B..B2c               $    V ^8  d   QhRRRRRR/# )r   old_keyr6   new_keyr   r   r   )r   s   "r   r   r\      s!      s S T r   c                   V P                   '       d3   V P                  P                  V P                  P                  ,           pMV P                  P                  pVP	                  V P
                  4       V F  pW9   g   K  W5V&    R# 	  R# )a  
Replace a variable name, with a potentially new value.

Parameters
----------
old_key : str
    Current variable name to replace
new_key : str
    New variable name to replace `old_key` with
new_value : object
    Value to be replaced along with the possible renaming
N)r|   r1   r   rW   appendrX   )r   r   r   	new_valuer   r   s   &&&&  r   swapkeyScope.swapkey   sd     >>&&8D::??DDJJG!#,  r   c                    V ^8  d   QhRRRR/# )r   scopesz	list[str]r   r   r   )r   s   "r   r   r\     s      y T r   c                    \         P                  ! W!4      pV FG  w  pw  p    p \        VRV 24      p\        V P                  P                  V4      4      V n        ?KI  	  R#   ?i ; i)aA  
Get specifically scoped variables from a list of stack frames.

Parameters
----------
stack : list
    A list of stack frames as returned by ``inspect.stack()``
scopes : sequence of strings
    A sequence containing valid stack frame attribute names that
    evaluate to a dictionary. For example, ('locals', 'globals')
f_N)	itertoolsproductgetattrr   rW   rf   )r   stackr   	variablesrW   ri   _ds   &&&     r   	_get_varsScope._get_vars  sn     %%f4	-6)E)E1aAqERw<0)$***>*>q*AB

  .7 s   8A&&A)c                    V ^8  d   QhRRRR/# r[   r   )r   s   "r   r   r\   '  s        S  T  r   c                    V^,           p\         P                  ! 4       p V P                  VRV R.R7       VR ?R#   TR ?i ; i)z[
Update the current scope by going back `level` levels.

Parameters
----------
level : int
Nlocals)r   :NNN)inspectr   r   )r   r+   slr   s   &&  r   rc   Scope._update'  sJ     QY
 	 NN5":xjN9a%a%s	   = Ac                   V ^8  d   QhRR/# r5   r   )r   s   "r   r   r\   ;  s       r   c                    \        V4      P                   RV P                   R\        V 4       2pW P                  9  g   Q hWP                  V&   W P                  9   g   Q hV# )z
Add a temporary variable to the scope.

Parameters
----------
value : object
    An arbitrary object to be assigned to a temporary variable.

Returns
-------
str
    The name of the temporary variable created.
r   )rr   r$   ntempsrG   rX   )r   r   names   && r   add_tmpScope.add_tmp;  sd     u+&&'qQ{47H6IJ ::%%% 

4zz!!! r   c                   V ^8  d   QhRR/# )r   r   r,   r   )r   s   "r   r   r\   T  s       r   c                ,    \        V P                  4      # )z/The number of temporary variables in this scope)rz   rX   r{   s   &r   r   Scope.ntempsS  s     4::r   c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   r\   Y  s     # #L #r   c                    V P                   .V P                  P                  OV P                  P                  Op\	        V!  # )z
Return the full scope for use with passing to engines transparently
as a mapping.

Returns
-------
vars : DeepChainMap
    All variables in this scope.
)rX   r1   r   rW   r   )r   r   s   & r   
full_scopeScope.full_scopeX  s7     

CT^^00C4::??CT""r   )r+   r1   rW   r2   rX   NNr   Nr   )r$   r%   r&   r'   r(   	__slots____annotations__rl   ru   propertyr|   r   r   r   rc   r   r   r   r)   r   r   r   r-   r-   z   s    ( CIJK&PR
 ) )%EN2. (0   # #r   r-   r   )!r(   
__future__r   collectionsr   rH   r   ior   r   rR   rA   rd   typingr   numpynppandas._libs.tslibsr   pandas.errorsr   r   r	   r   r3   r=   rG   rK   rL   rM   r_   rU   r-   r   r   r   <module>r      s    #         
   ) 0enen8CH% 8
 3 !!
DU
DU	266	266	&j# j#r   