
    tKg                     B    d dl mZ d dlZd dlZd dlZd Zd ZddZd Z	y)    )IterableNc                 j    | dk(  ry| dk(  ry| dv ry| dk(  ry| d	k(  ry
| dk(  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)modes    ]/home/alanp/www/video.onchill/myenv/lib/python3.12/site-packages/scipy/ndimage/_ni_support.py_extend_mode_to_coder   %   s]     y		+	+								 899    c                     t        | t              }|s8t        | t              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strr   listlenr   )inputrankis_str
normalizederrs        r   _normalize_sequencer   :   s\    
 s#Fj1%[
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 | 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)shapenpzerosr!   namepromote_types	complex64r   typekindwarningswarnr   r   
issubclassnumber)outputr   r$   complex_outputcomplex_types        r   _get_outputr3   J   s   }~XXe5;;+;+;<F* M' ++EKKFLXXe<8F$ M# 
FT288,	-bhhv.33s:MMGTUV%%fbll;F%v. M 
FC	 &!fkkS0?@@FKK3?@@%v.
 M	 
	566	FLL--4;<<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>n   s     ;d+ds   !r   zspecified axis: z is out of rangec              3   6   K   | ]  }|d k  r|z  n|  yw)r   N )r8   r9   ndims     r   r:   z_check_axes.<locals>.<genexpr>q   s!     @4R"q&R$Yb04s   z6axes must be an integer, iterable of integers, or Nonezaxes must be unique)tupleranger%   isscalarr6   r7   r   r   
ValueErrorr   set)axesr=   r9   messages    `  r   _check_axesrE   g   s    |U4[!!	T	t$&	D(	#B;d;;DTEzR$(] #3B47G!HII  @4@@J!!
5TD	).//Kr   )NF)
collections.abcr   r6   r,   numpyr%   r   r   r3   rE   r<   r   r   <module>rH      s'   > %   :* :r   