"""
This type stub file was generated by pyright.
"""

import numpy as np
from typing import Any
from pandas._typing import ArrayLike, Shape

"""
Functions for arithmetic and comparison operations on NumPy arrays and
ExtensionArrays.
"""
def comp_method_OBJECT_ARRAY(op, x, y): # -> ndarray[Any, dtype[bool_]]:
    ...

def arithmetic_op(left: ArrayLike, right: Any, op): # -> ndarray[Unknown, Unknown] | tuple[ndarray[Unknown, Unknown], Unknown]:
    """
    Evaluate an arithmetic operation `+`, `-`, `*`, `/`, `//`, `%`, `**`, ...

    Note: the caller is responsible for ensuring that numpy warnings are
    suppressed (with np.errstate(all="ignore")) if needed.

    Parameters
    ----------
    left : np.ndarray or ExtensionArray
    right : object
        Cannot be a DataFrame or Index.  Series is *not* excluded.
    op : {operator.add, operator.sub, ...}
        Or one of the reversed variants from roperator.

    Returns
    -------
    ndarray or ExtensionArray
        Or a 2-tuple of these in the case of divmod or rdivmod.
    """
    ...

def comparison_op(left: ArrayLike, right: Any, op) -> ArrayLike:
    """
    Evaluate a comparison operation `=`, `!=`, `>=`, `>`, `<=`, or `<`.

    Note: the caller is responsible for ensuring that numpy warnings are
    suppressed (with np.errstate(all="ignore")) if needed.

    Parameters
    ----------
    left : np.ndarray or ExtensionArray
    right : object
        Cannot be a DataFrame, Series, or Index.
    op : {operator.eq, operator.ne, operator.gt, operator.ge, operator.lt, operator.le}

    Returns
    -------
    ndarray or ExtensionArray
    """
    ...

def na_logical_op(x: np.ndarray, y, op): # -> ndarray[Any, Unknown]:
    ...

def logical_op(left: ArrayLike, right: Any, op) -> ArrayLike:
    """
    Evaluate a logical operation `|`, `&`, or `^`.

    Parameters
    ----------
    left : np.ndarray or ExtensionArray
    right : object
        Cannot be a DataFrame, Series, or Index.
    op : {operator.and_, operator.or_, operator.xor}
        Or one of the reversed variants from roperator.

    Returns
    -------
    ndarray or ExtensionArray
    """
    ...

def get_array_op(op): # -> partial[Unknown] | partial[ArrayLike] | partial[Unknown | ndarray[Unknown, Unknown] | tuple[ndarray[Unknown, Unknown], Unknown]]:
    """
    Return a binary array operation corresponding to the given operator op.

    Parameters
    ----------
    op : function
        Binary operator from operator or roperator module.

    Returns
    -------
    functools.partial
    """
    ...

def maybe_prepare_scalar_for_op(obj, shape: Shape): # -> Timedelta | NaTType | Timestamp:
    """
    Cast non-pandas objects to pandas types to unify behavior of arithmetic
    and comparison operations.

    Parameters
    ----------
    obj: object
    shape : tuple[int]

    Returns
    -------
    out : object

    Notes
    -----
    Be careful to call this *after* determining the `name` attribute to be
    attached to the result of the arithmetic operation.
    """
    ...

_BOOL_OP_NOT_ALLOWED = ...
