+
    ,i=]                    D	   R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt	 ^ RI
t^ RI
HtHtHtHtHtHtHtHtHtHtHtHtHt ^ RIt^ RIHtHtHtHtHtH t H!t! ^ RI"H#t# ^ RI$H%t% ^ RI&t'^ RI(H)t) ^ RI(H*t*H+t+H,t,H-t-H.t.H/t/H0t0H1t1H2t2H3t3H4t4H5t5H6t6H7t7H8t8H9t9H:t:H;t;H<t< ^ RI=H>t> ^ R	I?H@t@HAtAHBtBHCtCHDtD ^ R
IEHFtFHGtGHHtH ^ RIIHJtJ R]P                  9   tLR{R ltMR tN]O! R.4      tPR tQ]!! 4       tR]RP                  ]#4       R|R ltTR tU ! R R4      tV ! R R4      tW ! R R4      tX ! R R4      tY ! R R4      tZ ! R R4      t[ ! R  R!4      t\]P                  P                   ! R" R#4      4       t_ ! R$ R%4      t` ! R& R'4      ta ! R( R)4      tb]P                  R* 4       td ! R+ R,4      te ! R- R.4      tf ! R/ R04      tg ! R1 R24      th ! R3 R44      ti ! R5 R64      tjR}R7 ltkR~R8 ltl ! R9 R:]l! 4       4      tm]mP                  4         ! R; R<]Y]m4      to]oP                  4         ! R= R>]l! 4       4      tp]pP                  4         ! R? R@]Y]p4      tq]qP                  4         ! RA RB]l! RRRC7      4      tr ! RD RE]Y]r4      ts]rP                  4        ]sP                  4         ! RF RG]l! RRH7      4      tt ! RI RJ]Y]t4      tu]tP                  4        ]uP                  4         ! RK RL]l! RRRRRRM7      4      tv ! RN RO]Y]v4      tw]vP                  4        ]wP                  4         ! RP RQ]l! RRRRRRRRR7      4      tx ! RS RT]Y]x4      ty]xP                  4        ]yP                  4         ! RU RV]l! RRRRRRRW7      4      tz ! RX RY]Y]z4      t{]zP                  4        ]{P                  4        RZ t| ! R[ R\4      t} ! R] R^]}4      t~ ! R_ R`]~4      t ! Ra Rb]]m4      t ! Rc Rd]]o4      t ! Re Rf]]p4      t ! Rg Rh]]q4      t ! Ri Rj]~]z4      t ! Rk Rl]]{4      t ! Rm Rn]}]v4      t ! Ro Rp]]w4      tRq t ! Rr Rs4      t ! Rt Ru4      t]P                  P                  ]P                  EP                   ! Rv Rw]4      4       4       t]P                  P                   ! Rx Ry]4      4       tRz tR# )zTest functions for sparse matrices. Each class in the "Matrix class
based tests" section become subclasses of the classes in the "Generic
tests" section. This is done by the functions in the "Tailored base
class for generic tests" section.

N)raises)arangezerosarraydotasarrayvstackndarray	transposediagkroninf	conjugateint8)assert_equalassert_array_equalassert_array_almost_equalassert_almost_equalassert_assert_allclosesuppress_warnings)ComplexWarning)GenericAlias)
csc_matrix
csr_matrix
dok_matrix
coo_matrix
lil_matrix
dia_matrix
bsr_matrix	csc_array	csr_array	dok_array	coo_array	lil_array	dia_array	bsr_arrayeyeissparseSparseEfficiencyWarningsparrayspmatrix)_formats)supported_dtypesisscalarlikeget_index_dtypeasmatrixmatrix)spluexpminv)	decoratorzgoogle.colabc                 B    Ve   TMV : RV: 2p\        W9   VR7       R # )Nz not found in )msg)r   )member
collectionr7   messages   &&& >/usr/lib/python3/dist-packages/scipy/sparse/tests/test_base.py	assert_inr<   5   s%    _cVJnZN*SGF g.    c                 b    \        V P                  VP                  8H  4       \        W3/ VB  R # N)r   dtyper   )xykwargss   &&,r;   assert_array_equal_dtyperD   :   s$    AGGqwwq&v&r=   dokc                     R  pV! V 4       F2  pV! V4       F#  p\         P                  ! W44      '       g   K!    R# 	  K4  	  R# )c                     . pV P                   P                  4        FK  p\        V\        P                  \        P
                  ,          4      '       g   K:  VP                  V4       KM  	  V# r?   )__dict__values
isinstancenpr	   genericappend)rA   arraysas   &  r;   _underlying_arrays3sparse_may_share_memory.<locals>._underlying_arraysD   sM     ""$A!RZZ"**455a  % r=   TF)rK   may_share_memory)ABrP   rO   bs   &&   r;   sparse_may_share_memoryrV   A   s@      "#A&A""1(( ' # r=   Fc                R  a aaaaa S f   \         P                  ! ^
4      o M\         P                  ! S 4      o V'       d   R	R loMFSe
   R	V3R lloM9V'       d*   \         P                  P                  RR7      oR	V3R lloMR	V 3R lloSe   V3R lo\        VVV3R l4       pV# )
zv
Monkeypatch the maxval threshold at which scipy.sparse switches to
64-bit index arrays, or make it (pseudo-)random.

c                 8   \        WV4      p\        \        P                  ! V4      P                  \        P                  ! \        P
                  4      P                  4       \        V\        P
                  8H  ;'       g    V\        P                  8H  4       V# r?   )r/   r   rK   iinfomaxint32r   intc)rN   maxvalcheck_contentstps   &&& r;   new_get_index_dtype4with_64bit_maxval_limit.<locals>.new_get_index_dtypeh   s^     @B"))288BHH+=+A+ABB"((N33bBGGm4Ir=   c                    < S# r?    )rN   r]   r^   fixed_dtypes   &&&r;   r`   ra   n   s	    r=     )seedc                 p   < \         P                  \         P                  3SP                  ^4      ,          #    )rK   r[   int64randint)rN   r]   r^   counters   &&&r;   r`   ra   s   s$    HHbhh'(:;;r=   c                    < \         P                  pVe   VS8  d   \         P                  pV  F  p\         P                  ! V4      pVP                  \         P                  8  g   K:  V'       dz   VP
                  ^ 8X  d   KU  \         P                  ! VP                  \         P                  4      '       d2   VP                  4       pVP                  4       pVS) 8  d
   VS8:  d   K  \         P                  pK  	  V# r?   )
rK   r[   rj   r   r@   size
issubdtypeintegerrZ   min)rN   r]   r^   r@   arrminvalmaxval_limits   &&&   r;   r`   ra   v   s    HHE!L(HHEjjo99rxx'%88q=$]]399bjjAA%(WWYF%(WWYF%,66\;Q (HHE  Lr=   c                    < V P                  4       S8  d   \        R 4      hV P                  \        P                  4      # )zdowncast limited)rZ   AssertionErrorastyperK   intp)rr   downcast_maxvals   &r;   new_downcast_intp_index8with_64bit_maxval_limit.<locals>.new_downcast_intp_index   s0    wwy?*$%788::bgg&&r=   c           
      b  < . p\         P                  P                  \         P                  P                  \         P                  P                  \         P                  P
                  \         P                  P                  \         P                  P                  \         P                  P                  \         P                  P                  \         P                  P                  \         P                  P                  .
p V Fa  pVP                  VR \        VR R4      34       \        VR S
4       Sf   K5  VP                  VR\        VRR4      34       \        VRS	4       Kc  	  V ! V/ VB V F  w  rVpVf   K  \        WVV4       K  	  #   T F  w  rVpTf   K  \        YVT4       K  	  i ; i)r/   Ndowncast_intp_index)scipysparse_bsr_coo_csc_csr_dia_dok_lil_sputils_compressed
_constructrM   getattrsetattr)funcrO   kwbackupmodulesmodnameoldfuncry   rz   r`   s   &*,     r;   deco%with_64bit_maxval_limit.<locals>.deco   sS   <<$$ell&7&79J9J<<$$ell&7&79J9J<<$$ell&;&;<<++U\\-D-DF	0s$5&s,=tDF G.0CD".MM3(=#*30Et#L#N OC!68OP  >b>&,"7&Cw/ '-f"7&Cw/ '-s   2F 87F 
F.F.)rc   NF)rK   rj   randomRandomStater5   )	rt   r   rd   ry   assert_32bitr   rl   rz   r`   s	   f&ff& @@@r;   with_64bit_maxval_limitr   Y   s     xx| xx-	
 
	 	 		))''T'2	< 	<	* "	'
 0 0* Kr=   c                     \        V \        P                  4      '       g   \        V 4      '       d   V # V P	                  4       # r?   )rJ   rK   r	   r.   toarray)rO   s   &r;   r   r      s,    !RZZ  LOO99;r=   c                   P   a  ] tR t^t o R tR tR tR tR tR t	R t
R tR	tV tR
# )BinopTesterc                    R # matrix on the rightrc   selfmats   &&r;   __add__BinopTester.__add__       $r=   c                    R # r   rc   r   s   &&r;   __mul__BinopTester.__mul__   r   r=   c                    R # r   rc   r   s   &&r;   __sub__BinopTester.__sub__   r   r=   c                    R # matrix on the leftrc   r   s   &&r;   __radd__BinopTester.__radd__       #r=   c                    R # r   rc   r   s   &&r;   __rmul__BinopTester.__rmul__   r   r=   c                    R # r   rc   r   s   &&r;   __rsub__BinopTester.__rsub__   r   r=   c                    R # r   rc   r   s   &&r;   
__matmul__BinopTester.__matmul__   r   r=   c                    R # r   rc   r   s   &&r;   __rmatmul__BinopTester.__rmatmul__   r   r=   rc   N)__name__
__module____qualname____firstlineno__r   r   r   r   r   r   r   r   __static_attributes____classdictcell____classdict__s   @r;   r   r      s2     %%%$$$%$ $r=   r   c                   b   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V tR# )BinopTester_with_shapec                    Wn         R # r?   _shape)r   shapes   &&r;   __init__BinopTester_with_shape.__init__   s    r=   c                    V P                   # r?   r   r   s   &r;   r   BinopTester_with_shape.shape   s    {{r=   c                ,    \        V P                  4      # r?   )lenr   r   s   &r;   ndimBinopTester_with_shape.ndim   s    4;;r=   c                    R # r   rc   r   s   &&r;   r   BinopTester_with_shape.__add__   r   r=   c                    R # r   rc   r   s   &&r;   r   BinopTester_with_shape.__mul__   r   r=   c                    R # r   rc   r   s   &&r;   r   BinopTester_with_shape.__sub__   r   r=   c                    R # r   rc   r   s   &&r;   r   BinopTester_with_shape.__radd__   r   r=   c                    R # r   rc   r   s   &&r;   r   BinopTester_with_shape.__rmul__   r   r=   c                    R # r   rc   r   s   &&r;   r   BinopTester_with_shape.__rsub__   r   r=   c                    R # r   rc   r   s   &&r;   r   !BinopTester_with_shape.__matmul__   r   r=   c                    R # r   rc   r   s   &&r;   r   "BinopTester_with_shape.__rmatmul__   r   r=   r   N)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   s   @r;   r   r      sA      %%%$$$%$ $r=   r   c                   D   a  ] tR t^t o R tR tR tR tR tR t	Rt
V tR# )	ComparisonTesterc                    R # )eqrc   r   others   &&r;   __eq__ComparisonTester.__eq__       r=   c                    R # )nerc   r   s   &&r;   __ne__ComparisonTester.__ne__   r   r=   c                    R # )ltrc   r   s   &&r;   __lt__ComparisonTester.__lt__   r   r=   c                    R # )lerc   r   s   &&r;   __le__ComparisonTester.__le__   r   r=   c                    R # )gtrc   r   s   &&r;   __gt__ComparisonTester.__gt__   r   r=   c                    R # )gerc   r   s   &&r;   __ge__ComparisonTester.__ge__   r   r=   rc   N)r   r   r   r   r   r   r   r   r   r   r   r   r   s   @r;   r   r      s(      r=   r   c                   b   a  ] tR tRt o Rt]t]t]	t
]t]t]t]t]! ]4      tR tR tR tRtV tR# )_MatrixMixini	  z8mixin to easily allow tests of both sparray and spmatrixc                "   \        V P                  P                  ^4      P                  4       V P                  ^.R3,          4       \        V P                  P                  R4      P                  4       V P                  R.R3,          4       R#    NNNN)r   datspgetrowr   datr   s   &r;   test_getrow_MatrixMixin.test_getrow  sd    4::,,Q/779488QCF;KL4::,,R088:DHHbT1W<MNr=   c                "   \        V P                  P                  ^4      P                  4       V P                  R^.3,          4       \        V P                  P                  R4      P                  4       V P                  RR.3,          4       R# r  )r   r	  getcolr   r  r   s   &r;   test_getcol_MatrixMixin.test_getcol  sd    4::,,Q/779488AsF;KL4::,,R088:DHHQW<MNr=   c                   V P                  \        ^RR7      P                  ^^4      4      p\        VP	                  4       P
                  \        P
                  ! R4      4       \        VP	                  4       P                  VP                  4       \        VP                  R4      P	                  4       P
                  \        P
                  ! R4      4       \        VP                  R4      P	                  4       P
                  \        P
                  ! R4      4       VP	                  4       pVP	                  4       p\        W#J 4       R# )   r[   r@   float64int16float32
complex128N)
	spcreatorr   reshaper   asfptyper@   rK   formatrw   r   )r   rS   rT   Cs   &   r;   test_asfptype_MatrixMixin.test_asfptype  s    NN6!'2::1Q?@QZZ\''))<=QZZ\((!((3QXXg&//177)9LMQXXl+446<<bhh|>TUJJLJJLr=   rc   N)r   r   r   r   __doc__r   bsr_containerr   coo_containerr   csc_containerr   csr_containerr   dia_containerr   dok_containerr   lil_containerstaticmethodr0   asdenser  r  r  r   r   r   s   @r;   r  r  	  sK     BMMMMMMM8$GOO
 
r=   r  c                     a  ] tR tRt o Rt]t]t]	t
]t]t]t]t]t]t]R 4       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/R t0R t1]2Pf                  Ph                  R 4       t5R t6R t7R  t8R! t9R" t:R# t;R$ t<R% t=R& t>R' t?R( t@R) tAR* tBR+ tCR, tDR- tE]FR. 4       tG]FR/ 4       tH]FR0 4       tI]FR1 4       tJR2 tKR3 tL]FR4 4       tM]FR5 4       tNR6 tOR7 tPR8 tQR9 tRR: tSR; tTR< tUR= tVR> tWR? tXR@ tYRA tZRB t[RC t\RD t]RE t^RF t_RG t`RH taRI tbRJ tcRK tdRL teRM tfRN tgRO thRP tiRQ tjRR tkRS tlRT tmRU tnRV toRW tpRX tqRY trRZ tsR[ ttR\ tuR]tvV twR^# )__TestCommoni+  z6test common functionality shared by all sparse formatsc                   \        . RO. RO. RO.R4      V n        V P                  V P                  4      V n        \	        \
        4      P                  V P                  4      V n        / V n	        / V n
        V P                   Fb  pV P                  P                  V4      V P                  V&   V P                  V P                  P                  V4      4      V P                  V&   Kd  	  \        V P                  V P                  \        P                  ,          4       \        V P                  P                  4       V P                  \        P                  ,          P                  4       4       \!        V P                  \"        4      V n        R# )r  dN)r      r.  ri   )   r.  r  r.  )r.  ri   r.  r.  )r   r  r  r	  setr-   unionmath_dtypeschecked_dtypes
dat_dtypesdatsp_dtypesrw   r   rK   r  r   rJ   r*   is_array_test)clsr@   s   & r;   
init_class_TestCommon.init_class8  s    |\BCHMM#''*	
 !!1288I''E$'GGNN5$9CNN5!&)mmCGGNN54I&JCU# ( 	SWWcnnRZZ89SYY&&(%%bjj199;	= 'syy':r=   c                   a  V 3R  lp\        S \        4      '       d   \        P                  ! R4       S P                   F  pV! V4       K  	  R# )c                    < SP                   V ,          p\        \        \        V4       \	        SP                  ^..4      4       \	        SP                  ^ ..4      '       * 4       R# r  N)r5  assert_raises
ValueErrorboolr   r  )r@   r	  r   s   & r;   check$_TestCommon.test_bool.<locals>.checkQ  sL    %%e,E*dE2DNNQC5)*u--.r=   z%Cannot create a rank <= 2 DOK matrix.N)rJ   TestDOKpytestskipr3  r   r@  r@   s   f  r;   	test_bool_TestCommon.test_boolP  s;    	/ dG$$KK?@((E%L )r=   c                    \        R R..4      pV P                  V4      p\        ^
4       F  pW",           pW,           pK  	  \        WP	                  4       4       R# )TFN)r   r  ranger   r   )r   r  r	  _s   &   r;   test_bool_rollover_TestCommon.test_bool_rollover]  sN     dE]O$s#rAME)C  	30r=   c                  a  \        4       pVP                  \        4       V\        V 3R  l4       4       pS P                  P
                  R9  d   \        P                  ! R4       S P                   F  pV! V4       K  	  R# )c                 l  < S	P                   V ,          pS	P                  V ,          pVP                  4       p^ VR&   S	P                  V4      pS	P	                  V4      pS	P                  V4      pS	P                  V4      pS	P                  V4      p\        W8H  W$8H  P                  4       4       \        W8H  WT8H  P                  4       4       \        W8H  Wd8H  P                  4       4       \        W8H  Wt8H  P                  4       4       \        W8H  W8H  P                  4       4       \        W8H  WA8H  4       \        V^ 8H  V^ 8H  P                  4       4       \        V^8H  V^8H  P                  4       4       \        V\        P                  8H  V\        P                  8H  P                  4       4       R# r.  Nr  r.  )r4  r5  copyr  r!  r$  r#  r'  rD   r   rK   nan)
r@   r  r	  dat2datsp2datbsrdatcsrdatcscdatlilr   s
   &        r;   r@  "_TestCommon.test_eq.<locals>.checkl  si    //%(C%%e,E88:DDI^^D)F'',F'',F'',F'',F %S[5?2K2K2MN$S[63C2L2L2NO$S[63C2L2L2NO$S[63C2L2L2NO$S[63C2L2L2NO$S]FMB$SAX
/C/C/EF$SAX
/C/C/EF$SBFF]&+rvvo%>%>%@Br=   8Bool comparisons only implemented for BSR, CSC, and CSR.Nbsrcsccsr	r   filterr)   sup_complexr	  r  rC  rD  r3  r   supr@  r@   s   f   r;   test_eq_TestCommon.test_eqh  sm    !

