
    2;ji                         d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
  e
d          Zded	eed
ef         ged
ef         f         fdZdgZd	ee         fdZdS )z
Internal helpers
    )Callable)wraps)	signature)
ModuleType)TypeVar_Txpreturn.c                 d     dt           dt          f         dt           dt          f         f fd}|S )a2  
    Decorator to automatically replace xp with the corresponding array module.

    Use like

    import numpy as np

    @get_xp(np)
    def func(x, /, xp, kwarg=None):
        return xp.func(x, kwarg=kwarg)

    Note that xp must be a keyword argument and come after all non-keyword
    arguments.

    f.r
   c                4    t                     dt          dt          dt          f fd            }t                     }|                    d |j                                        D                       }|j        d j         d|_        ||_        |S )	Nargskwargsr
   c                       | di|S )Nr	    )r   r   r   r	   s     f/root/voice-cloning/.venv/lib/python3.11/site-packages/sklearn/externals/array_api_compat/_internal.py	wrapped_fz(get_xp.<locals>.inner.<locals>.wrapped_f    s    1d,r,V,,,    c                 $    g | ]\  }}|d k    |S )r	   r   ).0ipars      r   
<listcomp>z)get_xp.<locals>.inner.<locals>.<listcomp>&   s!    NNN3AIIIIIr   )
parametersz$Array API compatibility wrapper for zk.

See the corresponding documentation in NumPy/CuPy and/or the array API
specification for more details.

)	r   objectr   replacer   items__doc____name____signature__)r   r   signew_sigr	   s   `   r   innerzget_xp.<locals>.inner   s    	q	-V 	-v 	-& 	- 	- 	- 	- 	- 	- 
	- ll++NN#.*>*>*@*@NNN  
 
 $!%&Z! ! !I #*	r   )r   r   )r	   r#   s   ` r   get_xpr$      sH    "#r'" (37*;      * Lr   r$   c                      t           S )N)__all__r   r   r   __dir__r'   :   s    Nr   N)r   collections.abcr   	functoolsr   inspectr   typesr   typingr   r   r$   r&   liststrr'   r   r   r   <module>r/      s     % $ $ $ $ $                        WT]]&z &hb(9':HS"W<M'MN & & & &R *c      r   