+
    /i(G                     v    R t ^ RIt^RIHt ^RIHtHt ]]P                  3t
R t ! R R4      tR tR tR	 tR# )
z0Indexing mixin for sparse array/matrix classes.
N)	isintlike)sparrayissparsec                     \         P                  ! V !  p\        W4       F*  w  r#VP                  P                  VP                  n        K,  	  V# )a  
Same as np.broadcast_arrays(a, b) but old writeability rules.

NumPy >= 1.17.0 transitions broadcast_arrays to return
read-only arrays. Set writeability explicitly to avoid warnings.
Retain the old writeability rules, as our Cython code assumes
the old behavior.
)npbroadcast_arrayszipflags	writeable)arraysr   xas   *   Q/var/www/html/photoedit/myenv/lib/python3.14/site-packages/scipy/sparse/_index.py_broadcast_arraysr   
   sC     **F3$-GG-- .    c                      a  ] tR t^t o RtR tR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tRtV tR# )
IndexMixinzK
This class provides common dispatching and validation logic for indexing.
c                   \        WP                  V P                  4      w  r# p\        V4      ^8  d   \	        RV P                   R24      h\        V4      ^8X  EdJ   V^ ,          p\        V\        P                  4      '       d"   VP                  R
8X  d   VP                  4       p\        V\        4      '       d   V P                  V4      pM9\        V\        4      '       d   V P                  V4      pMV P                  V4      p\        V \        4      '       g   V# VP                  R
8X  de   VR
8w  d^   \        V4      ^8X  d   V P                  V.W0P                   R7      # \        V4      ^8X  d    V P                  V..W0P                   R7      # VP#                  V4      # Vw  rx\        V\        4      '       d   \        V\        4      '       d   V P%                  Wx4      pEM\        V\        4      '       d   V P'                  Wx4      pEMpVP(                  ^8X  d   V P+                  Wx4      pEMLVP(                  ^8X  d   V P+                  Wx4      pEM(\	        R4      h\        V\        4      '       d   \        V\        4      '       d   V P-                  Wx4      pEM\        V\        4      '       d<   V\        R4      8X  d   Wx8X  d   V P/                  4       pEMV P1                  Wx4      pEMVP(                  ^8X  d   V P3                  Wx4      pEMi\	        R4      h\        V\        4      '       d   V P5                  Wx4      pEM5\        V\        4      '       d   V P7                  Wx4      pEMVP(                  ^8X  dk   VP                  ^,          ^8X  dS   VP(                  ^8X  g   VP                  ^ ,          ^8X  d*   V P9                  VR,          VP#                  R4      4      pM\;        Wx4      w  rxVP                  VP                  8w  d   \	        R4      hVP<                  ^ 8X  d=   V P                  \        P>                  ! V4      P                  V P                   R7      pMV PA                  Wx4      p\        V \        4      '       gg   VR
8X  g"   \        V4      ^8X  d   VP(                  ^ 8w  d   V# \        V4      ^8X  d
   RV,           pW6P                  8X  d   V# VP#                  V4      # VP                  V8w  dw   V P                  R8X  dU   \        V4      ^8w  dE   VP                  R
8X  d   V PC                  V.VR	7      # VPE                  4       P#                  V4      # VP#                  V4      # V# )   z/Indexing that leads to >2D is not supported by z% format. Try converting to COO format)shapedtypezindex results in >2 dimensionsN'number of row and column indices differr   lil)r    )NNN    )   )#_validate_indicesr   formatlen
IndexError
isinstancer   ndarrayitem	INT_TYPES_get_intslice
_get_slice
_get_arrayr   	__class__r   reshape_get_intXint_get_intXslicendim_get_intXarray_get_sliceXintcopy_get_sliceXslice_get_sliceXarray_get_arrayXint_get_arrayXslice_get_columnXarrayr   size
atleast_2d_get_arrayXarray_coo_containertocoo)	selfkeyindex	new_shape_idxresrowcols	   &&       r   __getitem__IndexMixin.__getitem__   s7   !23