*+			B 
 
	B4 ::$99KKRS((E%L )r=   c                  a  \        4       pVP                  \        4       V\        V 3R  l4       4       pS P                  P
                  R9  d   \        P                  ! R4       S P                   F  pV! V4       K  	  R# )c                   < S	P                   V ,          pS	P                  V ,          pVP                  4       p^ VR&   S	P                  V4      pS	P	                  V4      pS	P                  V4      pS	P                  V4      pS	P                  V4      p\        W8g  W$8g  P                  4       4       \        W8g  WT8g  P                  4       4       \        W8g  Wd8g  P                  4       4       \        W8g  Wt8g  P                  4       4       \        W8g  W8g  P                  4       4       \        W8g  WA8g  4       \        V^ 8g  V^ 8g  P                  4       4       \        V^8g  V^8g  P                  4       4       \        ^ V8g  ^ V8g  P                  4       4       \        ^V8g  ^V8g  P                  4       4       \        V\        P                  8g  V\        P                  8g  P                  4       4       R# rO  )r4  r5  rQ  r  r!  r#  r$  r'  rD   r   rK   rR  )
r@   r  r	  rS  rT  rU  rW  rV  rX  r   s
   &        r;   r@  "_TestCommon.test_ne.<locals>.check  s    //%(C%%e,E88:DDI^^D)F'',F'',F'',F'',F %S[5?2K2K2MN$S[63C2L2L2NO$S[63C2L2L2NO$S[63C2L2L2NO$S[63C2L2L2NO$S]FMB$SAX
/C/C/EF$SAX
/C/C/EF$Q#XU
/C/C/EF$Q#XU
/C/C/EF$SBFF]&+rvvo%>%>%@Br=   rZ  Nr[  r_  rb  s   f   r;   test_ne_TestCommon.test_ne  sm    !

*+			B 
 
	B8 ::$99KKRS((E%L )r=   c                   V P                   P                  R9  d   \        P                  ! R4       V P                   V P                   P                  8H  RJ g   Q hV P                   V P                   P                  8g  RJ g   Q hR# )r\  rZ  FTNr[  )r	  r  rC  rD  Tr   s   &r;   test_eq_ne_different_shapes'_TestCommon.test_eq_ne_different_shapes  s`    ::$99KKRS

djjll*u444

djjll*t333r=   c                  a  \        4       pVP                  \        4       V\        V 3R  l4       4       pS P                  P
                  R9  d   \        P                  ! R4       S P                   F  pV! V4       K  	  R# )c                 r  < SP                   V ,          pSP                  V ,          pVP                  4       p^ VR&   SP                  V4      pVP	                  \
        4      pRVR&   SP                  V4      pSP                  V4      pSP                  V4      pSP                  V4      p	SP                  V4      p
\        W8  W$8  P                  4       4       \        WS8  Wd8  P                  4       4       \        W8  Wt8  P                  4       4       \        W8  W8  P                  4       4       \        W8  W8  P                  4       4       \        W8  W8  P                  4       4       \        W18  WG8  P                  4       4       \        W18  WH8  P                  4       4       \        W18  WI8  P                  4       4       \        W18  WJ8  P                  4       4       \        W8  W#8  4       \        WS8  Wc8  4       R FU  p\        P                  ! V4      p\        W+8  P                  4       W8  4       \        W8  P                  4       W8  4       KW  	  \        P                  ! RR7      ;_uu_ 4        \        V\        P                  8  P                  4       V\        P                  8  4       RRR4       SP                   V ,          pSP                  V ,          pVP                  4       p^ VR&   SP                  V4      p\        W8  W#8  4       R#   + '       g   i     Ln; ir.  ignoreinvalidNrP        ?      ?)ri   r  r.  r  r4  r5  rQ  r  rw   complexr!  r#  r$  r'  rD   r   rK   rj   errstaterR  r@   r  r	  rS  rT  
datcomplexdatspcomplexrU  rW  rV  rX  valr   s   &           r;   r@  "_TestCommon.test_lt.<locals>.check  s    //%(C%%e,E88:DDI^^D)FG,J$JsO>>*5L'',F'',F'',F'',F %SZ%.1I1I1KL$Z%6&2&;%D%D%FH %SZ&/1J1J1LM$SZ&/1J1J1LM$SZ&/1J1J1LM$SZ&/1J1J1LM$TZ&/1J1J1LM$TZ&/1J1J1LM$TZ&/1J1J1LM$TZ&/1J1J1LM$SZ>$Z%68KL(hhsm(%+)>)>)@#)L(#+)>)>)@#)L )
 X..(%"&&.)A)A)C),rvv7 /
 //%(C%%e,E88:DDI^^D)F %S\5<@ /.   =L&&L6	rZ  Nr[  r_  rb  s   f   r;   test_lt_TestCommon.test_lt  sn    !

*+		2	A 
 
2	Ah ::$99KKRS((E%L )r=   c                  a  \        4       pVP                  \        4       V\        V 3R  l4       4       pS P                  P
                  R9  d   \        P                  ! R4       S P                   F  pV! V4       K  	  R# )c                 r  < SP                   V ,          pSP                  V ,          pVP                  4       p^ VR&   SP                  V4      pVP	                  \
        4      pRVR&   SP                  V4      pSP                  V4      pSP                  V4      pSP                  V4      p	SP                  V4      p
\        W8  W$8  P                  4       4       \        WS8  Wd8  P                  4       4       \        W8  Wt8  P                  4       4       \        W8  W8  P                  4       4       \        W8  W8  P                  4       4       \        W8  W8  P                  4       4       \        W18  WG8  P                  4       4       \        W18  WH8  P                  4       4       \        W18  WI8  P                  4       4       \        W18  WJ8  P                  4       4       \        W8  W#8  4       \        WS8  Wc8  4       R FU  p\        P                  ! V4      p\        W+8  P                  4       W8  4       \        W8  P                  4       W8  4       KW  	  \        P                  ! RR7      ;_uu_ 4        \        V\        P                  8  P                  4       V\        P                  8  4       RRR4       SP                   V ,          pSP                  V ,          pVP                  4       p^ VR&   SP                  V4      p\        W8  W#8  4       R#   + '       g   i     Ln; irq  rw  rz  s   &           r;   r@  "_TestCommon.test_gt.<locals>.check  s    //%(C%%e,E88:DDI^^D)FG,J$JsO>>*5L'',F'',F'',F'',F %SZ%.1I1I1KL$Z%6&2&;%D%D%FH %SZ&/1J1J1LM$SZ&/1J1J1LM$SZ&/1J1J1LM$SZ&/1J1J1LM$TZ&/1J1J1LM$TZ&/1J1J1LM$TZ&/1J1J1LM$TZ&/1J1J1LM$SZ>$Z%68KL(hhsm(%+)>)>)@#)L(#+)>)>)@#)L )
 X..(%"&&.)A)A)C),rvv7 /
 //%(C%%e,E88:DDI^^D)F %S\5<@ /.r  rZ  Nr[  r_  rb  s   f   r;   test_gt_TestCommon.test_gt  sn    !

*+		1	A 
 
1	Af ::$99KKRS((E%L )r=   c                  a  \        4       pVP                  \        4       V\        V 3R  l4       4       pS P                  P
                  R9  d   \        P                  ! R4       S P                   F  pV! V4       K  	  R# )c                   < SP                   V ,          pSP                  V ,          pVP                  4       p^ VR&   SP                  V4      pVP	                  \
        4      pRVR&   SP                  V4      pSP                  V4      pSP                  V4      pSP                  V4      p	SP                  V4      p
\        W8*  W$8*  P                  4       4       \        WS8*  Wd8*  P                  4       4       \        Wt8*  P                  4       W8*  4       \        W8*  P                  4       W8*  4       \        W8*  P                  4       W8*  4       \        W8*  P                  4       W8*  4       \        WG8*  P                  4       W18*  4       \        WH8*  P                  4       W18*  4       \        WI8*  P                  4       W18*  4       \        WJ8*  P                  4       W18*  4       \        W#8*  W8*  4       \        Wc8*  WS8*  4       R FU  p\        P                  ! V4      p\        W+8*  P                  4       W8*  4       \        W8*  P                  4       W8*  4       KW  	  SP                   V ,          pSP                  V ,          pVP                  4       p^ VR&   SP                  V4      p\        W8*  W#8*  4       R# r.  NrP  ru  )ri   r  r  rv  r4  r5  rQ  r  rw   rx  r!  r#  r$  r'  rD   r   rK   rj   rz  s   &           r;   r@  "_TestCommon.test_le.<locals>.check<  W    //%(C%%e,E88:DDI^^D)FG,J$JsO>>*5L'',F'',F'',F'',F %S[5?2K2K2MN$Z%7&2&<%E%E%GI %f&6%?%?%A3;O$f&6%?%?%A3;O$f&6%?%?%A3;O$f&6%?%?%A3;O$f&6%?%?%A4;O$f&6%?%?%A4;O$f&6%?%?%A4;O$f&6%?%?%A4;O$U]CK@$\%9:;MN%hhsm(%,)?)?)A3:N(#,)?)?)A3:N & //%(C%%e,E88:DDI^^D)F %S]EMBr=   rZ  Nr[  r_  rb  s   f   r;   test_le_TestCommon.test_le8  n    !

*+		-	C 
 
-	C^ ::$99KKRS((E%L )r=   c                  a  \        4       pVP                  \        4       V\        V 3R  l4       4       pS P                  P
                  R9  d   \        P                  ! R4       S P                   F  pV! V4       K  	  R# )c                   < SP                   V ,          pSP                  V ,          pVP                  4       p^ VR&   SP                  V4      pVP	                  \
        4      pRVR&   SP                  V4      pSP                  V4      pSP                  V4      pSP                  V4      p	SP                  V4      p
\        W8  W$8  P                  4       4       \        WS8  Wd8  P                  4       4       \        Wt8  P                  4       W8  4       \        W8  P                  4       W8  4       \        W8  P                  4       W8  4       \        W8  P                  4       W8  4       \        WG8  P                  4       W18  4       \        WH8  P                  4       W18  4       \        WI8  P                  4       W18  4       \        WJ8  P                  4       W18  4       \        W#8  W8  4       \        Wc8  WS8  4       R FU  p\        P                  ! V4      p\        W+8  P                  4       W8  4       \        W8  P                  4       W8  4       KW  	  SP                   V ,          pSP                  V ,          pVP                  4       p^ VR&   SP                  V4      p\        W8  W#8  4       R# r  r  rz  s   &           r;   r@  "_TestCommon.test_ge.<locals>.checkv  r  r=   rZ  Nr[  r_  rb  s   f   r;   test_ge_TestCommon.test_ger  r  r=   c                   \        V P                  R4      P                  4       \        R4      4       \        V P                  R4      P                  ^ 4       \        V P                  R4      P                  4       ^ 4       V P                  P                  R9   d9   \        V P                  R4      P                  ^ R7      \        . RO4      4       R# R# )r/  axisNr/  r/  coor^  r]  lilr.  r.  r.  )	r   r  r   r   nnzcount_nonzeror	  r  r   r   s   &r;   
test_empty_TestCommon.test_empty  s    T^^F+335uV}ET^^F+//3T^^F+99;Q?:: <</==1=EuYGWX =r=   c                   V P                   P                  R9   pV'       d   . ROMR.pV P                   V P                   P                  3 FN  pV FE  p\        P                  ! VP                  4       VR7      p\        VP	                  VR7      V4       KG  	  KP  	  V'       gA   \        \        RR7      ;_uu_ 4        V P                   P	                  ^ R7       RRR4       R# R#   + '       g   i     R# ; i)r  Nr  znot implemented .* formatmatchr  )Nr.  r  r  rv  )	r	  r  rl  rK   r  r   r   r=  NotImplementedError)r   axis_supportaxesrS   axexpecteds   &     r;   test_count_nonzero_TestCommon.test_count_nonzero  s    zz((,HH'3#$**djjll+A++AIIKbAQ__"_5x@  ,
 2:UVV

((a(0 WV VVVs   >C''C8	c                    \        \        V P                  R4       \        \        V P                  R4       \        \        V P                  R4       R# )r  Nr  r/  r/  r  r  r  )r=  r>  r  r   s   &r;   test_invalid_shapes_TestCommon.test_invalid_shapes  s2    j$..&9j$..&9j$..':r=   c                r   V P                  . RO. RO. RO.4      pVP                  R8X  d   RMVP                  R8X  d   RMRp\        VP                  ,          w  r4V P                  '       d   RMRpRV R	V R
VP                   RVP
                   RV RVP                   R2p\        V4      V8X  g   Q hR# )r  dia(1 diagonals) r\  (blocksize=1x1)  r   r1   < sparse  of dtype ''
	with  stored elements 
and shape >Nr  r.  r.  r  r.  r.  rv  )r  r  r,   r6  r@   r  r   reprr   r	  extrarJ  fmt
sparse_clsr  s   &      r;   	test_repr_TestCommon.test_repr  s    	9jAB % 5',||u'<# 	
 %,,' $ 2 2 2W
uHZLEKK= Aii[ 1%
5;;-qR 	 E{h&&&r=   c           	     v   V P                  \        P                  ! ^K4      P                  ^^4      4      pVP                  ^28X  g   Q h\        \        V4      P                  R4      4      ^68X  g   Q h\        P                  ! ^4      P                  ^^4      pV P                  V4      pVP                  R8X  d   ^MVP                  pV P                  V^R7      p\        \        V4      P                  R4      4      V^,           8X  g   Q h\        \        V4      P                  R4      4      ^
8X  g   Q hV P                  VR
RR^R7      pV P                  VR
RR^R7      p\        P                  ! \        RR7      ;_uu_ 4        V P                  VR
RR^4       R	R	R	4       R	#   + '       g   i     R	# ; i)K   
r  )maxprintiF)r   r@   rQ  r  z'positional argument|unpack non-iterabler  N)   r/  )r  rK   r   r  r  r   strsplitr  r  rC  r   	TypeError)r   r	  r  	nnz_small	datsp_mp6s   &    r;   test_str_maxprint_TestCommon.test_str_maxprint  sZ   ryy}44Q;<~~###3u:##D)*f444iim##Aa(s#,,%/BUYY	NN3N3	3u:##D)*i!m;;;3y>''-.%777 s&%RSTsFCC]]9,UVVNN3UA6 WVVVs   F''F8	c                   V P                  . RO. RO. RO.4      pVP                  ^8w  d   R# VP                  R8X  d   RMVP                  R8X  d   RMRp\        VP                  ,          w  r4V P                  '       d   RMRpR	V R
V RVP
                   RVP                   RV RVP                   R2p\        V4      V8X  g   Q hR# )r  Nr  r  r\  r  r  r   r1   r  r  r  r  r  r  z(>
  Coords	Values
  (0, 0)	1
  (2, 2)	-2r  r  r  )r  r  r  r,   r6  r@   r   r  r  s   &      r;   test_str_TestCommon.test_str  s    	9jAB99> % 5',||u'<# 	
 %,,' $ 2 2 2W
uHZLEKK= Aii[ 1%
5;;- P 	 5zX%%%r=   c                   Rp\         P                  ! R4      \         P                  ! R4      \         P                  ! R4      \         P                  ! R4      \         P                  ! R4      3 F  pV P                  WR7      pW3,           p^V,          pW3P                  4       ,          pW3P	                  4       ,          pW3P                  4       ,          pW4WVWx3 Fz  p	\        V	P                  4       VP                  4       VP                  4       ,          4       \        V	P                  V4       \        V	P                  4       P                  V4       K|  	  K  	  R# )	r  r[   r  r  	complex64r  r  Nr  r  )rK   r@   r  tocsctocsrtocoor   r   )
r   r   mytyperO   rU   cr-  efms
   &         r;   test_empty_arithmetic!_TestCommon.test_empty_arithmetic  s    xx("((9*=#RXXk%:&(F u3AAAAGGIAGGIAGGIA!a]QYY[!))+aiik*ABQWWV,QYY[..v6	 #(r=   c                    \        . RO. RO. RO. RO.R4      p\        \        V4      \        V P                  V4      4      P	                  4       4       R# )r  r-  Nr  r.     r.  r.  r  r.  r  )r   r   absr  r   r   rS   s   & r;   test_abs_TestCommon.test_abs  s<    ;
J	BCHSVS!23;;=>r=   c                    ^p\        RR.RR..R4      p\        \        P                  ! W!R7      \	        V P                  V4      VR7      P                  4       4       R# )	r  gQ?g     @1@r-  )decimals)ndigitsNggQ)r   r   rK   aroundroundr  r   )r   decimalrS   s   &  r;   
test_round_TestCommon.test_round  sP    E4=5%.137RYYq34>>!,g>FFH	Jr=   c                   \        . RO. RO. RO.R4      p\        \        P                  ! V^4      V P	                  V4      P                  ^4      P                  4       4       \        \        V P	                  V4      P                  V4       R# )   r-  N)r  rv  r  r.  r  ri   r/  r  )r   r   rK   powerr  r   r=  r  r  s   & r;   test_elementwise_power"_TestCommon.test_elementwise_power  sd    <Y7=RXXa^T^^A%6%<%<Q%?%G%G%IJ 	)4>>!+<+B+BAFr=   c                    \        . RO. RO. RO. RO.R4      p\        V) V P                  V4      ) P                  4       4       \        . RO. RO.4      p\	        \
        V P                  V4      P                  4       R# )	r  r-  Nr  r  r  r  )TFF)FFT)r   r   r  r   r=  r  __neg__r  s   & r;   test_neg_TestCommon.test_neg   se    ;
J	BCHaR4>>!,,5578 ')=>?)4>>!+<+D+DEr=   c                    \        RR..4      pV P                  V4      p\        VP                  P	                  4       VP                  4       R# r  N      ?      @y       @      )r   r  r   realr   r   DrS   s   &  r;   	test_real_TestCommon.test_real(  ;    FF#$%NN1QVV^^%qvv.r=   c                    \        RR..4      pV P                  V4      p\        VP                  P	                  4       VP                  4       R# r  )r   r  r   imagr   r  s   &  r;   	test_imag_TestCommon.test_imag-  r
  r=   c           
     >   . pVP                  . RO.4       VP                  ^.^ .^..4       VP                  ^ ^.^ ^.^ ^..4       VP                  . RO. RO. RO.4       VP                  ^^ .^ ^ ..4       VP                  \        V^ ,          ^^..4      4       VP                  \        V^ ,          ^.^..4      4       VP                  \        V^,          ^^.^^..4      4       VP                  \        V^,          ^^.^^..4      4       VP                  \        V^,          ^^.^^..4      4       VP                  \        V^,          . RO.4      4       V F  p\        V4      P                  w  r4V P	                  V4      p\        V) ^,
          V^,           4       F)  p\        VP                  VR7      \        W&R7      4       K+  	  \        VP                  ^
R7      \        V^
R7      4       \        VP                  RR7      \        VRR7      4       K  	  \        V P	                  R	4      P                  4       \        P                  ! ^(4      4       \        V P	                  R
4      P                  4       \        P                  ! ^ 4      4       \        V P	                  R4      P                  4       \        P                  ! ^ 4      4       \        V P	                  R4      P                  ^
4      \        P                  ! ^ 4      4       R# )r  kNr  r.  ri   r.  r.  r  )r.  r.  ri   r.  r/  r.  r  ri   r/  r  i)(   i?  r.  r.  )   r.  r.  r  )rM   r   r   r   r  rI  r   diagonalr   rK   r   empty)r   matsr  rowscols
sparse_matr  s   &      r;   test_diagonal_TestCommon.test_diagonal2  sg   WIaS!aSM"aUAa5!A'(WWW-.aUAa5M"Da1Q%)*Da1#qc+,Da1Q%1/0Da1Q%1/0Da1Q%1/0Da)-.AqJD*JD57DF+Z00105tA|D , ,,r,2DbMB,,s,3T!s^D  	T^^K099;RXXb\J 	T^^F+446DT^^G,557!ET^^F+44R8"((1+Fr=   c                   \         P                  ! . RO. RO. RO.4      pV P                  V4      p\        R^4       F/  p\	        VP                  VR7      VP                  VR7      4       K1  	  \         P                  ! . RO. RO.4      pV P                  V4      p\        R^4       F/  p\	        VP                  VR7      VP                  VR7      4       K1  	  R# )r  )offsetNr  ri   r/  r  r  r  )      	   rv  r  )rK   r   r  rI  r   trace)r   rS   rT   r  s   &   r;   
test_trace_TestCommon.test_traceS  s    HHiI67NN1r1A*AGG1G,=>  HHi+,NN1r1A*AGG1G,=> r=   c           
     $   V P                  . RO. R	O. R
O. RO.4      pR FT  pR FK  p\        VP                  W2R7      P                  4       VP                  4       P                  W2R7      4       KM  	  KV  	  V P                  . RO. RO. RO.4      pVP                  R4      p. RO. RO.p\        VP                  4       V4       VP                  R4      p\        VP                  4       V4       VP                  R4      p\        VP                  4       V4       \	        \
        VP                  R4       VP                  ^^4      p\        VP                  4       V4       \	        \        VP                  ^^^R7       VP                  R4      p\        WAJ 4       VP                  RRR7      p\        WAJ4       \        VP                  R4       V P                  '       d+   \	        \        RR7      ;_uu_ 4        RVn        RRR4       M!RVn        \        VP                  4       V4       \	        \
        VP                  VP                  34       \	        \
        VP                  ^VP                  ^34       R#   + '       g   i     L`; i)r  order)
not_an_argTrQ  zhas no setter|n't set attributer  N)r  r.  r&  r  r  )r.  r.  r  )r  F))   r  )r  r2  r.  
   r.  r.  r.  r.  r.  r.  r.        r  ri   r  )r.  r4  r.  r.  r.  r.  )r.  r.  r.  r7  r8  r  ri   r  )r  r  r  r/  r  )r  r   r  r   r=  r>  r  r   r   r6  AttributeErrorrn   )r   rA   r.  srB   desireds   &     r;   test_reshape_TestCommon.test_reshape`  s   NNIy)YGHE'"199Q9#<#D#D#F#$99;#6#6q#6#FH (   NNM<IJIIf&(=>199;0 IIg199;0IIg199;0j!))X6 IIaO199;0iAqQ? IIfIIf4I(
 	177F+~5VWW  XW AGqyy{G4 	j!))affY7j!))a^< XWs   =I??J	c                  a V3R  loV3R lp\         P                  P                  R4       . ROp\         P                  \         P                  3 F  pV F  w  rE\         P
                  ! V) ^,           V^,
          4      pV F}  p\         P                  ! WE3VR7      pV P                  WE3VR7      p	V! WV4       \         P                  P                  V\        \        V4      ^4      R7       F  p
V! WV
4       K  	  K  	  K  	  K  	  R# )c                   < \         P                  ! V4      pV^ 8  d   \        V P                  ^ ,          V P                  ^,          V,
          4      pVP                  ^ 8w  d   \        V\        V4      4      pVRV p\         P                  ! ^ V4      p\         P                  ! W"V,           4      pWWE3&   R# V^ 8  d   S! V P                  W) 4       R# R# r.  N)rK   r   rq   r   r   r   r   rl  )rO   vr  nr  jdense_setdiags   &&&   r;   rG  =_TestCommon.test_setdiag_comprehensive.<locals>.dense_setdiag  s    

1AAv
AGGAJN366Q;As1vA"1AIIaOIIaQ'!#Qacc1b) r=   c                   < R\        \        P                  ! W4      4      ^^3 EF9  pV^ 8  d+   \        P                  P	                  \        ^^4      4      pM"\        P                  P                  ^^VR7      pS! WV4       \        4       ;_uu_ 4       pVP                  \        R4       VP                  WB4       RRR4       \        P                  ! W4      p\        P                  ! V4      P                  ^ 8X  d   \        WdRR7       M2\        \        V4      \        V4      4      p\        VRV VRV RR7       \        VP                  4       V RR7       EK<  	  R#   + '       g   i     L; i)r  rn   zChanging the sparsity structuNz	{msg} {r}err_msgr  )r   rK   r   r   choicerI  rk   r   r`  r)   setdiagr   r   r   rq   r   )	rO   rU   r  rrD  rc  r-  rE  rG  s	   &&&     r;   check_setdiag=_TestCommon.test_setdiag_comprehensive.<locals>.check_setdiag  s    #bggam,a4q5		((q"6A		))!Ra)8AaA&&((CJJ68WXIIaO )
 GGAM::a=%%*&q[ACFCF+A&q!uae[I"199;;GG' 5 )(s   (E%%E5re   r  rJ  N)r  r  r.  r  r  r  r  r  )rK   r   rf   r   r  r   r   r  rM  rq   r   )r   rP  shapesr@   r  rE  ksr  rO   rU   k2rG  s   &          @r;   test_setdiag_comprehensive&_TestCommon.test_setdiag_comprehensive  s    	*	H2 			t4ggrzz*EYYr!tQqS)A!u5AvU;A!!* !ii..rCGQ.H%aB/ I   +r=   c                r   V P                  \        P                  ! ^4      4      pV P                  R4      p. ROp\        4       ;_uu_ 4       pVP	                  \
        R4       \        \        VP                  V^R7       VP                  V4       \        VP                  4       V4       VP                  V^R7       \        VP                  4       \        P                  ! . RO. RO. R	O.4      4       VP                  VR
R7       \        VP                  4       \        P                  ! . RO. RO. RO.4      4       VP                  R^R7       \        VP                  4       R,          ^	4       VP                  RR
R7       \        VP                  4       R,          ^	4       VP                  ^.^R7       \        VP                  4       ^ ,          . RO4       VP                  ^^.^R7       \        VP                  4       R,          . RO. RO.4       RRR4       R#   + '       g   i     R# ; i)r/  Changing the sparsity structurer  Nri   NNr  r  )r/  ri   r  )r/  r/  r.  )r.  ri   ri   r  rv  r/  r.  r  )r(  r.  ri   ri   r.  r.  r.  r  r.  )r.  r.  r.  r  )r  rK   r'   r   r`  r)   r=  r>  rN  r   r  r   r   )r   r  m2rI   rc  s   &    r;   test_setdiag_TestCommon.test_setdiag  s   NN266!9%^^F#  CJJ.0QR*aii1=IIfqzz|V4IIfI"qyy{BHHi6?6?6A -B C IIfI#qyy{BHHi6?6?6A -B C IIdaI qyy{3/3IIdbI!qyy{3/3JJsaJ rzz|A=JJ1vJ#rzz|B/,2>2@ A- !   s   GH%%H6	c                >   \        . RO. RO. RO.4      pV P                  V4      p\        VP                  4       4       Uu0 uF  p\	        V4      kK  	  pp\        VP                  4       4       Uu0 uF  p\	        V4      kK  	  pp\        WE4       R# u upi u upi r  Nr  r.  r  r.  r  r  r  )r   r  r
   nonzerotupler   r   rS   AspijA_nzAsp_nzs   &     r;   test_nonzero_TestCommon.test_nonzero  s{    9Yy12nnQ$-aiik$:;$:bb	$:;&/&>?&>%)&>?T" <?s   B2Bc                V   \        . RO. RO. RO.4      pV P                  V4      p\        \        P                  ! V4      4       Uu0 uF  p\        V4      kK  	  pp\        \        P                  ! V4      4       Uu0 uF  p\        V4      kK  	  pp\        WE4       R# u upi u upi rf  )r   r  r
   rK   ri  rj  r   rk  s   &     r;   test_numpy_nonzero_TestCommon.test_numpy_nonzero  s    9i34nnQ$-bjjm$<=$<bb	$<=&/

3&@A&@%)&@AT" >As   B!>B&c                  a a	 \         P                  P                  R 4       \         P                  ! . RO. RO. RO.4      p\         P                  P	                  ^^4      p\         P                  ! . .4      p\         P
                  ! R4      p\        P                  ! ^^RR7      P                  4       pWW4V.o	V	V 3R lpS P                   F&  p\        \        S	4      4       F  pV! Wx4       K  	  K(  	  R# )	re   g{Gz?)densityc           
        < SP                  SV,          V R 7      pSP                  W R 7      p\        P                  ! RR7      ;_uu_ 4        \	        VP                  4       VP                  4       4       \        VP                  4       P                  VP                  4       P                  4       \        \        P                  ! VP                  RR7      4      4       \	        VP                  RR7      VP                  RR7      4       \        VP                  RR7      P                  VP                  RR7      P                  4       \	        VP                  ^ R7      VP                  ^ R7      4       \        VP                  ^ R7      P                  VP                  ^ R7      P                  4       \	        VP                  ^R7      VP                  ^R7      4       \        VP                  ^R7      P                  VP                  ^R7      P                  4       \	        VP                  RR7      VP                  RR7      4       \        VP                  RR7      P                  VP                  RR7      P                  4       \	        VP                  RR7      VP                  RR7      4       \        VP                  RR7      P                  VP                  RR7      P                  4       \	        VP                  RR7      VP                  RR7      4       \        VP                  RR7      P                  VP                  RR7      P                  4       RRR4       R#   + '       g   i     R# ; i)r  rr  )overNr  rv  r  r.  r  )
r)  r  rK   ry  r   sumr   r@   r   isscalar)r@   rF  r  r	  matricesr   s   &&  r;   r@  #_TestCommon.test_sum.<locals>.check  s]   ,,x{%,8CNN3N4E(++)#'')UYY[ASWWY__eiik.?.?@EII4I$89:)#''t'*<eiiTi>RSSWW$W/55uyydy7K7Q7QR)#''q'/599!9;LMSWW!W_22EII1I4E4K4KL)#''q'/599!9;LMSWW!W_22EII1I4E4K4KL)#''r'*:EII2I<NOSWW"W-33UYYBY5G5M5MN)#''r'*:EII2I<NOSWW"W-33UYYBY5G5M5MN)#''v'*>		v	@VWSWW&W1779O9U9UV ,+++s   LM33N	Nr.  r  ri   r/  r  r  r&  r(  )r  r  )rK   r   rf   r   randr   r   r   r3  rI  r   )
r   dat_1dat_2dat_3dat_4dat_5r@  r@   rF  r|  s
   f        @r;   test_sum_TestCommon.test_sum  s    
		t)""$ % 		q!$""Aq$/779%6	W( ((E3x=)e * )r=   c                   \         P                  ! R	4      p\        . R
O. RO. RO.4      pV P                  V4      p\	        \
        RR7      ;_uu_ 4        VP                  ^R7       RRR4       \	        \
        RR7      ;_uu_ 4        VP                  RR7       RRR4       \	        \        RR7      ;_uu_ 4        VP                  RR7       RRR4       \	        \
        RR7      ;_uu_ 4        VP                  ^VR7       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     Lm; i  + '       g   i     R# ; ir  zaxis out of ranger  r  Nzaxis must be an integer      ?z&do.*n.t match.*shape|wrong.*dimensionsr  outr  r/  r~  r  r  r.  r/  )	rK   r   r   r  r=  r>  rz  r  meanr   r  r  r	  s   &   r;   test_sum_invalid_params#_TestCommon.test_sum_invalid_params  s    hhvY! " s#:-@AAII1I B:-@AAII6I" B9,EFFII3I G :-UVVJJA3J' WV BAAAFF WVVs0   D	D"=D51ED	"D2	5E	E	c                   aa \        . RO. RO. RO.4      oV P                  S4      oVV3R lpV P                   F  pV! V4       K  	  R# )r.  c                    < SP                  V R 7      pSP                  V R 7      p\        W4       \        VP                  VP                  4       R# r  N)rz  r   r   r@   )r@   dat_sum	datsp_sumr  r	  s   &  r;   r@  )_TestCommon.test_sum_dtype.<locals>.check1  s=    ggEg*G			.I%g9	8r=   Nr~  r  r  r   r  r3  r   r@  r@   r  r	  s   &  @@r;   test_sum_dtype_TestCommon.test_sum_dtype+  sH    Y! " s#	9 ((E%L )r=   c                T   V P                   '       * p\        . RO. R	O. R
O.4      pV P                  V4      pV P                   '       d   \        ^ 4      M\        ^ ..4      pV P                   '       d   \        ^ 4      M\        ^ ..4      pVP	                  WAR7       VP	                  VR7       \        WE4       V P                   '       d   \        P                  ! R4      M\        P                  ! R4      pV P                   '       d   \        P                  ! R4      M\        \        P                  ! R4      4      pVP	                  ^WAR7       VP	                  ^VR7       \        WE4       \        \        RR7      ;_uu_ 4        VP	                  \        ^ .4      R7       RRR4       \        \        RR7      ;_uu_ 4        TP	                  \        V P                   '       d   ^ ..M^ 4      R7       RRR4       R#   + '       g   i     Le; i  + '       g   i     R# ; i)r.  r  keepdimsr  r  r  r  r  zoutput parameterr  Nr~  r  r  r/  r/  r  )
r6  r   r  r1   rz  r   rK   r   r=  r>  r   keepr  r	  dat_out	datsp_outs   &     r;   test_sum_out_TestCommon.test_sum_out;  s   %%%Y! " s#"000%(eaSEl $ 2 2 2E!Hu	G+		i	 !'5$($6$6$6"((4.BHHV<L&*&8&8&8BHHTNfRXXfEU>V	QG3		qi	(!'5 :-?@@II%*I% A:-?@@II%);););!CID A@ A@@@@   	H2HH	H'	c                    \        . RO. RO. RO.4      pV P                  V4      p\        P                  ! V4      p\        P                  ! V4      p\	        W44       \        VP                  VP                  4       R# r.  Nr~  r  r  )r   r  rK   rz  r   r   r@   )r   r  r	  r  r  s   &    r;   test_numpy_sum_TestCommon.test_numpy_sumV  s]    Y! " s#&&+FF5M	!'5W]]IOO4r=   c                D   \        . RO. RO. RO.4      pV P                  V4      p\        VP                  4       4      '       g   Q hV P                  '       d   \
        M\        P                  p\        VP                  ^ R7      V4      '       g   Q h\        VP                  ^R7      V4      '       g   Q h\        VP                  4       4      '       g   Q h\        VP                  ^ R7      V4      '       g   Q h\        VP                  ^R7      V4      '       g   Q hR# r.  r  Nr~  r  r  )
r   r  r.   rz  r6  r	   rK   r1   rJ   r  )r   r  r	  matrix_or_arrays   &   r;   test_sum_mean_container_type(_TestCommon.test_sum_mean_container_typec  s    Y! " s#EIIK((((%)%7%7%7'RYY%)))+_====%)))+_====EJJL))))%**!*,o>>>>%**!*,o>>>>r=   c                p   a a S P                   '       * oVV 3R  lpS P                   F  pV! V4       K  	  R# )c                   < \        . RO. RO. RO.V R7      pSP                  WR7      p\        VP                  4       VP                  4       4       \	        VP                  4       P
                  VP                  4       P
                  4       \        \        P                  ! VP                  RR7      4      4       \        VP                  RSR7      VP                  RR7      4       \	        VP                  RR7      P
                  VP                  RR7      P
                  4       \        VP                  ^ SR7      VP                  ^ R7      4       \	        VP                  ^ R7      P
                  VP                  ^ R7      P
                  4       \        VP                  ^SR7      VP                  ^R7      4       \	        VP                  ^R7      P
                  VP                  ^R7      P
                  4       \        VP                  RSR7      VP                  RR7      4       \	        VP                  RR7      P
                  VP                  RR7      P
                  4       \        VP                  R	SR7      VP                  R	R7      4       \	        VP                  R	R7      P
                  VP                  R	R7      P
                  4       \        VP                  R
SR7      VP                  R
R7      4       \	        VP                  R
R7      P
                  VP                  R
R7      P
                  4       R# )r.  r  Nr  r  r  r~  r/  r  r  )r  r&  r(  rv  r  ry  )	r   r  r   r  r   r@   r   rK   r{  )r@   r  r	  r  r   s   &  r;   r@  $_TestCommon.test_mean.<locals>.checkt  su   ""$+02C NN3N4E%chhj%**,?))5::<+=+=>BKK


 567%dT2EJJDJ4I t,22EJJDJ4I4O4OP%a$/1C q)//1C1I1IJ%a$/1C q)//1C1I1IJ%b40%**"*2E r*00%**"*2E2K2KL%b40%**"*2E r*00%**"*2E2K2KL%ft4ejjfj6M v.44ejjfj6M6S6STr=   N)r6  r3  )r   r@  r@   r  s   f  @r;   	test_mean_TestCommon.test_meanr  s1    %%% 	UF ((E%L )r=   c                   V P                  \        P                  ! R	4      4      p\        . R
O. RO. RO.4      pV P	                  V4      p\        \        RR7      ;_uu_ 4        VP                  ^R7       RRR4       \        \        RR7      ;_uu_ 4        VP                  RR7       RRR4       \        \        RR7      ;_uu_ 4        VP                  RR7       RRR4       \        \        RR7      ;_uu_ 4        VP                  ^VR7       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     Lm; i  + '       g   i     R# ; ir  )	r)  rK   r   r   r  r=  r>  r  r  r  s   &   r;   test_mean_invalid_param#_TestCommon.test_mean_invalid_param  s    ll288F+,Y! " s#:-@AAJJAJ B:-@AAJJFJ# B9,EFFJJCJ  G :-UVVJJA3J' WV BAAAFF WVVs0   $DD1E ED.	1E	E	E(	c                   aa \        . RO. RO. RO.4      oV P                  S4      oVV3R lpV P                   F  pV! V4       K  	  R# )r.  c                    < SP                  V R 7      pSP                  V R 7      p\        W4       \        VP                  VP                  4       R# r  )r  r   r   r@   )r@   dat_mean
datsp_meanr  r	  s   &  r;   r@  *_TestCommon.test_mean_dtype.<locals>.check  s?    xxex,H%0J%h;)9)9:r=   Nr~  r  r  r  r  s   &  @@r;   test_mean_dtype_TestCommon.test_mean_dtype  sH    Y! " s#	; ((E%L )r=   c                T   V P                   '       * p\        . RO. R	O. R
O.4      pV P                  V4      pV P                   '       d   \        ^ 4      M\        ^ ..4      pV P                   '       d   \        ^ 4      M\        ^ ..4      pVP	                  WAR7       VP	                  VR7       \        WE4       V P                   '       d   \        P                  ! R4      M\        P                  ! R4      pV P                   '       d   \        P                  ! R4      M\        \        P                  ! R4      4      pVP	                  ^WAR7       VP	                  ^VR7       \        WE4       \        \        RR7      ;_uu_ 4        VP	                  \        ^ .4      R7       RRR4       \        \        RR7      ;_uu_ 4        TP	                  \        V P                   '       d   ^ ..M^ 4      R7       RRR4       R#   + '       g   i     Le; i  + '       g   i     R# ; i)r.  r  r  r  r  z"output parameter.*wrong.*dimensionr  Nr~  r  r  r  r  )
r6  r   r  r1   r  r   rK   r   r=  r>  r  s   &     r;   test_mean_out_TestCommon.test_mean_out  s   %%%Y! " s#"000%(eaSEl $ 2 2 2E!Hu	W,

y
!!'5$($6$6$6"((4.BHHV<L&*&8&8&8BHHTNfRXXfEU>V	aW4

y
)!'5 :-QRRJJ5!:J& S:-QRRJJ5$*<*<*<1#!DJE SR SRRRRr  c                    \        . RO. RO. RO.4      pV P                  V4      p\        P                  ! V4      p\        P                  ! V4      p\	        W44       \        VP                  VP                  4       R# r  )r   r  rK   r  r   r   r@   )r   r  r	  r  r  s   &    r;   test_numpy_mean_TestCommon.test_numpy_mean  s_    Y! " s#773<WWU^
!(7X^^Z%5%56r=   c                   \        . RO. RO. RO.\        4      pV P                  VR	\        R7      p\        P                  P                  V4      p\        . R
O. RO. RO.4      pV P                  VR	\        R7      p\        P                  P                  V4      p\        4       ;_uu_ 4       pVP                  \        R4       VP                  \        R4       VP                  \        R4       \        V4      P                  4       p\        V4      P                  4       p	RRR4       \        XV,
          \        R	4      4       \        X	V,
          \        R	4      4       R#   + '       g   i     LJ; i)r  r   r@   &splu converted its input to CSC formatCspsolve is more efficient when sparse b is in the CSC matrix format.spsolve requires A be CSC or CSR matrix formatNr  r.  r.  r/  r  r  r  r  )      @              ?)r         @r  )r  r  r  )r   floatr  r~   linalgr3   r   r`  r)   r   r   r   )
r   MsMMexpNsNNexprc  sMexpsNexps
   &         r;   	test_expm_TestCommon.test_expm  s   9i4e<^^AU%^8||  #<|<=^^AU%^8||  #  CJJ'8 JJ'U JJ'@ H$$&EH$$&E !  	"54<%-@!54<%-@# ! s   .A5E%%E5	c                @   a  V 3R  lp\         3 F  pV! V4       K  	  R# )c                   < \        . RO. RO. RO.V 4      p\        4       ;_uu_ 4       pVP                  \        R4       VP                  \        R4       VP                  \        R4       SP	                  VR	V R7      p\        V4      pRRR4       \        XP                  X4      P                  4       \        P                  ! ^4      4       \        \        \
        V4       R#   + '       g   i     Ld; i)
r  r  r  r  r  Nr  r  r  r  )r   r   r`  r)   r  r4   r   r   r   rK   r'   r=  r  )r@   r  rc  r  sMinvr   s   &    r;   r@  #_TestCommon.test_inv.<locals>.check   s    y)Z8%@A"$$

2KN

29; 

2CF^^AU%^@B % &eiim&;&;&=rvvayI)S!, %$s   A"C''C7	N)r  rE  s   f  r;   test_inv_TestCommon.test_inv  s    	- WE%L r=   c                t   \        . RO. RO. RO. RO.4      p\        V P                  V4      P                  4       V4       \        . RO. R	O. RO.4      p\        V P                  V4      P                  4       V4       \        V P                  VRR7      P                  4       VP	                  R4      4       R# 
r  r  r  Nr  r  )r.  r  r.  r  )r  r.  r.  )r.        @r.  )r   r   r  r   rw   r  s   & r;   test_from_array_TestCommon.test_from_array  s    7777344>>!,446:#"  	4>>!,446:4>>!7>;CCEahhwFWXr=   c                   V P                  . RO. RO. RO. RO.4      p\        V P                  V4      P                  4       V4       V P                  . RO. R	O. RO.4      p\        V P                  V4      P                  4       V4       \        V P                  VRR7      P                  4       VP	                  R4      4       R# r  )r)  r   r  todenserw   r  s   & r;   test_from_matrix_TestCommon.test_from_matrix  s    LL)Y	9EF4>>!,446:LL*)#% & 	4>>!,446:NN1GN,4468I	
r=   c                t   . RO. RO. RO. RO.p\        V P                  V4      P                  4       V4       . RO. R	O. RO.p\        V P                  V4      P                  4       \        V4      4       \        V P                  VRR7      P                  4       \        V4      P	                  R4      4       R# r  )r   r  r   r   rw   r  s   & r;   test_from_list_TestCommon.test_from_list)  s    WWW-4>>!,446: 	4>>!,446aANN1GN,446a8P	
r=   c                   \        . RO. RO. RO. RO.4      pV P                  V4      p\        V P                  V4      P	                  4       V4       V P                  V4      p\        V P                  V4      P	                  4       V4       \        . RO. R	O. RO.4      pV P                  V4      p\        V P                  V4      P	                  4       V4       \        V P                  VRR7      P	                  4       VP                  R4      4       V P                  V4      p\        V P                  V4      P	                  4       V4       \        V P                  VRR7      P	                  4       VP                  R4      4       R# r  )r   r$  r   r  r   rw   r   r  Ss   &  r;   test_from_sparse_TestCommon.test_from_sparse6  s3   777734q!4>>!,446:NN14>>!,446:#"  q!4>>!,446:4>>!7>;CCE88G,	.NN14>>!,446:4>>!7>;CCE88G,	.r=   c                   V P                   P                  4       p\        YP                  '       d   \        P
                  M\        P                  4      '       g   Q h\        WP                  4       \        VP                  P                  VP                  P                  8g  4       V P                   P                  R R7      p\        WP                  4       \        VP                  P                  4       \        VP                  P                  '       * 4       V P                   P                  RR7      p\        WP                  4       \        VP                  P                  '       * 4       \        VP                  P                  4       \        P                  ! V P                   P                  V P                   P                  R7      pV P                   P                  VR7      p\        V P                  V4       \        V P                  V4       \        P                   ! W4      '       g   Q hV P#                  \        P                  ! V P                   P                  V P                   P                  R7      4      pV P                   P                  VR7      p\        V P                  V4       \        V P                  V4       \        P                   ! W4      '       g   Q h\%        . RO.4      pW0P                  ,          pW0P                   P                  4       ,          p\        WE4       \%        . RO.4      P&                  pV P                  V,          pV P                   P                  4       V,          p\        WG4       V P)                  V P                  \*        R7      pV P                  P-                  \*        4      p	\        VP                  4       V	4       R# )r  r-  r1  r  r  Nr  r  r  r  r  r        @)r	  r  rJ   r6  rK   r	   r1   r   r  r   flagsc_contiguousf_contiguousr   r   r@   rR   r)  r   rl  r  r?  rw   )
r   chkr  rO   dense_dot_denser@  rU   check2spboolmatbools
   &         r;   test_todense_TestCommon.test_todenseN  s   jj  "#-?-?-?rzzRYYOOOO3)		&&#))*@*@@Ajj  s +3)		&&'CII***+jj  s +3)CII***+		&&'hhtzz''tzz/?/?@jj  S )488S)488S)""3,,,,ll288DJJ$4$4DJJ<L<LMNjj  S )488S)488S)""3,,,,:,hh,JJ&&((?2=/"$$((Q,##%)?35((//$'6>>+W5r=   c                n   \        V P                  4      pV P                  P                  4       p\	        W!4       \        VP                  P                  VP                  P                  8g  4       V P                  P                  R R7      p\	        W!4       \        VP                  P                  4       \        VP                  P                  '       * 4       V P                  P                  RR7      p\	        W!4       \        VP                  P                  '       * 4       \        VP                  P                  4       \        P                  ! V P                  P                  V P                  P                  R7      pV P                  P                  VR7       \	        W!4       RVR&   V P                  P                  VR7       \	        W!4       \        . RO4      p\        WA4      p\        W@P                  P                  4       4      p\	        WV4       \        . R	O4      p\        W4      p\        V P                  P                  4       V4      p\	        WX4       V P                  V P                  \         R7      p	VP#                  \         4      p
\	        V	P                  4       V
4       R# )
r  r-  r1  r  r  r  .Nr  r  )r   r  r	  r   r   r   r  r   r  rK   r   r   r@   r   r   r  r?  rw   )r   r  r  r  rO   r  r@  rU   r  r  arrbools   &          r;   test_toarray_TestCommon.test_toarrayw  s   dhhjj  "3$		&&#))*@*@@Ajj  s +3$		&&'CII***+jj  s +3$CII***+		&&'hhtzz''tzz/?/?@

s#3$C

s#3$*a+Azz))+,?2- c+TZZ'')1-?35**T"6>>+W5r=   c                  aa	 \        . RO. R	O. R
O.4      pV P                  V4      p\         EF=  pVP                  V4      pR Fo  pVP                  W5R7      o\	        SP
                  VP
                  4       \	        SP                  4       V4       \	        SP                  VP                  4       Kq  	  \        SP                  VRR7      SJ 4       SP                  VRR7      o	\        S	SJ4       VV	3R lpSP                  R9   d   R F  pV! V4       K  	  K  SP                  R8X  d   R F  pV! V4       K  	  EK  SP                  R8X  g   EK,  R F  pV! V4       K  	  EK@  	  R# )r  TFr0  c                    < \        SV 4      p\        SV 4      p\        W4       \        WJ4       RVP                  ,          pW#,          pW#,          '       * W#&   \        W,          W#,          8g  4       WBV&   R# )r.  Nr.  )r   r   r   r   )	attributerO   rU   r  b_iS_castedS_copieds   &    r;   (check_equal_but_not_same_array_attributeI_TestCommon.test_astype.<locals>.check_equal_but_not_same_array_attribute  sc    Hi0Hi0"1(
#166Md4x%!r=   r  r  Ny       @      @r.  r.  r.  y      @      @r.  r  )TFr^  r]  r\  )indicesindptrdata)rowcolr  )offsetsr  )	r   r  r-   rw   r   r@   r   r  r   )
r   r  r  rA   D_castedrQ  r  r  r  r  s
   &       @@r;   test_astype_TestCommon.test_astype  s3   ##  NN1!!Axx{H%88A81X^^X^^<X--/:X__ahh7	 & HOOAEO2h>?qt4HHH,-	 "77!>I<YG "?E)!7I<YG "8E)!4I<YG "5? "r=   c                   \        . RO. RO. RO.4      pV P                  V4      p\        VR4      '       d   RVP                  P                  n        VP                  R9   d7   RVP                  P                  n        RVP                  P                  n        \         FE  pVP                  V4      pVP                  V4      p\        VP                  VP                  4       KG  	  R# )r  r  FNr  r  r  r  )r   r  hasattrr  r  	writeabler  r  r  r-   rw   r   r@   )r   r  r  rA   r  r  s   &     r;   test_astype_immutable!_TestCommon.test_astype_immutable  s    ##  NN11f%*AFFLL"88,,',AHHNN$(-AIIOO%!Axx{Hxx{H8 "r=   c                J   a  V 3R  lpS P                    F  pV! V4       K  	  R# )c                    < SP                   V ,          pSP                  V ,          p\        V^,          V^,          P                  4       4       \        VR,          VR,          P                  4       4       R# ri   L1@Nr4  r5  r   r   r@   r  r	  r   s   &  r;   r@  *_TestCommon.test_mul_scalar.<locals>.check  sW    //%(C%%e,Es1uuQw&7&7&9:s4x%*)=)=)?@r=   Nr2  rE  s   f  r;   test_mul_scalar_TestCommon.test_mul_scalar  "    	A %%E%L &r=   c                J   a  V 3R  lpS P                    F  pV! V4       K  	  R# )c                    < SP                   V ,          pSP                  V ,          p\        ^V,          ^V,          P                  4       4       \        RV,          RV,          P                  4       4       R# r)  r+  r,  s   &  r;   r@  +_TestCommon.test_rmul_scalar.<locals>.check  sW    //%(C%%e,Equqw&7&7&9:tCx$u*)=)=)?@r=   Nr.  rE  s   f  r;   test_rmul_scalar_TestCommon.test_rmul_scalar  r1  r=   c                    V P                   \        P                  ,          p\        \        4      ;_uu_ 4        R V,           R R R 4       R #   + '       g   i     R # ; ir?   )r5  rK   r  r=  r  )r   r	  s   & r;   test_rmul_scalar_type_error'_TestCommon.test_rmul_scalar_type_error  s7    !!"**-9%%5L &%%%s   
AA	c                J   a  V 3R  lpS P                    F  pV! V4       K  	  R# )c                   < SP                   V ,          pSP                  V ,          pVP                  4       pR VR&   TpWC,           p\        WTP	                  4       V,           4       WDP                  4       ,           p\        VP	                  4       VP	                  4       VP	                  4       ,           4       WC^ ,          ,           p\        WTP	                  4       V^ ,          ,           4       R# r  Nr_  )r4  r5  rQ  r   r   r  r@   r  r	  rO   rU   r  r   s   &     r;   r@  #_TestCommon.test_add.<locals>.check  s    //%(C%%e,E
AAcFAAq))+/2GGIAqyy{ yy{QYY[8: aDAq))+!"45r=   Nr.  rE  s   f  r;   test_add_TestCommon.test_add  s!    	6$ %%E%L &r=   c                J   a  V 3R  lpS P                    F  pV! V4       K  	  R# )c                    < SP                   V ,          pSP                  V ,          pVP                  4       pR VR&   TpW4,           p\        WSVP	                  4       ,           4       R# r<  )r4  r5  rQ  r   r   r=  s   &     r;   r@  $_TestCommon.test_radd.<locals>.check  sS    //%(C%%e,E
AAcFAAqaiik/2r=   Nr.  rE  s   f  r;   	test_radd_TestCommon.test_radd  s!    	3 %%E%L &r=   c                   a  V 3R  lpS P                    F(  pV\        P                  ! R4      8X  d   K   V! V4       K*  	  R# )c                 z  < SP                   V ,          pSP                  V ,          p\        W",
          P                  4       \        P
                  ! R4      4       \        V^ ,
          P                  4       V4       SP                  \        P                  ! . RO. RO. RO.R4      4      p\        W#,
          P                  4       WP                  4       ,
          4       \        W2,
          P                  4       VP                  4       V,
          4       \        W!^ ,          ,
          W^ ,          ,
          4       R# )r/  r-  Nr;  r  r.  r.  r  r  r.  r.  r.  r.  r'  r.  r  )r4  r5  r   r   rK   r   r  r   r@   r  r	  rS   r   s   &   r;   r@  #_TestCommon.test_sub.<locals>.check  s    //%(C%%e,E668"((6:JK	224c:,}EsKA 	224cIIK6GH	224aiikC6GH u1v~sV|<r=   r?  Nr2  rK   r@   rE  s   f  r;   test_sub_TestCommon.test_sub  s5    	=  %%E((%L &r=   c                   a  V 3R  lpS P                    F(  pV\        P                  ! R4      8X  d   K   V! V4       K*  	  R# )c                   < SP                   V ,          pSP                  V ,          p\        W,
          . RO. RO. RO.4       \        W!,
          . RO. RO. RO.4       \        ^ V,
          P                  4       V) 4       SP	                  . RO. RO. RO.RR7      p\        W,
          WP                  4       ,
          4       \        W1,
          VP                  4       V,
          4       \        VP                  4       V,
          VP                  4       V,
          4       \        W#P                  4       ,
          WP                  4       ,
          4       \        V^ ,          V,
          V^ ,          V,
          4       R# )r.  r-  r  Nr5  rH  rI  rJ  )r4  r5  r   r   r  rK  s   &   r;   r@  $_TestCommon.test_rsub.<locals>.check.  s    //%(C%%e,Ei	)-LMi	)-LME	224sd;	*Z@sKA#		*;<!))+*;<qyy{U2AIIK#4EFuyy{2C))+4EF s1v~s1v|<r=   r?  NrM  rE  s   f  r;   	test_rsub_TestCommon.test_rsub-  s5    	=" %%E((%L &r=   c                J   a  V 3R  lpS P                    F  pV! V4       K  	  R# )c                   < SP                   V ,          pSP                  V ,          p\        V^ ,           P                  4       V4       \	        \        ^^4       Uu. uF  q3V,          NK  	  up4      p\	        \        ^^4       Uu. uF  q3V,          NK  	  up4      p\        VP                  4       V4       R# u upi u upi rC  )r4  r5  r   r   rz  rI  r   )r@   r  r	  r  sumSsumDr   s   &     r;   r@  $_TestCommon.test_add0.<locals>.checkG  s    //%(C%%e,E 	224c:5A;7;aE		;78Dq!5AC56D5 85s   B;C Nr.  rE  s   f  r;   	test_add0_TestCommon.test_add0F  s!    		6 %%E%L &r=   c                   \        . RO. RO.4      p\        . RO. RO.4      pV P                  V4      pV P                  V4      pVP                  R9   d   VP                  MRpVP                  V4      P                  V8X  g   Q h\	        VP                  V4      P                  4       W,          4       \	        VP                  V4      P                  4       W,          4       \        . RO. R	O.4      p\        . R
O. RO.4      pV P                  V4      pV P                  V4      p	\	        VP                  V	4      P                  4       Wg,          4       \	        VP                  V4      P                  4       Wg,          4       \	        VP                  V	4      P                  4       W,          4       \	        VP                  V4      P                  4       W,          4       R# )r  r^  N)r  r.  r(  )ri   r  r  )r.  r&  r.  )r.  r  r.  )r]  r  r\  y      ?       y              @y              y      @      y            @r  y      @       @y      @      y             ?y              y             @r(  )r   r  r  multiplyr   r   )
r   rS   rT   rl  Bspout_fmtr  r  CspDsps
   &         r;   test_elementwise_multiply%_TestCommon.test_elementwise_multiplyU  sa   78$%78$%nnQnnQ #

.C C#**S!))W444CLL-557=CLLO335qs; $^45$^45nnQnnQCLL-557=CLLO335qs; 	CLL-557=CLLO335qs;r=   c                T   \        ^.4      p\        R..4      p\        . RO4      p\        . RO.4      p\        ^.^.^..4      p\        . RO. RO. RO.4      p. ROp\        P                  ! R	4      pVP                  p	\        ^ ..4      p
\        ^^.^ ^...4      pV P	                  V4      pV P	                  V4      pV P	                  V4      pV P	                  V4      pV P	                  V4      pV P	                  VR
,          4      pV P	                  V	4      pV P	                  V	R,          4      pV P	                  V
4      pWW4WVWxWV.pWWVVVVV.	pV F]  pV FT  p VP                  4       VP                  4       ,          pTP                  T4      p\        TP                  4       T4       KV  	  K_  	  V Fo  pV Ff  p VP                  4       V,          p TP                  T4      p\        T4      '       d   \        TP                  4       T4       KZ  \        TT4       Kh  	  Kq  	  R#   \         d     \        \        TP                  T4        K  i ; i  \         d     K  \         d     \        \        TP                  T4        K  i ; i  \         d     K  i ; i)r  Nr  r  r.  )r&  r(  ri  )r'  r  r/  )r  r/  ri   )r  r  r  r$  r;  rC  r  r.  N)r   rK   onesrl  r  r   r>  r=  ra  r   r  r(   )r   rS   rT   r  r  Er1  GHJKLrb  re  EspFspHspHsppJspJsppKspr|  
spmatricesr  rF  
dense_multsp_mults   &                          r;   #test_elementwise_multiply_broadcast/_TestCommon.test_elementwise_multiply_broadcastm  s^   1#JB4&M(O8*A3sA3- 78G,-GGFOCCA3%LQqE1Q%=/" nnQnnQnnQnnQnnQ~~ai(nnQ~~ak*nnQ!aA!4#tS$D
 A!"qyy{!:J **Q-#GOO$5zB    A!"qJjjmG G$$'(9:F'<   " !*ajj!< ! ! !*ajj!<
 " sB   "%H1IJ1&IIJ,J5JJJ'&J'c           
        ^\         P                  \         P                  ^.^\         P                  ^\         P                  .\         P                  ^\         P                  \         P                  ..p\        \        V P                  V P                  ,          4      V4       V P                  . R	O. R
O. RO.RR7      p^\         P                  \         P                  R.R\         P                  \        \         P                  .\         P                  R\         P                  ^ ..p\        \        V P                  V,          4      V4       \        . RO. RO.4      p\        . RO. RO.4      pV P                  V4      pV P                  V4      p\        \        WV,          4      W4,          4       \        . RO. RO.4      p\        . RO. RO.4      pV P                  V4      pV P                  V4      p\         P                  ! RR7      ;_uu_ 4        \        \        WV,          4      W4,          4       RRR4       \        ^ ^.^^ ..4      p\        ^^ .^^ ..4      pV P                  V4      pV P                  V4      p\         P                  ! RRR7      ;_uu_ 4        \        \         P                  ! \        WV,          4      4      W4,          4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)r  r-  r        ?g      ?rr  )divideN)r  rt  rH  rI  rJ  r  r]  r^  r_  r`  r$  )r  ri   r  r~  )r.  rv  r/  )
rK   rR  r   r   r	  r  r   r   r   ry  )r   r  denomrS   rT   rl  rb  s   &      r;   test_elementwise_divide#_TestCommon.test_elementwise_divide  s%   rvvbffQ'rvva'VVAbffRVV,. 	74::

