§
<ˆjµ ã óÚ — d Z ddlZddlZddlZddlmZ ddlmZ ddlm Z m
Z
mZ e¦ « Z
dZd„ Z e ed ¦ « e e
d
¦ « ej dd¦ « Zd
„ Z dd„Z dd„ZdS )z;Implementation of __array_function__ overrides from NEP-18.é Né )Ú
set_module)Ú
getargspec)Ú
add_docstringÚ_get_implementing_argsÚ_ArrayFunctionDispatcherar like : array_like, optional
Reference object to allow the creation of arrays which are not
NumPy arrays. If an array-like passed in as ``like`` supports
the ``__array_function__`` protocol, the result will be defined
by it. In this case, it ensures the creation of an array object
compatible with that passed in via this argument.c ó^ — | j �%| j dt ¦ « | _ | S )Nz${ARRAY_FUNCTION_LIKE})Ú__doc__ÚreplaceÚarray_function_like_doc)Ú
public_apis úK/opt/cloudlinux/venv/lib64/python3.11/site-packages/numpy/core/overrides.pyÚset_array_function_like_docr s4 € ØÔÐ%Ø'Ô/×7Ò7Ø$Ý#ñ
ô
ˆ
Ôð Ðó aã
Class to wrap functions with checks for __array_function__ overrides.
All arguments are required, and can only be passed by position.
Parameters
----------
dispatcher : function or None
The dispatcher function that returns a single sequence-like object
of all arguments relevant. It must have the same signature (except
the default values) as the actual implementation.
If ``None``, this is a ``like=`` dispatcher and the
``_ArrayFunctionDispatcher`` must be called with ``like`` as the
first (additional and positional) argument.
implementation : function
Function that implements the operation on NumPy arrays without
overrides. Arguments passed calling the ``_ArrayFunctionDispatcher``
will be forwarded to this (and the ``dispatcher``) as if using
``*args, **kwargs``.
Attributes
----------
_implementation : function
The original implementation passed in.
ar
Collect arguments on which to call __array_function__.
Parameters
----------
relevant_args : iterable of array-like
Iterable of possibly array-like arguments to check for
__array_function__ methods.
Returns
-------
Sequence of arguments with __array_function__ methods, in the order in
which they should be called.
ÚArgSpeczargs varargs keywords defaultsc ó — t t | ¦ « Ž }t t |¦ « Ž }|j |j k s{|j |j k sk|j |j k s[t |j ¦ « t |j ¦ « k s1|j �