
    rh                         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y)z
Internal helpers
    )Callable)wraps)	signature)
ModuleType)TypeVar_Txpreturn.c                 P     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                P    t               dt        dt        dt        f fd       }t               }|j                  |j                  j                         D cg c]  \  }}|dk7  s| c}}      }|j                  d j                   d|_        ||_        |S c c}}w )	Nargskwargsr
   c                       | di|S )Nr	    )r   r   r   r	   s     /var/www/html/ai-insurance-compliance-backend/venv/lib/python3.12/site-packages/sklearn/externals/array_api_compat/_internal.py	wrapped_fz(get_xp.<locals>.inner.<locals>.wrapped_f    s    d,r,V,,    r	   )
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iparnew_sigr	   s   `     r   innerzget_xp.<locals>.inner   s    	q	-V 	-v 	-& 	- 
	- l++*-..*>*>*@N3AIN  
 $%%%&ZZL 1!I #*	 Os   B"
+B"
)r   r   )r	   r    s   ` r   get_xpr!      s/    "#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,      sp    %    T]&z &hb(9':HS"W<M'MN &R *c r   