#:;XF	*Z@sKrvvbffS)s266*VVD*, 	74::#56A $^45$^45nnQnnQGCI.4 78$%78$%nnQnnQ[[))wsy1159 * Aa5!A- Aa5!A- nnQnnQ[[(;;rxx	(:;QUC <; *) <;;s   "K%%6K8%K5	8L		c                   \        . RO. RO. RO. RO.4      pV P                  V4      pV P                  '       d   R FM  pW#,          pW,          p\        VP	                  4       V4       \        VP                  VP                  4       KO  	  \        \        VP                  ^ 4       \        \        VP                  R4       V P                  VR,          4      p\        V^,          P	                  4       VP	                  4       4       R# R	 Fd  pW#,          p\        P                  P                  W4      p\        VP	                  4       V4       \        VP                  VP                  4       Kf  	  R
 F  p\        \        VP                  V4       K   	  V P                  VR,          4      p\        \        VP                  ^4       R# )r  Nr  r.  ri   r.  )r.  r/  r  r.  )r.  r  r.  r.  )r.  r  r&  r'  )r  ri   皙@r/  r  r  )Nr/  Nr  r.  r  ri   r/  )r  r  r  )r   r  r6  r   r   r   r@   r=  r  __pow__r>  rK   r  matrix_powerr  )r   rS   rT   exponentret_spret_nps   &     r;   test_pow_TestCommon.test_pow  sD   <|\JKNN10"6>>#3V<V\\6<<8	 1 -qyy!<*aii4 qw'A!Q$)199;7%//<"6>>#3V<V\\6<<8	 & .j!))X> . qw'A)QYY2r=   c                   V P                  . RO. RO. RO. RO.4      p\        . ROV,          \        . ROVP                  4       4      4       \	        . RO.4      p\        W!,          W!P                  4       ,          4       R# )r/  Nr/  r.  r.  r.  r  r.  ri   r.  r  ri   r/  r.  r  )r  r   r   r   r   )r   r  r  s   &  r;   test_rmatvec_TestCommon.test_rmatvec  sU    NNGGIg>?!)a-Y		1LMYK !#'3+<=r=   c                h   V P                  ^.^.^..4      p\        \        V\        ^4      ,          4      4       \	        V\        ^4      ,          P                  4       ^.^.^..4       \	        V\        ^.4      ,          \        . RO4      4       \	        V\        ^..4      ,          \        ^.^.^..4      4       \	        V\        P                  ! R4      ,          \        ^.^.^..4      4       \	        V\        P                  ! R4      ,          \        P                  ! R4      4       R# )r  Nr$  r  r  r  r.  r/  r.  )r  r   r(   r   r   r   rK   rl  r  s   & r;   test_small_multiplication%_TestCommon.test_small_multiplication  s    NNQCQC=)U1X&'a%(l++-aS1#?Qs^U9%56Qu%uqcA3_'=>Q(%!qcA3*@AQ("''&/:r=   c                j   \         P                  ! ^.^.^..4      pV P                  V4      pV P                  '       dd   \	        V\         P
                  ! R4      ,          P                  4       V4       \	        V\        ^..4      ,          P                  4       V4       R# \        V\        ^.4      ,          \        . RO4      4       \        V\        ^..4      ,          \        ^.^.^..4      4       \        V\         P
                  ! R4      ,          \         P
                  ! R4      4       R# )r  Nr  r$  r  r  )rK   r   r  r6  r   rl  r   r   )r   rS   rl  s   &  r;   -test_star_vs_at_sign_for_sparray_and_spmatrix9_TestCommon.test_star_vs_at_sign_for_sparray_and_spmatrix  s    HHqcA3_%nnQ%sRWWV_'<&E&E&GK%sUQC5\'9&B&B&DaHuaSz)5+;<uqcU|+UQC!qc?-CDrwwv.@r=   c                h   V P                  ^.^.^..4      p\        4       p\        W,           R4       \        W,
          R4       \        W,          R4       \        W!,           R4       \        W!,
          R4       \        W!,          R4       \        W,          R4       \        W!,          R4       R# )r  r   r   N)r  r   r   r   rS   rT   s   &  r;   test_binop_custom_type"_TestCommon.test_binop_custom_type
  s    
 NNQC!qc?+MQU01QU01QU01QU12QU12QU12QU01QU12r=   c                j   V P                  ^.^.^..4      p\        R4      p\        W,           R4       \        W,
          R4       \        W,          R4       \        W!,           R4       \        W!,
          R4       \        W!,          R4       \        W,          R4       \        W!,          R4       R# )r  r   r   Nr  )r  r   r   r  s   &  r;   !test_binop_custom_type_with_shape-_TestCommon.test_binop_custom_type_with_shape  s    NNQC!qc?+"5)QU01QU01QU01QU12QU12QU12QU01QU12r=   c                    ! R  R4      p^pV P                  ^.^.^..4      pV! V4      pW2,          pW4,          p\        VP                  4       VP                  4       4       \        VP                  VP                  4       R# )c                   ,   a  ] tR tRt o R tR tRtV tR# )0_TestCommon.test_mul_custom_type.<locals>.Customi)  c                    Wn         R # r?   scalar)r   r  s   &&r;   r   9_TestCommon.test_mul_custom_type.<locals>.Custom.__init__*  s    $r=   c                &    WP                   ,          # r?   r  r   s   &&r;   r   9_TestCommon.test_mul_custom_type.<locals>.Custom.__rmul__-  s    {{**r=   r  N)r   r   r   r   r   r   r   r   r   s   @r;   Customr  )  s     %+ +r=   r  N)r  rD   r   r   r  )r   r  r  rS   r  A_scalarA_cs   &      r;   test_mul_custom_type _TestCommon.test_mul_custom_type(  so    	+ 	+ NNQCQC=)6N:e !1!1!3S[[]CX__cjj1r=   c                    V P                  ^.^.^..4      p\        4       p\        W8H  R4       \        W8g  R4       \        W8  R4       \        W8  R4       \        W8  R4       \        W8*  R4       R# )r  r   r   r   r   r   r   N)r  r   r   r  s   &  r;   test_comparisons_custom_type(_TestCommon.test_comparisons_custom_type8  sl    NNQC!qc?+QVT"QVT"QUD!QVT"QUD!QVT"r=   c           	         V P                  \        . RO. RO. RO. RO.4      4      p^
pVP                  V4      pW,          p\        VP	                  4       VP	                  4       4       R# )r/  Nr  r  r  r  )r  r   r   r   r   )r   r  r  actualr  s   &    r;   test_dot_scalar_TestCommon.test_dot_scalarB  sQ    NN5'')G!DEFv:((*:*:*<=r=   c           	        V P                  \        . RO. RO. RO. RO.4      4      pV P                  \        ^ ^.^^ .^ ^..R4      4      p\        . RO.4      P                  p\        P                  p\        V! W4      VP                  4       V,          4       \        V! W4      P                  4       W,          P                  4       4       \        V! VP                  4       V4      W,          P                  4       4       \        V! WP                  4       4      W,          P                  4       4       \        \        WA^4       \        \        V^V4       R# )r/  r-  Nr  r  r  r  r$  )	r  r   rl  operatormatmulr   r   r=  r>  )r   r  rT   r  r  s   &    r;   test_matmul_TestCommon.test_matmulJ  s    NN5'')G!DEFNN51Q%1qe!4S9:WI  !&.!))+2CD 	"&,"6"6"815//:KL!&a"815//:KL!&IIK"815//:KL 	j&Q/j&!Q/r=   c           
        V P                  . RO. RO. RO. RO.4      p\        . RO.4      P                  p\        W,          VP	                  4       V,          4       \        V\        . RO4      ,          P                  R4       \        V\        ^.^.^..4      ,          P                  R4       \        V\        ^.^.^..4      ,          P                  R4       \        \        V\        . RO4      ,          \        4      4       V P                  '       d   \        M\        P                  p\        \        V\        . RO4      P                  ,          V4      4       \        ^^.4      \        . R	O4      \        ^.^..4      \        . RO4      \        ^.^..4      .pV F  p\        \        VP                  V4       K   	  \!        V\        . RO4      ,          \#        VP	                  4       . RO4      4       \!        V^.^.^..,          \        P$                  ! \#        VP	                  4       . RO4      4      P                  4       R# )
r/  Nr  r  r  r  r$  )r  )r  r  r  )r  r   rl  r   r   r   r   r1   r   rJ   r	   r6  rK   r=  r>  r   r   r   
atleast_2d)r   r  r  r  bad_vecsrA   s   &     r;   test_matvec_TestCommon.test_matvec\  s   NNGGIg>?WI  !!'199;+<= 	a%.(//5a%!aS!..55e<a&1#qc1#//66u= 	
1uW~-w78%)%7%7%7'RYY
1vg000/BC 1Q%L%	"2EA3s)4D7OVaS!I%68A*allA6 
 	AeGn,c!))+g.FGAsA3smOR]]3qyy{7;S-T-V-VWr=   c                d   \        . RO. RO. RO. RO.4      p\        . RO. RO. RO. RO.4      p\        ^ ^.^^ .^ ^..R4      pV P                  V4      pV P                  V4      p\        WE,          P	                  4       W,          4       \        WC,          W,          4       \        W,          W,          4       \        W%,          W,          4       VP                  4       pTpW,          p\        WF,          P	                  4       V4       \        WG,          V4       \        W,          V4       \        W&,          V4       VP                  4       p\        WF,          P	                  4       V4       \        WG,          V4       \        W,          V4       \        W&,          V4       VP                  4       p\        WF,          P	                  4       V4       \        WG,          V4       \        W,          V4       \        W&,          V4       ^p	Rp
\        P                  ! ^ 4       \        V	^34      p\        V	4       F>  p\        ^4       F,  p\        P                  ! 4       pW8  g   K   W,          WV3&   K.  	  K@  	  V P                  V4      pWP                  ,          p\        VP	                  4       VP	                  4       VP                  P	                  4       ,          4       \        VP	                  4       VP	                  4       VP	                  4       P                  ,          4       V P                  ^^.^^..4      pV P                  ^^.^^.^^..4      p\        \        VP                  V4       V P                   '       d   \        \        VP"                  V4       R# R# )r/  r-  g333333?Nr  r  r  r  )r1   r   r  r   r   r  r  r  r   rf   r   rI  rl  r=  r>  r   r6  r   )r   rO   a2rU   aspbspcspr  wantrr  fracrS   r  rF  rO  rT   s   &               r;   test_matmat_sparse_TestCommon.test_matmat_sparse{  s   GGIg67GGIg67QqE1Q%1&s+nnQnnQ!39"5"5"7?!#'151!!'151!"(AE2 iiku!39"5"5"7>!#'40!!'40!"(D1iik!39"5"5"7>!#'40!!'40!"(D1iik!39"5"5"7>!#'40!!'40!"(D1 A1Q%LqA1XMMO8VAcF   NN1G!!))+qyy{QSS[[]/JK!!))+qyy{QYY[]]/JK NNQqE1Q%=)NNQqE1Q%1./j!,,2*aii3 r=   c           	     v   . RO. RO. RO. RO.pV P                  V4      p\        ^^.^^.^^..4      \        ^^.^^.^^..4      .pV Fk  pW$,          p\        \	        YPP
                  '       d   \        M
\        V4      4      4       \        VP                  R4       \        V\        W4      4       Km  	  R# )r/  Nr  r  r  r  r  ri   )r  r   r1   r   rJ   r6  r	   typer   r   r   )r   rO   r  bsrU   results   &     r;   test_matmat_dense_TestCommon.test_matmat_dense  s    WYw/nnQ aUAa5!A'(&1Q%1qe1D*EFAWFJv2D2D2Dw$q'RSu-Q*	 r=   c                @   \         P                  ! . RO. RO. RO.^^.^ ^..4      pVP                  4       pV P                  V4      pR F  pVP	                  V4      p\        VP                  V4       \        VP                  4       V4       V P                  VR,           4      P	                  V4      p\        VP                  V4       \        VP                  4       VR,           4       V P                  V4      P	                  V4      p\        VP                  V4       \        VP                  4       V4       K  	  R FX  pVP	                  V4      p\        WB4       V P                  VR,           4      P	                  V4      p\        WRR,           4       KZ  	  R# )r                @Nr  r.  r/  r  )r  r.  r.  )r\  r  r]  r^  r  rE   r  )r   dense)r   r   r   r  asformatr   r  r   )r   rS   r  r  rO   rU   r  s   &      r;   test_sparse_format_conversions*_TestCommon.test_sparse_format_conversions  s6   KK1QqE1Q%=AIIKNN1AF

6"A&)qyy{A.qt$--f5A&)qyy{AbD1q!**62A&)qyy{A. B )F

6"Aq$qt$--f5AqB$' )r=   c           	     (   \        . RO. RO. RO.4      p\        . RO. RO.4      p\        W4      pV P                  V4      pR	 FJ  p\        VRV,           4      pR
 F.  pR F%  p\	        V! Wx3R7      P                  4       V4       K'  	  K0  	  KL  	  R# )r  to	blocksizeNr  r5  r.  r.  r  r  r~  r/  r.  r  )r\  )r  ri   r/  r  )r  ri   r/  r  r  r2  )r   r   r  r   r   r   )	r   rA   rB   rS   rl  r  fnXYs	   &        r;   
test_tobsr_TestCommon.test_tobsr  s    9Yy1277#$InnQFdVm,B!,A qf!5!=!=!?C - " r=   c                  a a S P                   p\        P                  ! . .4      pW.oVV 3R  lpS P                  R4      p\	        \        P
                  ! V4      P                  4       \        P
                  ! \        R4      4      4       \	        VP                  P                  4       \        R4      4       \        \        VP
                  ^ R7       S P                   F&  p\        \        S4      4       F  pV! WV4       K  	  K(  	  R# )c                   < \        SV,          V R 7      pSP                  V4      pVP                  4       pVP                  4       p\        VP	                  4       V4       \        VP                  4       P	                  4       V4       \        VP                  RR7      P	                  4       V4       \        VP                  VP                  4       R# )r  r  Nr  )r   r  r
   r   r   r   r@   )r@   rF  r  r	  rO   rU   r|  r   s   &&    r;   r@  )_TestCommon.test_transpose.<locals>.check  s    51CNN3'E!AAqyy{A.q{{}446<uF;CCEqI!''*r=   r  Nr;  r  r/  )r  rK   r   r  r   r
   r   r   rl  r=  r>  r3  rI  r   )r   r  r  r@  r  r@   rF  r|  s   f      @r;   test_transpose_TestCommon.test_transpose  s    ">
	+ v&2<<.668<<f6	8577??,eFm<j%//:((E3x=)e * )r=   c                J   a  V 3R  lpS P                    F  pV! V4       K  	  R# )c                    < SP                   V ,          pSP                  V ,          pW,           p\        W1V,           4       W!,           p\        WAV,           4       R # r?   )r4  r5  r   r@   r  r	  sum1sum2r   s   &    r;   r@  )_TestCommon.test_add_dense.<locals>.check  sI    //%(C%%e,E ;Dt3Y/;Dt3Y/r=   Nr.  rE  s   f  r;   test_add_dense_TestCommon.test_add_dense  s!    	0 %%E%L &r=   c                   a  V 3R  lpS P                    F(  pV\        P                  ! R4      8X  d   K   V! V4       K*  	  R# )c                   < SP                   V ,          pSP                  V ,          pVP                  \        8X  d7   W,
          p\	        W1V,
          4       W!,
          p\	        WAV,
          4       R # W,           V,           V,
          p\	        W1V,           4       W",           V,           V,
          p\	        WAV,           4       R # r?   )r4  r5  r@   r?  r   r  s   &    r;   r@  )_TestCommon.test_sub_dense.<locals>.check  s    //%(C%%e,E yyD {"4s3{"4s3 	C50"4s3-4"4s3r=   r?  NrM  rE  s   f  r;   test_sub_dense_TestCommon.test_sub_dense  s5    	4$ %%E((%L &r=   c           	       a aaa \         P                  ! . RO. RO. RO.4      o\         P                  ! . RO. RO. RO.4      o\         P                  ! . RO. R	O. R
O.4      oVVVV 3R lpS P                   Ft  p\         P                  \         P                  \         P
                  3 F>  pR F5  pV! \         P                  ! V4      \         P                  ! V4      V4       K7  	  K@  	  Kv  	  R# )r  c                   < \         P                  ! V \         P                  4      '       d"   SP                  SP	                  V 4      4      pM SP                  S
P	                  V 4      4      pVR 8X  d   VP                  ^4      pMdVR8X  d   VP                  R4      pMKVR8X  d   SP	                  V4      pM2VR8X  d"   SP                  SP	                  V4      4      pM
\        4       h\        4       ;_uu_ 4       pVP                  \        R4       VP                  V4      pVP                  V4      pRRR4       \         P                  ! \        V4      \        V4      4      p\        \        X4      V4       \        VP                  VP                  4       \         P                  ! \        V4      \        V4      4      p	\        \        X4      V	4       \        VP                  V	P                  4       R#   + '       g   i     L; i)r  scalar2r  r   zTTaking (maximum|minimum) with a (positive|negative) number results in a dense matrixNr  )rK   ro   complexfloatingr  rw   r  r>  r   r`  r)   maximumminimumr   r   r   r@   )r@   dtype2btyperS   rT   rc  max_smin_smax_dmin_dA_denseA_dense_cpxB_denser   s   &&&       r;   r@  /_TestCommon.test_maximum_minimum.<locals>.check0  sl   }}UB$6$677NN;#5#5e#<=NN7>>%#89 KKN)#KKO'!NN6*("NN7>>&#9: l""$$

278 		!		! % JJwqz71:6Ewu~u5ekk2JJwqz71:6Ewu~u5ekk2 %$s   =9G<<H	N)r  r.  r/  )r.  r  r  r  )r  r  ri   )r.  r/  r  rj  )r.  y      @       @r  )r.                ?y             )r  r  r  r   )rK   r   r2  r   r  r  r@   )r   r@  r@   r  r  r	  r
  r  s   f    @@@r;   test_maximum_minimum _TestCommon.test_maximum_minimum*  s    ((Iy)<=((Iy*=>hh	<FG	3 	3@ %%E77BJJ>EE"((5/288F+;UC F ? &r=   c                   V P                   p\        VP                  4       P                  VP                  4       \        VP	                  VR R7      P                  VP                  4       \        VP	                  VRR7      P                  VP                  4       \        VP                  4       P                  4       VP                  4       4       \        VP	                  VR R7      P                  4       VP                  4       4       \        VP	                  VRR7      P                  4       VP                  4       4       \        VRVP                  ,           4      p\        V! 4       VJ 4       \        V! RR7      VJ 4       \        V! R R7      P                  VP                  4       \        V! R R7      P                  4       VP                  4       4       \        \        VP                  4       V4      '       * 4       R# )Tr0  Fr  N)	r	  r   rQ  r  	__class__r   r   r   rV   )r   rS   toselfs   &  r;   	test_copy_TestCommon.test_copyU  sZ   JJ 	QVVX__ahh/Q[[[-44ahh?Q[[[.55qxx@QVVX%%'5Q[[[.668!))+FQ[[[/779199;G 4!((?+AE"a'(V&--qxx8V&..0!))+> 	+AFFHa889r=   c                    V P                  \        P                  ! ^24      P                  ^^
4      4      pV P	                  V4      p\        W!4       F  w  r4\        VP                  4       V4       K!  	  R# )2   N)r)  rK   r   r  r  zipr   r   )r   rT   rS   rA   rB   s   &    r;   test_iterator_TestCommon.test_iteratorm  sS    LL2..q"56NN1IDAa( r=   c                v   \        . 4      pVP                  R4      pVP                  R4      pVP                  R4      pVP                  R4      pVP                  R4      p\        P                  ! ^^.4      pV P	                  V4      pV P	                  V4      p	V P	                  V4      p
V P	                  V4      pV P	                  V4      pV P	                  V4      p\        VP                  V4      P                  4       \        P                  ! W"4      4       \        V	P                  V4      P                  4       \        P                  ! W54      4       \        VP                  V	4      P                  4       \        P                  ! WS4      4       \        V
P                  V4      P                  4       \        P                  ! WF4      4       \        V
P                  V4      P                  4       \        P                  ! WG4      4       \        VP                  V
4      P                  4       \        P                  ! Wd4      4       \        VP                  V
4      P                  4       \        P                  ! WT4      4       \        VP                  V4      P                  4       \        P                  ! Wv4      4       \        \        VP                  V4       \        \        VP                  V4       \        VP                  V4      P                  4       \        P                  ! W"4      4       \        V	P                  V	4      P                  4       \        P                  ! W34      4       \        VP                  V4      P                  4       \        P                  ! WU4      4       \        VP                  V4      P                  4       \        P                  ! W"4      4       \        V	P                  V4      P                  4       \        P                  ! W34      4       \        VP                  V4      P                  4       \        P                  ! WU4      4       \        VP                  ^4      P                  4       \        P                  ! V^4      4       \        V	P                  ^4      P                  4       \        P                  ! V^4      4       \        VP                  ^4      P                  4       \        P                  ! V^4      4       \        \        VP                  V4       \        \        VP                  V4       \        VP                  V4      P                  4       VP                  V4      4       \        V	P                  V	4      P                  4       VP                  V4      4       \        VP                  V4      P                  4       VP                  V4      4       \        \        VP                  V4       \        \        V	P                  V4       R# )r.  Nr  ry  r  r  rR  )r   r  rK   rl  r  r   r   r   r=  r>  ra  r   )r   r   rO   rU   r  r-  r  r  r  r  r  dspespfsps   &             r;    test_size_zero_matrix_arithmetic,_TestCommon.test_size_zero_matrix_arithmetict  s    BiKKKKKKKKKKGGQFOnnQnnQnnQnnQnnQnnQ 	3773<//1266!<@3773<//1266!<@3773<//1266!<@3773<//1266!<@3773<//1266!<@3773<//1266!<@3773<//1266!<@3773<//1266!<@ 	j#''1-j#''1- 	3<<,446A8IJ3<<,446A8IJ3<<,446A8IJ3<<?224bkk!6GH3<<?224bkk!6GH3<<?224bkk!6GH3<<?224bkk!Q6GH3<<?224bkk!Q6GH3<<?224bkk!Q6GH 	j#,,2j#,,2 	3;;s+335qyy|D3;;s+335qyy|D3;;s+335qyy|D 	j#++s3j#++s3r=   c                   \        . 4      pVP                  R4      pVP                  R4      pVP                  R4      pW#V3 EF  pV P                  V4      p\        VP	                  4       P                  4       V4       \        VP                  4       P                  4       V4       \        VP                  4       P                  4       V4       \        VP                  4       P                  4       V4       \        VP                  4       P                  4       V4       \        VP                  4       P                  4       V4       EK  	  R# )r.  Nr  r  rR  )r   r  r  r   r  r   r  r  toliltodoktobsr)r   r   rO   rU   r  r  spms   &      r;   test_size_zero_conversions&_TestCommon.test_size_zero_conversions  s    BiKKKKKKA..#Csyy{224a8syy{224a8syy{224a8syy{224a8syy{224a8syy{224a8 r=   c                   \         P                  ! . RO. RO.\         P                  R7      p\        \        RR7      ;_uu_ 4        V P                  V4       RRR4       V P                  VP                  \         P                  4      4      p\        \        RR7      ;_uu_ 4        V P                  V\         P                  R7       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)      @r  zdoes not support dtyper  N)r(  r.  g?r  )rK   r   float16r=  r>  r  rw   r  )r   rO   A32s   &  r;   test_dtype_check_TestCommon.test_dtype_check  s    HHmY/rzzB:-EFFNN1 G nnQXXbjj12:-EFFNN3bjjN1 GF	 GF GFFs   C'"C&C#	&C7	c                v   a a ^ RI o\        4       pVP                  \        4       VVV 3R l4       pV! 4        R# )r.  Nc                  N  < SP                   P                  4       p \        SP                  4       EFo  pSP	                  SP                  WR 7      4      p\        V P                  VP                  4       \        V P                  4       VP                  4       4       \        V P                  VP                  4       V P                  P                  4        F  w  r4\        V\        P                  4      '       d   \        WBP                  V,          4       KC  \        V\         4      '       dN   V'       dF   \        V^ ,          \        P                  4      '       d   \        WBP                  V,          4       K  \#        WBP                  V,          8H  4       K  	  EKr  	  R# ))protocolN)r	  rQ  rI  HIGHEST_PROTOCOLloadsdumpsr   r   r   r   r  rH   itemsrJ   rK   r	   rj  r   )r	  r/  sploadedkeyr}  pickler   s        r;   r@  &_TestCommon.test_pickle.<locals>.check  s
   JJOO%E!&"9"9:!<<U(NOU[[(..9"5==?H4D4D4FGU\\8??; !& 4 4 6HC!#rzz22*30A0A#0FG$S%00S(Q<<*30A0A#0FG'8'8'= => !7 ;r=   )r6  r   r`  r)   )r   rc  r@  r6  s   f  @r;   test_pickle_TestCommon.test_pickle  s4    !

*+		? 
	?( 	r=   c                6   a  V 3R  lpR F  pV! V4       K  	  R# )c                   < V R 8X  d   \         P                  ! R4       SP                  P                  R9   d   \         P                  ! R4       \	        \
        V 4      pSP                  \
        P                  ! ^4      P                  ^^4      R,          4      pV! VP                  4       4      pV! V4      p\        VP                  4       V4       R# )signz2sign conflicts with comparison op support on Numpyz%Unary ops not implemented for dok/lil      4@N)rE   r  )rC  rD  r	  r  r   rK   r  r   r  r   r   )r   ufuncr  X0X2r   s   &    r;   r@  5_TestCommon.test_unary_ufunc_overrides.<locals>.check  s    v~ / 0zz  N2CDB%Eryy}44Q:S@AAqyy{#BqBrzz|R0r=   N)sintanarcsinarctansinhtanharcsinharctanhrintr<  expm1log1pdeg2radrad2degfloorceiltruncsqrtr  rc   )r   r@  r   s   f  r;   test_unary_ufunc_overrides&_TestCommon.test_unary_ufunc_overrides  s    	1D $K	r=   c                   \         P                  ! . RO. RO. RO.4      pV P                  V4      p\        VP	                  R4      RJ 4       \        VP                  4       ^^ .^^ .^^ ..4       VP	                  R4       \        VP                  4       ^^ .^^ ..4       VP	                  R4       \        VP                  4       ^^ .^^ .^ ^ ..4       VP	                  R4       \        VP                  4       . RO. R	O. R
O.4       VP	                  R4       \        VP                  4       . RO. R	O. R
O.4       VP	                  ^^4       \        VP                  4       ^^ .^^ .^ ^ ..4       V P                  '       d$   VP                  R9   d   VP	                  ^4       M&\        \        \        \        3VP                  ^4       R F  p\        \        VP                  V4       K   	  R# )r  Nr  r.  r/  r  ri   r.  r.  r.  r/  r.  r.  r.  r/  ri   ri   ri   r  r  )ri   r.  r.  r  )r  r^  ))r  ri   r:  r$  )rK   r   r  r   resizer   r   r6  r  r=  r>  r  
IndexError)r   r  r  	bad_shapes   &   r;   test_resize_TestCommon.test_resize  s   HHl""$ % NN1 D()199;!Q*+Q*+Q)1 	2 	
199;!Q*+Q)1 	2	199;!Q*+Q*+Q)1 	2 	
199;)2)2)4 	5 	
199;)2)2)4 	5
 	
