
    I j                        S r SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
  SSKJrJrJr  SSKJrJr  \(       a  SS	KJr  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)item_from_zerodim)is_matching_na)ABCExtensionArrayABCIndex	ABCSeries)ensure_wrapped_if_datetimelikesanitize_array)Callable)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    g/root/GenerationalWealth/GenerationalWealth/venv/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      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
_)orxorandrorrxorrandc                  > [        USS 5      nUb  X R                  :  a  [        $ [        U5      n[	        U [
        5      (       a3  [	        U[        5      (       a  T(       d  [        US 5      n[        U5      nT" X5      $ )N__pandas_priority__)	getattrr$   NotImplementedr   
isinstancer   listr   r   )selfotherprio
is_logicalr   s      r   
new_method-_unpack_zerodim_and_defer.<locals>.new_methodC   su    u3T:...%%!%(t.//5$'' #5$/E259Ed""r   )stripr   )r   r   r-   r,   s   `  @r   r   r   1   s6      C$OOJ
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_namer4   \   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   r1   r1   r   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   r   r=   r   r   )__doc__
__future__r   	functoolsr   typingr   pandas._libs.libr   pandas._libs.missingr   pandas.core.dtypes.genericr   r	   r
   pandas.core.constructionr   r   collections.abcr   pandas._typingr   r   r   r4   r1   r   r   r   <module>rH      sJ    #    . / 
 ( &(V,+r   