
    fK                     J    d Z ddlmZ ddlmZ ddlmc m	Z
 d Zd Zd Zd Zy)	zNTools for testing implementations of __array_function__ and ufunc overrides


    )ARRAY_FUNCTIONS)ufuncNc                      t         j                  j                         D  ch c]  } t        | t              r|  }} |S c c} w )zList all numpy ufuncs overridable via `__array_ufunc__`

    Parameters
    ----------
    None

    Returns
    -------
    set
        A set containing all overridable ufuncs in the public numpy API.
    )_umath__dict__values
isinstance_ufunc)objufuncss     9/usr/lib/python3/dist-packages/numpy/testing/overrides.pyget_overridable_numpy_ufuncsr   
   sA     $__335 *cC(  *F *M*s   >c                 6    t        | t        j                        S )a  Determine if a function can be overridden via `__array_ufunc__`

    Parameters
    ----------
    func : callable
        Function that may be overridable via `__array_ufunc__`

    Returns
    -------
    bool
        `True` if `func` is overridable via `__array_ufunc__` and
        `False` otherwise.

    Notes
    -----
    This function is equivalent to ``isinstance(func, np.ufunc)`` and
    will work correctly for ufuncs defined outside of Numpy.

    )r	   npr   funcs    r   allows_array_ufunc_overrider      s    ( dBHH%%    c                  6    ddl m}  t        j                         S )a  List all numpy functions overridable via `__array_function__`

    Parameters
    ----------
    None

    Returns
    -------
    set
        A set containing all functions in the public numpy API that are
        overridable via `__array_function__`.

    r   recfunctions)	numpy.libr   _array_functionscopyr   s    r   %get_overridable_numpy_array_functionsr   2   s      '  ""r   c                     | t         v S )ah  Determine if a Numpy function can be overridden via `__array_function__`

    Parameters
    ----------
    func : callable
        Function that may be overridable via `__array_function__`

    Returns
    -------
    bool
        `True` if `func` is a function in the Numpy API that is
        overridable via `__array_function__` and `False` otherwise.
    )r   r   s    r   allows_array_function_overrider   E   s     ###r   )__doc__numpy.core.overridesr   r   numpyr   r
   numpy.core.umathcoreumathr   r   r   r   r    r   r   <module>r%      s-   
 E ! ! !"&.#&$r   