A199;!Q*+Q*+Q)1 	2 !((n"<HHQK:':JGSTU6I*ahh	: 7r=   c                P   V P                   pVP                  pVP                  VR R7      p\        VP	                  4       VP	                  4       4       V\
        9  d   \        \        W4      4       VP                  WP                  R R7      p\        VP	                  4       VP	                  4       4       V\
        9  d   \        \        W4      4       VP                  V\        P                  R R7      p\        VP	                  4       VP	                  4       4       VP                  VRR7      p\        VP	                  4       VP	                  4       4       \        \        W4      '       * 4       R F  pWB8X  d   K  VP                  V4      pVP                  VR R7      p\        VP	                  4       VP	                  4       4       VP                  VRR7      p\        VP	                  4       VP	                  4       4       \        \        WS4      '       * 4       K  	  R# )Fr0  )r@   rQ  TN)r^  r]  r  r  rE   r  )r	  r  r  rD   r   NON_ARRAY_BACKED_FORMATSr   rV   r@   rK   r  r   r  )r   rS   self_formatr  other_formatrT   s   &     r;   test_constructor1_base"_TestCommon.test_constructor1_base 	  s   JJhhKKK& aiik:66+A12KKuK5 aiik:66+A12KK%K8199;		4KKK% aiik:+A112FL*

<(AAE*A$QYY[!))+>AD)A$QYY[!))+>/556 Gr=   rc   N)xr   r   r   r   r   r-   r2  r&   r!  r#   r"  r    r#  r!   r$  r%   r%  r"   r&  r$   r'  r   r)  classmethodr8  rF  rK  rd  ri  rm  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r   r*  r?  rC  markslowrX  rc  rp  rs  r  r  r  r  r  r  r  r  r  r  r  r  r  ra  r  r  r  r  r  r  r   r%  r/  r5  r8  r?  rD  rN  rS  rZ  rf  r}  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r%  r+  r8  rS  r^  rd  r   r   r   s   @r;   r+  r+  +  s    @"KMMMMMMMG; ;.	1#J%N4=~<|8t8tY1;
'7(&(7$?JGF/
/
GB?-=^ [[40 40lA<##! F(" E65?&P(" F67A8$ Y Y 

 

 

 

 . ..'6R#6J &H &HP 9 9		
,02<08=t!DF3B>
;A3"32 #>0$X>64p+(2
D 86)DV:0)84t928*';R7 7r=   r+  c                   8   a  ] tR tRt o R tR tR tR tRtV t	R# )_TestInplaceArithmeticiB	  c                   \         P                  ! R4      pV P                  V4      pVP                  4       pVP                  4       pW1,          pWB,          p\	        W44       VP                  4       pVP                  4       pW1,          pWB,          p\	        W44       V P
                  '       d   VP                  4       pVP                  4       p\        \        RR7      ;_uu_ 4        W2P                  ,          pRRR4       W1,          pWB,          p\	        W4P                  4       4       MVP                  4       pVP                  4       p\        \        RR7      ;_uu_ 4        W2,          pRRR4       VP                  VP                  4      pWBP                  ,          p\	        W44       VP                  4       pWBP                  ,          pVP                  4       pVP                  4       p\        \        RR7      ;_uu_ 4        W2,          pRRR4       VP                  VP                  4      pWBP                  ,          p\	        W44       \        \        RR7      ;_uu_ 4        W2,          pRRR4       R#   + '       g   i     EL; i  + '       g   i     EL-; i  + '       g   i     L; i  + '       g   i     R# ; i)r/  inconsistent shapesr  Nzdimension mismatchunsupported operandr;  )rK   rl  r  rQ  r   r6  r=  r>  rl  r   r   r  )r   rO   rU   rA   rB   s   &    r;   test_inplace_dense)_TestInplaceArithmetic.test_inplace_denseC	  s   GGFONN1FFHFFH		1 FFHFFH		1 AAz1FGGSS HAFAq))+. AAz1EFF Gacc
AHAq$ FFH	SSFFHFFH:-ABBFA CEE!##J	SS1  9,ABBGA CB7 HGG GFF CB CBBs0   )J '	J	J(-	J; J	J%	(J8	;K	c                J   a  V 3R  lpS P                    F  pV! V4       K  	  R# )c                   < SP                   V ,          pSP                  V ,          p\        P                  ! \        V R R7      '       dL   VP                  4       pV^,          pVP                  4       pV^,          p\        WCP                  4       4       \        P                  ! \        V R R7      '       dN   VP                  4       pVR,          pVP                  4       pVR,          p\        WCP                  4       4       R# R# 	same_kind)castingr*  N	r4  r5  rK   can_castintrQ  r   r   r  r@   r  r	  rO   rU   r   s   &    r;   r@  6_TestInplaceArithmetic.test_imul_scalar.<locals>.checkv	  s    //%(C%%e,E {{3{;;JJLQHHJQ"1iik2{{5%==JJLT	HHJT	"1iik2 >r=   Nr.  rE  s   f  r;   test_imul_scalar'_TestInplaceArithmetic.test_imul_scalaru	  s!    	3& %%E%L &r=   c                   a  V 3R  lpS P                    FB  p\        P                  ! V\        P                  ! \        4      4      '       d   K:  V! V4       KD  	  R# )c                   < SP                   V ,          pSP                  V ,          p\        P                  ! \        V R R7      '       dL   VP                  4       pV^,          pVP                  4       pV^,          p\        WCP                  4       4       \        P                  ! \        V R R7      '       dN   VP                  4       pVR,          pVP                  4       pVR,          p\        WCP                  4       4       R# R# rr  ru  rx  s   &    r;   r@  6_TestInplaceArithmetic.test_idiv_scalar.<locals>.check	  s    //%(C%%e,E{{3{;;JJLQHHJQ"1iik2{{5%==JJLT	HHJT	"1iik2 >r=   N)r2  rK   rv  r@   rw  rE  s   f  r;   test_idiv_scalar'_TestInplaceArithmetic.test_idiv_scalar	  s<    	3$ %%E ;;ubhhsm44e	 &r=   c                D   V P                  \        P                  ! ^4      4      pV P                  \        P                  ! ^4      4      pV P                  \        P                  ! ^4      4      pW!,          pW1,           p\        VP	                  4       VP	                  4       4       V P
                  '       d9   W!,          pW1,          p\        VP	                  4       VP	                  4       4       W!,          pW1,          p\        VP	                  4       VP	                  4       4       W!,          pW1,
          p\        VP	                  4       VP	                  4       4       \        \        RR7      ;_uu_ 4        W,          pRRR4       R#   + '       g   i     R# ; i)r  rm  r  N)r  rK   r'   r   r   r6  r=  r  )r   rO   rU   bps   &   r;   test_inplace_success+_TestInplaceArithmetic.test_inplace_success	  s    NN266!9%NN266!9%^^BFF1I&	V		RZZ\2FABAIIK6	V		RZZ\2	V		RZZ\29,ABBGA CBBBs   ;	FF	rc   N)
r   r   r   r   rn  rz  r  r  r   r   r   s   @r;   rj  rj  B	  s     0d.2 r=   rj  c                   >   a  ] tR tRt o R tR tR tR tR tRt	V t
R# )	_TestGetSeti	  c                f   a  V 3R  lp\          F  pV! \        P                  ! V4      4       K!  	  R# )c                   < \        . RO. RO. RO. RO.V R7      pSP                  V4      pVP                  w  r4\        V) V4       F3  p\        V) V4       F  p\	        W%V3,          WV3,          4       K!  	  K5  	  \	        \        VR,          4      V 4       R F$  p\        \        \        3VP                  V4       K&  	  R# )	r  r  Nr  r  r/  r.  r.  ri   r.  r  r  r  r  )r  r.  r  )r  r  r$  )
r   r  r   rI  r   r  r=  r\  r  __getitem__)	r@   r  rS   r  r  r  rF  rm  r   s	   &       r;   r@  *_TestGetSet.test_getelement.<locals>.check	  s    w  (-.A q!A''CAA2q\r1A Q3Q30 & " afu-Bz95q}}bI Cr=   Nr-   rK   r@   rE  s   f  r;   test_getelement_TestGetSet.test_getelement	  s%    	J$ &E"((5/" &r=   c                f   a  V 3R  lp\          F  pV! \        P                  ! V4      4       K!  	  R# )c                   < SP                  RV R7      p\        4       ;_uu_ 4       pVP                  \        R4       V P	                  ^ 4      VR&   V P	                  R4      VR	&   V P	                  ^4      VR
&   V P	                  R4      VR&   V P	                  ^4      VR&   V P	                  ^4      VR&   V P	                  ^4      VR
&   RRR4       V \
        P                  8w  d$   \        VP                  4       . RO. RO. RO.4       R F  p\        \        VP                  VR4       K!  	  . RO\        . RO4      3 F  p\        \        VP                  RV4       K!  	  \
        P                  ! V \
        P                  4      '       g?   V \
        P                  8w  d(   R F  p\        \         VP                  RV4       K!  	  R# R# R#   + '       g   i     EL; i)r/  r  r[  r  r  Ng     ^@r;  r  r  ri   ry  r`  r.  r  r  rv  )r.  r  r.  r'  )r.  r.  r  r.  )ri   r.  r&  r.  ))r.  r  )r  r  r  r;  r  r$  )r  )r  r   r`  r)   r  rK   bool_r   r   r=  r\  __setitem__r   r>  ro   r   r  )r@   rS   rc  rm  rD  r   s   &    r;   r@  *_TestGetSet.test_setelement.<locals>.check	  su   uE2A"$$

24UV**Q-$**S/$**Q-$**S/$**Q-$ ::a=%**Q-$ %  "IIK$$$ 8j!--UC 8 uW~.j!--B / MM%););<<RXX%A!)Q]]E1E  & =5 %$$s   B#GG	Nr  rE  s   f  r;   test_setelement_TestGetSet.test_setelement	  s&    	FB &E"((5/" &r=   c                r   a  V 3R  lpS P                    F  pV! \        P                  ! V4      4       K!  	  R# )c                    < SP                  RV R7      p\        4       ;_uu_ 4       pVP                  \        R4       ^VR&   RRR4       \	        VR,          ^4       R#   + '       g   i     L%; i)r/  r  r[  N)r/  r4  )r.  r  )r  r   r`  r)   r   r@   rS   rc  r   s   &  r;   r@  9_TestGetSet.test_negative_index_assignment.<locals>.check 
  sW    we4A"$$

24UV% % 51% %$s   A  A0	NrM  rE  s   f  r;   test_negative_index_assignment*_TestGetSet.test_negative_index_assignment	  s*    	& %%E"((5/" &r=   c           	        a aa ^^
uooVVV 3R lpRRR\        R4      R3R\        R4      3\        R4      \        R4      33 F  w  r#V! W#^4       K  	  R# )r  c                 >  < V : R V: R V: 2pSP                  SS34      p\        4       ;_uu_ 4       pVP                  \        R4       ^W@V3&   RRR4       \	        VP                  4       W#R7       \	        W@V3,          ^VR7       R#   + '       g   i     LC; i)z ; r[  NrK  )r  r   r`  r)   r   rz  )	r  rF  nitemsr7   rS   rc  r  rE  r   s	   &&&   r;   	_test_set3_TestGetSet.test_scalar_assign_2.<locals>._test_set
  s    EQEVJ/C1v&A"$$

24UVQ$ %  =Q$C8	 %$s   BB	Nri   r/  r  r  r'  rv  r  )r   r   r  r  rF  r  rE  s   f   @@r;   test_scalar_assign_2 _TestGetSet.test_scalar_assign_2

  sX    21	9 WhrB"eBiBir+-DAaA-r=   c                B   V P                  R4      p\        P                  ! R4      p\        4       ;_uu_ 4       pVP	                  \
        R4       W3 F  p^VR&   ^VR&   ^	VR&   K  	  RRR4       \        VP                  4       V4       R#   + '       g   i     L,; i)r  r[  Nr  ry  r  r  rK   r   r   r`  r)   r   r   r   rS   rT   rc  r  s   &    r;   test_index_scalar_assign$_TestGetSet.test_index_scalar_assign
  s    NN6"HHV  CJJ.0QRV###  ! 	199;* ! s   0BB	rc   N)r   r   r   r   r  r  r  r  r  r   r   r   s   @r;   r  r  	  s$     #,##J#"	+ 	+r=   r  c                   &   a  ] tR tRt o R tRtV tR# )
_TestSolvei'
  c                |   ^p\         P                  P                  ^ 4       \        W3\        R7      p\         P                  P                  V4      p\         P                  P                  V^,
          4      R\         P                  P                  V^,
          4      ,          ,           p\         P                  P                  V4      p\        \        V4      4       F  pW6,          W&V3&   K  	  \        \        V4      4       F2  pWF,          W&V^,           3&   \        WF,          4      W&^,           V3&   K4  	  V P                  V4      p\        4       ;_uu_ 4       pVP                  \        R4       \        V4      P                  V4      pRRR4       \        W#,          V4       R#   + '       g   i     L$; i)r7  r  r  r  N)rK   r   rf   r   rx  r  rI  r   r   r  r   r`  r)   r2   solver   )r   rE  rS   rA   rB   rO  r  rc  s   &       r;   
test_solve_TestSolve.test_solve)
  s/    
		q1%w'IINN1IINN1Q3299>>!A##6 66IINN1s1vATAcF s1vAtA!eH Ac!eH  NN1  CJJ.?AQa A ! 	AE!$	 ! s   1F++F;	rc   N)r   r   r   r   r  r   r   r   s   @r;   r  r  '
  s     % %r=   r  c                      a  ] tR tRt o R tR tR tR tR tR t	R t
]P                  P                  ^4      R	 4       tR
 tR tR tR tR tRtV tR# )_TestSlicingi?
  c                V   \        V P                  R\        P                  R7      R,          P                  \        P                  4       \        V P                  R\        P
                  R7      R,          P                  \        P
                  4       \        V P                  R\        P                  R7      R,          P                  \        P                  4       \        V P                  R\        P                  R7      R,          P                  \        P                  4       R# )r  r  Nr  r4  )r.  r  r  N)r   r  rK   r  r@   r[   r  r  r   s   &r;   test_dtype_preservation$_TestSlicing.test_dtype_preservation@
  s    T^^F"((^;EBHH"((ST^^F"((^;EBHH"((ST^^F"**^=eDJJBJJWT^^F"**^=eDJJBJJWr=   c                   \         P                  \         P                  \         P                  \         P                  3 F  pV P                  RVR7      p\        VR,          P                  V4       \        VR,          P                  V4       \        VR,          P                  V4       \        VR,          P                  V4       K  	  R# )r/  r  NrY  )r  r.  r.  ri   )r  r  )r.  r  )r  r.  rK   r  r[   r  r  r  r   r@   r   dtrS   s   &  r;   #test_dtype_preservation_empty_slice0_TestSlicing.test_dtype_preservation_empty_sliceF
  s     88RXXrzz2::>BvR0A8**B/8**B/8**B/8**B/ ?r=   c           	        V P                  \        R 4      P                  ^^
4      4      pV P                  V4      pV P                  '       d   RM^ .^.^.3w  r4p\        WR3,          VR,          P                  4       4       \        WR3,          VR,          P                  4       4       V P                  . RO. R	O. R
O. RO.4      pV P                  V4      p\        WdR3,          VR,          P                  4       4       V P                  . RO. RO. R
O. RO.4      pV P                  V4      p	\        WR3,          V	R,          P                  4       4       \        WRR13,          V	^RR13,          P                  4       4       \        \        VP                  \        R4      ^34       \        \        VP                  ^\        ^^4      34       R# )      I@r  ri   r  Nr  r/  NNr~  r  r  )r  r  r  ri   r  r  r.  r  r  r  r  r  r  r.  r.  rv  )r)  r   r  r  r6  r   r   r=  r\  r  slice)
r   rT   rS   r0r1r2r  r  rm  r1  s
   &         r;   test_get_horiz_slice!_TestSlicing.test_get_horiz_sliceP
  sj   LL,,Qr23NN1"&"4"4"4YA3aS/
1U8QtW__%671W:qy'8'8':;LL)Y	9EFNN11W:qy'8'8':; LL)Y	9EFNN11W:qy'8'8':;1W:qBCy'8'8':; 	j!--%+r1BCj!--!U1a[1ABr=   c           	        \        R 4      P                  ^^
4      pV P                  V4      pV P                  '       d   RM^ .^.^.3w  r4p\	        VRV3,          VR,          P                  4       4       \	        VRV3,          VR,          P                  4       4       \        . RO. R	O. R
O. RO.4      pV P                  V4      p\	        VRV3,          VR,          P                  4       4       \	        VRV3,          VR,          P                  4       4       \        . RO. RO. R
O. RO.4      pV P                  V4      p	\	        VRV3,          V	R,          P                  4       4       \	        VRR1V3,          V	RR1^3,          P                  4       4       \        \        VP                  \        R4      ^34       \        \        VP                  ^\        ^^4      34       R# )r  r  r  r  Nr~  )r  r.  )r  r  r  r  r  r  r  r  r  ri   rg  r  rv  )r   r  r  r6  r   r   r   r=  r\  r  r  )
r   rT   rS   c0c1c2r  r  rm  r1  s
   &         r;   test_get_vert_slice _TestSlicing.test_get_vert_slicee
  s~   3K2&NN1"&"4"4"4YA3aS/
1S"W:qy'8'8':;1QU8QtW__%679iI>?NN11S"W:qy'8'8':;1QU8QtW__%67 9iI>?NN11QU8QtW__%671RS"W:qay'8'8':; 	j!--%+r1BCj!--!U1a[1ABr=   c                ^   \        R 4      P                  ^^
4      pV P                  V4      p\        VR,          P	                  4       VR,          4       \        VRRR13,          P	                  4       VRRR13,          4       \        VRR1R3,          P	                  4       VRR1R3,          4       \        . RO. RO. RO. RO.4      pV P                  V4      p\        VR	,          VR	,          P	                  4       4       \        VR
,          VR
,          P	                  4       4       R# )r  r  NNN)r  :r.  r/  Nr  rg  r  r  r  r  ri   Nr  )r  r  )r   r  r  r   r   r   )r   rT   rS   rm  r1  s   &    r;   test_get_slices_TestSlicing.test_get_slices{
  s    3K2&NN11X;..0!H+>1R"W:--/2ss7<1SbS"W:--/3B37< 9iI>?NN11X;((;(;(=>1U8QuX%5%5%78r=   c                   \         P                  P                  ^2^24      p V P                  V4      R,          p\        TP                  4       TR,          4       R#   \         d    \
        P                  ! R4      hi ; i)r  feature not implementedN):r.     ri   :ri   r8  r/  )	rK   r   r  r  r>  rC  rD  r   r   )r   v0rD  s   &  r;    test_non_unit_stride_2d_indexing-_TestSlicing.test_non_unit_stride_2d_indexing
  sf    YY^^B#	9r">2A
 	199;>(:;	  	9++788	9s   A "A?c                   V P                  \        ^24      P                  ^^
4      4      pV P                  V4      p\	        VR,          VR,          4       \	        VR,          VR,          4       \	        VR	,          VR	,          4       \	        V\        R4      R3,          VR	,          4       \	        VR\        R4      3,          VR	,          4       \	        V\        R4      \        R4      3,          VR	,          4       \	        VR
,          P                  4       VR
,          4       \	        V^^R13,          P                  4       V^^R13,          4       \	        V\        ^4      ^R13,          P                  4       V^^R13,          4       \	        VR,          P                  4       VR,          4       \	        VR,          P                  4       VR,          4       \	        VR,          P                  4       VR,          4       \	        V^R1^3,          P                  4       V^R1^3,          4       \	        V^R1\        ^4      3,          P                  4       V^R1^3,          4       \	        VR,          P                  4       VR,          4       \	        VR,          P                  4       VR,          4       \	        VR,          P                  4       VR,          4       \	        V^R1R3,          P                  4       V^R1R3,          4       \	        VR,          P                  4       VR,          4       \	        VR,          P                  4       VR,          4       \	        V\        R4      R3,          P                  4       VR,          4       \	        VR,          P                  4       VR,          4       \	        V^R P                  4       V^R 4       \        \        ^4      \        ^4      R4      p\	        W#R3,          P                  4       VR,          4       \	        VRV3,          P                  4       VR,          4       R# )r  r  r  r  NNr  NNr  r  r  rv  r  )ri   r  r  )r/  r  Nr(  )r  r  r  )r  NNr/  NN):Nr  Nr  r  )rv  r  ri   r  Nr  r  r  )	r)  r   r  r  r   r   r   r  r   )r   rT   rS   r=  s   &   r;   test_slicing_2_TestSlicing.test_slicing_2
  s<   LL++Ab12NN1 	QsVQsV$QtWag&QuXah'QuRy|_QuX.Qr%)|_QuX.QuRyr*+AeH5 	QtW__&$0Qq!B$wZ'')1Q"W:6QuQx2~&..0!AqtG*= 	QtW__&$0QvY&&(!F)4QwZ'')1W:6QqtQwZ'')1QrT1W:6QqtU1X~&..0!AbD!G*= 	Qx[((*AhK8QvY&&(!F)4QvY&&(!F)4QqtRx[((*AadBhK8 	QtW__&$0QuX%%'52QuRy!|_,,.%9 	QsV^^%qv.QqW__&!B0 $q'$q'$'Q!tW__&&	2Qq!tW__&&	2r=   c                @  aa V P                  \        ^24      P                  ^^
4      4      oV P                  S4      o\        P
                  pVR,          VR,          VR,          VR,          VR,          VR,          V^^R1,          V^RR1,          VR^R1,          ^ ^VR,          VR	,          RRR\        R4      \        P                  ! R4      .pVV3R
 lp\        V4       F  w  rEV! V4       K  	  VV3R lp\        V4       F!  w  ru\        V4       F  w  rHV! WX4       K  	  K#  	  . p	\        P                  ! R.^,          !   F*  w  rXp
V
^ 8X  d   K  V	P                  \        WXV
4      4       K,  	  V	 F  pV! WU4       V! VR4       V! RV4       K  	  R# )r  r\  r  r  r/  Nri   :r  r7  N:r/  ri   NNr  r  c                   < SV ,          pSV ,          pVP                   R8X  d   \        W\        V 4      4       R# VP                  ^ 8X  d   VP                  ^ 8X  d   R# \	        VP                  4       V\        V 4      4       R# r.  Nrc   )r   r   r  rn   r   r   )rO   rA   rB   rS   rT   s   &  r;   check_1,_TestSlicing.test_slicing_3.<locals>.check_1
  s\    !A!Aww"}Q47+66Q;166Q;&qyy{AtAw?r=   c                   < \        V \        P                  4      '       d   \        V 4      pMT p\        V\        P                  4      '       d   \        V4      pMTpSW3,          pSW#3,          pVP                  R8X  d   \        WE\        W34      4       R# VP                  ^ 8X  d   VP                  ^ 8X  d   R# \        VP                  4       V\        W34      4       R# r  )
rJ   rK   r	   rw  r   r   r  rn   r   r   )rO   rU   aibirA   rB   rS   rT   s   &&    r;   check_2,_TestSlicing.test_slicing_3.<locals>.check_2
  s     !RZZ((V!RZZ((V!$A"&	Aww"}Q4<066Q;166Q;&qyy{AtQF|Dr=   r  rv  r  r  )
Nr.  r  ri   r  r  r  rv  r  i)r)  r   r  r  rK   s_r   r   	enumerate	itertoolsproductrM   r  )r   r  slicesr  rF  rO   r  r  rU   extra_slicesr  rS   rT   s   &          @@r;   test_slicing_3_TestSlicing.test_slicing_3
  s|   LL++Ab12NN1UUR&"S'2b62d8U)RWQqV*bBiEQrEQ1r#wB)RWWR[	*		@ f%DAAJ &	E0 f%DA!&) * &
  (( -= ,>>?,@ BGA!AvaA/	B AAMArNBN r=   c                	   V P                  \        ^24      P                  ^^
4      4      pV P                  V4      pVR,          P                  ^ 8X  g   Q hVR,          P
                  R8X  g   Q hVR,          P
                  R8X  g   Q hVR,          P
                  R8X  g   Q hVR,          P
                  R8X  g   Q hVR	,          P
                  R8X  g   Q hVR
,          P
                  R8X  g   Q hVR,          P
                  R8X  g   Q hVR,          P
                  VR,          P
                  u;8X  d	   R8X  g   Q h Q hVR,          P
                  VR,          P
                  u;8X  d	   R8X  g   Q h Q hVR,          P
                  VR,          P
                  u;8X  d	   R8X  g   Q h Q hVR,          P
                  VR,          P
                  u;8X  d	   R8X  g   Q h Q hVR,          P
                  VR,          P
                  u;8X  d	   R8X  g   Q h Q hVR,          P
                  VR,          P
                  u;8X  d	   R8X  g   Q h Q hV P                  '       Ed   VR,          P
                  VR,          P
                  u;8X  d	   R8X  g   Q h Q hVR,          P
                  VR,          P
                  u;8X  d	   R8X  g   Q h Q hVR,          P
                  VR,          P
                  u;8X  d	   R8X  g   Q h Q hVR,          P
                  VR,          P
                  u;8X  d	   R8X  g   Q h Q hVR,          P
                  VR,          P
                  u;8X  d	   R8X  g   Q h Q hR# VR,          P
                  VR,          P
                  u;8X  d	   R8X  g   Q h Q hVR,          P
                  VR,          P
                  u;8X  d	   R8X  g   Q h Q hVR,          P
                  VR,          P
                  u;8X  d	   R8X  g   Q h Q hVR,          P
                  VR,          P
                  u;8X  d	   R8X  g   Q h Q hVR,          P
                  VR,          P
                  u;8X  d	   R8X  g   Q h Q hR# )r  Nr  )Nr  r  )Nr  ri   Nr  )Nr  r  r<  )Nr  r  )r  Nr  )r  r  N)r4  r  )Nr  ri   )r  Nri   ri   r  )r  ri   N)r  Nr  )r  r  N)r  ri   rh   )r  r  )Nr  ri   )r  )r  Nri   )r  ri   N)r)  r   r  r  r   r   r6  )r   rT   rS   s   &  r;   test_None_slicing_TestSlicing.test_None_slicing  s   LL++Ab12NN1w||q   $$...!"((F222 z7***z7***}""g---}""g---}""g---$$,(=(=GGGGGG$$,(=(=GGGGGG$$,(=(=GGGGGG$$,(=(=GGGGGG$$,(=(=GGGGGG$$,(=(=GGGGGG V9??aioo======V9??aioo======Z=&&!J-*=*=EEEEEEZ=&&!J-*=*=EEEEEEZ=&&!J-*=*=EEEEEEV9??aioo??????V9??aioo??????Z=&&!J-*=*=GGGGGGZ=&&!J-*=*=GGGGGGZ=&&!J-*=*=GGGGGGr=   c                D	   V P                  \        ^24      P                  ^^
4      4      pV P                  V4      p\	        VR,          P                  4       VR,          4       \	        VR,          P                  4       VR,          4       \	        VR,          P                  4       VR,          4       \	        VR,          P                  4       VR,          4       \	        VR	,          P                  4       VR	,          4       \        P                  ! \        RR7      ;_uu_ 4        VR
,           RRR4       \        P                  ! \        RR7      ;_uu_ 4        VR,           RRR4       \        P                  ! \        RR7      ;_uu_ 4        VP                  R	,           RRR4       \	        VR,          P                  4       VR,          4       \	        VR,          P                  4       VR,          4       \	        VR,          P                  4       VR,          4       \	        VR,          P                  4       VR,          4       \	        VR,          P                  4       VR,          4       \	        VR,          P                  4       VR,          4       \	        VR,          P                  4       VR,          4       \	        VR,          P                  4       VR,          4       \	        VR,          P                  4       VR,          4       \	        VR,          P                  4       VR,          4       \	        VR,          P                  4       VR,          4       \	        VR,          P                  4       VR,          4       \	        VR,          P                  4       VR,          4       \	        VR,          P                  4       VR,          4       \	        VR,          P                  4       VR,          4       \	        VR,          P                  4       VR,          4       \        VR,          VR,          4       \        VR,          VR,          4       R#   + '       g   i     EL=; i  + '       g   i     EL; i  + '       g   i     EL; i)r  .zindex .5. out of ranger  Nzindex .10. out of range).)r  .).r  ).r  )r  .).r4  )r  .).r  )r\  .).r\  )r  .).r  )r  NN.).r
  )r4  NN.).r  )r  r  .)r  .r  ).r  r  )r\  r  .)r  .r\  ).r  r\  )r  r  .)r  .r  )r)  r   r  r  r   r   rC  r   r\  rl  r   r   rU   rO   s   &  r;   test_ellipsis_slicing"_TestSlicing.test_ellipsis_slicing'  s   LL++Ab12NN11S6>>+QsV41T7??,ag61V9,,.&	:1V9,,.&	:1V9,,.&	:]]:-EFFfI G]]:-FGGgJ H]]:-EFFCCK G 	1W:--/7<1W:--/7<1W:--/7<1W:--/7< 	1W:--/7<1W:--/7<1W:--/7<1W:--/7<1X;..0!H+>1X;..0!H+> 	1Z=002AjMB1Z=002AjMB1Z=002AjMB1Z=002AjMB1Z=002AjMB1Z=002AjMBQy\1Y<0Qy\1Y<0; GFFGGGFFFs$   (
Q&
Q:R&Q7	:R	R	c                d   V P                  \        ^24      P                  ^^
4      4      pV P                  V4      p. ROpR.^,          V,           pW3,           pV.^,          p\	        \        W&R3,          4      WR3,          4       \	        \        VRV3,          4      VRV3,          4       \	        \        W#R3,          4      WR3,          4       \	        \        VRV3,          4      VRV3,          4       \	        \        W#RV3,          4      WRV3,          4       \	        \        VRW43,          4      VRW43,          4       \	        \        W#VR3,          4      WVR3,          4       \        \        RR7      ;_uu_ 4        W#V3,           RRR4       R#   + '       g   i     R# ; i)r  F.zshape mismatchr  N)TFTFT)r)  r   r  r  r   r   r=  r>  )r   numpy_arO   ix5ix10
ix10_6Truefull_ixs   &      r;   test_ellipsis_fancy_bool%_TestSlicing.test_ellipsis_fancy_boolP  sX   ,,vbz11!R89NN7#.w{S Y
&1*71c\?3Wc\5JK71S'\?3WS'\5JK71#X;/c1BC71S$Y<0'#t)2DE71#t^#45wC~7NO71S#^#45wsC~7NO71$^#45wD#~7NO:-=>>:o ?>>>s   	FF/	c           	     <   V P                  \        ^24      P                  ^^
4      4      pV P                  V4      p\	        V^.R3,          P                  4       V^.R3,          4       \	        V^^.R3,          P                  4       V^^.R3,          4       \	        VR^.3,          P                  4       VR^.3,          4       \	        VR^^.3,          P                  4       VR^^.3,          4       \	        V^.^R3,          P                  4       V^.^R3,          4       \	        V^^.^R3,          P                  4       V^^.^R3,          4       \	        V^.R^3,          P                  4       V^.R^3,          4       \	        VR^.^3,          P                  4       VR^.^3,          4       \	        \        V^^.R^^.3,          4      V^^.R^^.3,          4       \	        \        VR^^.^^.3,          4      VR^^.^^.3,          4       R# )r  .N)r)  r   r  r  r   r   r  s   &  r;   test_ellipsis_fancy_slicing(_TestSlicing.test_ellipsis_fancy_slicingf  s   LL++Ar23NN11aS#X;..0!QCH+>1aVS[>113Q1vs{^D1S1#X;..0!C!H+>1S1a&[>113QsQF{^D1aS!S[>113QsAs{^D1aVQ^,4461a&!S.8IJ1aS#q[>113QsC{^D1S1#q[>113QsQC{^D71aVS1a&%8#9:Aq!fcAq6>Q<RS71S1a&1a&%8#9:AcAq6Aq6>Q<RSr=   c                   V P                  \        ^4      P                  ^^4      4      p\        P                  ! \
        RR7      ;_uu_ 4        VR,           RRR4       \        P                  ! \
        RR7      ;_uu_ 4        VR,           RRR4       R#   + '       g   i     LH; i  + '       g   i     R# ; i)r  z(an index can only have a single ellipsisr  N)..).r  .)r  r   r  rC  r   r\  r   rO   s   & r;   test_multiple_ellipsis_slicing+_TestSlicing.test_multiple_ellipsis_slicingw  s    NN6!9,,Q23]]:!KM MhKM ]]:!KM MkNM MM MM M Ms   
