
    (ph                     T    S SK Jr  S SKrS SKrS SKrS	S jrS rS
S jrS r	S r
S rg)    )IterableNc                     U S:X  a  gU S:X  a  gU S;   a  gU S:X  a  gU S	:X  a  g
U S:X  a  U(       a  gU S:X  a  gU S:X  a  U(       a  g
U S:X  a  g[        S5      e)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     L/var/www/html/venv/lib/python3.13/site-packages/scipy/ndimage/_ni_support.py_extend_mode_to_coder   %   sw     y		+	+										 Y		 899    c                     [        U [        5      nU(       dE  [        R                  " U 5      (       a*  [	        U 5      n[        U5      U:w  a  Sn[        U5      e U$ U /U-  nU$ )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"   >   sf    
 s#Fbkk%((%[
z?d"JCs## #
  Wt^
r   c                 @   Uc  UR                   nU cw  U(       d*  [        R                  " X!R                  R                  S9n U $ [        R
                  " UR                  [        R                  5      n[        R                  " X$S9n  U $ [        U [        [        R                  45      (       a{  U(       a^  [        R                  " U 5      R                  S:w  a:  [        R                  " SSS9  [        R
                  " U [        R                  5      n [        R                  " X S9n U $ [        U [        5      (       a  [        R                  " U 5      n U(       a  U R                  S:w  a  [        S5      e[        U R                  [        R                  5      (       d  [        S5      e[        R                  " X S9n U $ [        R                   " U 5      n U R                   U:w  a  [        S5      eU(       a%  U R                  R                  S:w  a  [        S5      eU $ )	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   }~XXe;;+;+;<F0 M- ++EKKFLXXe8F* M) 
FT288,	-	-bhhv.33s:MMGTUV%%fbll;F%. M 
FC	 	 &!fkkS0?@@FKK33?@@%. M F#<<5 9:: 1 1S 8?@@Mr   c                   ^ U c  [        [        T5      5      $ [        R                  " U 5      (       a  [        R
                  " U 5      4n Or[        U [        5      (       aP  U  H4  n[        S U  5       5      n UT* :  d  UTS-
  :  d  M'  [        SU S35      e   [        U4S jU  5       5      n OSn[        U5      e[        [        [        U 5      5      5      [        U 5      :w  a  [        S5      eU $ )Nc              3   N   #    U  H  n[         R                  " U5      v   M     g 7fN)operatorindex).0axs     r   	<genexpr>_check_axes.<locals>.<genexpr>u   s     ;d++ds   #%r   zspecified axis: z is out of rangec              3   <   >#    U  H  oS :  a  UT-  OUv   M     g7f)r   N )r<   r=   ndims     r   r>   r?   x   s     @4Rq&R$Yb04s   z6axes must be an integer, iterable of integers, or Nonezaxes must be unique)tupleranger   isscalarr:   r;   r   r   
ValueErrorr   set)axesrB   r=   messages    `  r   _check_axesrJ   n   s    |U4[!!	T		t$&	D(	#	#B;d;;DTEzR$(] #3B47G!HII  @4@@J!!
5TD	).//Kr   c                     [        U [        5      (       a  g[        U 5      [        L a#  [        U [        R
                  5      (       a  S$ U $ [        U [        R                  5      (       a  S$ U $ )zt'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_dtyperO      sV     #sCyD!#rzz22t;;!#rxx00t9c9r   c                 :    U b  [        U [        5      (       a  S $ U $ r9   )r   intrM   s    r   _skip_if_intrR      s    K:c3#7#74AcAr   )F)NF)collections.abcr   r:   r.   numpyr   r   r"   r6   rJ   rO   rR   rA   r   r   <module>rU      s3   > %   :2 @$:Br   