DKK!P!Qy>AN $},QS T T u:?(C#rzz**99?((*C#y))mmC(C''ooc*ooc* dG,,
yyB9?y>Q&>>3%y

>SSy>Q&>>C5'**>UU;;y))  c9%%#y))''1C''))#3Q))#3Q))#3 !ABBU###y))))#3C''%+%#*))+C//9CQ++C5 !ABB#y))))#3C''++C5((a-CIIaLA$5xx1}		!(9,,SYBH -S699		)$%NOO88q=..s);)A)A.TC//9C $((B3y>Q#6388q=
9~" 9,	#yy03Lckk)6LL 99	!{{e#I!(;99?..ui.HHyy{**955;;y))
r   c                :   \        WP                  V P                  4      w  r4 p\        V4      ^8X  Ed   V^ ,          p\	        V4      '       d   VP                  4       pM!\        P                  ! W P                  R7      p\        V\        4      '       dA   VP                  ^8w  d   \        R4      hV P                  WbP                  ^ ,          4       R# \        V\        4      '       d   \!        VP#                  V P                  ^ ,          4      !  p\        V4      pV^8X  d>   VP                  ^8X  d-   V P                  V^ ,          VP                  ^ ,          4       R# \        P$                  ! VP#                  V P                  ^ ,          4      !  pVP                  p	MVP'                  4       P                  p	VP'                  4       P                  V	8w  d!   \        P(                  ! W&P                  4      pVP                  ^ 8w  d   V P+                  Wb4       R# Vw  r\        V
\        4      '       d   \        V\        4      '       d   \	        V4      '       d   VP                  4       pM!\        P                  ! W P                  R7      pVP                  ^8w  d   \        R4      hV P-                  WVP                  ^ ,          4       R# \        V
\        4      '       d=   \        P$                  ! V
P#                  V P                  ^ ,          4      !  R	,          p
M\        P.                  ! V
4      p
\        V\        4      '       dW   \        P$                  ! VP#                  V P                  ^,          4      !  R
,          pV
P0                  ^8X  d
   V
R	,          p
M\        P.                  ! V4      p\3        W4      w  rVP                  VP                  8w  d   \5        R4      h\	        V4      '       Ed]   ^ VP                  9   d   R# VP0                  ^8X  d   VR,          pVR,          pVP7                  RR7      P9                  VP:                  RR7      pVP                  ^ ,          ^8H  ;'       d    VP                  ^ ,          ^8g  pVP                  ^,          ^8H  ;'       d    VP                  ^,          ^8g  pV'       g*   VP                  ^ ,          VP                  ^ ,          8X  d2   V'       g5   VP                  ^,          VP                  ^,          8X  g   \        R4      hVP=                  4        V P?                  WV4       R# \        P                  ! W P                  R7      pVP'                  4       P                  VP'                  4       P                  8w  d!   \        P(                  ! W,P                  4      pVP                  ^ 8X  d   R# VP9                  VP                  4      pV PA                  WV4       R# )r   r   z&Trying to assign a sequence to an itemNr   F)r2   Tzshape mismatch in assignment)r   N)Nr   )!r   r   r    r!   r   toarrayr   asarrayr   r#   r&   r8   
ValueError_set_intflatr(   rangeindicesarangesqueezebroadcast_to
_set_array_set_intXint
atleast_1dr/   r   r"   r<   r,   _shape_as_2dsum_duplicates_set_arrayXarray_sparse_set_arrayXarray)r=   r>   r   r?   r@   rA   rB   	idx_rangeN	idx_shaperD   rE   ijbroadcast_rowbroadcast_cols   &&&             r   __setitem__IndexMixin.__setitem__   s   !23

DKK!P!Q u:?(C{{IIKJJq

3#y))66Q;$%MNNc66!9-#u%% "3;;tzz!}#=>		N6affkMM)A,q	:iiTZZ]!;<II	KKM//	yy{  I-OOAyy1vv{' c9%%*S)*D*D{{IIKJJq

3vv{ !IJJcq	2c5!!))S[[A78AC--$Cc5!!))S[[A78ACxx1}'l--$C *77aggFGGA;;AGG|vv{dGdGU#++ANN+FAGGAJ!O??
aMGGAJ!O??
aM"aggajAGGAJ&>"aggajAGGAJ&> !?@@((q1 

1JJ/Ayy{  AIIK$5$55OOAww/vv{		!''"A!!!*r   c                    V P                   w  r#\        V4      pW) 8  g   W8  d   \        RV R24      hV^ 8  d	   W,          pV P                  V\	        R4      4      # )zGReturn a copy of row i of the matrix, as a (1 x n) row vector.
        index () out of rangeN)r   intr"   r.   r(   r=   r]   Mr[   s   &&  r   _getrowIndexMixin._getrow   s\     zzFr6QVwqc899q5FA""1eDk22r   c                    V P                   w  r#\        V4      pW) 8  g   W8  d   \        RV R24      hV^ 8  d	   W,          pV P                  \	        R4      V4      # )zMReturn a copy of column i of the matrix, as a (m x 1) column vector.
        rd   re   N)r   rf   r"   r1   r(   rg   s   &&  r   _getcolIndexMixin._getcol   s\     zzFr6QVwqc899q5FA""5;22r   c                    \        4       hNNotImplementedErrorr=   rB   s   &&r   r'   IndexMixin._get_int       !##r   c                    \        4       hro   rp   rr   s   &&r   r)   IndexMixin._get_slice   rt   r   c                    \        4       hro   rp   rr   s   &&r   r*   IndexMixin._get_array   rt   r   c                    \        4       hro   rp   r=   rD   rE   s   &&&r   r-   IndexMixin._get_intXint   rt   r   c                    \        4       hro   rp   rz   s   &&&r   r0   IndexMixin._get_intXarray   rt   r   c                    \        4       hro   rp   rz   s   &&&r   r.   IndexMixin._get_intXslice   rt   r   c                    \        4       hro   rp   rz   s   &&&r   r1   IndexMixin._get_sliceXint  rt   r   c                    \        4       hro   rp   rz   s   &&&r   r3   IndexMixin._get_sliceXslice  rt   r   c                    \        4       hro   rp   rz   s   &&&r   r4   IndexMixin._get_sliceXarray  rt   r   c                    \        4       hro   rp   rz   s   &&&r   r5   IndexMixin._get_arrayXint  rt   r   c                    \        4       hro   rp   rz   s   &&&r   r6   IndexMixin._get_arrayXslice  rt   r   c                    \        4       hro   rp   rz   s   &&&r   r7   IndexMixin._get_columnXarray  rt   r   c                    \        4       hro   rp   rz   s   &&&r   r:   IndexMixin._get_arrayXarray  rt   r   c                    \        4       hro   rp   r=   rB   r   s   &&&r   rL   IndexMixin._set_int  rt   r   c                    \        4       hro   rp   r   s   &&&r   rS   IndexMixin._set_array  rt   r   c                    \        4       hro   rp   r=   rD   rE   r   s   &&&&r   rT   IndexMixin._set_intXint  rt   r   c                    \        4       hro   rp   r   s   &&&&r   rY   IndexMixin._set_arrayXarray   rt   r   c                    \         P                  ! VP                  4       V P                  R 7      p\	        W14      w  r4V P                  WV4       R# )r   N)r   rJ   rI   r   r   rY   )r=   rD   rE   r   rA   s   &&&& r   rX   "IndexMixin._set_arrayXarray_sparse#  s8    JJqyy{$**5 (c*r   r   N)__name__
__module____qualname____firstlineno____doc__rF   ra   ri   rl   r'   r)   r*   r-   r0   r.   r1   r3   r4   r5   r6   r7   r:   rL   rS   rT   rY   rX   __static_attributes____classdictcell__)__classdict__s   @r   r   r      s     `DY+v	3	3$$$$$$$$$$$$$$$$$+ +r   r   c           	     
   \        V4      pV \        J d   \        R4      3V,          V. . 3# \        V \        4      '       g   V .p Rp. p^ p\        V 4       F  w  rxV\        J d   Ve   \        R4      hTpK"  Vf   VP                  V4       K9  \        V\        4      '       g   \        V4      '       d   VP                  V4       V^,          pK|  \        W4      ;p	e&   VP                  V	4       WiP                  ,          pK  \        V4      '       d   \        R4      hVP                  \        P                  ! V4      4       V^,          pK  	  Wc8  d   \        RV  RV RV R24      hW6,
          \        R4      .,          p
V
'       d,   Vf   VP                  V
4       MVRV V
,           WTR ,           p. p^ p. p. p. p. p\        V4       EF1  w  rxVf.   VP                  \        V4      4       VP                  ^4       K7  \        V\        4      '       dW   VP                  V4       W,          p\        \        VP!                  V4      !  4      pVP                  V4       V^,          pK  \        V4      '       ds   W,          pV) Tu;8:  d   V8  g   M \        RV R	24      h\#        V^ 8  d
   VV,           MT4      pVP                  V4       VP                  V4       V^,          pEK&  VP$                  P&                  R
8X  d   WP                  ,           pWV pVP(                  V8w  d   \        RV RV RVP(                   24      hVP                  VP+                  4       4       VP                  \        VV4      4       VP                  \        VV4      4       TpEK  W,          p\-        VVV4      pVP                  V4       VP                  V4       VP                  V4       V^,          pEK4  	  \        V4      ^8  d   V Uu. uF  q}V,          P(                  NK  	  pp \        P.                  ! V!  p\        T4      TR,          T^ ,          ,
          ^,           8w  d   \5        T4      T,           pMzT^ ,          pTRT \5        T4      ,           TTR ,           pMQ\        V4      ^8X  dB   W^ ,          ,          P(                  pV^ ,          pVRV \5        V4      ,           VVR ,           p\	        V4      \	        V4      VV3# u upi   \0         d*    RP3                  R T 4       4      pRT 2p\        T4      hi ; i)a  Returns four sequences: (index, requested shape, arrays, nones)

index : tuple of validated idx objects. bool arrays->nonzero(),
        arrays broadcast, ints and slices as they are, Nones removed
requested shape : the shape of the indexed space, including Nones
arr_pos : position within index of all arrays or ints (for array fancy indexing)
none_pos : insert positions to put newaxis coords in indexed space.
Nz(an index can only have a single ellipsiszoIndexing with sparse matrices is not supported except boolean indexing where matrix and index are equal shapes.z<Too many indices for array or tuple index out of range. Key z needs zD. Array is Drd   re   bzbool index z has shape z instead of  c              3   8   "   T F  p\        V4      x  K  	  R # 5iro   )str).0shps   & r   	<genexpr>$_validate_indices.<locals>.<genexpr>  s     =*3c#hh*s   zLshape mismatch: indexing arrays could not be broadcast together with shapes r   )r!   Ellipsisr(   r#   tuple	enumerater"   appendr   _compatible_boolean_indexr/   r   r   rJ   extendrN   rO   rf   r   kindr   nonzero
_asindicesbroadcast_shapesrK   joinlist)r>   
self_shapeself_format	self_ndim	ellps_pos	index_1stprelim_ndimr]   rB   ixellip_slicesr\   
index_ndimr?   array_indicesnone_positionsarr_int_posMs	len_slicer[   tmp_ndim	mid_shape
arr_shapes	arr_shapeshapesmsgarr_poss   &&&                        r   r   r   *  s    JI
hd~	):r2==c5!!e IIKC.(?$ !KLLI[S!U##y~~S!1K-c==bJR 77"Kc]]$% %
 RZZ_-1K- !. %w{m<	{!E
 	
 +d}<L\*!*9-<y?TTI IJEMNKI&;!!#i.1QU##LL'BE3;;r?34IY'!OJs^^&AB#MM 73%~!>??qcAgc2CLLz*!OJYY^^s"!HH,H"h7IyyI% !!K	{,syykR  LL'  z8!<=uZ:;!J&AS![1CLLz*  ,!OJI 'J =A.;<mAhnnm
<	"++Z8I {B+a. @1 DEY)3I!!nG!(7+d9o=	'(@SSI	]	q	 *+11	a.hw'$y/9Igh<OO	<y);FF' =  	"XX=*==F++1(4CS/!		"s   T ;T% %4Uc                    \         P                  ! V 4      pTR8w  d   TP                  R9  g   TR8X  d*   TP                  ^ 8X  d   \        RTP                   24      hTR8X  d   T# TP                  ^ 8X  d   T# TP                  4       pYQ8  d   \        RT R24      hTP                  4       pT^ 8  d_   Ya) 8  d   \        RT R24      hY0J g   TP                  P                  '       g   TP                  4       pY3^ 8  ;;,          T,          uu&   T#   \        \        \        3 d   p\        R4      ThRp?ii ; i)	zConvert `idx` to a valid index for an axis with a given length.

Subclasses that need special validation can override this method.
zinvalid indexNcooz$Index dimension must be 1 or 2. Got r   rd   re   )r   r   )r   rJ   rK   	TypeErrorMemoryErrorr"   r/   r8   maxminr	   owndatar2   )rB   lengthr    r   emax_indxmin_indxs   &&&    r   r   r     s   
1ZZ_ 277&0FeOST?yIJJ 		ww!|	 vvxH78*N;<<vvxH!|gwxj?@@9BHH,,,B
6
f
I3 	;/ 1)q01s   D D?.D::D?c                b   \        V R4      '       gn    \        \        V 4      R4      p\        V4       F0  p\	        V\
        4      '       d    M\        \        V4      R4      pK2  	  R# \        P                  ! V 4      p V P                  P                  R8X  d   V # R#   \         d     R# i ; i)zICheck for boolean array or array-like. peek before asarray for array-liker/   Nr   )hasattrnextiterrN   r#   boolr   r   
asanyarrayr   r   )rB   desired_ndimr   rA   s   &&  r   r   r     s     3		d3i&B<(b$''$r(D) )
  mmC 
yy~~
  		s   :B B B.-B.)r   numpyr   _sputilsr   _baser   r   rf   integerr&   r   r   r   r   r   r   r   r   <module>r      sF      $"**	N+ N+bFGR Fr   