B
B,B)	,B=	rc   N)r   r   r   r   r  r  r  r  r  r  r  rC  rg  	fail_slowr  r  r  r  r  r  r   r   r   s   @r;   r  r  ?
  st     X0C*C,9	<+3Z [[1@ @D"HH'1R,T" r=   r  c                   P   a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
tV tR# )_TestSlicingAssigni  c                `   V P                  R4      p\        P                  ! R4      p\        4       ;_uu_ 4       pVP	                  \
        R4       W3 F!  p^VR&   ^VR&   ^	VR&   ^VR&   ^	V^RR	1R3&   K#  	  RRR4       \        VP                  4       V4       R#   + '       g   i     L,; i)
r  r[  r  Nr  ):r.  r  Nr  ):r/  r.  Nr.  )r  r.  )r.  r  r  r  r  s   &    r;   test_slice_scalar_assign+_TestSlicingAssign.test_slice_scalar_assign  s    NN6"HHV  CJJ.0QRV%%%$!%R%(  ! 	199;* ! s   ?BB-	c                   a aa ^^
uooVVV 3R lp^\        ^4      3^\        R^
^4      3^\        ^R4      3\        ^4      \        ^R4      33 F  w  r#V! W#4       K  	  R# )r  c                 H  < R V : RV: 2pSP                  SS34      p\        4       ;_uu_ 4       pVP                  \        R4       ^W0V3&   RRR4       \        P
                  ! SS34      p^WPV3&   \        VP                  4       WRR7       R#   + '       g   i     LK; i)zi=z; j=r[  NrK  )r  r   r`  r)   rK   r   r   r   )	r  rF  r7   rS   rc  rT   r  rE  r   s	   &&    r;   r  9_TestSlicingAssign.test_slice_assign_2.<locals>._test_set  s    qe4u%C1v&A"$$

24UVQ$ % !Q AAdG%aiik1B %$s   BB!	Nrv  )r  r   r  s   f   @@r;   test_slice_assign_2&_TestSlicingAssign.test_slice_assign_2  se    21	C q]QdB(:$;aq"=NAha-/DAaO/r=   c                   V P                  R4      p\        4       ;_uu_ 4       pVP                  \        R4       ^VR&   ^VR&   ^VR&   ^
VR&   V^
,          pVR,          VR&   \	        VR,          P                  4       VR,          P                  4       4       V^
,          pVR	,          VR
&   \	        \        P                  ! R4      VR,          ,           VP                  4       4       V^
,          pVR,          P                  VRR1^ 3&   \	        VR,          P                  4       P                  VRR1^ 3,          P                  4       4       RRR4       R#   + '       g   i     R# ; i)r  r[  Nr  r  r  r  r  r.  r  )Nr  Nr+  r  r  Nr.  r  r  )	r  r   r`  r)   r   r   rK   r   rl  )r   rT   rc  rS   s   &   r;   test_self_self_assignment,_TestSlicingAssign.test_self_self_assignment  s   NN5!  CJJ.0QRAcFAcFAcFAcFBAsVAcFqv~~/31ABBAuXAcFrxx37EBA{}}Acrc!eHqv~~/111SbSU83C3C3EF# !   s   D.EE-	c                   V P                  R4      p\        . RO. RO. RO. RO.4      p^^ .^ ^..p\        4       ;_uu_ 4       pVP                  \        R4       ^VR&   ^VR	&   ^VR
&   W,           VR&   \        VP                  4       V4       V P                  \        V4      4      VR&   \        VP                  4       R,          V4       RRR4       R#   + '       g   i     R# ; i)r  r[  Nr  r4  r.  r.  )r.  r.  r  )r.     r.  r  r  r  r  r,  )r\  r\  )r  r   r   r`  r)   r   r   r#  )r   rT   r  blockrc  s   &    r;   test_slice_assignment(_TestSlicingAssign.test_slice_assignment  s    NN5!(!"!# $ A!u  CJJ.0QRAcFAcFAcFSAcFqyy{H5))%,7AeHqyy{62E: !   s   B	CC'	c                   V P                  R4      p\        4       ;_uu_ 4       pVP                  \        R4       ^VR&   ^VR&   ^VR&   ^
VR&   V P	                  \
        P                  ! ^4      4      VR&   RRR4       \        . R	O. R
O. RO. RO.4      p\        VP                  4       V4       R#   + '       g   i     LC; i)r  r[  r  Nr  r  r  r  r  r  r  r  r1  )
r  r   r`  r)   r$  rK   r'   r   r   r   )r   rT   rc  r  s   &   r;   "test_sparsity_modifying_assignment5_TestSlicingAssign.test_sparsity_modifying_assignment  s    NN5!  CJJ.0QRAcFAcFAcFAcF&&rvvay1AbE ! '''(;<199;1 ! s   AB22C	c                   V P                  R
4      p\        \        R
\        4      4      p\        P
                  pVR,          VR,          VR,          VR,          V^^R1,          V^RR1,          VR^R1,          ^ ^VR,          VR,          RRR\        R4      \        P                  ! R4      .p\        4       ;_uu_ 4       pVP                  \        R4       \        V4       F1  w  rgWaV&   WbV&   \        VP                  4       V\        V4      4       K3  	  \        V4       F  w  r\        V4       Fn  w  ri^
V,          R	V^,           ,          ,           WV	3&   ^
V,          R	V^,           ,          ,           W'V	3&   \        VP                  4       V\        Wy34      4       Kp  	  K  	  \        ^^
^4      VR&   \        ^^
^4      VR&   \        VP                  4       V4       \        P                  ! ^^^4      R,          VR&   \        P                  ! ^^^4      R,          VR&   \        VP                  4       V4       RRR4       \!        \"        VP$                  R\'        \        ^d4      4      4       \!        \"        VP$                  R\        ^d4      4       \!        \"        VP$                  ^ \)        R4      3\'        \        ^d4      4      4       \!        \"        VP$                  \)        R4      ^3\'        \        ^d4      4      4       \!        \"        VP$                  \)        R4      ^3VP+                  4       4       \!        \"        VP$                  . RO. RO.. RO3. RO4       \!        \"        VP$                  . RO. RO. RO.. RO. RO.3. RO4       \!        \"        VP$                  \)        ^4      ^ 3^^.^^..4       R#   + '       g   i     EL; i)r  r\  r  r  r  Nr  r  r[    r  r4  r  rv  r  r  )r.  :r  r4  ri   r  N):r  r  ri   r.  r  r$  r  r  )r  r  r/  r  ri   r  )r.  r  r/  r  )r  r   r   r  rK   r  r   r   r`  r)   r  r   r   r  rI  r   r=  r>  r  listr  rQ  )
r   rS   rT   r  r  rc  rF  rO   r  rU   s
   &         r;   test_set_slice!_TestSlicingAssign.test_set_slice  s   NN6"%'(UUR&"S'2b62d8QqV*bBiEQrEQ1r#wB)RWWR[*
   CJJ.0QR!&)!!"199;47; *
 "&)%f-DATD!A#J.AcFTD!A#J.AcF&qyy{AtQF|D . * !B?AiL B?AiLqyy{A.))Aq!,W5AhK))Aq!,Q/AhKqyy{A.% !* 	j!--eCj9IJj!--Ej!--!U4[1A5:&	(j!--%+q1A5:&	(j!--%+q1A1668Lj!--!9-y9<	Ij!--!9i8!9-/09	; 	j!--%(A1v1v&	(C !  s   F OO	c                    V P                  \        P                  ! R4      4      pV P                  R4      pW!R&   \        VP	                  4       . RO. RO.4       R# )ri   Nr  r  )r  r\  r  r  r  r  )r  rK   rl  r   r   r  s   &  r;   test_assign_empty$_TestSlicingAssign.test_assign_empty  sB    NN2776?+NN6"%199;I(>?r=   c                    V P                  \        P                  ! R4      4      p\        P                  ! ^4      pW!R&   W!R&   \	        VP                  4       . RO. RO. RO.4       R# )r/  Nr  rP  r  rh  r  )r  rK   rl  r   r   r   r   rS   rA   s   &  r;   test_assign_1d_slice'_TestSlicingAssign.test_assign_1d_slice
  sJ    NN2776?+HHQK$$199;Iy(IJr=   rc   N)r   r   r   r   r"  r'  r.  r4  r7  r?  rC  rG  r   r   r   s   @r;   r   r     s7     +"G,;&2+(Z@K Kr=   r   c                   f   a  ] tR tR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V tR# )_TestFancyIndexingi  z~Tests fancy indexing features.  The tests for any matrix formats
that implement these features should derive from this class.
c                   \         P                  \         P                  \         P                  \         P                  3 F  pV P                  RVR7      p\        VRRR.3,          P                  V4       \        V. ROR3,          P                  V4       \        VR. 3,          P                  V4       \        V. R3,          P                  V4       K  	  R# )r/  r  r  FNrY  )FFFr  r  s   &  r;   #test_dtype_preservation_empty_index6_TestFancyIndexing.test_dtype_preservation_empty_index  s     88RXXrzz2::>BvR0A1uen,-33R80!34::B?1b5,2q5, ?r=   c                :   V P                  \        P                  ! ^^.4      4      p\        \        \
        \        3VP                  R4       \        \        \
        \        3VP                  R4       \        \        \
        3VP                  . RO. RO34       R# )r  fooNri   rO  r$  r  )r  rK   r   r=  r\  r>  r  r  r  s   & r;   test_bad_index!_TestFancyIndexing.test_bad_index!  sh    NN288QF+,z:y91==%Pz:y91==*Uz:. ,/	1r=   c           
        V P                  \        ^24      P                  ^^
4      4      pV P                  V4      p\	        V^.,          P                  4       V^.,          4       \	        V^^.,          P                  4       V^^.,          4       \	        V^^.3,          P                  4       V^^.3,          4       \	        V^^^.3,          P                  4       V^^^.3,          4       \	        VR	^R
.3,          P                  4       VR	^R
.3,          4       \	        V\        R	4      ^R
.3,          P                  4       VR	^R
.3,          4       \	        VR	\        ^R
.4      3,          P                  4       VR	^R
.3,          4       \	        V\        R	4      \        ^R
.4      3,          P                  4       VR	^R
.3,          4       \	        VR. RO3,          P                  4       VR. RO3,          4       \	        VR^	.3,          P                  4       VR^	.3,          4       \	        VRR	R
.3,          P                  4       VRR	R
.3,          4       \	        VR\        R	R
.4      3,          P                  4       VRR	R
.3,          4       \	        V^.^3,          P                  4       V^.^3,          4       \	        V^^.^3,          P                  4       V^^.^3,          4       \	        V^R
.R3,          P                  4       V^R
.R3,          4       \	        V\        ^R
.4      R3,          P                  4       V^R
.R3,          4       \	        V^R
.\        R4      3,          P                  4       V^R
.R3,          4       \	        V\        ^R
.4      \        R4      3,          P                  4       V^R
.R3,          4       \	        V^.R3,          P                  4       V^.R3,          4       \	        V^^.R3,          P                  4       V^^.R3,          4       \	        V^R
.^R	13,          P                  4       V^R
.^R	13,          4       \	        V\        ^R
.4      ^R	13,          P                  4       V^R
.^R	13,          4       \	        \        V^.^.3,          4      V^.^.3,          4       \	        \        V^^.^^.3,          4      V^^.^^.3,          4       \	        \        VR	R.^R.3,          4      VR	R.^R.3,          4       \	        \        V\        R	R.4      ^R.3,          4      VR	R.^R.3,          4       \	        \        VR	R.\        ^R.4      3,          4      VR	R.^R.3,          4       \	        \        V\        R	R.4      \        ^R.4      3,          4      VR	R.^R.3,          4       \	        V^.^..^^.3,          P                  4       V^.^..^^.3,          4       \	        VR	.R.R..^R.3,          P                  4       VR	.R.R..^R.3,          4       \	        V\        R	.R.R..4      ^R.3,          P                  4       VR	.R.R..^R.3,          4       \	        VR	.R.R..\        ^R.4      3,          P                  4       VR	.R.R..^R.3,          4       \	        V\        R	.R.R..4      \        ^R.4      3,          P                  4       VR	.R.R..^R.3,          4       \	        V^^.,          P                  4       V^^.,          4       \	        VR	R.,          P                  4       VR	R.,          4       \	        V\        R	R.4      ,          P                  4       VR	R.,          4       \	        V^.R3,          R^.3,          P                  4       V^.R3,          R^.3,          4       \	        V^^.R3,          R^^.3,          P                  4       V^^.R3,          R^^.3,          4       \	        VR	R.R3,          R^R.3,          P                  4       VR	R.R3,          R^R.3,          4       \	        V\        R	R.4      R3,          R\        ^R.4      3,          P                  4       VR	R.R3,          R^R.3,          4       \	        V^^^..3,          ^ ^ ..^3,          P                  4       V^^^..3,          ^ ^ ..^3,          4       \	        V^R	R..3,          ^ R	..^3,          P                  4       V^R	R..3,          ^ R	..^3,          4       \        P                  ! \        RR7      ;_uu_ 4        VR^^..3,           RRR4       \        P                  ! \        RR7      ;_uu_ 4        V^ ^ ..R3,           RRR4       \	        VR^^.3,          ^^.R3,          P                  4       VR^^.3,          ^^.R3,          4       \	        VRR	R.3,          ^R.R3,          P                  4       VRR	R.3,          ^R.R3,          4       \	        VR\        R	R.4      3,          \        ^R.4      R3,          P                  4       VRR	R.3,          ^R.R3,          4       \        \        ^4      \        ^4      R4      p\	        W#R3,          P                  4       VR,          4       \	        VRV3,          P                  4       VR,          4       \        P                  ! ^..\        R7      p\	        W$V3,          P                  4       WV3,          4       \	        V. .. .3,          P                  4       V. .. .3,          4       R#   + '       g   i     EL; i  + '       g   i     EL; i)r  r  r  r  zOnly 1D or 2D arrays allowedr  r+  Nr  r  r  )ri   r'  r/  r  r  r  rv  r  r  )r)  r   r  r  r   r   r   rC  r   r\  r  r   rK   rw  )r   rT   rS   r=  r  s   &    r;   test_fancy_indexing&_TestFancyIndexing.test_fancy_indexing(  s"   LL++Ab12NN1 	QsV^^%q!v.Q1vY&&(!QF)4 	Qq1#vY&&(!AsF)4Qq1a&y\))+Qq1a&y\:QrAr7{^++-qaW~>QuRy1b')*224aQGnEQr5!R>)*224aQGnEQuRy%B.0199;QrAr7{^L 	Qq-'(002Aa6F4GHQsQCx[((*AcA3hK8QsRH}%--/3R=1ABQsE2r(O+,446#Bx-8HI 	QsAvY&&(!QCF)4Q1vqy\))+Q1vqy\:Q2w{^++-q!R"~>QuaW~r)*224aBnEQ2wb	)*224aBnEQuaW~uRy0199;Q2w{^L 	QsAvY&&(!QCF)4Q1vqy\))+Q1vqy\:Q2w"}%--/Ar7AbD=1ABQuaW~qt+,4461b'1R4-8HI 	WQsQCx[)1aS1#X;7WQ1v1v~./Aq6Aq6>1BCWQBx!R012Ar2hB6G4HIAeRHo2w./0!RHq"g4E2F	
 	Ar2hq"g./0!RHq"g4E2F	
 	AeRHouaW~567B8aW;L9M	

 	QaSzAq6)*224a!qc
QF8J6KLtbTB4 1b')*224tbTB4 1b')*	
 	ebTB4"&'!R0199;tbTB4 1b')*	
 	tbTB4 %B.0199;tbTB4 1b')*	
 	ebTB4"&'2w78@@BtbTB4 1b')*	
 	Q1vY&&(!QF)4QBx[((*Ar2hK8Qub"X'//11b"X;? 	QsAvYq1#v&..0!QCF)AsF2CDq!faiLQF#++-q!Q|A1vI/F	
 	r2hkN1q"g:&..0!RHaK.QG2L	
 	eRHoq !!UAr7^"34<<>r2hkN1q"g:&	
 	a1a&kNQF8Q;'//11Q!Q[>Aq6(A+3N	
 	a2r(mq"gY\*224aRH:6FByRS|6T	
 ]]:-KLLbAq6(lO M]]:-KLL1vhlO M 	a!QiL!Q#++-qQF|QFAI/F	
 	a"bkNAr7A:&..0!ABxK.!R!2L	
 	aBx !%B.!"34<<>a"bkNAr7A:&	
 $q'$q'$'Q!tW__&&	2Qq!tW__&&	2 HHqcU#&Q!tW__&Q$0 	QtbTz]**,ard
m<9 MLLLLLs   n?o?o	o$	c                   \         P                  P                  R 4       ^2p^p^pV P                  \         P                  P	                  W#4      4      p\         P
                  ! WDR8  4      p\         P                  P                  V) ^,           W!R7      p\         P                  P                  V) ^,           W1R7      pV P                  V4      pWuV3,          p\        V4      '       d   VP                  4       p\        WWV3,          4       WR,           p	Wc,
          p
\        \        VP                  W34       \        \        VP                  WZ34       R# )re   r  rJ  N)rK   r   rf   r)  r  ra  rk   r  r(   r   r   r=  r\  r  )r   NUM_SAMPLESr  r  r  Irp  r  SIJI_badJ_bads   &          r;   test_fancy_indexing_randomized1_TestFancyIndexing.test_fancy_indexing_randomized  s    
		tLL,-KKs7#IIqb1fa:IIqb1fa:NN1!fC==++-CSAC&!j!--%;j!--!;r=   c                   ^^
r!V P                  \        W,          4      P                  W4      4      pV P                  V4      p\        P
                  ! V^,           \        R7      p\        P
                  ! V^,
          \        R7      p\        P
                  ! V^,           \        R7      p\        P
                  ! V^,
          \        R7      pRp	\        P                  ! WV\        R4      3Wx\        R4      34       Fj  w  r\        V
\        4      '       d   \        V\        4      '       d   K3  \        P                  ! \        V	R7      ;_uu_ 4        WJV3,          pRRR4       Kl  	  R#   + '       g   i     K  ; i)r  r  z(bool index .* has shape .* instead of .*Nr  )r)  r   r  r  rK   rl  r?  r  r   r  rJ   rC  r   r\  )r   r  r  rT   rS   row_long	row_shortcol_long	col_shortr  r  rF  rJ  s   &            r;   test_missized_masking(_TestFancyIndexing.test_missized_masking  s
   "1LL..q45NN1 771q5-GGAE.	771q5-GGAE.	8%%%+.%+.
DA !U##
1e(<(<z77dG 87
 877s   E//F c                   \         P                  P                  R 4       V P                  \	        ^24      P                  ^^
4      4      pV P                  V4      p\         P                  ! \         P                  P                  ^ ^^R7      \        R7      p\         P                  ! \         P                  P                  ^ ^^
R7      \        R7      p\         P                  ! \         P                  P                  ^ ^RR7      \        R7      p\        \        W#,          4      W,          4       \        \        VRV3,          4      VRV3,          4       \        \        W%,          4      W,          4       \        \        W!^	8  ,          4      W^	8  ,          4       \         P                  ! . RO4      p\         P                  ! . RO4      p\        \        W#V3,          4      WV3,          4       \         P                  ! R	\        R7      p\         P                  ! R	\        R7      pRVR
&   \         P                  ! R	\        R7      pRVR&   \        \        VP                  V4       \        \        VP                  V4       \        \        VP                  V4       \        \        \         3VP                  V^34       R# )re   rJ  r  r  TNr;  )TFTTF)
FTTFTFFFFF)r     r  )r  r.  )rK   r   rf   r)  r   r  r  r   rk   r?  r   r   r   r=  r\  r  r>  )	r   rT   rS   rX  rp  r  Z1Z2Z3s	   &        r;   test_fancy_indexing_boolean._TestFancyIndexing.test_fancy_indexing_boolean  s   
		tLL++Ab12NN1HHRYY&&q!!&4DAHHRYY&&q!"&5TBHHRYY&&q!'&:$GWQT]AD)WQq!tW%qAw/WQT]AD)WQ1uX&a%1HH56HH 9 : 	WQ!tW%qAw/XXgT*XXgT*4XXgT*4j!--4j!--4j!--4z:.1vFr=   c                   \         P                  P                  R 4       V P                  \	        ^24      P                  ^^
4      4      pV P                  V4      p\         P                  ! \         P                  P                  ^ ^RR7      \        R7      pV P                  V4      p\        \        W$,          4      W,          4       \        \        W"^	8  ,          4      W^	8  ,          4       \         P                  ! \         P                  P                  ^ ^RR7      \        R7      p\         P                  ! \         P                  P                  ^ ^RR7      \        R7      pV P                  V4      pV P                  V4      p\        \        VP                  V4       \        \        VP                  V4       \        \        \         3VP                  V^34       R# )re   rJ  r  Nr;  )r  rf  )r  r4  )rK   r   rf   r)  r   r  r  r   rk   r?  r$  r   r   r=  r\  r  r>  )	r   rT   rS   r  XspZr  ZspYsps	   &        r;   "test_fancy_indexing_sparse_boolean5_TestFancyIndexing.test_fancy_indexing_sparse_boolean  sG   
		tLL++Ab12NN1HHRYY&&q!'&:$G  #WQV_ad+WQ1uX&a%1HHRYY&&q!'&:$GHHRYY&&q!'&:$G  #  #j!--5j!--5z:.QxHr=   c                    V P                  \        . RO. RO. RO.4      4      p\        P                  ! VP	                  ^ 4      4      ^ 8  p\        VRV3,          P                  4       ^^ .^ ^.^^ ..4       R# )r  r  Nr  r  )r  r   rK   ravelrz  r   r   )r   r   desired_colss   &  r;   #test_fancy_indexing_regression_30876_TestFancyIndexing.test_fancy_indexing_regression_3087  sf    nnUIw#@ABxx
+a/SL)113q!fq!fq!f5MNr=   c           	         V P                  \        ^^ .^ ^..4      4      p\        \        VP                  R\
        P                  ! ^^.4      4       R# )r  Nr  )r  r   r=  r>  r  rK   r   s   & r;   test_fancy_indexing_seq_assign1_TestFancyIndexing.test_fancy_indexing_seq_assign  s@    nnUQFQF#345j#//6288QqE?Kr=   c                F   V P                  \        ^^ .^^..4      4      p\        4       ;_uu_ 4       pVP                  \        R4       V^^ .^ ^ .3,          V^ ^.^^.3&   RRR4       \        \        V4      \        ^^.^^..4      4       R#   + '       g   i     L6; i)r  r[  N)r  r   r   r`  r)   r   r   )r   r   rc  s   &  r;   test_fancy_indexing_2d_assign0_TestFancyIndexing.test_fancy_indexing_2d_assign  s    nnUQFQF#345  CJJ.0QR"%q!fq!fn"5CAA ! 	WS\51a&1a&)9#:; ! s   /BB 	c                   V P                  \        ^24      P                  ^^
4      4      p^ VR&   ^ VR&   ^ VR&   V P                  V4      p\        P
                  ! . RO4      p\        \        W#,          4      W,          4       \        P
                  ! . \        R7      p\        \        W#,          4      W,          4       \        \        W#V3,          4      WV3,          4       \        P
                  ! . RO\        R7      R,          p\        \        W#V3,          4      WV3,          4       \        \        W$V3,          4      WV3,          4       R# 	r  r  Nr  r  r/  r  )FFFFFr.  r  ri   r/  r  r<  	r)  r   r  r  rK   r   r   r   rw  r   rT   rS   rq  rp  s   &    r;   test_fancy_indexing_empty,_TestFancyIndexing.test_fancy_indexing_empty  s    LL++Ab12###NN1HH89WQT]AD)HHRs#WQT]AD)WQ!tW%qAw/HH_C08WQ!tW%qAw/WQ!tW%qAw/r=   rc   N)r   r   r   r   r   rL  rQ  rT  r\  rc  rj  rq  rv  ry  r|  r  r   r   r   s   @r;   rJ  rJ    sM     -1{=z<4,G@I.O
L<0 0r=   rJ  c              #     "   \        V R4      '       d   V P                  '       g   Rx  R# Rx  V P                  P                  4       pRV n        V P	                  4        \        WP                  R4       R# 5i)zIChecks that sorted indices property is retained through an operation
    has_sorted_indicesNFz'Expected sorted indices, found unsorted)r#  r  r  rQ  sort_indicesr   )r  r  s   & r;   check_remains_sortedr  .  s]      1*++13G3G3G	iinnG ANNw		@Bs   $A:AA:c                   >   a  ] tR tRt o R tR tR tR tR tRt	V t
R# )	_TestFancyIndexingAssigni=  c                    V P                  \        P                  ! ^^.4      4      p\        \        \
        \        3VP                  R^4       \        \        \
        \        3VP                  R^4       R# )r  rO  NrP  )r  rK   r   r=  r\  r>  r  r  r  s   & r;   test_bad_index_assign._TestFancyIndexingAssign.test_bad_index_assign>  sQ    NN288QF+,z:y91==%QRSz:y91==*VWXr=   c                V  a aa ^^
uooVVV 3R lpR\        R^
^4      3\        P                  ! ^4      \        ^R4      3\        ^^4      \        ^R4      33 F  w  r#V! W#4       K  	  \        P                  ! ^4      \        P                  ! ^4      3R3 F  w  r#V! W#4       K  	  R# )r  c           	        < SP                  SS34      pSP                  \        P                  ! SS34      4      p\	        4       ;_uu_ 4       pVP                  \        R 4       ^W0V3&   \        V4      ;_uu_ 4        ^W V3&   RRR4       RRR4       \        VP                  4       V4       R#   + '       g   i     L4; i  + '       g   i     L?; ir[  N)
r  r)  rK   r   r   r`  r)   r  r   r   )r  rF  rS   rT   rc  r  rE  r   s   &&   r;   _test_set_sliceI_TestFancyIndexingAssign.test_fancy_indexing_set.<locals>._test_set_sliceF  s    1v&ARXXq!f-.A"$$

24UVQ$)!,,AdG - %
 &aiik15 -, %$s$   0C>B1	C1C<CC	Nr  rv  )r  r=  )r  rK   r   r   r  r  rF  r  rE  s   f   @@r;   test_fancy_indexing_set0_TestFancyIndexingAssign.test_fancy_indexing_setC  s    21	6  tR!34iilE!RL1Aqk5B<02DA A!2 iilBIIaL13IJDAA! Kr=   c                f   a  V 3R  lp\          F  pV! \        P                  ! V4      4       K!  	  R# )c           	        < SP                  RV R7      p\        4       ;_uu_ 4       pVP                  \        R4       V P	                  ^4      V^ ^.^ ^.3&   \        VP                  4       V P	                  ^4      ^,          4       V P	                  R4      VR&   \        VP                  4       V P	                  ^4      ^,          4       V P	                  R4      VR&   \        VP                  4       V P	                  ^4      ^,          V P	                  ^4      ,           4       RRR4       R#   + '       g   i     R# ; i)r  r  r[  r  Nr  )r.  ri   Nr  rZ  )r  r   r`  r)   r  r   rz  r  s   &  r;   r@  D_TestFancyIndexingAssign.test_fancy_assignment_dtypes.<locals>.checkX  s    vU3A"$$

24UV!&A1Q%1+QUUWejjmAo6"ZZ_'
QUUWejjmAo6C#QUUWejjmAo

1&EF %$$$s   C?D00E	Nr  rE  s   f  r;   test_fancy_assignment_dtypes5_TestFancyIndexingAssign.test_fancy_assignment_dtypesW  s%    		G &E"((5/" &r=   c           
        V P                  R4      pV P                  \        ^^4      4      p. ROpRp\        V4      p\        4       ;_uu_ 4       pVP	                  \
        R4       \        V4      ;_uu_ 4        W#^ 3,          P                  V^ V3&   W$^3,          P                  V^V3&   W%^3,          P                  V^V3&   RRR4       \        VP                  4       VP                  P                  4       4       V P                  R4      p\        V4      ;_uu_ 4        ^
^.VR&   RRR4       \        VP                  4       . RO. RO.4       V P                  R	4      p\        V4      ;_uu_ 4        ^
.^..VR
&   RRR4       \        VP                  4       ^ ^ .^ ^
.^ ^..4       V P                  R4      pV P                  \        P                  ! R4      4      p\        V4      ;_uu_ 4        W3 F  p. ROV. RO. RO3&   K  	  RRR4       \        VP                  4       V4       V P                  R4      p\        V4      ;_uu_ 4        . ROVR&   RRR4       \        VP                  4       ^4       V P                  \        P                  ! R4      4      p. ROVR&   \        VP                  4       V4       RRR4       R#   + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL}; i  + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     R# ; i)r  r[  Nr  r~  r  r  r  )r.  r4  r7  rY  r  r  r%  r$  )r$  r~  )r  r'   r   r   r`  r)   r  rl  r   r   r)  rK   r   r   rz  )r   rS   rT   i0i1i2rc  r  s   &       r;   test_sequence_assignment1_TestFancyIndexingAssign.test_sequence_assignmentf  su   NN5!NN3q8$2Y  CJJ.0QR%a((qD'))!B$qD'))!B$qD'))!B$ ) qyy{ACCKKM: u%A%a((r7% )qyy{Y,DE u%A%a((D";% )qyy{aVaWq"g,FG u%ARXXe_-A%a((A*1Agw&'   ) qyy{A. v&A%a((*3&' )+RXXf-.A&/A"#qyy{A.G ! ((( )(( )(( )(( )(= !  s   *L1:AK	AL1$K"	,AL18
K6	A4L16L
	AL1L	A(L1K	L1"K3-	L16L	L1
L	L1L.)L11M	c                R   V P                  \        ^24      P                  ^^
4      4      p^ VR&   ^ VR&   ^ VR&   V P                  V4      p\        P
                  ! . RO4      p^*W#&   \        \        V4      V4       \        P
                  ! . \        R7      p^*W#&   \        \        V4      V4       ^*W#V3&   \        \        V4      V4       \        P
                  ! . RO\        R7      R,          p^*W#V3&   \        \        V4      V4       ^*W$V3&   \        \        V4      V4       R# r  r  r  s   &    r;   test_fancy_assign_empty0_TestFancyIndexingAssign.test_fancy_assign_empty  s    LL++Ab12###NN1HH89WQZ#HHRs#WQZ#A#WQZ#HH_C08A#WQZ#A#WQZ#r=   rc   N)r   r   r   r   r  r  r  r  r  r   r   r   s   @r;   r  r  =  s%     Y
"(#+/Z$ $r=   r  c                   &   a  ] tR tRt o R tRtV tR# )_TestFancyMultidimi  c           
        \         P                  ! ^.^.^..4      \         P                  ! . RO4      3\         P                  ! ^.^.^..4      \         P                  ! . RO.4      3\         P                  ! . RO.4      \         P                  ! ^.^.^..4      3\         P                  ! . RO4      \         P                  ! ^.^.^..4      3\         P                  ! . RO. RO.4      \         P                  ! . RO. RO.4      3.pV EF;  w  r#\         P                  P                  R4       V P	                  \         P                  P                  ^^4      4      pV P                  V4      pWRV3,          p\        V4      '       d   VP                  4       p\        WdW#3,          4       V^,           pV^,           p\        \        VP                  Ws34       \        \        VP                  W(34       \        \        VP                  W".\        R4      34       \        \        VP                  \        R4      W3.34       EK>  	  R# )r  re   Nr/  r  ri   r$  r  r  r/  ri   r/  r  )rK   r   r   rf   r)  r  r  r(   r   r   r=  r\  r  r  )	r   setsrX  rp  r  r  rY  rZ  r[  s	   &        r;   test_fancy_indexing_ndarray._TestFancyMultidim.test_fancy_indexing_ndarray  s   XXsQC!o&(;<XXsQC!o&)(=>XXyk"BHHqcA3_$=>XXi "((QC!qc?";<XXy),-XXy),-/ DAIINN4 RYY^^Aq12Aq!AaC&C}}kkmf%EEEE*ammeY?*ammaY? *ammqfeDk5JK*ammeDkA65JK% r=   rc   N)r   r   r   r   r  r   r   r   s   @r;   r  r    s     L Lr=   r  c                   8   a  ] tR tRt o R tR tR tR tRtV t	R# )_TestFancyMultidimAssigni  c                   \         P                  P                  R 4       V P                  \         P                  P	                  ^^4      4      pV P                  V4      p\         P                  P	                  ^^4      p\         P                  ! . RO. RO.4      p\         P                  ! . RO. RO.4      p\        V4      ;_uu_ 4        W2WE3&   RRR4       W1WE3&   \        VP                  4       V4       V^,           pV^,           p. ROp\        V4      ;_uu_ 4        WWE3&   RRR4       WWE3&   \        VP                  4       V4       \        V4      ;_uu_ 4        ^W$V3&   RRR4       ^WV3&   \        VP                  4       V4       \        \        VP                  We3V4       \        \        VP                  WG3V4       R#   + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     L; ire   Nr$  r  r  r  )rK   r   rf   r)  r  r  r   r  r   r   r=  r\  r  )	r   r  r  r  rX  rp  rZ  r[  r  s	   &        r;   test_fancy_assign_ndarray2_TestFancyMultidimAssign.test_fancy_assign_ndarray  sn   
		tLL1-.NN1IINN1a HHi+,HHi+,!!$$acF %!#QYY[!$AA!!$$acF %!#QYY[!$!!$$AcF %A#QYY[!$j!--%A>j!--!A>+ %$$ %$
 %$s$   G!G !G3G	 G0	3H	c                   a aa ^^
