Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/site-packages/pandas/core/ops/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/site-packages/pandas/core/ops/__pycache__/common.cpython-312.pyc

�

Mٜg�
���dZddlmZddlmZddlmZmZddlm	Z	ddl
mZddlm
Z
mZerddlmZdd	�Zdd
�Zd�Zd�Zy
)z;
Boilerplate functions used in defining binary operations.
�)�annotations)�wraps)�
TYPE_CHECKING�Callable)�item_from_zerodim)�is_matching_na)�ABCIndex�	ABCSeries)�Fc���d�fd�}|S)z�
    Boilerplate for pandas conventions in arithmetic and comparison methods.

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

    Returns
    -------
    decorator
    c���t|��S)N)�_unpack_zerodim_and_defer)�method�names ��A/usr/local/lib/python3.12/site-packages/pandas/core/ops/common.py�wrapperz)unpack_zerodim_and_defer.<locals>.wrapper%s���(���6�6�)rr�returnr�)rrs` r�unpack_zerodim_and_deferrs���7��Nrc�z���|jd�jd�}|dv�t����fd��}|S)aM
    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����r!t|t�rt|t�rn$t|dd�}|�||jkDrt
St
|�}�||�S)N�__pandas_priority__)�
isinstancer	r
�getattrr �NotImplementedr)�self�other�prio�is_cmprs   ��r�
new_methodz-_unpack_zerodim_and_defer.<locals>.new_method>s[����j��x�0�Z��y�5Q���5�"7��>�D����$�2�2�2�)�)�!�%�(���d�E�"�"r)�removeprefix�removesuffixr)rr�
stripped_namer(r's`   @rrr+sI��� �%�%�d�+�8�8��>�M�
�B�
B�F�
�6�]�
#��
#��rc�f�t|ttf�rt||�}|S|j}|S)a
    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�rightrs   r�get_op_result_namer0Qs6���%�)�X�.�/� ��u�-���K��y�y���Krc��t|d�}t|d�}|rU|rS	|j|jk(r|jSt|j|j�r|jSy|r|jS|r|jSy#t$r1t|j|j�r|jcYSYyt$rYywxYw)a�
    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
    rN)�hasattrrr�	TypeError�
ValueError)�a�b�a_has�b_hass    rr-r-gs���(
�A�v��E��A�v��E���	��v�v������v�v�
��������/��v�v�
��
��v�v�
�	��v�v�
����	��a�f�f�a�f�f�-��v�v�
���	��	�s�$B
�+B
�
5C�C�CN)r�strrzCallable[[F], F])rr9)�__doc__�
__future__r�	functoolsr�typingrr�pandas._libs.libr�pandas._libs.missingr�pandas.core.dtypes.genericr	r
�pandas._typingrrrr0r-rrr�<module>rBsA���#���
/�/��
� ��&#�L�,+r

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists