o
    tBh                     @   s:   d dl mZ d dlZd dlZdd Zdd Zd
dd	ZdS )    )IterableNc                 C   s\   | dkrdS | dkrdS | dv rdS | dkrdS | d	krd
S | dkr$dS | dkr*dS t d)zAConvert an extension mode to the corresponding integer code.
    nearestr   wrap   )reflectzgrid-mirror   mirror   constant   z	grid-wrap   zgrid-constant   zboundary mode not supported)RuntimeError)mode r   p/var/www/html/riverr-enterprise-integrations-main/venv/lib/python3.10/site-packages/scipy/ndimage/_ni_support.py_extend_mode_to_code$   s   r   c                 C   sJ   t | t}|st | trt| }t||krd}t||S | g| }|S )zIf input is a scalar, create a sequence of length equal to the
    rank by duplicating the input. If input is a sequence,
    check if its length is equal to the length of array.
    z6sequence argument must have length equal to input rank)
isinstancestrr   listlenr   )inputrankis_str
normalizederrr   r   r   _normalize_sequence9   s   

r   Fc                 C   s  |d u r|j }| d u r)|stj||jjd} | S t|jtj}tj||d} | S t| ttjfrP|rGt| j	dkrGt
d t| tj} tj|| d} | S t| trqtj|  } |rht| j	dkrhtdtj|| d} | S | j |krztd|r| jj	dkrtd| S )N)dtypecz+promoting specified output dtype to complexzoutput must have complex dtypezoutput shape not correct)shapenumpyzerosr   namepromote_types	complex64r   typekindwarningswarnr   
sctypeDictr   )outputr   r   complex_outputcomplex_typer   r   r   _get_outputI   s4   




r-   )NF)collections.abcr   r'   r    r   r   r-   r   r   r   r   <module>   s   