uooVVV 3R lp\         P                  ! ^^.^^..4      ^^.3\         P                  ! ^ ^.4      ^ ^.^^..3. RO. RO.. RO. RO.33 F  w  r#V! W#4       K  	  R# )r  c           	        < SP                  SS34      p\        V4      ;_uu_ 4        \        4       ;_uu_ 4       pVP                  \        R 4       ^W V3&   RRR4       RRR4       SP                  \        P                  ! SS34      4      p^W@V3&   \        VP                  4       V4       R#   + '       g   i     La; i  + '       g   i     Ll; ir  )
r  r  r   r`  r)   r)  rK   r   r   r   )r  rF  rS   rc  rT   r  rE  r   s   &&   r;   r  R_TestFancyMultidimAssign.test_fancy_indexing_multidim_set.<locals>._test_set_slice  s    1v&A%a((*;*=*=

24UVQ$ +>( RXXq!f-.AAdG%aiik15 +>*=((s"   CB1	C1C<CC	Nr$  r.  ri   r  )r.  r  r/  )r  r  ri   )rK   r   r  s   f   @@r;    test_fancy_indexing_multidim_set9_TestFancyMultidimAssign.test_fancy_indexing_multidim_set  s    21	6 hhAA/01a&91a&)QFQF+;<#Y/)Y1GHJDA A!Jr=   c           	     H   \         P                  P                  R 4       V P                  \         P                  P	                  ^^4      4      pV P                  V4      p\         P                  P	                  ^^4      p. RO. RO.p. RO. RO.pW2WE3&   W1WE3&   \        VP                  4       V4       V UUu. uF  qf Uu. uF  qw^,           NK  	  upNK  	  pppV U	U
u. uF  q U
u. uF  q^,           NK  	  up
NK  	  pp	p
. ROpWWE3&   WWE3&   \        VP                  4       V4       ^W$V3&   ^WV3&   \        VP                  4       V4       \        \        VP                  W3V4       \        \        VP                  WK3V4       R# u upi u uppi u up
i u up
p	i r  )rK   r   rf   r)  r  r  r   r   r=  r\  r  )r   r  r  r  rX  rp  r  iirZ  rF  jjr[  r  s   &            r;   test_fancy_assign_list/_TestFancyMultidimAssign.test_fancy_assign_list  sX   
		tLL1-.NN1IINN1a 	"	"!#!#QYY[!$/01q!1%1Rq&&1%q1/01q!1%1Rq&&1%q1!#!#QYY[!$A#A#QYY[!$j!--%A>j!--!A> &1%1s0   9FFF!F)F:FFFc                "   \         P                  P                  R 4       V P                  \         P                  P	                  ^^4      4      pV P                  V4      p. ROp. ROpV Uu. uF  qU^,           NK  	  ppV Uu. uF  qw^,           NK  	  pp. ROp	\         P                  ! ^4      R,          p
\        \        VP                  V\        R4      3V	4       \        \        VP                  \        R4      V3V
4       R# u upi u upi )re   N)r  ri   r/  r/  r  ri   )r  r  r/  ri   r/  r  )r  ri   r/  r  r  r  r&  r<  )rK   r   rf   r)  r  r  r   r=  r\  r  r  )r   r  r  rX  rp  r  rZ  r  r[  C1C2s   &          r;   test_fancy_assign_slice0_TestFancyMultidimAssign.test_fancy_assign_slice  s    
		tLL1-.NN1"#$!Ba!$"#$!Ba!$"YYq\'"j!--%t1ErJj!--%+u1ErJ %$s   ,DDrc   N)
r   r   r   r   r  r  r  r  r   r   r   s   @r;   r  r    s!     ?B""?:K Kr=   r  c                   r   a  ] tR tRt o RtR t]P                  P                  ^4      R 4       t	R t
RtV tR# )_TestArithmetici0  z
Test real/complex arithmetic
c                .   \        . RO. RO. RO. RO.R4      p\        . RO. R	O. R
O. RO.R4      p\        . RO. RO. RO. RO.R4      Vn        \        V^,          P                  R4      ^V,          4       \        VP                  ^,          P                  R4      ^VP                  ,          4       \        VP                  ^,          P                  R4      ^VP                  ,          4       V P                  V4      pV P                  V4      pWW43# )r  r  r  r[   )g      g      @r.        @r.  r.  )g      	@g     g      ?r.  r.  r.  )r.  r.        r  r.  r.  )r.  r.  g      @r.  r.  r.  )g      ?r.  r.  r.  r  g      @)g     ,@g      r.  r.  r  r.  )r.  g      @r.  r.  r.  r.  )g     2@      r.  r.  r.  r.  )g      ?r.  r.  r.  r  g      )r       @r.  r.  r.  g      @)r.  r  r.  r.  r.  r.  )r  r.  r.  r.  r.  r.  )r   r  r   rw   r  r  )r   _TestArithmetic__A_TestArithmetic__B_TestArithmetic__Asp_TestArithmetic__Bsps   &    r;   __arith_init_TestArithmetic.__arith_init4  s    /9302 4=> .9/57 9EF 4;579 ;DE 	CF??73BsF;CHHRK//8CHHECHHRK//8CHHEs#s#%%r=   c           	        V P                  4       w  rr4\        W4,           P                  4       W,           4       \         EF  p\        P
                  ! R R7      ;_uu_ 4        VP                  V4      pRRR4       V P                  X4      p\         EF  p\        P                  ! V\        P                  4      '       gE   \        P
                  ! R R7      ;_uu_ 4        VP                  P                  V4      p	RRR4       MVP                  V4      p	V P                  X	4      p
Wi,           pWz,           p\        VP                  VP                  4       \        VP                  4       V4       \        Wy,           V4       \        Wj,           V4       \        P                  ! R4      WX39   d   EK"  Wi,
          pWz,
          p\        VP                  VP                  4       \        VP                  4       V4       \        Wy,
          V4       \        Wj,
          V4       EK  	  EK  	  R#   + '       g   i     EL; i  + '       g   i     EL=; i)rr  rs  Nr?  )_TestArithmetic__arith_initr   r   r-   rK   ry  rw   r  ro   r   r  r   r@   r   r  r  r  r  rA   rS   rl  rB   rT   rb  D1S1s   &            r;   test_add_sub_TestArithmetic.test_add_subL  s   !%!2!2!4% 	]##%sy	

 "!AX..JJqM /..#C%%}}Q(:(:;;X66HHOOA. 76 

1AnnQ' UYRXXbhh/"2::<4"372."172. 88F#v-UYRXXbhh/"2::<4"372."172.9 &	 "...
 766s   #H0"I	0IIc           
        V P                  4       w  rr4\        W4P                  ,          P                  4       WP                  ,          4       \         EFl  p\
        P                  ! R R7      ;_uu_ 4        VP                  V4      pRRR4       V P                  X4      p\         EF  p\
        P                  ! V\
        P                  4      '       d   VP                  V4      p	MC\
        P                  ! R R7      ;_uu_ 4        VP                  P                  V4      p	RRR4       V P                  X	4      p
WiP                  ,          pWzP                  ,          p\        VP                  4       VR\        V4      P                  4       ,          R7       \        VP                   VP                   4       EK  	  EKo  	  R#   + '       g   i     ELG; i  + '       g   i     L; i)rr  rs  Ng+=)atol)r  r   rl  r   r-   rK   ry  rw   r  ro   r   r  r   r  rZ   r   r@   r  s   &            r;   test_mu_TestArithmetic.test_mux  s;   !%!2!2!4% 	EGGO446%%K	) "!AX..JJqM /..#C%%==B$6$677

1AX66HHOOA. 7nnQ'W55[

b%*3r7;;=%8:RXXbhh/ &	 "... 76s   7GG	GG+rc   N)r   r   r   r   r   r  rC  rg  r  r  r  r   r   r   s   @r;   r  r  0  s=     &0 [[2)/ )/V0 0r=   r  c                   J   a  ] tR tRt o R tR tR tR tR tR t	R t
R	tV tR
# )_TestMinMaxi  c                   \         P                  \         P                  \         P                  \         P                  \         P
                  3 EFU  p\         P                  ! ^VR7      P                  ^^4      pV P                  V4      p\        VP                  4       ^ 4       \        VP                  4       ^4       \        VP                  4       P                  V4       \        VP                  4       P                  V4       VR,          pV P                  V4      p\        VP                  4       R4       \        VP                  4       ^ 4       V^,          pV P                  V4      p\        VP                  4       R4       \        VP                  4       ^4       EKX  	  V P                  \         P                  ! ^^
4      P                  ^^4      4      p\        VP                  4       ^4       \        VP                  4       P                  VP                  4       \        VP                  RR7      ^4       V) p\        VP                  4       R4       \        VP                  RR7      R4       V P                  \         P                  ! R4      4      p\        VP                  4       ^ 4       \        VP                  4       ^ 4       \        VP                  4       P                  VP                  4       \         P                  ! ^\        R7      P                  ^^4      p^ VR	&   V P                  V4      p\        VP                  4       ^ 4       \        VP                  4       ^4       \         P                  ! R
4      \         P                  ! R4      \         P                  ! R4      3 FH  pV P                  V4      p\        \         VP                  4       \        \         VP                  4       KJ  	  R# )r7  r  TexplicitNr  iir  )r  r  r  r.  r4  r4  r.  )rK   r  r  r[   rj   r  r   r  r  r   rq   rZ   r@   r   r  r=  r>  )r   r@   r  r  rn  s   &    r;   test_minmax_TestMinMax.test_minmax  s   jj"**bhh"--PE		"E*221Q7Aq!A!$"%..GAq!A#&!$FAq!A#&!$# Q( NN299Q+33Aq9:QUUWa QUUW]]AGG,QUUDU)1-BQUUWb!QUUDU)2. NN288F+,QUUWa QUUWa QUUW]]AGG, IIb&..q3&	NN1QUUWa QUUWb! ((6"BHHW$5rxx7HIAq!A*aee,*aee, Jr=   c           	        V P                   '       * p\        P                  ! ^24      P                  ^^
4      p^ VR&   ^ VR&   ^ VR	&   R
VR&   V P	                  V4      p^ R.p^R
.pWT,            Fw  p\        VP                  VR7      P                  4       VP                  WaR7      4       \        VP                  VR7      P                  4       VP                  WaR7      4       Ky  	  V F  p\        VP                  VRR7      P                  4       V P                  . RO4      4       \        P                  ! VP                  ^ 8H  4      '       d   V P                  . RO4      pMV P                  . RO4      p\        VP                  VRR7      P                  4       V4       K  	  V F  p\        P                  ! . RO4      p\        P                  ! . RO4      p	V P                   '       g#   VP                  R4      pV	P                  R4      p	\        VP                  VRR7      P                  4       V4       \        VP                  VRR7      P                  4       V	4       K  	  \        P                  ! ^^34      P                  ^
^4      pV P	                  V4      pWT,            Fw  p\        VP                  VR7      P                  4       VP                  WaR7      4       \        VP                  VR7      P                  4       VP                  WaR7      4       Ky  	  \        VP                  RR7      VP                  RVR7      4       V F  pVR,          pVR,          p	V P                   '       g   VR,          pVR,          p	\        VP                  VRR7      P                  4       V4       \        VP                  VRR7      P                  4       V	4       K  	  V F  pVR,          pVR,          p	V P                   '       g   VR,          pVR,          p	\        VP                  VRR7      P                  4       V4       \        VP                  VRR7      P                  4       V	4       K  	  V P                  \        P                  ! R4      4      pV P	                  V4      pWE,            Fy  p\        VP                  VRR7      P                  4       VP                  VR7      4       \        VP                  VRR7      P                  4       VP                  VR7      4       K{  	  V P                  \        P                  ! R4      4      pV P	                  V4      pRR.p
\        \         P"                  ! WJ4      4      p\        \         P"                  ! WZ4      4      pV F=  w  rm\%        \&        VP                  WmR7       \%        \&        VP                  WmR7       K?  	  V Fy  w  rm\        VP                  WmR7      P                  4       VP                  VR7      4       \        VP                  WmR7      P                  4       VP                  VR7      4       K{  	  V P                  \        P                  ! R4      4      pV P	                  V4      pV F=  w  rm\%        \&        VP                  WmR7       \%        \&        VP                  WmR7       K?  	  V Fy  w  rm\        VP                  WmR7      P                  4       VP                  VR7      4       \        VP                  WmR7      P                  4       VP                  VR7      4       K{  	  R# )r  r  r  Tr  r  NFr  r  r(  r  r  rZ  rv  )
r  )   *   +   ,   -   .   /   0   r.  )
r7  r  r  r/  r  r  r.  r&  r'  r.  )
r7  r  r  r/  r  r  r  r&  r'  r.  )r'  r.     &   r  )r  r.  r  r8  r  rT  ry  )r  r  r*  )Nr  r  r-  )r  r  rP  )r  r  Nrk  )r4  r  r  r  )r6  rK   r   r  r  r   rZ   r   rq   r   r)  anyr  r   r   r>  r  r   r=  r>  )r   r  r  r  	axes_evenaxes_oddr  r  expected_maxexpected_minexplicit_valueseven_explicit_pairsodd_explicit_pairsexs   &             r;   test_minmax_axis_TestMinMax.test_minmax_axis  s   %%%IIbM!!!R($$$$NN1G	r7((D4 ((*AEEtE,K 4 ((*AEEtE,K	 ) D4$/779DE vvaffk""<<(HI<<(HID48@@BHM  D88$67L88$67L%%%+33F;+33F;D48@@BLQD48@@BLQ  IIa$$R+NN1((D4 ((*AEEtE,K 4 ((*AEEtE,K	 ) 	QUUU'FT)JKDU8LT7L%%% ~ }D48@@BLQD48@@BLQ  DU8LT7L%%% ~ }D48@@BLQD48@@BLQ  LL'*+NN1((DD48@@BAEEtEDTUD48@@BAEEtEDTU )
 LL'*+NN1-"9#4#4Y#PQ!)"3"3H"NO+HD*aee$D*aee$D , +HDD6>>@!%%T%BRSD6>>@!%%T%BRS + LL'*+NN1*HD*aee$D*aee$D + ,HDD6>>@!%%T%BRSD6>>@!%%T%BRS ,r=   c                   \        . RO. RO. RO.4      pV P                  V4      pV P                  '       d   \        M\        P
                  pV P                  '       d   \        M\        p\        VP                  4       4      '       g   Q h\        VP                  ^ R7      V4      '       g   Q h\        VP                  ^R7      V4      '       g   Q h\        VP                  4       4      '       g   Q h\        VP                  ^ R7      V4      '       g   Q h\        VP                  ^R7      V4      '       g   Q h\        VP                  4       4      '       g   Q h\        VP                  ^ R7      V4      '       g   Q h\        VP                  ^R7      V4      '       g   Q h\        VP                  4       4      '       g   Q h\        VP                  ^ R7      V4      '       g   Q h\        VP                  ^R7      V4      '       g   Q h\        VP                  4       4      '       g   Q h\        VP                  ^ R7      V4      '       g   Q h\        VP                  ^R7      V4      '       g   Q h\        VP                  4       4      '       g   Q h\        VP                  ^ R7      V4      '       g   Q h\        VP                  ^R7      V4      '       g   Q hR# r  )r   r  r6  r	   rK   r1   r*   r+   r.   rq   rJ   rZ   nanminnanmaxargminargmax)r   r  r	  r  spmatrix_or_sparrays   &    r;   test_minmax_container_type&_TestMinMax.test_minmax_container_type+  sL   Y! " s#%)%7%7%7'RYY)-);););gEIIK((((%)))+-@AAAA%)))+-@AAAAEIIK((((%)))+-@AAAA%)))+-@AAAAELLN++++%,,A,.0CDDDD%,,A,.0CDDDDELLN++++%,,A,.0CDDDD%,,A,.0CDDDDELLN++++%,,A,.@@@@%,,A,.@@@@ELLN++++%,,A,.@@@@%,,A,.@@@@r=   c           	     n   V P                  \        P                  ! ^24      P                  ^^
4      \        R7      p^ VR&   ^ VR&   ^ VR&   RVR&   \        P
                  VR	&   \        P
                  VR
&   V P                  V4      pVP                  4       p\        P                  ! V4      '       g   Q hV\        P                  ! V4      8X  g   Q hVP                  4       p\        P                  ! V4      '       g   Q hV\        P                  ! V4      8X  g   Q hVP                  RR7      p\        P                  ! V4      '       g   Q hV\        P                  ! VRR7      8X  g   Q h. ROpV F  pVP                  VR7      p\        VP                  4       \        P                  ! WR7      4       \        WpP                  4      '       g   Q hVP                  VR7      p\        VP                  4       \        P                  ! WR7      4       \        WP                  4      '       d   K  Q h	  R# )r  r  r  Nr  r  r  r  rZ  r  )r  r  ry  )rv  r  r.  r  )r)  rK   r   r  r  rR  r  r   r{  r  r   r   rJ   r"  )	r   r  r  X_nan_maximumX_nan_minimumr  r  X_nan_maximaX_nan_minimas	   &        r;   test_nanminmax_TestMinMax.test_nanminmaxK  s   LL2..q4ELB$$$$&&$&&$NN1
{{=))))		!,,,
{{=))))		!,,,f-{{=))))		!& 9999D888.LL002BIIa4KLl,>,>????888.LL002BIIa4KLl,>,>???? r=   c                0   \        . RO. RO. RO.4      pV P                  V4      pR Fj  p\        W4      p\        W#4      p\        \        V^R7       \        \
        VRR7       \        \        V^^R7       \        V! R	R7      V! R	R7      4       Kl  	  R# )
r.  r  r  r  Nr~  r  r  )rq   rZ   ry  )r   r  r   r=  r>  r  r   )r   r  r	  fnamedatfuncr   s   &     r;   test_minmax_invalid_params&_TestMinMax.test_minmax_invalid_paramsk  s    Y! " s##Ec)G5(D*d3)T4*d:6*G,@A $r=   c                f   ^ RI Hp \        . RO. RO. RO.4      pV P                  V4      p\	        W1P
                  4      '       dk   \        \        P                  ! V4      \        P                  ! V4      4       \        \        P                  ! V4      \        P                  ! V4      4       R# R# )r.  _dataNr~  r  r  )
scipy.sparser  r   r  rJ   _minmax_mixinr   rK   rq   rZ   )r   r  r  r	  s   &   r;   test_numpy_minmax_TestMinMax.test_numpy_minmaxy  sz     	'Y! " s# e0011rvve}bffSk:rvve}bffSk: 2r=   c           	     .   ^ RI Hp \        P                  ! . RO. RO. RO. RO. RO.4      pVP	                  4       p\        P                  ! ^^.^^..4      p\        P                  ! ^^.^^ ..4      p\        P                  ! . RO. RO. RO.4      pW#WEV3 EFg  pV P                  V4      pV P                  V4      p\        WP                  4      '       g   KC  \        VP                  4       \        P                  ! V4      4       \        VP                  4       \        P                  ! V4      4       \        VP                  ^ R7      \        P                  ! V^ R7      4       \        VP                  ^ R7      \        P                  ! V^ R7      4       \        VP                  ^R7      \        P                  ! V^R7      4       \        VP                  ^R7      \        P                  ! V^R7      4       EKj  	  V P                  V P                  V4      4      p\        VP                  RR7      ^4       \        V) P                  RR7      ^4       \        VP                  RR7      ^4       \        V) P                  RR7      ^4       V P                  \        P                  ! R4      4      p	V P                  \        P                  ! R4      4      p
RR.p\        P                  ! W.. ROV4       EF#  w  rpVe   VP                  V,          ^ 8X  d   \         P"                  ! \$        RR7      ;_uu_ 4        VP                  WR	7       RRR4       \         P"                  ! \$        RR7      ;_uu_ 4        VP                  WR	7       RRR4       K  V P&                  '       d   \        P(                  ! ^ 4      pM\        P(                  ! V^8X  d   RMR4      p\        VP                  WR	7      V4       \        VP                  WR	7      V4       EK&  	  V P                  V4      p\        VP                  ^ RR	7      V P                  . RO4      4       \        VP                  ^ RR	7      V P                  . RO4      4       \        P                  ! . RO4      p\        P                  ! . RO4      pVP*                  ^8w  d   ^VR
&   V P&                  '       g#   VP-                  R4      pVP-                  R4      p\        VP                  ^RR	7      V4       \        \/        VP                  ^RR	7      4      V4       \        P(                  ! R4      pV P                  V4      pVP*                  ^ 8w  d=   \        VP                  RRR	7      ^ 4       \        VP                  RRR	7      ^ 4       R# \         P"                  ! \$        RR7      ;_uu_ 4        VP                  RRR	7       RRR4       \         P"                  ! \$        RR7      ;_uu_ 4        VP                  RRR	7       RRR4       R#   + '       g   i     EL; i  + '       g   i     EKn  ; i  + '       g   i     L{; i  + '       g   i     R# ; i)r.  r  r  Tr  FNzCannot applyr  r  r  )r  r  ri   r/  )r.  r.  r  rv  )r  rv  r  r  r  )r  ri   r.  r.  )r  r  r/  )r  r(  r4  )r/  r  r(  r  rR  )Nr.  r  ry  r  )r/  r.  r/  r/  )r.  ri   ri   ri   )r  ri   r.  r/  r  )r.  r/  r/  r.  r.  rT  rZ  )r  r  rK   r   r
   r)  r  rJ   r  r   r  r  r  r  r   r   rC  r   r>  r6  r   r  r  r   )r   r  r  D2D3D4D5r  r   D6D7	explicitsr  r  r  r  r  s   &                r;   test_argmax_TestMinMax.test_argmax  s   &XX
  \\^XX1v1v&'XX1v1v&'XXy*i89""%AQA..#Cc#6#677ryy|4ryy|4+RYYqq-AB+RYYqq-AB+RYYqq-AB+RYYqq-AB &  nnT\\"-.SZZZ.2sd]]D]115SZZZ.2sd]]D]115 ^^BHHV,-^^BHHV,-5M	&..xyQMCr|syy!3]]:^DDJJDJ6 E]]:^DDJJDJ6 ED %%%!xx{H!xx$!)HHSZZTZ?JSZZTZ?J R nnR SZZQZ6\8RSSZZQZ6\8RSxx0xx077b= L!!!'//7L'//7LSZZQZ6EWSZZQZ>?N HHVnnQ77a<=qA=qA z@@

t
4 Az@@

t
4 A@O EDDDDDF A@@@@s0   YY)Y0)ZYY-0Z 	Z	rc   N)r   r   r   r   r  r  r  r  r  r  r!  r   r   r   s   @r;   r  r    s8     /-bdTLA@@@B;$T5 T5r=   r  c                   &   a  ] tR tRt o R tRtV tR# )_TestGetNnzAxisi  c                   \        ^ ^.^^.R^	..4      pVP                  \        4      pV P                  V4      p\        P
                  \        P                  3pV P                  '       d   VP                  MVP                  p\        VP                  RR7      V! RR7      4       \        VP                  4       V! 4       4       \        VP                  ^ R7      V! ^ R7      4       \        V! ^ R7      P                  V4       \        VP                  ^R7      V! ^R7      4       \        V! ^R7      P                  V4       \        VP                  RR7      V! RR7      4       \        V! RR7      P                  V4       \        VP                  RR7      V! RR7      4       \        V! RR7      P                  V4       \        \        V^R7       R# )r.  Nr  r  rv  r  )r   rw   r?  r  rK   r[   rj   r6  r  getnnzr   rz  r<   r@   r=  r>  )r   r  bool_datr	  accepted_return_dtypesr&  s   &     r;   test_getnnz_axis _TestGetNnzAxis.test_getnnz_axis  sb   aVV!W  ::d#s#"$((BHH!5(,(:(:(:$$8<<T<2F4EF8<<>6848<<Q</Q@&a.&&(>?8<<Q</Q@&a.&&(>?8<<R<0&b/B&b/'')?@8<<R<0&b/B&b/'')?@j&q1r=   rc   N)r   r   r   r   r)  r   r   r   s   @r;   r$  r$    s     2 2r=   r$  c                "   V'       d   V # R p\        V P                  4      pV P                  P                  4        F(  w  rEVP                  R4      '       g   K  V! V4      W4&   K*  	  \	        V P
                  R,           V P                  V4      # )zy
Construct a class that either runs tests as usual (require=True),
or each method skips if it encounters a common error.
c                 F   a  \         P                  ! S 4      V 3R  l4       pV# )c                     <  S! V / VB #   \         \        \        \        \        3 d    \
        P                  ! R 4      hi ; i)r  )r  r  r>  r\  r<  rC  rD  )rO   r   fcs   *,r;   wrapper6_possibly_unimplemented.<locals>.wrap.<locals>.wrapper  sF    Aq<B<'+Y
"N4 A ++&?@@As	    7A)	functoolswraps)r.  r/  s   f r;   wrap%_possibly_unimplemented.<locals>.wrap  s'    __R A !A Nr=   test_NotImplemented)dictrH   r3  
startswithr  r   	__bases__)r7  requirer3  new_dictr   r   s   &&    r;   _possibly_unimplementedr<    sy    
 
		 %,,,,.JDw''!%d / CLL#33MM 	r=   c	                n   \         \        \        V 4      \        \        \
        \        \        V4      \        \        V4      \        \        V4      \        \        V4      \        \        T;'       d    T4      \        \        T;'       d    T4      \        \        V4      \        \        V4      3p	/ p
V	 Fp  pVP                   F]  pVP                  R4      '       g   K  V
P!                  V4      pVe)   \#        RVP$                   RV RVP$                   24      hWV&   K_  	  Kr  	  \'        RV	/ 4      # )z|
Construct a base class, optionally converting some of the tests in
the suite to check that the feature is not implemented.
r5  zTest class z overloads test z defined in TestBase)r+  r<  r  r  rj  r  r  r   rJ  r  r  r  r  r$  rH   r8  getr>  r   r  )getsetslicingslicing_assignfancy_indexingfancy_assignfancy_multidim_indexingfancy_multidim_assignminmaxnnz_axisbasesnamesr7  r   old_clss   &&&&&&&&&     r;   sparse_test_classrL    s#    $[&9#$\7;$%7H$%7H$%=%13$%7%3%O%O8OQ$%=%:%K%K|M$[&9$_h?AE$ ELLD??7++iioG" ;s||n<L$(6g6F6F5G"I J J$K !  
E2&&r=   c                      a  ] tR tRt o ]R 4       t]P                  ]P                  ]P                  ]P                  .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# )TestCSRiG  c                    \        4       ;_uu_ 4       pVP                  \        R 4       \        V/ VB uuRRR4       #   + '       g   i     R# ; ir  )r   r`  r)   r!   r7  argsrC   rc  s   &*, r;   r  TestCSR.spcreatorH  9      CJJ.0QRd-f- !   	   !?A	c                n   \        . RO. RO. RO.R4      pV P                  V4      p\        VP                  . RO4       \	        VP
                  . RO4       \	        VP                  . R	O4       \        VP                  ^4       \        VP                  R4       \	        VP                  4       V4       R# )
r.  r-  r^  N)r.  r  r.  r  r  )r  r/  ri   rg  r  )r   r$  r   r  r   r  r  r   r  r  r   r   rU   r  s   &  r;   test_constructor1TestCSR.test_constructor1O  s    9"$   #!#((733;;w/3::i0SWWQSZZ&3;;=!,r=   c                
   \        RR4      p^VR&   V P                  V4      p\        VP                  ^.4       \	        VP
                  ^.4       \	        VP                  . RO4       \        VP                  4       V4       R# )r  r-  Nr  r  r;  )r.  r.  r.  r.  r  r  r  )r   r$  r   r  r   r  r  r   rV  s   &  r;   test_constructor2TestCSR.test_constructor2[  se    %#  #!#((A3/3;;s+3::o6!#++-3r=   c                   \        ^^ .^ ^.^^ ..R4      pV P                  V4      p\        VP                  . RO4       \	        VP
                  . RO4       \	        VP                  . RO4       \        VP                  4       V4       R# )r  r-  Nr$  r  r  )r   r$  r   r  r   r  r  r   rV  s   &  r;   test_constructor3TestCSR.test_constructor3d  st    Aq6q6q6!   #!#((733;;w/3::i0!#++-3r=   c                   \        . RO4      p\        . RO4      p\        . RO4      p\        W34      pV P                  W43R4      p\        \	        ^4      P                  ^^4      VP                  4       4       V P                  R^.^ ^.^ ^.33\        P                  R7      p\        R^ .^ ^..\        P                  R7      p\        WeP                  4       4       V P                  . RO. R	O. R
O334      pVP                  ^8X  g   Q hR# )ri   r  Nri   r/  r  r/  r.  r  r/  r.  ri   r  ri   r.  r  r.  r.  r  r  ri   ri   ri   ri   r        @g      $@r        "@r  r  g      &@r         @      @r  r             r  r  r  r  r.  ri   ri   r.  r.  r  r  r.  )
r   r   r$  r   r   r  r   rK   uint64r  )r   r  r  r  rm  r^  r  s   &      r;   test_constructor4TestCSR.test_constructor4n  s    5656 3 4 SI  $516":--a3S[[]C   9a.Aq6Aq62B!C299 U	1~1v.bii@5++-0   )i-C!DEww!||r=   c                    \        . RO4      p\        . RO4      p\        . RO4      pV P                  W2V34      p\        VP                  R4       R# r.  Nr.  r  r/  r/  r.  r  r  ri   r  r  )r   r$  r   r   r   r  r  r  r^  s   &    r;   test_constructor5TestCSR.test_constructor5  C    y!	"Y  $!89399U+r=   c                    . ROp. ROp. ROpV P                  W2V34      p\        VP                  R4       \        \        P
                  ! VP                  \        P                  4      4       R# rp  )r$  r   r   r   rK   ro   r@   signedintegerrs  s   &    r;   test_constructor6TestCSR.test_constructor6  sQ      $!89399e,cii)9)9:;r=   c                2   \        ^4      ^,           p\        . RO\        P                  R7      p\        . RO\        P                  R7      pV P	                  WV3RR7      p\        . RO. R	O. R
O.R4      p\        P
                  ! V P                  '       d   \        P                  M\        P                  4      p\        VP                  P
                  V4       \        VP                  P
                  V4       \        VP                  4       V4       R# )r  r  r   r-  N)r  ri   r  r.  r.  ri   r.  ri   r  r  r  r~  r  )r  r.  r  )r   r   rK   rj   r$  r@   r6  r[   r   r  r  r   r   )r   r  r  ptrrO   rU   expected_dtypes   &      r;   test_constructor_smallcol!TestCSR.test_constructor_smallcol  s    ay1}&bhh7L13/v>9"$
 d.@.@.@"((bhhOQXX^^^4QYY__n5199;*r=   c           	        \        ^4      ^,           p\        P                  ! \        P                  4      P                  ^d,           p\        ^ ^^W"^,           V^,           .\        P                  R7      p\        . RO\        P                  R7      pV P                  WV34      p\        VP                  P                  \        P                  ! \        P                  4      4       \        VP                  P                  \        P                  ! \        P                  4      4       \        VP                  ^\	        V4      ^,           34       R# )r  r  Nr}  )r   rK   rY   r[   rZ   r   rj   r$  r   r  r@   r  r   r   )r   r  larger  r~  rO   s   &     r;   test_constructor_largecol!TestCSR.test_constructor_largecol  s    ay1}"&&,Q1e1WeAg6bhhGL13/0QXX^^RXXbhh%78QYY__bhhrxx&89177QC
O4r=   c                :   \        ^4      p\        . RO4      p\        . RO4      pV P                  WV3RR7      pVP                  4       pVP	                  4        \        VP                  . RO4       \        VP                  4       VP                  4       4       R# )r  r|  Nr&  ri   r  r  r  r.  r/  r  ri   r4  r  ri   r&  r  r  )r   r   r$  rQ  r  r   r  r   r   r  r  r  r  r  s   &     r;   test_sort_indicesTestCSR.test_sort_indices  st    ay(y!  $!8 Ghhj3;;73;;=#++-8r=   c                j   \        . RO4      p\        . RO4      p\        . RO4      pV P                  WV3RR7      pVP                  4       pVP                  4        \	        VP
                  ^4       \	        VP                  . RO4       \	        VP                  4       VP                  4       4       R# )r  r|  Nr  r.  r.  r.  ri   r.  r/  r.  r  ri   r/  r  r  r  r&  r'  r.  r/  r'  r  r$  )r   r$  rQ  eliminate_zerosr   r  r  r   r  s   &     r;   test_eliminate_zerosTestCSR.test_eliminate_zeros      -.01y!  $!8 Ghhj377A&388I.3;;=#++-8r=   c                (   V P                  \        P                  ! ^4      P                  ^^4      R,          4      pR F  p\	        \        V P                  V4      R4       \        W4      ! 4       p\	        VP                  VP                  4       \        VP                  VP                  4       \        VP                  VP                  4       \        VP                  4       \        \        V4      ! VP                  4       4      4       K  	  R# )r7  r=  TNrB  rC  rD  rE  rF  rG  rH  rI  rJ  r<  rK  rL  rM  rN  rO  rP  rQ  rR  )r$  rK   r   r  r   r#  r	  r   r   r   r  r  r   r   r  r  r@  s   &   r;   test_ufuncsTestCSR.test_ufuncs      ryy}44Q:S@AJA Q/6B"((+qyy"**5qxx3rzz|WR^AIIK-HIJr=   c                t   \        ^4      p\        . RO4      p\        . RO4      pV P                  WV3RR7      p\        ^4      p\        . RO4      p\        . RO4      pV P                  WV3RR7      p\        WE,           P	                  4       VP	                  4       VP	                  4       ,           4       R# )r  r|  Nr  r  r  r'  r  r  r&  ri   r  r.  ri   r  )r   r   r$  r   r   r  s   &     r;   test_unsorted_arithmetic TestCSR.test_unsorted_arithmetic      ay(y!  $!8 Gay*+y!  $!8 Gci((*CKKMCKKM,IJr=   c                   \         P                  ! ^.^.^..4      p\         P                  ! . RO4      p\         P                  P                  R4       V P	                  \         P                  P                  ^^4      4      pV P                  V4      pWAV3,          p\        V4      '       d   VP                  4       p\        WSW3,          4       R# r  re   Nr  
