
    e!h                     P    d dl mZ d dlZd dlZd dlZd	dZd Zd
dZd Z	d Z
d Zy)    )IterableNc                     | dk(  ry| dk(  ry| dv ry| dk(  ry| d	k(  ry
| dk(  r|ry| dk(  ry| dk(  r|ry
| dk(  ry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	is_filters     a/var/www/html/diagnosisapp-backend/venv/lib/python3.12/site-packages/scipy/ndimage/_ni_support.py_extend_mode_to_coder   %   sw     y		+	+										 Y		 899    c                     t        | t              }|s=t        j                  |       r(t	        |       }t        |      |k7  rd}t        |      |S | g|z  }|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strnpiterablelistlenr   )inputrankis_str
normalizederrs        r   _normalize_sequencer"   >   s^    
 s#Fbkk%(%[
z?d"JCs##  Wt^
r   c                    ||j                   }| v|s-t        j                  ||j                  j                        } | S t        j
                  |j                  t        j                        }t        j                  ||      } | S t        | t        t        j                  f      rx|r]t        j                  |       j                  dk7  r;t        j                  dd       t        j
                  | t        j                        } t        j                  ||       } | S t        | t              ryt        j                  |       } |r| j                  dk7  rt        d      t        | j                  t        j                        st        d      t        j                  ||       } | S t        j                   |       } | j                   |k7  rt        d      |r$| j                  j                  dk7  rt        d      | S )	N)dtypecz+promoting specified output dtype to complexr   )
stacklevelzoutput must have complex dtypezoutput must have numeric dtypezoutput shape not correct)shaper   zerosr$   namepromote_types	complex64r   typekindwarningswarnr   r   
issubclassnumberasarray)outputr   r'   complex_outputcomplex_types        r   _get_outputr6   N   s   }~XXe5;;+;+;<F0 M- ++EKKFLXXe<8F* M) 
FT288,	-bhhv.33s:MMGTUV%%fbll;F%v. M 
FC	 &!fkkS0?@@FKK3?@@%v. M F#<<5 9:: 1 1S 8?@@Mr   c                    | t        t                    S t        j                  |       rt	        j
                  |       f} nht        | t              rK| D ]1  }t        d | D              } | k  s	|dz
  kD  s$t        d| d       t        fd| D              } nd}t        |      t        t        t        |                   t        |       k7  rt        d      | S )Nc              3   F   K   | ]  }t        j                  |        y wN)operatorindex).0axs     r   	<genexpr>z_check_axes.<locals>.<genexpr>u   s     ;+;s   !r   zspecified axis: z is out of rangec              3   6   K   | ]  }|d k  r|z  n|  yw)r   N )r<   r=   ndims     r   r>   z_check_axes.<locals>.<genexpr>x   s      @R"q&R$Yb0@s   z6axes must be an integer, iterable of integers, or Nonezaxes must be unique)tupleranger   isscalarr:   r;   r   r   
ValueErrorr   set)axesrA   r=   messages    `  r   _check_axesrI   n   s    |U4[!!	T	t$&	D(	# 	JB;d;;DTEzR$(] #3B47G!HII	J @4@@J!!
5TD	).//Kr   c                     t        | t              ryt        |       t        u rt        | t        j
                        rdS | S t        | t        j                        rdS | S )z'array or dtype' polymorphism.

    Return None for np.int8, dtype('float32') or 'f' etc
           arg for np.empty(3) etc
    N)r   r   r,   r0   r   genericr$   args    r   _skip_if_dtyperN      sM     #sCyD!#rzz2t;;!#rxx0t9c9r   c                 .    | t        | t              rd S | S r9   )r   intrL   s    r   _skip_if_intrQ      s    K:c3#74AcAr   )F)NF)collections.abcr   r:   r.   numpyr   r   r"   r6   rI   rN   rQ   r@   r   r   <module>rT      s3   > %   :2 @$:Br   