o
    "ì¤gU  ã                   @   sR   d Z ddlmZ ddlmZ ddlm  m	Z
 dd„ Zdd„ Zd	d
„ Zdd„ ZdS )zNTools for testing implementations of __array_function__ and ufunc overrides


é    )ÚARRAY_FUNCTIONS)ÚufuncNc                  C   s   dd„ t j ¡ D ƒ} | S )zÎList all numpy ufuncs overridable via `__array_ufunc__`

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

    Returns
    -------
    set
        A set containing all overridable ufuncs in the public numpy API.
    c                 S   s   h | ]	}t |tƒr|’qS © ©Ú
isinstanceÚ_ufunc)Ú.0Úobjr   r   úY/var/www/html/ecg_monitoring/venv/lib/python3.10/site-packages/numpy/testing/overrides.pyÚ	<setcomp>   s    
ÿz/get_overridable_numpy_ufuncs.<locals>.<setcomp>)Ú_umathÚ__dict__Úvalues)Úufuncsr   r   r
   Úget_overridable_numpy_ufuncs
   s   r   c                 C   s
   t | tƒ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   ©Úfuncr   r   r
   Úallows_array_ufunc_override   s   
r   c                  C   s   ddl m}  t ¡ 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   r   r   r
   Ú%get_overridable_numpy_array_functions2   s   r   c                 C   s   | 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   r   r   r
   Úallows_array_function_overrideE   s   r   )Ú__doc__Únumpy._core.overridesr   r   Únumpyr   r   Únumpy._core.umathÚ_coreÚumathr   r   r   r   r   r   r   r   r
   Ú<module>   s    