rK   r   r   rf   r)  r  r  r(   r   r   r   rX  rp  r  r  rY  s   &     r;   test_fancy_indexing_broadcast%TestCSR.test_fancy_indexing_broadcast      HHqcA3_%HHY
		tLL1-.NN1!fC==++-CSAC&!r=   c                R   \         P                  ! ^ ^.4      p\         P                  ! ^^ .4      p\         P                  ! ^^.4      p\         P                  ! ^ ^.4      pV P                  W1V34      P                  4       p\	        RVP
                  4       \        VP
                  \        4      '       g   Q hV P                  W2V34      P                  4       p\	        RVP
                  4       VP                  4        \	        RVP
                  4       \        VP                  V4       V P                  W2V34      P                  4       pRVn        \	        RVP
                  4       \        VP                  V4       VP                  4        \        VP                  V4       R# )z@Ensure has_sorted_indices memoizes sorted state for sort_indicesTFN)rK   r   r$  rQ  r   r  rJ   r?  r  r   r  )r   sorted_indsunsorted_indsr  r  r  s   &     r;   test_has_sorted_indicesTestCSR.test_has_sorted_indices  sG   hh1v&!Q(xxA1a&!6:;@@BT1//0!..5555V<=BBDUA001 	
T1//0199k2V<=BBD#T1//0199m4 	
199m4r=   c                   V P                  \        P                  ! ^.4      \        P                  ! ^ .4      \        P                  ! ^ ^.4      34      p\        RVP                  4       \        P                  ! ^ ^ .4      p\        P                  ! ^^.4      p\        P                  ! ^ ^.4      pV P                  W2V34      P                  4       p\        RVP                  4       \        VP                  \        4      '       g   Q hVP                  4        \        RVP                  4       \        ^\        VP                  4      4       V P                  W2V34      P                  4       pRVn        \        RVP                  4       \        ^\        VP                  4      4       VP                  4        \        ^\        VP                  4      4       R# )z=Ensure has_canonical_format memoizes state for sum_duplicatesTFN)r$  rK   r   r   has_canonical_formatrQ  rJ   r?  sum_duplicatesr   r  )r   r  r  r  r  s   &    r;   test_has_canonical_format!TestCSR.test_has_canonical_format  sa    !rxx}bhh1v>NOPT1112((Aq6"xxA1a&!v67<<>UA223!00$7777 	
T1112QAII'v67<<>!%T1112QAII' 	
QAII'r=   c                N   \         P                  ! ^\         P                  R7      p\         P                  ! ^ \         P                  R7      p\         P                  ! ^ 4      pV P                  W2V3RR7      pV P                  W2V3RR7      p\         P                  ! R\         P                  R7      pV P                  W63RR7      pV P                  W63RR7      pV P                  R4      p	V P                  R4      p
\	        VP
                  P                  \         P                  4       \	        VP
                  P                  \         P                  4       \	        VP
                  P                  \         P                  4       \	        VP
                  P                  \         P                  4       \	        V	P
                  P                  \         P                  4       \	        V
P
                  P                  \         P                  4       WEWxW3 F  pW,            K  	  R# )ri   r  r|  Nr  r          r`  )rK   r   r[   r$  r   r  r@   rj   r   r  r  valsrO   rU   rm  r  r-  r  r  rA   s   &           r;   test_scalar_idx_dtypeTestCSR.test_scalar_idx_dtype%  m    !288,((1BHH-xx{v6lKv6jIXXfBHH-z>z<|,z*QXX^^RXX.QXX^^RXX.QXX^^RXX.QXX^^RXX.QXX^^RXX.QXX^^RXX. a#AEE $r=   c                   V P                  \        P                  ! R 4      .^ .3RR7      pV P                  V4      pVP	                  ^\        P
                  ! VP                  ^ ,          4      ,          4       VR,          ^8X  g   Q hR#   r|  N)r  r  r  r%  rK   r   r  rN  rl  r   r  s   &  r;   test_setdiag_csrTestCSR.test_setdiag_csr=  i    4 1A37|LNN1			!bggaggaj))*yA~~r=   c                    V P                  . RO.4      pV P                  . RO.4      pW,           P                  ^8X  g   Q hVP                  V4      P                  ^8X  g   Q hR# )r.  Nr  r  r  r.  )r$  r  ra  r   rO   rU   s   &  r;   test_binop_explicit_zeros!TestCSR.test_binop_explicit_zerosD  sX     	{+	{+{{azz!}  A%%%r=   rc   N) r   r   r   r   rf  r  rK   r  int_r  r  r2  rW  r[  r^  rm  rt  ry  r  r  r  r  r  r  r  r  r  r  r  r  r   r   r   s   @r;   rN  rN  G  s     . . 88RWWbjj"--@K
-44(,<+$59	9
J	K"58(:0& &r=   rN  c                   6   a  ] tR tRt o ]R 4       tR tRtV tR# )TestCSRMatrixiP  c                    \        4       ;_uu_ 4       pVP                  \        R 4       \        V/ VB uuRRR4       #   + '       g   i     R# ; ir  )r   r`  r)   r   rP  s   &*, r;   r  TestCSRMatrix.spcreatorQ  9      CJJ.0QRt.v. !   rT  c                    \         \        P                  ,          p\        V\        4      '       g   Q hVP
                  \         J g   Q hVP                  \        P                  38X  g   Q hR # r?   )r   rK   r   rJ   r   
__origin____args__r   r  s   & r;   test_spmatrix_subscriptable)TestCSRMatrix.test_spmatrix_subscriptableW  sO    BGG$&,////  J...277*,,,r=   rc   N)	r   r   r   r   rf  r  r  r   r   r   s   @r;   r  r  P  s!     / /
- -r=   r  c                      a  ] tR tRt o ]R 4       t]P                  ]P                  ]P                  ]P                  .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# )TestCSCia  c                    \        4       ;_uu_ 4       pVP                  \        R 4       \        V/ VB uuRRR4       #   + '       g   i     R# ; ir  )r   r`  r)   r    rP  s   &*, r;   r  TestCSC.spcreatorb  rS  rT  c                z   \        . RO. RO. RO.R4      pV P                  V4      p\        VP                  . RO4       \	        VP
                  . RO4       \	        VP                  . R	O4       \        VP                  ^4       \        VP                  VP                  4       \        VP                  R4       R# )
r  r-  r]  Nr  r.  r.  r.  ra  r.  ri   r.  r/  )r  ri   r  r/  )r.  ri   r  ri   r  )r   r#  r   r  r   r  r  r   r  r   r  rV  s   &  r;   rW  TestCSC.test_constructor1i  s}    <|<cB  #!#((953;;y13::k2SWWQSYYqww'SZZ&r=   c                    \        RR4      p^VR&   V P                  V4      p\        VP                  ^.4       \	        VP
                  ^.4       \	        VP                  . RO4       R# )r  r-  NrZ  ri   r  )r.  r.  r.  r.  r.  r  r  )r   r#  r   r  r   r  r  rV  s   &  r;   r[  TestCSC.test_constructor2s  sU    %#  #!#((A3/3;;s+3::o6r=   c                    \        ^^ .^ ^ .^ ^..R4      pV P                  V4      p\        VP                  ^^.4       \	        VP
                  ^ ^.4       \	        VP                  . RO4       R# )r  r-  Nr~  )r   r#  r   r  r   r  r  rV  s   &  r;   r^  TestCSC.test_constructor3{  sc    Aq6Aq6Aq6*C0  #!#((Aa513;;!u-3::g.r=   c                T   \        . RO4      p\        . RO4      p\        . RO4      p\        W34      pV P                  W43R4      p\        \	        ^4      P                  ^^4      VP                  4       4       V P                  . RO. RO. RO334      pVP                  ^8X  g   Q hR# )	ri   Nra  rb  rc  r  ri  rj  rk  )r   r   r#  r   r   r  r   r  )r   r  r  r  rm  r]  s   &     r;   rm  TestCSC.test_constructor4  s    5656CDSI  $516":--a3S[[]C   )i-C!DEww!||r=   c                    \        . RO4      p\        . RO4      p\        . RO4      pV P                  W2V34      p\        VP                  R4       R# r.  Nrq  rr  r  )r  r/  )r   r#  r   r   r   r  r  r  r]  s   &    r;   rt  TestCSC.test_constructor5  rv  r=   c                    . ROp. ROp. ROpV P                  W2V34      p\        VP                  R4       \        \        P
                  ! VP                  \        P                  4      4       R# r  )r#  r   r   r   rK   ro   r@   rx  r  s   &    r;   ry  TestCSC.test_constructor6  sQ      $!89399U+cii)9)9:;r=   c                j   \        . RO4      p\        . RO4      p\        . RO4      pV P                  WV3RR7      pVP                  4       pVP                  4        \	        VP
                  ^4       \	        VP                  . RO4       \	        VP                  4       VP                  4       4       R# )r  r|  Nr  r  r  r4  ri   r$  )r   r#  rQ  r  r   r  r  r   r  s   &     r;   r  TestCSC.test_eliminate_zeros  r  r=   c                (   \        ^4      p\        . RO4      p. ROpV P                  WV3RR7      pVP                  4       pVP	                  4        \        VP                  . RO4       \        VP                  4       VP                  4       4       R# )r  r|  Nr  r  r  r  )r   r   r#  rQ  r  r   r  r   )r   r  r  r~  r  r  s   &     r;   r  TestCSC.test_sort_indices  so    ayO$  $S!1 @hhj3;;73;;=#++-8r=   c                (   V P                  \        P                  ! ^4      P                  ^^4      R,          4      pR F  p\	        \        V P                  V4      R4       \        W4      ! 4       p\	        VP                  VP                  4       \        VP                  VP                  4       \        VP                  VP                  4       \        VP                  4       \        \        V4      ! VP                  4       4      4       K  	  R# )   g      5@TNr  )r#  rK   r   r  r   r#  r	  r   r   r   r  r  r   r  s   &   r;   r  TestCSC.test_ufuncs  r  r=   c                t   \        ^4      p\        . RO4      p\        . RO4      pV P                  WV3RR7      p\        ^4      p\        . RO4      p\        . RO4      pV P                  WV3RR7      p\        WE,           P	                  4       VP	                  4       VP	                  4       ,           4       R# )r  r|  Nr  r  r  r  r  )r   r   r#  r   r   r  s   &     r;   r   TestCSC.test_unsorted_arithmetic  r  r=   c                   \         P                  ! ^.^.^..4      p\         P                  ! . RO4      p\         P                  P                  R4       V P	                  \         P                  P                  ^^4      4      pV P                  V4      pWAV3,          p\        V4      '       d   VP                  4       p\        WSW3,          4       R# r  r  r  s   &     r;   r  %TestCSC.test_fancy_indexing_broadcast  r  r=   c                N   \         P                  ! ^\         P                  R7      p\         P                  ! ^ \         P                  R7      p\         P                  ! ^ 4      pV P                  W2V3RR7      pV P                  W2V3RR7      p\         P                  ! R\         P                  R7      pV P                  W63RR7      pV P                  W63RR7      pV P	                  R4      p	V P	                  R4      p
\        VP                  P                  \         P                  4       \        VP                  P                  \         P                  4       \        VP                  P                  \         P                  4       \        VP                  P                  \         P                  4       \        V	P                  P                  \         P                  4       \        V
P                  P                  \         P                  4       WEWxW3 F  pW,            K  	  R# )	ri   r  r|  N)r  r  )r  r  r`  r  r  )	rK   r   r[   r#  r$  r   r  r@   rj   r  s   &           r;   r  TestCSC.test_scalar_idx_dtype  r  r=   c                   V P                  \        P                  ! R 4      .^ .3RR7      pV P                  V4      pVP	                  ^\        P
                  ! VP                  ^ ,          4      ,          4       VR,          ^8X  g   Q hR# r  r  r  s   &  r;   test_setdiag_cscTestCSC.test_setdiag_csc  r  r=   rc   N)r   r   r   r   rf  r  rK   r  r  r  r  r2  rW  r[  r^  rm  rt  ry  r  r  r  r  r  r  r  r   r   r   s   @r;   r  r  a  s     . . 88RWWbjj"--@K'7/,<	99
J	K"0 r=   r  c                   0   a  ] tR tRt o ]R 4       tRtV tR# )TestCSCMatrixi  c                    \        4       ;_uu_ 4       pVP                  \        R 4       \        V/ VB uuRRR4       #   + '       g   i     R# ; ir  )r   r`  r)   r   rP  s   &*, r;   r  TestCSCMatrix.spcreator  r  rT  rc   N)r   r   r   r   rf  r  r   r   r   s   @r;   r  r    s     / /r=   r  c                      a  ] tR tRt o ]t]P                  ]P                  ]P                  .t
R tR tR tR tR tR tRtV tR	# )
rB  i	  c                    V P                  R4      p^
VR&   ^VR&   WP                  ,          pWP                  P                  4       ,          p\        VP	                  4       VP	                  4       4       R# )r4  N)r4  r2  r  r  r  )r&  rl  r   r   r   )r   rS   r  rm  s   &   r;   	test_multTestDOK.test_mult  sW    x($$G199;		4r=   c                   V P                  R4      pRVR&   ^VR&   V^
,           p\        ^
^ .^
^
.^^
..4      p\        VP                  4       V4       VR,           pVR,           p\        VP                  4       V4       R# r/  r  NrY  iry  r`  )r  r   r   r   r  s   &  r;   test_add_nonzeroTestDOK.test_add_nonzero  sz    NN5!##FB7RHr2h/0199;*FF199;*r=   c                   V P                  R4      pRVR&   ^VR&   \        VR,          P                  4       VP                  4       R,          4       \        V^	,          P                  4       VP                  4       ^	,          4       R# r  r  r   r   r  s   & r;   test_dok_divide_scalarTestDOK.test_dok_divide_scalar!  s_    NN5!##AbD>>+QYY[^<AaC==?AIIKM:r=   c                   ^^r!V P                  W34      p^VR&   ^VR&   ^VR&   ^VR&   ^VR&   ^VR&   \        VP                  4       RV^,
          3,          \        V4      4       VP	                  4       p\        VP                  4       RV^,
          3,          \        V4      4       Y!r!VP                  4       p\        VP                  W34       \        VP                  4       V^,
          R3,          \        V4      4       VP                  4       p\        VP                  4       V^,
          R3,          \        V4      4       R# )	r  r  Nr  r_  r  rS  r  r  )	r&  r   r   r   r  r
   r   r   r  )r   r  rE  rO   r]  rU   r^  s   &      r;   test_convertTestDOK.test_convert)  s   QAv& ###### 	199;q1u-uQy9 ggi3;;=1Q3/q; AKKMQWWqf%199;qs1u-uQy9 ggi3;;=1Q/q;r=   c                   \        \        V P                  4       \        . RO. RO. RO.R4      pV P                  V4      p\	        VP
                  VP
                  4       \	        VP                  4       V4       V P                  V4      p\	        VP                  4       VP                  4       4       . RO. RO.pV P                  V\        P                  R7      p\	        VP
                  \        P                  4       VP                  4       p\	        VP
                  \        P                  4       \        Wd4       R# )	r  r-  r  Nr  ra  r  r~  r  )r=  r  r&  r   r   r@   r   r$  rK   r  r   )r   rU   rS   r  r  r-  das   &      r;   	test_ctorTestDOK.test_ctorH  s    i!3!34 <|<cBq!QWWagg&QYY[!$ q!QYY[!))+.9%t2::6QWWbjj)YY[RXXrzz*2$r=   c                    V P                  R4      p^ VR&   \        RVP                  4       9  R4       V P                  R4      p^ VR&   \        \        VP                  4       4      ^ 8H  R4       R# )r/  zUnexpected entry (0,0) in keyszUnexpected entries in keysNr  r  rP  )r&  r   keysr   r  s   &  r;   test_ticket1160TestDOK.test_ticket1160]  sh    u%# 	QVVX%'GH u%#AFFH"$@Ar=   rc   N)r   r   r   r   r"   r  rK   r  r  r  r2  r  r  r
  r  r  r  r   r   r   s   @r;   rB  rB  	  sG     I77BJJ6K5
+;<>%*B Br=   rB  )rG  rH  c                       ] tR tRt]tRtR# )TestDOKMatrixik  rc   N)r   r   r   r   r   r  r   rc   r=   r;   r  r  k      Ir=   r  c                      a  ] tR tRt o ]t]P                  ]P                  ]P                  .t
R tR tR tR tR tR tR tR	 tR
 tRtV tR# )TestLILis  c                   \        R\        P                  4      p^
VR&   RVR&   V P                  R\        P                  R7      p^
VR&   RVR&   \        P
                  ! 4       R8w  d;   \        WP                  ,          W"P                  ,          P                  4       4       \        WP                  4       P                  ,          W"P                  4       P                  ,          P                  4       4       R# )r4  y              4@r  ppc64leNr4  r4  r  r  )
r   rK   r  r'  platformmachiner   rl  r   r   r  s   &  r;   test_dotTestLIL.test_dotw  s    (BMM*$$xr}}=$$ *q33wSS(9(9(;<1{{}.[[]__1D0M0M0OPr=   c                    V P                  R4      p^VR&   V^,          p\        VR,          ^4       V^ ,          p\        VR,          ^ 4       R# )r/  Nr  r  )r'  r   )r   rA   s   & r;   test_scalar_mulTestLIL.test_scalar_mul  sI    v&$aCQtWa aCQtWa r=   c                   V P                  R4      pRVR&   ^VR&   \        VR,          P                  4       VP                  4       R,          4       \        V^	,          P                  4       VP                  4       ^	,          4       R# r  r	  r  s   & r;   test_truediv_scalarTestLIL.test_truediv_scalar  sc    NN6"$$AF++-qyy{R/?@AE??,aiikAo>r=   c                X   V P                  . R	O. R
O.4      pV P                  . RO. R	O.4      pRW!V,           3RW!V,
          3R^V^,          3/pVP                  4        FV  w  pw  rVVP                  4       p\        VRV R24      ! V4       \	        VP                  4       VP                  4       4       KX  	  V P                  R\        P                  ! R4      R7      pV P                  . RO4      pVR;;,          V,          uu&   \	        VR,          P                  4       V4       R# )r.  addsubmul__i__r  r  Nr.  ri   r/  r  r  r  )皙?r0  r0  r*  )	r'  r3  rQ  r   r   r   rK   r@   r)  )r   rS   rT   r  opr   r  r  s   &       r;   test_inplace_opsTestLIL.test_inplace_ops  s    	956	956q5zq5z1q5z# &*ZZ\!B!VVXFFc"RL)%0v~~/1A1A1CD	 &2 vRXXi-@ALL)	$11T7??,a0r=   c           	         . RO. RO.pV P                  \        V4      4      p\        V4       F:  w  r4\        VP	                  4       \        W,          VP
                  R7      4       K<  	  R# )r  )ndminNr$  r%  )r'  r   r  r   r   r   )r   row_datarT   rO  r  s   &    r;   test_lil_iterationTestLIL.test_lil_iteration  sM    y)uX/lFAs{{}eHKsxx.PQ #r=   c                    V P                  R4      p^
VR&   ^VR&   ^VR&   ^(VR&   ^2VR&   VP                  4       pV P                  V4      p\        VP                  4       VP                  4       4       R# )r4  Nr  r  r  )r'  r/  )r/  r'  )r'  r(  )r'  r  r   r   )r   rT   r  r  s   &   r;   test_lil_from_csrTestLIL.test_lil_from_csr  sp    x($$$$$GGIq!199;		4r=   c                    V P                  \        ^4      P                  ^^4      4      pV P                  V4      p\	        V\        . RO4      R3,          P                  4       V\        . RO4      R3,          4       R# )r  :ri   r/  NNr$  )r)  r   r  r'  r   r   r   )r   r  rS   s   &  r;   test_fancy_indexing_lilTestLIL.test_fancy_indexing_lil  se    LL++Aq12q!QuY',-557uY',-	/r=   c                   V P                  R4      p^VR&   ^VR&   ^VR&   ^VR&   V P                  R4      p^VR&   ^VR&   ^VR&   ^VR&   ^VR&   \        VP                  V4      P                  4       VP                  V4      P                  4       4       \        VP                  V4      P                  4       . R	O. R
O. RO. RO.4       R# )r  Nr  r  r  rZ  r  ry  rY  r  r  r.  r.  r(  )r.     r.  )r'  r   ra  r   )r   lr  s   &  r;   test_point_wise_multiply TestLIL.test_point_wise_multiply  s    v&$$$$v&$$$$$1::a=002::a=002	4 	1::a=002%%%&(	)r=   c                l    V P                  \        P                  ! R4      4      pVR,          p^ VR&   R# )r/  r  Nr  r*  )r'  rK   rl  r  s   & r;   test_lil_multiply_removal!TestLIL.test_lil_multiply_removal  s,    rwwv/	R$r=   rc   N)r   r   r   r   r$   r  rK   r  r  r  r2  r!  r$  r'  r2  r7  r:  r=  rC  rF  r   r   r   s   @r;   r  r  s  sV     I77BJJ6KQ!?1(R
5/). r=   r  )rG  c                       ] tR tRt]tRtR# )TestLILMatrixi  rc   N)r   r   r   r   r   r  r   rc   r=   r;   rI  rI    r  r=   rI  c                      a  ] tR tRt o ]t]P                  ]P                  ]P                  .t
R tR tR tR tR t]P"                  P%                  RRR	7      R
 4       tR tR tR tR tR tR tR tR tRtV tR# )TestCOOi  c                   \        . RO4      p\        . RO4      p\        . RO4      pV P                  W1V33R4      p\        \        ^4      P	                  ^^4      VP                  4       4       V P                  R^.^ ^.^ ^.33\        P                  R7      p\        R^ .^ ^..\        P                  R7      p\        WTP                  4       4       R# )ri   r  Nra  rb  rc  r  rh  )r   r"  r   r   r  r   rK   rl  )r   r  r  r  r  r  s   &     r;   rW  TestCOO.test_constructor1  s    5656CD  $Cy!1%86":--a3S[[]C   9a.Aq6Aq62B!C299 U	1~1v.bii@5++-0r=   c                    \        . RO4      p\        . RO4      p\        . RO4      pV P                  W1V33R4      p\        . RO. RO. RO.4      p\        WTP                  4       4       R# )	r.  N)
r.  r  ri   ri   ri   ri   r.  r.  ri   ri   )
r.  ri   r.  ri   r  r  r  r.  r.  ri   )
ri   r(  r  r  r&  r.  r  ri   r  r  r  )r  r  r.  r@  )r  r&  r.  )r   r"  r   r   )r   r  r  r  r  r   s   &     r;   r[  TestCOO.test_constructor2  s[    )*)*-.  $Cy!1%8ZJ783.r=   c                   V P                  R4      p\        VP                  R4       \        VP                  . 4       \        VP                  . 4       \        VP
                  . 4       \        VP                  4       \        R4      4       R# r  Nr  )r"  r   r   r  r  r  r   r   r   r  s   & r;   r^  TestCOO.test_constructor3
  s^      '399U+3772&3772&388B'3;;=%-8r=   c                   \        . RO. RO. RO.4      pV P                  V4      p\        VP                  4       V4       \        . RO4      pV P                  V4      pV P                  '       d   TMVP                  ^R	4      p\        VP                  4       V4       \        P                  ! \        RR7      ;_uu_ 4        V P                  . R
O. RO. RO34       RRR4       \        P                  ! \        RR7      ;_uu_ 4        V P                  . R
ORR7       RRR4       R#   + '       g   i     LT; i  + '       g   i     R# ; i)r.  zobject cannot be interpretedr  Nrl  r|  r.  r  r.  r.  )r&  r.  r/  r.  )r.  r  r.  r.  r  )r.  rf     !   r  r5  r]  )
r   r"  r   r   r6  r  rC  r   r  r>  )r   r   r  r  s   &   r;   rm  TestCOO.test_constructor4  s    Y  !   %3;;=#. I  %,,,3#++a2D3;;=(3 ]]9,KLL|0LM M ]]:-CDDf= ED	 ML EDDs   D)	D<)D9	<E	c                    ^.pV P                  V^ .^ .33RR7      pVP                  \        P                  ! V4      P                  8X  g   Q hR# )r  Nr  )r"  r@   rK   r   )r   r  r  s   &  r;   "test_constructor_data_ij_dtypeNone*TestCOO.test_constructor_data_ij_dtypeNone*  sK    s  $!qc
!34 @yyBHHTN00000r=   FzCOO does not have a __getitem__runreasonc                    R # r?   rc   r   s   &r;   r  TestCOO.test_iterator/      r=   c                    ^ ^ ..pV P                  V4      P                  4       p\        VP                  4       V4       R# rC  )r"  todiar   r   )r   r   r  s   &  r;   test_todia_all_zerosTestCOO.test_todia_all_zeros3  s6    Q  '--/3;;=%0r=   c                   V P                  R4      pVP                  4        V P                  ^^.^^ .^^ .334      pVP                  4        \        VP                  4       ^^ .^ ^..4       V P                  ^^.^^.^^.334      pVP                  4        \        VP                  4       ^ ^ .^ ^..4       \        VP                  ^.4       \        VP
                  ^.4       \        VP                  ^.4       R# rQ  )r"  r  r   r   r  r  r  rR  s   & r;   test_sum_duplicatesTestCOO.test_sum_duplicates8  s      '  1Q%1Q%!A!893;;=Aa5!A-8  1Q%1Q%!A!893;;=Aa5!A-8377QC(377QC(388aS)r=   c                    V P                  . RO. RO. RO334      pVP                  4       p\        VP                  4       VP                  4       4       R# r  Nri  rj  rk  )r"  r"  r   r   )r   r  rE   s   &  r;   test_todok_duplicatesTestCOO.test_todok_duplicatesE  s=      )i-C!DEiik3;;=#++-8r=   c                   V P                  . RO. RO. RO334      pVP                  4       p\        VP                  ^,           VP                  4       VP	                  4       p\        VP                  ^,           VP                  4       R# rj  )r"  r  r   r  r  )r   r  r^  r]  s   &   r;   test_tocompressed_duplicates$TestCOO.test_tocompressed_duplicatesJ  s^      )i-C!DEiikSWWq[#''*iikSWWq[#''*r=   c                \   \        . RO4      p\        . RO4      p\        . RO4      pV P                  WV33RR7      pVP                  4       pVP                  4        \	        VP
                  ^ 8g  P                  4       4       \        VP                  4       VP                  4       4       R# )r  r|  Nr  )r.  r.  r.  r  r  r  r  r  r  r  )	r   r"  rQ  r  r   r  allr   r   )r   r  r  r  r  r  s   &     r;   r  TestCOO.test_eliminate_zerosQ  s    -.,-,-  $c
!36 BhhjQ##%&3;;=#++-8r=   c                   . RO. RO. RO.pRpV P                  V4      pVP                  V4      p\        VP                  VP                  J 4       VP                  VRR7      p\        VP                  VP                  J 4       VP                  VRR7      p\        \        P
                  ! VP                  VP                  4      '       * 4       R# )	r.  Fr0  TNr3  r5  r6  r9  )r"  r  r   r  rK   rR   )r   rr   	new_shaperA   rB   s   &    r;   test_reshape_copyTestCOO.test_reshape_copy[  s    lO<	s#IIi !&& !IIieI,!&& !IIidI+B''778r=   c                   V P                  ^.R.R.33R4      pV P                  ^.R.R.33R4      p\        VP                  RRR7      V8g  P                  ^ 8H  4       \        VP                  RRR7      V8g  P                  ^ 8H  4       R# )	r  i- r:  r  r-  r1  N)-   )ry  rx  )r"  r   r  r  )r   mat1mat2s   &  r;   test_large_dimensions_reshape%TestCOO.test_large_dimensions_reshapei  s     !!A3'TF(;"<oN!!A3$'(;"<oN 	oS9TAFF!KLoS9TAFF!KLr=   c                   \         \        P                  \        \        ,          3,          p\        V\        4      '       g   Q hVP                  \         J g   Q hVP                  \        P                  \        \        ,          38X  g   Q h\         \        P                  ,          p\        V\        4      '       g   Q hVP                  \         J g   Q hVP                  \        P                  38X  g   Q hR # r?   )	r#   rK   r   rj  rw  rJ   r   r  r  r  s   & r;   test_sparray_subscriptable"TestCOO.test_sparray_subscriptablet  s    277E#J./&,////  I---277E#J"7777277#&,////  I---277*,,,r=   rc   N)r   r   r   r   r#   r  rK   r  r  r  r2  rW  r[  r^  rm  rZ  rC  rg  xfailr  rd  rg  rk  rn  r  ru  r|  r  r   r   r   s   @r;   rK  rK    s      I77BJJ6K1	/9>,1
 [[5)JK L1
*9
+99	M	- 	-r=   rK  )r@  rA  rB  rC  rD  c                       ] tR tRt]tRtR# )TestCOOMatrixi  rc   N)r   r   r   r   r   r  r   rc   r=   r;   r  r    r  r=   r  c                   @  a  ] tR tRt o ]t]P                  ]P                  ]P                  .t
R t]P                  P                  RRR7      R 4       t]! ^4      R 4       t]P                  P%                  RR	7      R
 4       tR tR tR tR tR tR tR tRtV tR# )TestDIAi  c                   \        . RO. RO. RO. RO.4      p\        P                   ! . RO.4      P                  ^^ R7      p\        P                   ! . R	O4      p\        V P	                  W#3R
R7      P                  4       V4       R# )r  r  r|  N)r  r.  r/  r.  )r  ri   r.  r  )r.  ri   r/  r.  )r.  r.  r/  r  r  r.  r  ri   r]  )r   rK   repeatr   r%  r   )r   r  r  r  s   &   r;   rW  TestDIA.test_constructor1  sr    <! " xx$++A1+5((8$T''v'FNNPRSTr=   FzDIA does not have a __getitem__r\  c                    R # r?   rc   r   s   &r;   r  TestDIA.test_iterator  ra  r=   c                V   V P                  \        P                  ! ^4      4      p\        VP                  P
                  \        P                  4       VP                  R^R7       \        VP                  P
                  \        P                  4       V P                  \        P                  ! ^4      4      p\        VP                  P
                  \        P                  4       VP                  R^R7       \        VP                  P
                  \        P                  4       R# )r/  r  Nr  )	r%  rK   r'   r   r  r@   r[   rN  rj   r   r  s   & r;   test_setdiag_dtypeTestDIA.test_setdiag_dtype  s    rvvay)QYY__bhh/			$!	QYY__bhh/rvvay)QYY__bhh/			$!	QYY__bhh/r=   zDIA stores extra zerosr^  c                    R # r?   rc   r   s   &r;   r)  TestDIA.test_getnnz_axis  ra  r=   c                    V P                  . RO.R.3RR7      pVP                  4       p\        VP                  4       P                  4       V4       \        VP	                  4       P                  4       V4       R# )r  r|  Nr  r  r  )r%  r   r   r  r  )r   r  r  s   &  r;   test_convert_gh14555TestDIA.test_convert_gh14555  s]    bT2&A99;1779,,.91779,,.9r=   c                >   V P                  ^^.^^..4      P                  4       p\        P                  ! VP                  VP
                  3VP                  4      p\        P                  ! \        P                  ! V4      ^ 8  4      pVP                  V8X  g   Q hR# r<  )
r%  r  rK   ravel_multi_indexr  r  r   rq  diffr  )r   r  	flat_indsinds_are_sorteds   &   r;   test_tocoo_gh10050TestDIA.test_tocoo_gh10050  sz    AA/0668((!%%A	&&!3a!78%%888r=   c                >   \         P                  ! . RO.4      P                  ^^ R7      p\         P                  ! . RO\         P                  R7      p\        P
                  ! W3RR7      pVP                  4       pVP                  P                  \         P                  8X  g   Q hVP                  4       pVP                  P                  \         P                  8X  g   Q hVP                  4       pVP                  P                  \         P                  8X  g   Q hR# )r  r  r  r|  Nr  r  r]  )rK   r   r  r[   r   r%   r  r  r@   r  r  r  )r   r  r  r  r  r^  r]  s   &      r;   test_tocoo_tocsr_tocsc_gh19245&TestDIA.test_tocoo_tocsr_tocsc_gh19245  s    xx'..qq.9((:RXX6f=iikww}}(((iik{{  BHH,,,iik{{  BHH,,,r=   c                t   \        ^^.4      pV\        ^.^4      ,           p\        V4      p\        V4      pW4,           p\        V\        4      '       g   Q h\        VP	                  4       W,           4       WC,           p\        V\        4      '       g   Q h\        VP	                  4       W!,           4       R# r<  )r   r   rJ   r   r   r   rS   rT   rl  rb  rd  s   &     r;   test_add_sparseTestDIA.test_add_sparse  s    !QLaS!mmi#z****3;;=!%0i#z****3;;=!%0r=   c                .   \        ^^.4      pV\        ^.^4      ,           p\        V4      p\        V4      pW4,
          p\        V\        4      '       g   Q h\        VP	                  4       W,
          4       WC,
          p\        V\        4      '       g   Q h\        VP	                  4       W!,
          4       VP                  R4      p\        W4,
          P	                  4       W,
          4       \        WC,
          P	                  4       W!,
          4       R# )r  r^  N)r   r   rJ   r   r   r  r  s   &     r;   test_sub_sparseTestDIA.test_sub_sparse  s    !QLaS!mmi#z****3;;=!%0i#z****3;;=!%0ll5!CI..0!%8CI..0!%8r=   c                \   V P                  ^^.^ ^..4      pV^,          p\        W!P                  4      '       g   Q h\        VP	                  4       ^^.^ ^..4       VP                  ^4      p\        W1P                  4      '       g   Q h\        VP	                  4       ^^.^ ^..4       R# r<  )r%  rJ   r  r   r   ra  )r   r  resres2s   &   r;   r/  TestDIA.test_mul_scalar  s    AA/0!e#{{++++3;;=Aq6Ar7*;<zz!}$,,,,4<<>QFQG+<=r=   c                   \        . RO. RO.4      p\        ^^.^^.^^..4      p\        V4      p\        V4      pRVP                  VP                  ^ 8H  &   RVP                  VP                  ^ 8H  &   \        VP	                  4       V4       \        VP	                  4       V4       W,          pW4,          p\        V\        4      '       g   Q h\        VP	                  4       V4       \        VP                  . RO4       \        VP                  \        V4      P                  4       W!,          pWC,          p\        V\        4      '       g   Q h\        VP	                  4       V4       \        VP                  . RO4       \        VP                  \        V4      P                  4       \        . RO. R	O.^R.3R
4      p\        . RO. RO.R^.3R
4      pW4,          p\        VP                  \        R^ .4      4       \        VP                  . RO. RO.4       WC,          p\        VP                  \        R^ .4      4       \        VP                  . RO. RO.4       R# )r  Nr$  r%  r  r  rv  )rv  r  r.  r  ri   )r  r  r  )r  r  rg  r  )rd  r  rf  )r  r  re  r  )      8@g     A@r  )rd        ,@      ;@)r  r  r  )r  rd  r  )r   r   r  r   r   rJ   r  )r   rS   rT   rl  rb  r  rd  s   &      r;   test_matmul_diaTestDIA.test_matmul_dia  s    9 B888  mm"$Q"$Q3;;=!,3;;=!,Ei#z****3;;=!,3;;
3388Z]%7%78Ei#z****3;;=!,3;;(9:388Z]%7%78 <6B@&I<6Q@&Ii3;;r1g7388n&4&6 	7 i3;;r1g7388m&4&6 	7r=   rc   N)r   r   r   r   r%   r  rK   r  r  r  r2  rW  rC  rg  r  r  r   r  rD  r)  r  r  r  r  r  r/  r  r   r   r   s   @r;   r  r    s      I77BJJ6KU [[5)JK L Q	0  	0 [[56 7:9-19&	>*7 *7r=   r  )r@  rA  rB  rC  rD  rG  rH  c                       ] tR tRt]tRtR# )TestDIAMatrixi   rc   N)r   r   r   r   r   r  r   rc   r=   r;   r  r     r  r=   r  c                     a  ] tR tRt o ]t]P                  ]P                  ]P                  .t
R tR tR tR tR tR tR tR	 tR
 tR tR t]P.                  P1                  RRR7      R 4       t]P.                  P1                  RRR7      R 4       tR t]P.                  P1                  RRR7      R 4       t]P.                  P;                  ]RR7      R 4       tRt V t!R# )TestBSRi(  c                   \        . RO4      p\        . RO4      p\        R4      p\        . RO. RO.4      V^ &   \        . RO. R	O.4      V^&   \        . R
