o
    h+
                     @   s   d dl Z d dlmZmZmZmZ d dlZddlT ddl	mZ ddl	m
Z
 ejZdZdd	 ZejD ]ZeeeZee
ed
 ZerGeeeeneZee e< q0dS )    N)is_cupyis_jaxscipy_namespace_forSCIPY_ARRAY_API   )*)_ndimage_api)_delegatorsndimagec                    s    fdd}|S )Nc                    s   t   fdd}|S )Nc            	         s  | i | t  r$dd l}|d }t|j}|| i |S t rCjdkrCt }t|}t|j}|| i |S | i |}t|tj	tj
frX |S t|tr_|S t|tro fdd| D S |d u ru|S t| fdd|D S )Nr   zcupyx.scipy.map_coordinatesc                    s,   i | ]\}}|  t fd d|D qS )c                 3   s    | ]}  |V  qd S N)asarray).0vvxp _/var/www/vscode/kcb/lib/python3.10/site-packages/scipy/ndimage/_support_alternative_backends.py	<genexpr>/   s    zIdelegate_xp.<locals>.inner.<locals>.wrapper.<locals>.<dictcomp>.<genexpr>)itemtuple)r   kvr   r   r   
<dictcomp>.   s    z?delegate_xp.<locals>.inner.<locals>.wrapper.<locals>.<dictcomp>c                 3   s*    | ]}t |tjr |n|V  qd S r   )
isinstancenpndarrayr   )r   xr   r   r   r   7   s
    
z>delegate_xp.<locals>.inner.<locals>.wrapper.<locals>.<genexpr>)r   	importlibimport_modulegetattr__name__r   r   r   r   r   genericr   intdictitemstype)	argskwdsr   cupyx_module
cupyx_funcspx
jax_modulejax_funcresult)	delegatorfuncmodule_namer   r   wrapper   s2   




z+delegate_xp.<locals>.inner.<locals>.wrapper)	functoolswraps)r0   r2   r/   r1   )r0   r   inner   s   (zdelegate_xp.<locals>.innerr   )r/   r1   r6   r   r5   r   delegate_xp   s   +r7   
_signature)r3   scipy._lib._array_apir   r   r   r   numpyr   r    r	   __all__MODULE_NAMEr7   	func_namer    	bare_funcr/   fvarsr   r   r   r   <module>   s$    
/
