
    Mh                        S r SSKJr  SSKJr  SSKJrJr  SSKJ	r	  SSK
Jr  SSKJrJr  \(       a  SSKJr  SS	 jrSS
 jrS rS rg)z;
Boilerplate functions used in defining binary operations.
    )annotations)wraps)TYPE_CHECKINGCallable)item_from_zerodim)is_matching_na)ABCIndex	ABCSeries)Fc                   ^  SU 4S jjnU$ )z
Boilerplate for pandas conventions in arithmetic and comparison methods.

Parameters
----------
name : str

Returns
-------
decorator
c                   > [        U T5      $ )N)_unpack_zerodim_and_defer)methodnames    H/var/www/html/env/lib/python3.13/site-packages/pandas/core/ops/common.pywrapper)unpack_zerodim_and_defer.<locals>.wrapper%   s    (66    )r   r   returnr    )r   r   s   ` r   unpack_zerodim_and_deferr      s    7 Nr   c                ~   ^ ^ UR                  S5      R                  S5      nUS;   m[        T 5      UU 4S j5       nU$ )a!  
Boilerplate for pandas conventions in arithmetic and comparison methods.

Ensure method returns NotImplemented when operating against "senior"
classes.  Ensure zero-dimensional ndarrays are always unpacked.

Parameters
----------
method : binary method
name : str

Returns
-------
method
__>   eqgegtleltnec                   > T(       a+  [        U [        5      (       a  [        U[        5      (       a  O%[        USS 5      nUb  X R                  :  a  [
        $ [        U5      nT" X5      $ )N__pandas_priority__)
isinstancer	   r
   getattrr!   NotImplementedr   )selfotherpriois_cmpr   s      r   
new_method-_unpack_zerodim_and_defer.<locals>.new_method>   s]    jx00Zy5Q5Q5"7>D222))!%(d""r   )removeprefixremovesuffixr   )r   r   stripped_namer)   r(   s   `   @r   r   r   +   sI      %%d+88>MBBF
6]# # r   c                n    [        U[        [        45      (       a  [        X5      nU$ U R                  nU$ )z
Find the appropriate name to pin to an operation result.  This result
should always be either an Index or a Series.

Parameters
----------
left : {Series, Index}
right : object

Returns
-------
name : object
    Usually a string
)r"   r
   r	   _maybe_match_namer   )leftrightr   s      r   get_op_result_namer2   Q   s7     %)X.// - K yyKr   c                   [        U S5      n[        US5      nU(       a`  U(       aY   U R                  UR                  :X  a  U R                  $ [        U R                  UR                  5      (       a  U R                  $ gU(       a  U R                  $ U(       a  UR                  $ g! [         a6    [        U R                  UR                  5      (       a  U R                  s $  g[         a     gf = f)ao  
Try to find a name to attach to the result of an operation between
a and b.  If only one of these has a `name` attribute, return that
name.  Otherwise return a consensus name if they match or None if
they have different names.

Parameters
----------
a : object
b : object

Returns
-------
name : str or None

See Also
--------
pandas.core.common.consensus_name_attr
r   N)hasattrr   r   	TypeError
ValueError)aba_hasb_hass       r   r/   r/   g   s    ( AvEAvE	vvvv//vv 
vv	vv  	affaff--vv 		s   %B' 0B' ';C2&	C21C2N)r   strr   zCallable[[F], F])r   r;   )__doc__
__future__r   	functoolsr   typingr   r   pandas._libs.libr   pandas._libs.missingr   pandas.core.dtypes.genericr	   r
   pandas._typingr   r   r   r2   r/   r   r   r   <module>rD      sA    # 
 / /
  &#L,+r   