
    Mpje                     N   S SK rS SKrS SKrS SKJr  S SKJrJ	r	J
r
  \R                  R                  S\S/\S/\S/45      S 5       r\R                  R                  S0 \R                   4S	\R"                  " \R                   5      R$                  0\R                   4S	\R"                  " \R                   5      R$                  S-   0\R&                  4/5      S
 5       r\R                  R                  SS\R*                  " SS/\R&                  S90\R&                  4S\R*                  " SS/\R                   S9\R*                  " SS/\R&                  S940\R&                  4S\R*                  " SS/\R                   S9\R*                  " SS/\R                   S940\R                   4S\R*                  " SS/\R,                  S90\R                   4\R*                  " SS/\R                   S9\R"                  " \R                   5      R$                  S-   S.\R&                  4/5      S 5       r\R                  R                  S\R*                  " / \R&                  S9\R*                  " / \R&                  S94SS.\R                   4\R*                  " S/\R&                  S9SS.\R                   4\R*                  " \R"                  " \R                   5      R$                  S-   /\R0                  S9SS.\R&                  4\R*                  " S/\R                   S9S\R"                  " \R                   5      R$                  S-   S.\R&                  4\R*                  " \R"                  " \R                   5      R$                  S-   /\R0                  S9SSS.\R&                  4/5      S 5       r\R                  R                  SS	\R"                  " \R&                  5      R$                  S-   0\S4S\R*                  " SS/\R6                  S90\S4SSS/0\S4/5      S 5       r\R<                  R>                  \R<                  R@                  \R<                  RB                  \R<                  RD                  \R<                  RF                  \R<                  RH                  /r%\R<                  RL                  \R<                  RN                  \R<                  RP                  \R<                  RR                  \R<                  RT                  \R<                  RV                  \R<                  RX                  \R<                  RZ                  /r.\%\.-   r/\R                  R                  S\/5      S 5       r0\R                  R                  S\%5      S 5       r1g)    N)assert_array_equal)_ensure_sparse_index_int32_object_dtype_isnan _smallest_admissible_index_dtypez
dtype, val   ac                     [         R                  " U[         R                  /[         R                  U//U S9n[         R                  " SS/SS//5      n[        U5      n[	        XC5        g )NdtypeFT)nparraynanr   r   )r   valXexpected_maskmasks        Z/var/www/html/pdf-tiff/venv/lib/python3.13/site-packages/sklearn/utils/tests/test_fixes.pytest_object_dtype_isnanr      sT    
3-"&&#/u=AHHudmdE];<Mq!Dt+    zparams, expected_dtypemaxvalc                 &    [        S0 U D6U:X  d   eg)zdCheck the behaviour of `smallest_admissible_index_dtype` depending only on the
`max_val` parameter.
N r   paramsexpected_dtypes     r   ,test_smallest_admissible_index_dtype_max_valr      s     ,5f5GGGr   arrays   r
   )r   r   c                 &    [        S0 U D6U:X  d   eg)zCheck the behaviour of `smallest_admissible_index_dtype` using the passed
arrays but without checking the contents of the arrays.
Nr   r   r   s     r   >test_smallest_admissible_index_dtype_without_checking_contentsr!   *   s    \ ,5f5GGGr   T)r   check_contents)r   r"   r   c                 &    [        S0 U D6U:X  d   eg)zqCheck the behaviour of `smallest_admissible_index_dtype` using the dtype of the
arrays but as well the contents.
Nr   r   r   s     r   9test_smallest_admissible_index_dtype_by_checking_contentsr$   [   s    h ,5f5GGGr   zparams, err_type, err_msgz)is to large to be represented as np.int64z$Array dtype float64 is not supportedz#Arrays should be of type np.ndarrayc                 v    [         R                  " XS9   [        S0 U D6  SSS5        g! , (       d  f       g= f)z-Check that we raise the proper error message.matchNr   )pytestraisesr   )r   err_typeerr_msgs      r   *test_smallest_admissible_index_dtype_errorr,      s'    $ 
x	/(262 
0	/	/s   *
8constructorc                 ^    U " [         R                  " / SQ/ SQ/5      5      n[        U5        g )N)      ?       @      @)r1   r0   r/   )r   r   r   )r-   As     r   test_ensure_sparse_index_int32r3      s"    BHHo?@AAq!r   c                 d   [         R                  " [        SS9   SS/S[        R                  " [        R
                  5      R                  S-   /p!SU R                  ;   a  X!p![        R                  R                  SS/X445      n[        U " U5      5        S S S 5        g ! , (       d  f       g = f)	Nz	too larger&   r   r   r   cscr/   r0   )r(   r)   
ValueErrorr   iinfoint32max__name__spsparse	coo_arrayr   )r-   rowscolsr2   s       r   test_ensure_int32_raisesr@      s    	z	5Va"((!3!7!7!!;<dK((($II#sd\ :;";q>2 
6	5	5s   A>B!!
B/)2numpyr   r(   scipyr;   sklearn.utils._testingr   sklearn.utils.fixesr   r   r   markparametrizeobjectfloatr   r8   r7   r9   int64r   r   int8r!   uint32r$   r6   float64	TypeErrorr,   r<   	csc_array	csr_arrayr=   
csc_matrix
csr_matrix
coo_matrixINDEX_CONSTRUCTORS	bsr_array
bsr_matrix	dia_array	dok_array	lil_array
dia_matrix
dok_matrix
lil_matrixNO_INDEX_TEST_CONSTRUCTORSSPARSE_CONSTRUCTORSr3   r@   r   r   r   <module>r^      sS      5  fc]UAJ'OP, Q, 	RXX
BHHRXX&**	+RXX6
BHHRXX&**Q.	/:HH  BHHaV2884	5rxx@
 HHaV2884HHaV2884 HH	
 HHaV2884HHaV2884 HH	
 BHHaV2773	4bhh?
 ((Aq6:((288,0014 HH	
;$'PHQ'PH 
 88Bbhh7"BHH9UV"& HH	
 xx2884MHH	
 ((BHHRXX$6$:$:Q$>#?ryyQ"& HH	
 ((A3bhh7"&((288,0014
 HH	
 ((BHHRXX$6$:$:Q$>#?ryyQ"&
 HH	
I,/`Ha/`H  rxx)--127	
 rxxAbjj9:2	

 QF	Y(MN 3! 3 IIIIIIIIIIII  IIIIIIIIIIIIIIII	  )+EE  (;<" ="
 (:;3 <3r   