O. RO.4      V^&   \        . RO. RO.4      V^&   \        . RO. RO. RO.. RO. RO.4      pV P                  W2V3RR7      p\	        VP                  4       V4       V P                  W2V34      p\	        VP                  4       V4       R# r.  r|  N)r.  ri   ri   r  )r.  ri   ri   r/  )r  ri   r/  r~  r  r  )r  r.  r4  )r.  r  r'  )r2  r.  r7  )r.  r  r4  )r  r.  r  r  r5  r  r  r2  )r   r   r   r!  r   r   )r   r  r  r  rS   rl  s   &     r;   rW  TestBSR.test_constructor1/  s    y!	"W~"$ %Q#% &Q$& 'Q$& 'Q )Ii0772CD  $v!6V DS[[]A&   $v!67S[[]A&r=   c                   R F7  p\        V4      p\        V P                  V4      P                  4       V4       K9  	  \        R4      p\        V P                  VRR7      P                  4       V4       \        V P                  VRR7      P                  4       V4       \	        . R	O. R
O. RO.. RO. RO.4      p\        V P                  V4      P                  4       V4       \        V P                  VRR7      P                  4       V4       \        V P                  VRR7      P                  4       V4       \        V P                  VRR7      P                  4       V4       \        V P                  VRR7      P                  4       V4       \        V P                  VRR7      P                  4       V4       \        V P                  VRR7      P                  4       V4       \        V P                  VRR7      P                  4       V4       \	        . R	O. RO. R
O.. RO. RO.4      p\        V P                  VRR7      P                  4       V4       R# )r  r  r|  Nr  )r  rT  r  )r4  r  )r/  r&  r  )r  r  rZ  r  r  r5  r  r~  r  r  r9  )ri   r2  )r/  r2  rU  )r   r   r!  r   r   )r   r   rS   s   &  r;   r[  TestBSR.test_constructor2F  s    BEeA++A.668!< B %LT''V'<DDFJT''V'<DDFJ)Ii0772CDT''*224a8T'''9AACQGT''V'<DDFJT''V'<DDFJT''V'<DDFJT''W'=EEGKT''W'=EEGKT''W'=EEGK)Ii0772CDT''V'<DDFJr=   c                    . RO. RO. RO33p\        ^^ .^^..4      p\        V P                  VRR7      P                  4       V4       R# )r  r  Nr$  rh  r  rZ  )r   r   r!  r   )r   argrS   s   &  r;   r^  TestBSR.test_constructor3^  sJ    '*+Aa5!A- T''v'>FFH!Lr=   c                &   ^p\         P                  ! W^3\         P                  R7      p\         P                  ! ^ V.\         P                  R7      p\         P
                  ! V\         P                  R7      pV P                  W$V3V^3RR7       R# )r'  r  F)r  rQ  N)rK   rl  r   r   r[   r   r!  )r   rE  r  r  r  s   &    r;   rm  TestBSR.test_constructor4d  sk     wway01a&1))ARXX.D62q!f5Qr=   c                p   ^p\         P                  ! V4      p\         P                  ! WV34      p\         P                  ! ^ V.4      p\         P                  ! V4      p\	        \
        4      ;_uu_ 4        V P                  W%V34       RRR4       \	        \
        4      ;_uu_ 4        V P                  W5V3RR7       RRR4       \	        \
        4      ;_uu_ 4        V P                  W5V3RR7       RRR4       R#   + '       g   i     L|; i  + '       g   i     LZ; i  + '       g   i     R# ; i)r'  Nr  rB  r  )rK   rl  r   r   r=  r>  r!  )r   rE  	data_1dimr  r  r  s   &     r;   rt  TestBSR.test_constructor5m  s    GGAJ	wway!1a&!))A,:&&	F;< ' :&&v6)L ' :&&v6&I '& '& '& '&&s$   6C>)DD$>D	D!	$D5	c                J   ^.^..^.^...p\         P                  ! ^ ^.\         P                  R7      p\         P                  ! ^ ^.\         P                  R7      pV P                  WV3RR7      pVP                  \         P                  ! V4      P                  8X  g   Q hR# )r  r  r  Nr  )rK   r   r[   r!  r@   )r   rI   r  r  rU   s   &    r;   test_default_dtypeTestBSR.test_default_dtype  s    3*sQCj)1a&1((Aq628FKww"((6*00000r=   c                0   \        . RO4      p\        . RO4      p\        R4      p\        . RO. RO.4      V^ &   \        . RO. R	O.4      V^&   \        . R
O. RO.4      V^&   \        . RO. RO.4      V^&   \        . RO. RO. RO.. RO. RO.4      pV P                  W2V3RR7      pVP	                  4       pVP                  4       P	                  4       p\        VP                  4       V4       \        VP                  4       VP                  4       4       R# r  )r   r   r   r!  r  r  r   r   )r   r  r  r  rS   AbsrAcsrAcsr_via_coos   &       r;   test_bsr_tocsrTestBSR.test_bsr_tocsr  s    |$%Y"$ %Q#% &Q$& 'Q$& 'Q ,l;Y')!!4&"9!Izz|zz|))+T\\^Q'T\\^\%9%9%;<r=   c                   \        . RO^^.^^..4      P                  pVP                  R^^4      p\        . RO4      p\        . RO4      pV P	                  WV3RR7      pVP                  4       pVP                  4        \        VP                  ^4       \        VP                  4       VP                  4       4       R# )r  r|  Nr  r  r  r  )r  r7  )
r   rl  r  r   r!  rQ  r  r   r  r   r  s   &     r;   r  TestBSR.test_eliminate_zeros  s    ,!uaUm<>>||Bq#01y!  $!8 Ghhj377C(3;;=#++-8r=   c                p   \         P                  P                  ^ 4       V P                  \         P                  P                  R4      RR7      p^ VP                  VP                  R8*  &   VP                  4        \        VP                  ^B4       \        VP                  P                  R4       ^ VP                  VP                  R8*  &   VP                  4        \        VP                  ^ 4       \        VP                  P                  R4       \        VP                  4       \         P                  ! R4      4       VP                  4        \        VP                  ^ 4       \        VP                  P                  R4       \        VP                  4       \         P                  ! R4      4       R# )	r.  r  g?r  N)r2  r2  r  )rf  ri   r/  r/  )rK   r   rf   r!  r  r  r   r  r   r   r   r   r  s   & r;   test_eliminate_zeros_all_zero%TestBSR.test_eliminate_zeros_all_zero  s   
		qryy//9VL !"qvv}	QUUB166<<4 !"qvv}	QUUA166<<3199;(:; 	
QUUA166<<3199;(:;r=   c                   V P                  \        ^x4      P                  ^^4      RR7      p\        VP                  ^,          4      P                  R^4      p\	        W,          VP                  4       V,          4       R# ri   r  N)r  r  r  r!  r   r  r   r   r   rF  s   &  r;   test_bsr_matvecTestBSR.test_bsr_matvec  s]    vg66s3?5Q1771:&&r!,QUAIIK!O,r=   c                   V P                  \        ^x4      P                  ^^4      RR7      p\        VP                  ^,          ^,          4      P                  R^4      p\	        W,          VP                  4       V,          4       R# r  r  rF  s   &  r;   test_bsr_matvecsTestBSR.test_bsr_matvecs  sa    vg66s3?5Q1771:a< ((A.QUAIIK!O,r=   FzBSR does not have a __getitem__r\  c                    R # r?   rc   r   s   &r;   r  TestBSR.test_iterator  ra  r=   zBSR does not have a __setitem__c                    R # r?   rc   r   s   &r;   rc  TestBSR.test_setdiag  ra  r=   c                P   \         P                  ! . RO. RO. RO.4      pV P                  VRR7      p\        VP	                  R4      RJ 4       \        VP                  4       ^^ .^^ .^^ ..4       VP	                  R4       \        VP                  4       ^^ .^^ ..4       VP	                  R4       \        VP                  4       ^^ .^^ .^ ^ ..4       VP	                  R	4       \        VP                  4       . R
O. RO. RO.4       \        \        VP                  R4       R# )r  r  NrV  rW  rX  r  rY  rZ  r;  r  r5  r  )	rK   r   r  r   r[  r   r   r=  r>  r  s   &  r;   test_resize_blockedTestBSR.test_resize_blocked  s   HHl""$ % NN1N/ D()199;!Q*+Q*+Q)1 	2 	
199;!Q*+Q)1 	2	199;!Q*+Q*+Q)1 	2 	
199;)5)5)7 	8 	j!((F3r=   c                    R # r?   rc   r   s   &r;   rX  "TestBSR.test_setdiag_comprehensive  ra  r=   zexceeds memory limitr  c                   \         P                  ! ^\         P                  R7      p\         P                  ! ^ \         P                  R7      p\         P                  ! R4      pV P                  W2V3RR7      pV P                  W2V3RR7      pV P                  R4      pV P                  R4      p\	        VP
                  P                  \         P                  4       \	        VP
                  P                  \         P                  4       \	        VP
                  P                  \         P                  4       \	        VP
                  P                  \         P                  4        \         P                  ! R4      p\         P                  ! R4      p	V P                  WV3RR7      p
V P                  WV3RR7      p\	        V
P
                  P                  \         P                  4       \	        VP
                  P                  \         P                  4       WEWgW3 F  pW,            K  	  R#   \        \        3 d    ^ p
^ p L-i ; i)	ri   r  r|  Nrh  r  r  )r.  r  r  )r.  r  r  )
rK   r   r[   r!  r   r  r@   rj   MemoryErrorr>  )r   r  r  r  rO   rU   r  r-  vals2vals3r  r  rA   s   &            r;   r  TestBSR.test_scalar_idx_dtype  s    !288,((1BHH-xx	"v6lKv6jI|,z*QXX^^RXX.QXX^^RXX.QXX^^RXX.QXX^^RXX.
	HH_-EHH]+E""EF#;<"PA""EF#;:"NA22 a#AEE $ Z( 	AA	s   (B2H0 0IIrc   N)"r   r   r   r   r&   r  rK   r  r  r  r2  rW  r[  r^  rm  rt  r  r  r  r  r  r  rC  rg  r  r  rc  r  rX  skipifIS_COLABr  r   r   r   s   @r;   r  r  (  s     I77BJJ6K'.K0MRJ(1=.	9<.-
-
 [[5)JK L [[5)JK L4. [[5)JK L [[)?@ Ar=   r  )r@  rA  rB  rC  rD  rH  c                       ] tR tRt]tRtR# )TestBSRMatrixi  rc   N)r   r   r   r   r   r  r   rc   r=   r;   r  r    r  r=   r  c                   VP                  RR4      p\        P                  ! V P                  \        P                  4      '       g6   \        P                  ! V P                  \        P
                  4      '       d!   Vf   V 3V,           # V 3V,           V3,           # V ^ 8H  P                  4       pV P                  ^^ R7      p V R;;,          ^,          uu&   ^V R&   V^ ,          P                  ^ 8  dz   \        ;QJ d    . R V 4       F  NK  	  5M! R V 4       4      p^V^ ,          ,          3VR,          ,           p^V^ ,          ,          ^,           3VR,          ,           p^ W&   ^ W&   \        ;QJ d    . R V 4       F  NK  	  5M! R V 4       4      pVf   V 3V,           # V 3V,           V^,          3,           # )	z-Duplicates entries to produce the same matrixr  Nr  :NNri   :r  Nri   c              3   2   "   T F  q^ ,          x  K  	  R# 5irC  rc   ).0ps   & r;   	<genexpr>&_same_sum_duplicate.<locals>.<genexpr>0  s     ,)QaDD)s   r  c              3   B   "   T F  qP                  ^4      x  K  	  R# 5i)ri   N)r  )r  r  s   & r;   r  r  6  s     7$w""$s   )
poprK   ro   r@   r  unsignedintegerri  r  rn   rj  )r  indsrC   r  	zeros_pospospos1pos2s   &*,     r;   _same_sum_duplicater    s`   ZZ$'F	}}TZZ**	}}TZZ!3!344>7T>!7T>VI--##%I ;;qq;!DINIDJ |1e,),ee,),,#a&{SW$#a&
}s2w&

57$7557$77D~w~w~!--r=   c                     a a ] tR tRt oRR/V 3R llt]P                  P                  RR7      R 4       t]P                  P                  RR7      R	 4       t	]P                  P                  R
R7      R 4       t
RtVtV ;t# )_NonCanonicalMixini>  sorted_indicesFc               B  < \         SV `  pV! V.VO5/ VB pVP                  4       ^ 8H  P                  4       pV^ ,          P                  ^ 8  pV'       dz   V^ ,          P                  ^,          p	\        4       ;_uu_ 4       p
V
P                  \        R4       V P                  Wg^ ,          V	,          V^,          V	,          4      pRRR4       V P                  Wb4      pRV9  d   VP                  VR&   V! V3/ VB pVP                  \        P                  \        P                  39   d   RpMRp\        VP                  4       VP                  4       VR7       V'       d'   \!        VP"                  ^ 8H  P%                  4       4       V#   + '       g   i     L; i)z[Replace D with a non-canonical equivalent: containing
duplicate elements and explicit zerosr[  Nr   gh㈵>gHz>)rtol)superr  r   ri  rn   r   r`  r)   _insert_explicit_zero_arg1_for_noncanonicalr   r@   rK   r  r  r   r   r  r  )r   r  r  rQ  rC   	constructr  zero_pos	has_zerosr  rc  arg1NCr  r  s   &&$*,         r;   r  _NonCanonicalMixin.spcreator?  sL    G%	a)$)&)IIK1$--/a[%%)	  !#A"$$

24UV..q1+a.(1+a.Q % **1=& ggF7Ot&v& 88

BLL11
 DD

aiik= RWW\&&() 	3 %$s   AFF	z"bool(matrix) counts explicit zerosr  c                    R # r?   rc   r   s   &r;   rF  _NonCanonicalMixin.test_boold  ra  r=   z!getnnz-axis counts explicit zerosc                    R # r?   rc   r   s   &r;   r)  #_NonCanonicalMixin.test_getnnz_axish  ra  r=   znnz counts explicit zerosc                    R # r?   rc   r   s   &r;   r  _NonCanonicalMixin.test_emptyl  ra  r=   rc   )r   r   r   r   r  rC  rg  rD  rF  r)  r  r   r   __classcell__)r  r   s   @@r;   r  r  >  s     # #J [[AB C [[@A B [[89 : r=   r  c                   0   a  ] tR tRt o RR ltR tRtV tR# )_NonCanonicalCompressedMixiniq  c                &   \        VP                  VP                  VP                  R7      w  r4pV'       gX   \	        WUR,          4       FA  w  rgWFV RRR1,          P                  4       WFV% W6V RRR1,          P                  4       W6V% KC  	  W4V3# )5Return non-canonical constructor arg1 equivalent to M)r  r  Nr  )r  r  r  r  r  rQ  )r   r  r  r  r  r  startstops   &&&     r;   r  3_NonCanonicalCompressedMixin._arg1_for_noncanonicalr  s     3AFFAII;<88!Ev"6":6&-D&9$B$&?&D&D&Fd##'d#3DbD#9#>#>#@4   7 f$$r=   c                    ^ WV3&   V# r  rc   r   r  r  rF  s   &&&&r;   r   2_NonCanonicalCompressedMixin._insert_explicit_zero|  s    A#r=   rc   N)F)r   r   r   r   r  r   r   r   r   s   @r;   r  r  q  s     % r=   r  c                      a  ] tR tRt o R tR t]P                  P                  RRR7      R 4       t	]P                  P                  RRR7      R	 4       t
R
tV tR# )_NonCanonicalCSMixini  c                z   a  V 3R  lp\          F)  pR F   pV! \        P                  ! V4      V4       K"  	  K+  	  R# )c                 V  < \        . RO. RO. RO. RO.V R7      pS	P                  W!R7      pVP                  w  rE\        V) V4       F3  p\        V) V4       F  p\	        W6V3,          W&V3,          4       K!  	  K5  	  R F$  p\        \        \        3VP                  V4       K&  	  R# )	r  r  )r  Nr  r  r  r  r  )	r   r  r   rI  r   r=  r\  r  r  )
r@   r  r  rS   r  r  r  rF  rm  r   s
   &&       r;   r@  3_NonCanonicalCSMixin.test_getelement.<locals>.check  s    w  (-.A q@A''CAA2q\r1A Q3Q30 & " Cz95q}}bI Cr=   N)FTr  )r   r@  r@   r  s   f   r;   r  $_NonCanonicalCSMixin.test_getelement  s1    	J  &E"/bhhuo~6 #0 &r=   c                   \         P                  ! ^4      pV P                  V4      pV P                  . RO.4      pVP                  4       VR&   \	        4       ;_uu_ 4       pVP                  \        R4       W2R&   RRR4       \        VP                  4       V4       VP                  4       P                  4       VR&   \	        4       ;_uu_ 4       pVP                  \        R4       VP                  VR&   RRR4       \        VP                  4       V4       R#   + '       g   i     L; i  + '       g   i     L?; i)r/  r[  Nr$  r  r  )
rK   r'   r  r   r   r`  r)   r   rt  rl  )r   r  rS   rT   rc  s   &    r;   test_setitem_sparse(_NonCanonicalCSMixin.test_setitem_sparse  s    FF1INN1NNG9%#  CJJ.0QRcF ! 	199;*""$#  CJJ.0QRSSAcF ! 	199;* !  ! s   !D&D.D+	.D>	Fz(inverse broken with non-canonical matrixr\  c                    R # r?   rc   r   s   &r;   r  _NonCanonicalCSMixin.test_inv  ra  r=   z&solve broken with non-canonical matrixc                    R # r?   rc   r   s   &r;   r  _NonCanonicalCSMixin.test_solve  ra  r=   rc   N)r   r   r   r   r  r   rC  rg  r  r  r  r   r   r   s   @r;   r  r    sc     7*+" [[5)ST U [[5)QR Sr=   r  c                       ] tR tRtRtR# )TestCSRNonCanonicali  rc   Nr   r   r   r   r   rc   r=   r;   r'  r'        r=   r'  c                       ] tR tRtRtR# )TestCSRNonCanonicalMatrixi  rc   Nr(  rc   r=   r;   r+  r+    r)  r=   r+  c                       ] tR tRtRtR# )TestCSCNonCanonicali  rc   Nr(  rc   r=   r;   r-  r-    r)  r=   r-  c                       ] tR tRtRtR# )TestCSCNonCanonicalMatrixi  rc   Nr(  rc   r=   r;   r/  r/    r)  r=   r/  c                      a  ] tR tRt o R t]P                  P                  RRR7      R 4       t]P                  P                  RRR7      R 4       t	R	t
V tR
# )TestBSRNonCanonicali  c                f    VP                  4       p^ WBV3&   VP                  VP                  R7      # )r.  r  )r  r#  r  )r   r  r  rF  rA   s   &&&& r;   r   )TestBSRNonCanonical._insert_explicit_zero  s-    GGIA#www--r=   Fz&diagonal broken with non-canonical BSRr\  c                    R # r?   rc   r   s   &r;   r   !TestBSRNonCanonical.test_diagonal  ra  r=   z"expm broken with non-canonical BSRc                    R # r?   rc   r   s   &r;   r  TestBSRNonCanonical.test_expm  ra  r=   rc   N)r   r   r   r   r   rC  rg  r  r   r  r   r   r   s   @r;   r1  r1    s^     .
 [[5)QR S [[5)MN Or=   r1  c                       ] tR tRtRtR# )TestBSRNonCanonicalMatrixi  rc   Nr(  rc   r=   r;   r9  r9    r)  r=   r9  c                   6   a  ] tR tRt o RR ltR tR tRtV tR# )TestCOONonCanonicali  Nc                h    \        VP                  VP                  VP                  4      w  r4pW4V33# )r  )r  r  r  r  )r   r  r  r  r  r  s   &&&   r;   r  *TestCOONonCanonical._arg1_for_noncanonical  s-    ,QVVQUUAEEB33Zr=   c                   \         P                  VP                  P                  P	                  ^ 4      VP                  3,          Vn        \         P                  VP
                  P                  P	                  V4      VP
                  3,          Vn        \         P                  VP                  P                  P	                  V4      VP                  3,          Vn        V# r  )rK   r_r  r@   r  r  r  r  s   &&&&r;   r   )TestCOONonCanonical._insert_explicit_zero  s    qvv||((+QVV34aeekk&&q)15501aeekk&&q)15501r=   c                :   V P                  \        P                  ! ^4      4      pVP                  4        VP	                  ^^.^R7       VP                  4        \        \        P                  ! \        P                  ! VP                  4      ^ 8  4      4       R# )r/  r  N)	r  rK   r'   r  rN  r   rq  r  r  r  s   & r;   test_setdiag_noncanonical-TestCOONonCanonical.test_setdiag_noncanonical  sf    NN266!9%				1a&A		rwwquu~*+,r=   rc   r?   )	r   r   r   r   r  r   rB  r   r   r   s   @r;   r;  r;    s      
- -r=   r;  c                       ] tR tRtRtR# )TestCOONonCanonicalMatrixi  rc   Nr(  rc   r=   r;   rE  rE    r)  r=   rE  c              #     "   V R8X  d'   \         \        \        \        \        \
        \        .pM=V R8X  d'   \        \        \        \        \        \        \        .pM\        RV : R24      hRRRRR	RR
RRRRRRRRR/pV F  p\        \!        V4      4       F  p\#        W44      pVP%                  R4      '       g   K'  \#        VRR4      '       d   K<  . pVP'                  V4      p\)        V4      '       d)   V\*        P,                  P/                  VR7      .,          p\#        VR. 4      pV F'  p	V	P0                  R9   g   K  VP3                  V	4       K)  	  \*        P4                  ! W4VR7      x  K  	  K  	  R# 5i)a  Yield all tests for all formats that use get_index_dtype

This is more than testing get_index_dtype. It allows checking whether upcasting
or downcasting the index dtypes affects test results. The approach used here
does not try to figure out which tests might fail due to 32/64-bit issues.
We just run them all.
So, each test method in that uses cases_64bit reruns most of the test suite!
r*   r+   zparameter sp_api=z& is not one of 'sparray' or 'spmatrix'r  z%expm for 64-bit indices not availabler  z)linsolve for 64-bit indices not availabler  r  ztest implemented in base classr|  z%test actually requires 64-bit to workr  ztest verifies int32 indexesr  ztest verifies int64 indexesr  r5  rh  Fr  
pytestmark)marksN)r  rD  r  xslow)r  rK  r  rN  r  rB  r  r  r  r  r  r  r  rI  r>  sorteddirr   r8  r?  r?  rC  rg  rD  r   rM   param)
sp_apiTEST_CLASSES
SKIP_TESTSr7  method_namemethodrH  r7   markersrg  s
   &         r;   cases_64bitrS    sc     '7G
 !' 
:	%}m&& -fY.TUVV 	<?A!A')P#%B#%B(*G	J !#c(+KS.F&&w//66 nn[199fkk..c.:;;E!&,;#Dyy$HHT* $ ll35AA , s   B8E>?E>A,E>9E>c            
          a  ] tR tRt o ]]]]]]	]
]]].
tR t]P"                  P$                  R 4       t]P"                  P$                  R 4       t]P"                  P$                  R 4       tRtV tR# )	Test64Biti&  c                   \         P                  ! V4      pVP                  R9   d;   VP                  P                  V8H  ;'       d    VP                  P                  V8H  # VP                  R8X  d;   VP
                  P                  V8H  ;'       d    VP                  P                  V8H  # VP                  R8X  d   VP                  P                  V8H  # \        RV: R24      h)r]  r  r  zmatrix z has no integer indices)r]  r^  r\  )	rK   r@   r  r  r  r  r  r  r>  )r   r  r@   s   &&&r;   _compare_index_dtypeTest64Bit._compare_index_dtype-  s    88,,IIOOu,KK188>>U3JKXXEEKK5(DDquu{{e/CDXXIIOOu,-wqe+BCDDr=   c                h   a  \        ^
R7      V 3R l4       pS P                   F  pV! V4       K  	  R# )r4  rt   c                 D  < V ! \         P                  P                  ^
^4      4      p\        SP	                  V\         P
                  4      4       V ! \         P                  P                  ^^4      4      p\        SP	                  V\         P                  4      4       R# )r4  N)rK   r   r  r   rW  r[   rj   )mat_clsr  r   s   & r;   r@  4Test64Bit.test_decorator_maxval_limit.<locals>.check<  sg    		r1-.AD--a:;		r1-.AD--a:;r=   Nr   MAT_CLASSESr   r@  r\  s   f  r;   test_decorator_maxval_limit%Test64Bit.test_decorator_maxval_limit8  s5     
!b	1	< 
2	< ''G'N (r=   c                h   a  \        R R7      V 3R l4       pS P                   F  pV! V4       K  	  R# )Tr   c                 d  < R pR p\        ^d4       F  pV ! \        P                  P                  ^	^	4      4      pT;'       g!    SP	                  V\        P
                  4      pT;'       g!    SP	                  V\        P                  4      pV'       g   K  V'       g   K   R# 	  \        R4      h)Fz#both 32 and 64 bit indices not seenN)rI  rK   r   r  rW  r[   rj   rv   )r\  seen_32seen_64r  r  r   s   &    r;   r@  5Test64Bit.test_decorator_maxval_random.<locals>.checkJ  s    GG3ZBIINN1a01!KKT%>%>q"((%K!KKT%>%>q"((%K7ww   %%JKKr=   Nr^  r`  s   f  r;   test_decorator_maxval_random&Test64Bit.test_decorator_maxval_randomF  s7     
!	-
	L 
.
	L ''G'N (r=   c                8   \        \        P                  ^R7      R 4       p\        \        P                  R7      R 4       pV! \        \        \
        4       V! \        \        \
        4       V! \        \        \        4       V! \        \        \        4       R# )r  )rd   ry   c                    V ! ^^.^^.^^..4      p\        \        VP                  ^R7       \        \        VP                  ^ R7       V! . RO. RO.4      p\        \        VP                  ^ R7       \        \        VP                  ^R7       V! . RO. RO.4      p\        \        VP                  ^ R7       RVn        \        \        VP
                  4       R# r  r  FNr$  )r/  r  r  r  )r=  rv   r  rz  r  r  r#  r$  r"  rO   s   &&& r;   check_limited3Test64Bit.test_downcast_intp.<locals>.check_limitedb  s     1v1v1v67A.!//B.!%%a8y)45A.!//B.!%%a8y)45A.!//B%*A".!*:*:;r=   rd   c                 B   V ! ^^.^^.^^..4      pVP                  ^R7       VP                  ^ R7       V! . RO. RO.4      pVP                  ^ R7       VP                  ^R7       V! . RO. RO.4      pVP                  ^ R7       RVn        VP                  4        R# rm  )r  rz  r  r  rn  s   &&& r;   check_unlimited5Test64Bit.test_downcast_intp.<locals>.check_unlimitedr  s     1v1v1v67AOOO#EEqEMy)45AOOO#EEqEMy)45AOOO#%*A"r=   N)	r   rK   rj   r    r!   r#   r   r   r   )r   ro  rs  s   &  r;   test_downcast_intpTest64Bit.test_downcast_intpZ  sq     
!RXXq	I	< 
J	< 
!RXX	6	 
7	 	iI6	9i8j*j9
J
;r=   rc   N)r   r   r   r   r   r   r   r   r   r&   r#   r    r!   r%   r_  rW  rC  rg  thread_unsafera  ri  ru  r   r   r   s   @r;   rU  rU  &  s      	J
J
9iIK
	E [[  [[ & [[*< *<r=   rU  c                   &   a  ] tR tRt o R tRtV tR# )RunAll64Biti  c                8    \        R/ VB R  4       pV! W4       R# )c                    V ! 4       p\        VR 4      '       d   VP                  4         \        W!4      ! 4        \        VR4      '       d   VP                  4        R# R#   \        TR4      '       d   TP                  4        i i ; i)setup_methodteardown_methodN)r#  r|  r   r}  )r7  rP  instances   && r;   r@  ,RunAll64Bit._check_resiliency.<locals>.check  sq    uHx00%%'/.08%677,,. 878%677,,. 8s   A! !%BNrc   )r   )r   r7  rP  r   r@  s   &&&, r;   _check_resiliencyRunAll64Bit._check_resiliency  s(     
!	&2	&	/ 
'	/ 	cr=   rc   N)r   r   r   r   r  r   r   r   s   @r;   ry  ry    s        r=   ry  c                     a  ] tR tRt o ]P
                  P                  R]! R4      4      R 4       t]P
                  P                  ^4      ]P
                  P                  R]! R4      4      R 4       4       t
]P
                  P                  R]! R4      4      R 4       t]P
                  P                  R]! R4      4      R 4       tRtV tR	# )
Test64BitArrayi  cls,method_namer*   c                ,    V P                  W^
R7       R# r4  rZ  Nr  r   r7  rP  s   &&&r;   test_resiliency_limit_10'Test64BitArray.test_resiliency_limit_10      sbAr=   c                ,    V P                  WR R7       R# Trd  Nr  r  s   &&&r;   test_resiliency_random%Test64BitArray.test_resiliency_random       	s=r=   c                H    V P                  W\        P                  R 7       R# rq  Nr  rK   r[   r  s   &&&r;   test_resiliency_all_32%Test64BitArray.test_resiliency_all_32      sRXXFr=   c                H    V P                  W\        P                  R 7       R# r  r  rK   rj   r  s   &&&r;   test_resiliency_all_64%Test64BitArray.test_resiliency_all_64  r  r=   rc   N)r   r   r   r   rC  rg  parametrizerS  r  r  r  r  r  r   r   r   s   @r;   r  r    s     
 [[.I0FGB HB [[1[[.I0FG> H > [[.I0FGG HG [[.I0FGG HGr=   r  c                   (  a  ] tR tRt o ]P
                  P                  ^4      ]P
                  P                  R]! R4      4      R 4       4       t	]P
                  P                  R]! R4      4      R 4       t
]P
                  P                  ^4      ]P
                  P                  R]! R4      4      R 4       4       t]P
                  P                  R]! R4      4      R 4       t]P
                  P                  R]! R4      4      R 4       tR	tV tR
# )Test64BitMatrixi  r  r+   c                ,    V P                  WR R7       R# )T)r   Nr  r  s   &&&r;   
test_no_64Test64BitMatrix.test_no_64  s     	sdCr=   c                ,    V P                  W^
R7       R# r  r  r  s   &&&r;   r  (Test64BitMatrix.test_resiliency_limit_10  r  r=   c                ,    V P                  WR R7       R# r  r  r  s   &&&r;   r  &Test64BitMatrix.test_resiliency_random  r  r=   c                H    V P                  W\        P                  R 7       R# r  r  r  s   &&&r;   r  &Test64BitMatrix.test_resiliency_all_32  r  r=   c                H    V P                  W\        P                  R 7       R# r  r  r  s   &&&r;   r  &Test64BitMatrix.test_resiliency_all_64  r  r=   rc   N)r   r   r   r   rC  rg  r  r  rS  r  r  r  r  r  r   r   r   s   @r;   r  r    s     [[1[[.J0GHD I D
 [[.J0GHB IB [[1[[.J0GH> I > [[.J0GHG IG [[.J0GHG IGr=   r  c                     \         P                  ! . RO.4      p \         P                  ! ^.^ .^..4      p\         P                  ! . RO. RO.4      p\         P                  ! ^..4      p\         P                  ! ^ ..4      p\         P                  ! . RO.4      p\        \        \        \
        3 EF&  pV! V 4      P                  R4      pV! V4      P                  R	4      pV! V4      P                  R4      p	V! V4      P                  R
4      p
V! V4      P                  R4      pV! V4      P                  R4      p\        VP                  4       \         P                  ! V R4      4       \        VP                  4       \         P                  ! VR	4      4       \        V	P                  4       V4       \        V
P                  4       \         P                  ! VR
4      4       \        VP                  4       \         P                  ! VR4      4       \        VP                  4       \         P                  ! VR4      4       \        P                  ! \        RR7      ;_uu_ 4        V! . RO. RO.4      P                  RR7       RRR4       \        P                  ! \        RR7      ;_uu_ 4        V! . RO.4      P                  RR7       RRR4       EK)  	  R#   + '       g   i     L_; i  + '       g   i     EKR  ; i)r  zcannot be broadcastr  r|  Nr  r  r5  r  r;  r]  r  r  )r  ri   r.  r^  r  r~  rY  )rK   r   r   r    r   r!   _broadcast_tor   r   broadcast_torC  r   r>  )rO   rU   r  r-  r  r  	containerres_ares_bres_cres_dres_eres_fs                r;   test_broadcast_tor    s   
)A
1#sQC!A
)Y'(A
1#A
1#A
)A )ZC	!**51!**51!**51!**51!**51!**515==?BOOAu,EF5==?BOOAu,EF5==?A.5==?BOOAu,EF5==?BOOAu,EF5==?BOOAu,EF]]:-BCCy),-;;&;I D ]]:-BCCyk"00v0> DC# D DC DCCs   (K3K1K.1Lr?   )NFNNF)T)	TTTTTTTTT)r   
contextlibr1  r  r  r  sysrC  r   r=  numpyrK   r   r   r   r   r   r   r	   r
   r   r   r   r   r   r   numpy.testingr   r   r   r   r   r   r   numpy.exceptionsr   typesr   scipy.linalgr~   r  r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   scipy.sparse._baser,   scipy.sparse._sputilsr-   r.   r/   r0   r1   scipy.sparse.linalgr2   r3   r4   scipy._lib.decoratorr5   r   r  r<   rD   	frozensetra  rV   ra  r`  r   r   r   r   r   r  r+  rj  r  rg  rw  r  r  r   rJ  contextmanagerr  r  r  r  r  r  r$  r<  rL  rN  r8  r  r  r  rB  r  r  rI  rK  r  r  r  r  r  r  r  r  r  r'  r+  r-  r/  r1  r9  r;  rE  rS  rU  ry  rh  r  r  r  rc   r=   r;   <module>r     s        
  *     , , , ,   C C C C C C
 (F F / / *ckk)/
'
 %eW- (  !   > "Nb$ $6"$ "$H 4 DT 7 T 7n@| |~c+ c+L % % %.@ @F
MK MK`Y0 Y0x B Bk$ k$\ L  LF_K _KD`0 `0FL5 L5^
2 2:8%'XC&! C&L    -L' -    W! Wt    /L' /    _Buu= _BDL'         mu- m`L'         R-u(-e/45J R-jL'         U7ueE/45',u> U7pL'         fu(-e/45).0 fRL'         .B0 0f#5  -7 -`	. 		 3] 		. 		 3] 	6 	 3] 	-,g -(	 3] 	
6Br_< _<H   & G[ G  G0 Gk G G:?r=   