
    Ph                      &    d Z ddlmZ ddlmZ d Zy)z
Internal helpers
    )wraps)	signaturec                       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.

    c                     t                fd       }t               }|j                  |j                  D cg c]  }|dk7  s	|j                  |    c}      }|j                  d j
                   d|_        ||_        |S c c}w )Nc                       | di|S )Nxp )argskwargsfr   s     pC:\Users\daisl\Desktop\realtime-object-detection\venv\Lib\site-packages\scipy/_lib/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   r   replacer   __doc____name____signature__)r   r   siginew_sigr   s   `    r   innerzget_xp.<locals>.inner   s    	q	- 
	- l++36>>O>aQ$Yq)>O  
 $%%%&ZZL 1!I #*	 Ps   
B	B	r	   )r   r   s   ` r   get_xpr      s    "* Lr   N)r   	functoolsr   inspectr   r   r	   r   r   <module>r      s     &r   