
    Ug                     D    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	dS )	    )IterableNc                     | 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)modes    X/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/scipy/ndimage/_ni_support.py_extend_mode_to_coder   %   s     yq	q	+	+	+q			q			q			q		 	 q8999    c                     t          | t                    }|sIt          | t                    r4t          |           }t	          |          |k    rd}t          |          n| 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   :   ss    
 s##F $j11 $%[[
z??d""JCs### # Wt^
r   Fc                 ~   ||j         }| `|s"t          j        ||j        j                  } nt          j        |j        t          j                  }t          j        ||          } nQt          | t          t          j        f          rk|rRt          j        |           j	        dk    r5t          j        dd           t          j        | t          j                  } t          j        ||           } nt          | t                    rut          j        |           } |r| j	        dk    rt          d          t          | j        t          j                  st          d          t          j        ||           } n;| j         |k    rt          d          |r| j        j	        dk    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   }~ 	9Xe5;+;<<<FF+EKFFLXe<888FF	FT28,	-	- = 	<bhv..3s::MGTUVVVV%fbl;;F%v...	FC	 	  
=&!! 	AfkS00?@@@FK33 	A?@@@%v...			5666	 =FL-44;<<<Mr   c                 0   | t          t                              S t          j        |           rt	          j        |           f} nt          | t                    r]| D ]>}t          d | D                       } | k     s	|dz
  k    rt          d| d          ?t          fd| D                       } nd}t          |          t          t          t          |                               t          |           k    rt          d          | S )Nc              3   >   K   | ]}t          j        |          V  d S )N)operatorindex).0axs     r   	<genexpr>z_check_axes.<locals>.<genexpr>n   s,      ;;++;;;;;;r   r   zspecified axis: z is out of rangec              3   2   K   | ]}|d k     r|z  n|V  dS )r   N )r8   r9   ndims     r   r:   z_check_axes.<locals>.<genexpr>q   s3      @@R"q&&R$YYb@@@@@@r   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(	#	# " 	J 	JB;;d;;;;;DTEzzR$(]] !HB!H!H!HI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   