a :jgMã@sRdZddlmZddlmZddlmm Z dd„Z dd„Z d d „Z d d „ZdS) zNTools for testing implementations of __array_function__ and ufunc overrides é)ÚARRAY_FUNCTIONS)ÚufuncNcCsdd„tj ¡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. cSsh|]}t|tƒr|’qS©)Ú isinstanceÚ_ufunc)Ú.0ÚobjrrúA/usr/local/lib/python3.9/site-packages/numpy/testing/overrides.pyÚ s ÿz/get_overridable_numpy_ufuncs..)Ú_umathÚ__dict__Úvalues)Zufuncsrrr Úget_overridable_numpy_ufuncs s rcCs t|tjƒ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©Úfuncrrr Úallows_array_ufunc_overridesrcCsddlm}t ¡S)aList 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)Z numpy.librÚ_array_functionsÚcopyrrrr Ú%get_overridable_numpy_array_functions2s rcCs|tvS)ahDetermine 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. )rrrrr Úallows_array_function_overrideEsr)Ú__doc__Znumpy._core.overridesrrÚnumpyrrZnumpy._core.umathZ_coreZumathr rrrrrrrr Ús