
    Mpj	T                    %   S r SSKrSSKrSSKrSSKJr  SSKJr  SSKJ	r	  SSK
rSSKrSSKJr  SSKrSSKJr  SSKJr  SSKJr  SS	KJr  SS
KJrJr  SSKJr  SSKJr  SSK J!r!  SSK"J#r#  SSK$J%r%  SSK&J'r'J(r(J)r)J*r*J+r+J,r,  SSK-J.r.J/r/J0r0  SSK1J2r2J3r3  SSK4J5r5J6r6J7r7J8r8J9r9J:r:J;r;J<r<  SSK=J>r>  SSK?J@r@JArAJBrBJCrCJDrDJErE  SSKFJGrGJHrHJIrIJJrJJKrKJLrLJMrMJNrNJOrOJPrPJQrQJRrRJSrSJTrTJUrUJVrVJWrWJXrXJYrYJZrZJ[r[J\r\J]r]J^r^J_r_J`r`Jara  S rbS rc\R                  R                  S\R                  R                  S5      \E" SSS9/5      S 5       rgS rhS riS  rj\R                  R                  S!\R                  S"4\R                  S#4\R                  S"4/5      \R                  R                  S$\R                  \R                  \R                  /5      S% 5       5       rp\R                  R                  S&\R                  S'S(S)4\R                  SS(S*4\R                  S+S(S,4\R                  SS#S*4\R                  S'S(S-4\R                  SS(S.4\R                  S/S(S04\R                  S'S1S24\R                  S'S3S-4/	5      \R                  R                  S$\R                  \R                  \R                  /5      S4 5       5       rq\R                  R                  S5/ S6Q5      \R                  R                  S$\R                  \R                  \R                  /5      S7 5       5       rrS8 rs\R                  R                  S9\R                  " S3\R                  //5      S:4\R                  " S3\R                  //5      S:4\R                  " S3\R                  //5      S;4\R                  " S3\R                  //\uS<9S=4/5      \R                  R                  S>S(S"/5      S? 5       5       rvS@ rw\R                  R                  SA5      SB 5       ry\R                  R                  SSCSD/SESF//\R                  " SCSD/SESF//SGS<9\R                  " SCSD/SESF//SHS<9SISJ/SKSL//\R                  " SISJ/SKSL//SMS<9/5      SN 5       rzSO r{\R                  R                  SP/ SQQ5      \R                  R                  SR\R                  \R                  /\R                  4\R                  \R                  4SS\R                  4/5      ST 5       5       r~SU rSV rSW rSX rSY rSZ rS[ r\GR                  " / S\QS]9S^ 5       rS_ rS` rSa rSb rSc rSd rSe rSf rSg rSh r\R                  R                  Si\" S5      \\// SjQSk9Sl 5       rSm r\R                  R                  Sn\0" 5       5      So 5       rSp rSq rSr r\R                  R                  Ss\R                  \R                  4\R                  SSS45      \R                  R                  StSu5      Sv 5       5       rSw rSx r " Sy Sz5      r " S{ S|5      rS} r\R                  R                  S~S(S"/5      S 5       r\R                  R                  SS\" SSSS(05      SS(S4S\" SSSS(05      SS(S4S\" SSSS(05      /S/S(S4S\" SSSS(05      S/S(S4S\" SSSS(05      SS\4S\" SSSS(05      SS\4// SQSk9S 5       r\R                  R                  S$\R                  \R                  \GRJ                  \GRL                  \GRN                  \GRP                  \GRR                  \GRT                  \R                  \GRV                  \GRX                  \GRZ                  \GR\                  \GR^                  \GR`                  /5      S 5       rS rS r\R                  R                  S/ SQ5      S 5       r\R                  R                  S/ SQ5      S 5       r\R                  R                  S/ SQ5      S 5       r\R                  R                  SS3S\SSS\" S5      4SS\GRr                  SSS\" S5      4SS\GRt                  SSS\" S5      4S3S\\4SSS\" S5      4S3S\SSS\" S5      4SS\SSS\" S5      4SS\SSS\" S5      4SS\SSS\" S5      4SS\SSS\" S5      4SS\SSS\" S5      4SS\SSS\" S5      4/5      S 5       rS\R                  " S3S/5      SS'4\R                  " S3S/5      \R                  " S3S/5      SS'4S\R                  " SS/5      \S4S\R                  " SS/5      \S'4\R                  " S3S/\R                  S<9\R                  " S3S/\R                  S<9\S4\R                  " S3S/\R                  S<9\R                  " S3S/\R                  S<9\S4S\R                  " SS/5      \S4S.r\R                  R                  S\" \GR                  5       5      \" \GR                  5       5      Sk9\R                  R                  SS(S"/5      S 5       5       rS\S4S\S4S\S4\R                  " SS/\R                  S<9\S4\R                  " SS/\R                  S<9\S4S.r\R                  R                  S\" \GR                  5       5      \" \GR                  5       5      Sk9S 5       rS rS r\R                  R                  Sn\0" 5       5      S 5       r\R                  R                  SS/SS3/SS3// SQ/ SQ/5      S 5       r\R                  R                  Sn\0" 5       5      \R                  R                  SS/SS3/SS3// SQ/ SQ/5      S 5       5       r\R                  R                  S/ SQS/SS//5      S 5       r\R                  R                  Sn\0" 5       5      \R                  R                  S/ SQS/SS//5      S 5       5       r\R                  \R                  \GRV                  \GRJ                  /r\R                  R                  S\R                  /\-   5      S 5       r\R                  R                  S\R                  /\-   5      S 5       r\R                  R                  S\5      S 5       rS rS rS r\R                  R                  SSS3S//5      S 5       r\R                  R                  S/ SQ5      S 5       rS r\R                  R                  S/ SQ5      S 5       r\R                  R                  SSS\GR                  4SS\GR                  4SS\GR                  4SS\GR                  4SS\GR                  4SS\GR                  4SS\GR                  4SS\GR                  4SS\GR                  4SS\GR                  4SS\GR                  4GS GS\GR                  4GSGS\GR                  4GSGS\GR                  4GSGS\GR                  4/5      GS 5       r\R                  R                  S/ GS	Q5      GS
 5       r\R                  R                  S/ GSQ/ GSQ/ GSQ/ GSQGSS30GSS0GSS0/// GSQSk9\R                  R                  S/ GSQ5      GS 5       5       r\R                  R                  S/ GSQ/ GSQSk9GS 5       r\R                  R                  GS\" \" S5      5      \" S5      SGSGS/GSGS//// GSQSk9GS 5       r\R                  R                  GS/ GSQ5      GS 5       rGS r\R                  R                  GS GSS3/GS!4GS"GS#/GS$4/GS%GS&/Sk9GS' 5       r " GS( GS)\5      r\R                  R                  / GS*QGS+/ GS,QGS-4GS./ GSQGS/4GS0/ GSQGS/4/5      GS1 5       rGS2 r\R                  R                  GS3/ GS4Q5      GS5 5       rGS6 rGS7 r\R                  R                  GS8SS3SS3S\R                  // GS9Q/5      GS: 5       r\<GS; 5       r\R                  R                  GS</ GS=Q5      \R                  R                  GS>S(S"/5      GS? 5       5       r\R                  R                  GS@\B\A-   \@-   \C-   5      \R                  R                  GSA/ GSBQ5      GSC 5       5       r\R                  R                  GSD\R                  " S35      \R                  " S5      /S3S/SS///5      GSE 5       rGSF rGSG rGSH rGSI r\<GSJ 5       r\R                  R                  / GSKQ\R                  " S3S/SS//S3S/SS///5      \" 5       GSL4\R                  " S3S/SS//S3S/SS///5      SGSM4/5      GSN 5       r\R                  R                  GSOGSP/GSQGSR/\GR                  " GSS5      4\R                  " GSQGST/\uS<9\GR                  " GSU5      4SS/\GR                  " GSV5      4/ GSWQ\GR                  " GSX5      4/5      GSY 5       r\R                  R                  GSOGSZ// GS[QS(4S3S/S(4GSGS/S"4GS\/5      \R                  R                  S/ GS]Q5      GS^ 5       5       rGS_ rg(`  z$Tests for input validation functions    N)product)
itemgetter)NamedTemporaryFile)config_context)BaseEstimator)
make_blobs)RandomForestRegressor)NotFittedErrorPositiveSpectrumWarning)ARDRegression)EstimatorWithFit)KNeighborsClassifier)_sparse_random_matrix)SVR)_safe_indexingas_float_arraycheck_arraycheck_symmetric	check_X_y
deprecated)_is_numpy_namespacemove_to)yield_namespace_device_dtype_combinations)MockDataFrame_MockEstimatorOnOffPrediction)
TempMemmap_array_api_for_tests_convert_containerassert_allcloseassert_allclose_dense_sparseassert_array_equalcreate_memmap_backed_data'skip_if_array_api_compat_not_configured)_NotAnArray)COO_CONTAINERSCSC_CONTAINERSCSR_CONTAINERSDIA_CONTAINERSDOK_CONTAINERS_sparse_random_array)FLOAT_DTYPES_allclose_dense_sparse_check_categorical_features_check_feature_names_in_check_method_params_check_pos_label_consistency_check_psd_eigenvalues_check_response_method_check_sample_weight_check_y_deprecate_positional_args_estimator_has_get_feature_names
_is_fitted_num_features_num_samples_to_object_arrayassert_all_finitecheck_consistent_lengthcheck_is_fittedcheck_memorycheck_non_negativecheck_random_statecheck_scalarcolumn_or_1dhas_fit_parametervalidate_datac                     [        S 5      [        R                  R                  R                  L d   e[        [        R                  5      [        R                  R                  R                  L d   e[        R                  R                  S5      n [        S5      R                  S5      U R                  S5      :X  d   e[        R                  R                  S5      n [        U 5      U L d   e[        R                  R                  S5      n [        S5      R                  S5      U R                  S5      :w  d   e[        R                  " [        5         [        S5        S S S 5        g ! , (       d  f       g = f)N*   d   +   zsome invalid seed)
rA   nprandommtrand_randRandomStaterandintpytestraises
ValueError)rng_42s    _/var/www/html/pdf-tiff/venv/lib/python3.13/site-packages/sklearn/utils/tests/test_validation.pytest_make_rngrU   ^   s
   d#ryy'7'7'='====bii(BII,<,<,B,BBBBYY""2&Fb!))#.&..2EEEEYY""2&Ff%///YY""2&Fb!))#.&..2EEEE	z	"./ 
#	"	"s   E--
E;c                     [         R                  " S[         R                  S9n U [         R                  " S[         R                  S9-   n [	        U SS9nUR
                  [         R                  :X  d   eU R                  [         R                  5      n [	        U SS9n[	        U SS9U Ld   eUR
                  [         R                  :X  d   e[        [         R                  [         R                  [         R                  [         R                  [         R                  [         R                  /nU H?  nU R                  U5      n [	        U 5      nUR
                  [         R                  :X  a  M?   e   U R                  [         5      n [	        U SS9nUR
                  [         R                  :X  d   e[         R                  " S[         R                  S9n [	        U SS9U L d   e[         R"                  " U 5      n [         R$                  " [	        U SS95      (       d   e[&        R(                  " [         R                  " S5      5      R+                  5       [&        R,                  " [         R                  " S5      /5      R+                  5       [/        SSS	S
9R+                  5       /nU HK  n[	        USS9n[         R0                  US'   [         R2                  " U5      R5                  5       (       d  MK   e   g )N)   
   dtyperX   FcopyT)rW         皙?)densityr   r   )rJ   onesint32aranger   rZ   float32astypeint64float64boolint8int16uint8uint16uint32objectasfortranarray	isfortransp
csc_matrixtoarray	csc_arrayr   nanisnanany)XX2tested_dtypesrZ   matricesMNs          rT   test_as_float_arrayr   p   s    
rxx(A	BIIb))A		&B88rzz!!!	A		%B!%(11188rzz!!!277BHHbhh"))RYYWMHHUOAxx2::%%%  	
A		%B88rzz!!! 	bjj)A!%(A---
!A<<qt45555 	biil#++-
biil^$,,.b"d3;;=H
 14(&&$88A;??$$$$     ry   rX   r]   csrformatc                     U R                  5       n [        R                  U S'   [        R                  U S'   [        U SS9n[	        X5        g )N)r^   r   )      	allow-nanensure_all_finite)r\   rJ   rv   r   r    )ry   X_converteds     rT   test_as_float_array_nanr      s=     	
AffAdGffAdG kBK 0r   c                     [         R                  " S5      R                  SS5      n [        [	        U 5      [         R
                  5      (       a   e[        [	        [        R                  " U 5      5      [         R
                  5      (       a   e[        [	        [        R                  " U 5      5      [         R
                  5      (       a   eg )N   rW      )	rJ   rd   reshape
isinstancer   matrixrr   rs   ru   ry   s    rT   test_np_matrixr      s    
		"a#A.+RYY7777.q)9:BIIFFFF.a9299EEEEEr   c                  R   S n [        SS9 n[        R                  " US[        R                  S9nSUS S & [        [        R
                  U 4 H=  nU" U5      nSUS S & [        UR                  5       UR                  5       5        SUS S & M?     S S S 5        g ! , (       d  f       g = f)Nc                     [        U SS9$ )NFr[   )r   xs    rT   <lambda>test_memmap.<locals>.<lambda>   s    nQU3r   zsklearn-test)prefixrX   rX   )shaperZ   r   r   )r   rJ   memmapre   r   asarrayr!   ravel)asflttmpr}   fry   s        rT   test_memmapr      s     4E	>	2cIIc<!rzz51A!AAaDqwwy!'')4AaD	 2	 
3	2	2s   BB
B&c                     [         R                  " S5      n X R                  4 H]  nS HT  n[        USUS9nUR                  S   (       d   e[        USUS9nUR                  S   (       d   eU(       d  MN  XLa  MT   e   M_     [
        R                  " U 5      n U R                  S S S2   U l        U R                  R                  S   (       a   eg )	N)rX   r^   )TFC)orderr\   C_CONTIGUOUSFF_CONTIGUOUS)rJ   rb   Tr   flagsrr   	csr_arraydata)ry   Ar\   Bs       rT   test_orderingr      s     	AV!DASt4A77>***ASt4A77>***tz!z "  	QAVVDbD\AFvv||N++++r   zvalue, ensure_all_finiteFr   retypec                     U" [         R                  " S5      R                  SS5      R                  [        5      5      nXS'   [        X1SS9n[        X45        g )Nr   r]   ra   T)r   accept_sparse)rJ   rd   r   rf   floatr   r    )valuer   r   ry   	X_checkeds        rT   (test_check_array_ensure_all_finite_validr      sJ     	ryy|##Aq)0078AdGARVWI .r   z/value, input_name, ensure_all_finite, match_msg TzInput contains infinityzInput X contains infinitysample_weightz%Input sample_weight contains infinityInput contains NaNzInput X contains NaNyzInput y contains NaNz	allow-infz1ensure_all_finite should be a bool or 'allow-nan'r   c                    U" [         R                  " S5      R                  SS5      R                  [         R                  5      5      nXS'   [
        R                  " [        US9   [        UUUSS9  S S S 5        g ! , (       d  f       g = f)Nr   r]   ra   matchT)
input_namer   r   )	rJ   rd   r   rf   rh   rP   rQ   rR   r   )r   r   r   	match_msgr   ry   s         rT   *test_check_array_ensure_all_finite_invalidr      sg    . 	ryy|##Aq)00<=AdG	z	3!/		
 
4	3	3s   'A==
Br   )ry   r   r   c                 B   U" [         R                  " S5      R                  SS5      R                  [         R                  5      5      n[         R
                  US'   [        5       nSUR                  R                   S3n[        R                  " [        SU  S3S9 n[        UUU S	S
9  S S S 5        U S:X  a   UWR                  R                  S   ;   d   eOUWR                  R                  S   ;  d   eU S:X  a  [        R                  " [        SU  S3S9 n[        5       R                  U[         R                   " UR"                  S   5      5        S S S 5        XER                  R                  S   ;   d   eg g ! , (       d  f       N= f! , (       d  f       N?= f)Nr   r]   ra   
aX   does not accept missing values encoded as NaN natively. For supervised learning, you might want to consider sklearn.ensemble.HistGradientBoostingClassifier and Regressor which accept missing values encoded as NaNs natively. Alternatively, it is possible to preprocess the data, for instance by using an imputer transformer in a pipeline or drop samples with missing values. See https://scikit-learn.org/stable/modules/impute.html You can find a list of all estimators that handle NaN values at the following page: https://scikit-learn.org/stable/modules/impute.html#estimators-that-handle-nan-valueszInput z contains NaNr   T)	estimatorr   r   ry   r   )rJ   rd   r   rf   rh   rv   r   	__class____name__rP   rQ   rR   r   r   argsfitrb   r   )r   r   r   r   extended_msgctxs         rT   0test_check_array_links_to_imputer_doc_only_for_Xr      s\    "))A,&&q!,33BJJ?@DDJI
Y  ))* +- 	-  
z6*])K	LPS!		
 
M Ssyy~~a0000399>>!#4444S ]]:vj\-OPTWEIIdBGGDJJqM23 Qyy~~a0000  
M	L  QPs   E?<F?
F
Fc                  .   [         R                  " SS[         R                  //[        S9R                  n [        U S SS9nXL d   e[        U S SS9nXL d   e[        R                  " [        SS9   [        U S S	S9  S S S 5        g ! , (       d  f       g = f)
NabrY   r   rZ   r   Fr   r   T)	rJ   arrayrv   ro   r   r   rP   rQ   rR   )ry   r   s     rT   )test_check_array_ensure_all_finite_objectr   *  s}    
3RVV$%V466AAT[II>>ATUCI>>	z)=	>ATT: 
?	>	>s   1B
Bz
X, err_msgInput contains NaN.z5Input contains infinity or a value too large for.*intrY   z#cannot convert float NaN to integerr   c                     [         R                  " [        US9   [        U [        US9  S S S 5        g ! , (       d  f       g = f)Nr   r   )rP   rQ   rR   r   int)ry   err_msgr   s      rT   8test_check_array_ensure_all_finite_object_unsafe_castingr   7  s+    0 
z	1AS4EF 
2	1	1s	   3
Ac                      [         R                  " S5      n U R                  / SQ5      nS[        U5       S3n[         R                  " [
        US9   [        USS9  SSS5        g! , (       d  f       g= f)	z
Check that we raise a proper error message when passing a Series and we expect a
2-dimensional container.

Non-regression test for:
https://github.com/scikit-learn/scikit-learn/issues/27498
pandasr   r]   rW   z+Expected a 2-dimensional container but got z	 instead.r   T	ensure_2dN)rP   importorskipSeriestyperQ   rR   r   )pdsermsgs      rT   test_check_array_series_err_msgr   S  sX     
		X	&B
))I
C7S	{)
LC	z	-C4( 
.	-	-s   A&&
A4z3ignore:Can't check dok sparse matrix for nan or infc                  `   SS/SS//n [         R                  " U 5      n[        R                  " [        5         [        U5        S S S 5        [        / SQSS9nUR                  S:X  d   e[        R                  " [        SS	9   [        / SQS
S9  S S S 5        [        R                  " [        SS	9   [        SS
S9  S S S 5        [        [         S5      (       ae  [        [        [         R                  " U 5      5      5      nUR                  S:X  a-  [        R                  " [        SS	9   [        US
S
S9  S S S 5        [        R                  " S5      R                  SSS5      n[        R                  " [        5         [        U5        S S S 5        [        US
S9  [        R                  " S5      R                  SS5      R                  S5      nUR                  S5      nUR                  [         5      nUR                  ["        5      nXVXx/n	[        R$                  [         ["        [        R&                  S [(        [*        /n
/ SQnS
S/n[-        XX5       GH   u  pp[        XXS9nUb  UR.                  U:X  d   eOUR.                  U R.                  :X  d   eUS:X  a-  UR0                  S   (       d   eUR0                  S   (       a   eO2US:X  a,  UR0                  S   (       d   eUR0                  S   (       a   eU(       a	  U ULd   eM  U R.                  UR.                  :X  d  M  UR0                  S   U R0                  S   :X  d  M  UR0                  S   U R0                  S   :X  d  GM  U UL a  GM!   e   / n	U	R3                  [4        [6        -   [8        -   [:        -    Vs/ s H  nU" U5      PM     sn5        U	R3                  U	S   R                  [        R<                  5      U	S   R                  [        R>                  5      /5        SS/SS//nU
 Vs/ s H  nU[*        Ld  M  UPM     nn[-        U	UUU5       H  u  pnn[        XUUS9nUb  UR.                  U:X  d   eOUR.                  U R.                  :X  d   eU R@                  U;   a  U R@                  UR@                  :X  d   eOUR@                  US   :X  d   eU(       a	  U ULd   eM  U R.                  UR.                  :X  d  M  U R@                  UR@                  :X  d  M  U UL a  M   e   [        SS/SS//5      n[C        U[        RD                  5      (       d   e[        R                  " [        5         [        URG                  5       5        S S S 5        [        URG                  5       S
S9  [I        U5      n[        U5      n[C        U[        RD                  5      (       d   e[        SS/SS//5      nSn[        R                  " [        US	9   [        US
S[K        5       S 9  S S S 5        g ! , (       d  f       GN= f! , (       d  f       GN= f! , (       d  f       GN= f! , (       d  f       GN/= f! , (       d  f       GN= fs  snf s  snf ! , (       d  f       GN= f! , (       d  f       g = f)!Nr   r]   rW   r   )r   r   r]   Fr   z'Expected 2D array, got 1D array insteadr   Tz+Expected 2D array, got scalar array insteadrX   r   zExpected 2D input, got)r   r      allow_ndr   r   )r   r   N)rZ   r   r\   r   r   r   r   coodokrZ   r   r\   z<Negative values in data passed to X in RandomForestRegressorry   )ensure_non_negativer   r   )&rr   r   rP   rQ   	TypeErrorr   ndimrR   hasattrnextiterrJ   rd   r   r\   rf   r   r   rc   re   ri   ro   r   rZ   r   extendr'   r&   r%   r)   rg   rh   r   r   ndarraytolistr$   r	   )ry   X_csrX_array
sparse_rowX_ndimX_CX_FX_intX_floatXsdtypesorderscopysrZ   r   r\   r   sparse_containeraccept_sparsesdtnon_object_dtypesr   X_dense
X_no_arrayresultX_negr   s                              rT   test_check_arrayr
  b  s|    Q!QALLOE	y	!E 
" )u5G<<1	z)R	SI. 
T 
z)V	WB$' 
X r;$r||A/0
??az1IJJddK K YYq\!!!Q*F	z	"F 
#& ))A,

q!
$
)
)#
.C
((3-CJJsOEjjG
E	#BhhUBJJdFCFF5ME!(V!C%eG	??e+++??agg---C<??>222 ~6666c\??>222 ~666I%%% 9??*OON3qww~7NNOON3qww~7NNI~%~+ "D4 
BII %3%% %	
%  S!%	
 IIr!u||BHH%r!u||BJJ'?@Aenuen5N '-Af&0@fA)0
~u*%-  mRVW	??e+++??agg---88}$88y///// ##}Q'7777I%%% ww)//)ahh):J:J.JI~%~'*. Aq6Aq6*+Ggrzz****	z	"FMMO$ 
#$/ W%J$Ffbjj)))) !Q"a)*ELG	z	1 $+-		
 
2	1m 
"	! 
T	S 
X	W KJ
 
#	"T	
 B6 
#	" 
2	1se   X)X;2Y+Y Y1*Z"Z3Z.ZZ)
X8;
Y

Y
Y.1
Z 
Z
Z-1234US   1   2   3   4V1c                     Sn[         R                  " [        US9   [        U SS9  SSS5        g! , (       d  f       g= f)ziTest that check_array errors when it receives an array of bytes/string
while a numeric dtype is required.z>dtype='numeric' is not compatible with arrays of bytes/stringsr   numericrY   NrP   rQ   rR   r   )ry   expected_msgs     rT   test_check_array_numeric_errorr    s.     UL	z	6AY' 
7	6	6s   0
>c                  ,   [         R                  " S5      n U R                  / SQ/ SQS.5      n[         R                  " [        5         [        USS9  SSS5        U R                  / SQ/ SQS.5      n[         R                  " [        5         [        USS9  SSS5        U R                  / S	Q5      n[         R                  " [        5         [        USS
S9  SSS5        [        USS9nUR                  [        R                  :X  d   e[        XAR                  5        [        USS
S9nUR                  [        R                  :X  d   e[        XCR                  5        g! , (       d  f       GN= f! , (       d  f       N= f! , (       d  f       N= f)zcheck_array raises an error for pandas StringDtype with dtype='numeric'.

Non-regression test for pandas 3 where string columns use StringDtype
instead of object dtype. check_array should reject string data when
dtype='numeric' is requested.
r   )r   r   z)r  r  r  r   r   r  rY   N)      ?       @      @r   r   cFrZ   r   )rP   r   	DataFramerQ   rR   r   r   rZ   rJ   object_r!   values)r   df_strdf_mixeds_strr  s        rT   2test_check_array_pandas_string_dtype_numeric_errorr*    s    
		X	&B \\oFGF	z	"F), 
# ||/HIH	z	"HI. 
# IIo&E	z	"Ee< 
# t,F<<2::%%%v}}-de<F<<2::%%%v||,) 
#	"
 
#	"
 
#	"s$   	E"E4F"
E14
F
Fpd_dtype)Int8Int16UInt8UInt16Float32Float64zdtype, expected_dtyper  c                    [         R                  " S5      nU S;   a  [         R                  " SSS9n[        R                  " SSS[        R                  [        R                  /[        R                  [        R                  SS	S
// SQ/5      R
                  nUR                  X@/ SQS9nUS   R                  S5      US'   [        USUS9n[        Xd5        UR                  U:X  d   e[        USUS9n[        Xd5        UR                  U:X  d   eSn[         R                  " [        US9   [        USS9  S S S 5        g ! , (       d  f       g = f)Nr   >   r0  r1  z1.2)
minversionr   r]   rW   r   r   r   )r   r]   rW   r   r^   r!  )rZ   columnsr"  r   r   )r   rZ   Fr   r   Tr   )rP   r   rJ   r   rv   r   r$  rf   r   r   rZ   rQ   rR   )r+  rZ   expected_dtyper   X_npry   r   r   s           rT   "test_check_array_pandas_na_supportr7    s    
		X	&B))  e<88
Q266266	"RVVRVVQ1$=Oa 	
 	T?CAsV]]7#AcFAEJII$??n,,,AeDII$??n,,,
C	z	-A. 
.	-	-s   -E
Ec                  (   [         R                  " S5      n U R                  SSU R                  /SS9nSn[         R                  " [
        US9   [        USS	S
9  SSS5        [        US	S	S
9n[        USS[        R                  /5        UR                  [        R                  :X  d   e[        US	S	[        R                  S9n[        USS[        R                  /5        UR                  [        R                  :X  d   eg! , (       d  f       N= f)z4Check check_array is correct with pd.NA in a series.r   r   r]   Int64rY   r   r   TF)r   r   N)r   r   rZ   )rP   r   r   NArQ   rR   r   r   rJ   rv   rZ   rh   re   )r   X_int64r   X_outs       rT   *test_check_array_panadas_na_support_seriesr=  C  s    			X	&BiiAruuWi5G
C	z	-GtuE 
. 5EJEEAq"&&>*;;"**$$$5EE EAq"&&>*;;"**$$$ 
.	-s   D
Dc                  x   [         R                  " S5      n [        R                  " / SQ/ SQ/ SQ/[        R                  S9nU R                  U5      n[        U5      R                  [        R                  :X  d   e[        U[        S9R                  [        R                  :X  d   eUR                  S[        R                  05      n[        UR                  [        R                  [        R                  [        R                  45        [        U5      R                  [        R                  :X  d   e[        U[        S9R                  [        R                  :X  d   eUR                  S[        R                  05      n[        U5      R                  [        R                  :X  d   e[        U[        S9R                  [        R                  :X  d   eUR                  S[        R                  05      n[        U5      R                  [        R                  :X  d   e[        U[        S9R                  [        R                  :X  d   eUR                  [        R                  5      n[        U5      R                  [        R                  :X  d   e[        U[        S9R                  [        R                  :X  d   eU R                  SU R                  / SQ5      05      n[        U5      R                  [        R                   :X  d   e[        U[        S9R                  [        R                  :X  d   eg )	Nr   r   r   r^   r      r   	   rY   r   r]   cat_col)rP   r   rJ   r   re   r$  r   rZ   r+   rf   float16r!   r   rk   rh   Categoricalrg   )r   ry   X_dfcat_dfs       rT   %test_check_array_pandas_dtype_castingrH  X  s7   			X	&B
)Y	2"**EA<<?Dt""bjj000t<066"**DDD;;2::'Dt{{RZZRZZ$HIt""bjj000t<066"**DDD;;288}%Dt""bjj000t<066"**DDD;;2::'Dt""bjj000t<066"**DDD;;rxx Dt""bhh... t<066"**DDD
 \\9bnnY&?@AFv$$000v\288BJJFFFr   c                  D   [         R                  " SS/SS/SS/SS//5      n [        U 5      n[        U5      nUR                  U R                  :X  d   e[        U[         R
                  S9nUR                  [         R                  " [         R
                  5      :X  d   eg )N皙?gffffff?g333333?g      ?g?r_   rY   )rJ   r   r   r   rZ   re   )arrmock_dfchecked_arrs      rT   "test_check_array_on_mock_dataframerN  }  s    
((S#Jc
S#Jc
C
DCC Gg&K		)))gRZZ8K 4444r   c                      / SQ/ SQ/ SQ/n [        U 5      R                  R                  S:X  d   e[        U SS9R                  R                  S:X  d   eg )Nr   r?  r@  iFr   )r   rZ   kindr   s    rT    test_check_array_dtype_stabilityrR    sM    	Iy)Aq>$$+++qE*0055<<<r   c            	      ~   / SQ/ SQ/ SQ/n [         R                  " U [         R                  S9n[         R                  " U [         R                  S9n[        R
                  " U5      n[        R                  " U5      n[        R                  " U[         R                  S9nX%/nXU/n[        R                  " 5          [        R                  " S5        U H<  n[        U[         R                  SS9n	U	R                  [         R                  :X  a  M<   e   U H  n[        U[         R                  [         R                  /SS9n	U	R                  [         R                  :X  d   eXL d   e[        U[         R                  [         R                  /SS	/SS
9n	U	R                  [         R                  :X  d   eXLa  M   e   [        U[         R                  [         R                  /SS	/SS
9n	U	R                  [         R                  :X  d   eXLd   eU	R                  S:X  d   e S S S 5        g ! , (       d  f       g = f)Nr   r?  r@  rY   errorT)rZ   r   r   r   r   F)rJ   r   re   rg   rr   r   ru   rc   warningscatch_warningssimplefilterr   rh   rZ   r   )

X_int_list	X_float32r;  X_csr_float32X_csc_float32X_csc_int32integer_datafloat32_datary   r   s
             rT   test_check_array_dtype_warningr_    s   Y	2J

:RZZ8Ijj2884GLL+MLL+M,,wbhh7K)Lm<L		 	 	"g&A#ARZZtLI??bjj000  A#"**bjj1I ??bjj000>!>#zz2::.$en	I ??bjj000%%%    ::rzz* %.	
	 "**,,,---5(((? 
#	"	"s   =AH.B&H.<A(H..
H<c                     SS/SS//n [         R                  " U 5      n[        5       nSn[        R                  " [
        US9   [        USS9  S S S 5        S	n[        R                  " [        US9   [        XS9  S S S 5        S
n[        R                  " [        US9   [        U/ S9  S S S 5        [        R                  " [        US9   [        USS9  S S S 5        [        R                  " [
        SS9   [        X/S9  S S S 5        g ! , (       d  f       N= f! , (       d  f       N= f! , (       d  f       N= f! , (       d  f       Nn= f! , (       d  f       g = f)Nr   r]   rW   r   ziSparse data was passed, but dense data is required. Use '.toarray\(\)' to convert to a dense numpy array.r   Fr   zjParameter 'accept_sparse' should be a string, boolean or list of strings. You provided 'accept_sparse=.*'.z]When providing 'accept_sparse' as a tuple or list, it must contain at least one string value. r   )rr   r   r   rP   rQ   r   r   rR   )ry   r   invalid_typer   s       rT   -test_check_array_accept_sparse_type_exceptionrd    s	   
Q!QALLOE5L	A  
y	,E/ 
-	G  
z	-E6 
.	5  
z	-E, 
.	z	-E, 
.	y	.E8 
/	.% 
-	, 
.	- 
.	-	-	-	.	.s<   D2
DD-D>7E
D
D*-
D;>
E
Ec                      SS/SS//n [         R                  " U 5      n[        USS9  [        USS9  [        US/S9  [        USS9  g )	Nr   r]   rW   r   Tra  r   )r   )rr   r   r   )ry   r   s     rT   +test_check_array_accept_sparse_no_exceptionrf    sK    
Q!QALLOET*U+eW-X.r   )r   cscr   bsr)paramsc              #     #    [        SU R                  S9nU R                  S:X  at  [        US5      (       a"  [        S UR                   5       5      Ul        OUR
                  R                  S5      Ul        UR                  R                  S5      Ul        O@UR                  R                  S5      Ul        UR                  R                  S5      Ul	        Uv   g 7f)N)   rX   r   r   coordsc              3   B   #    U  H  oR                  S 5      v   M     g7f)rg   N)rf   ).0vs     rT   	<genexpr>X_64bit.<locals>.<genexpr>  s     A1XXg..s   rg   )
r*   paramr   tuplerl  rowrf   colindicesindptr)requestry   s     rT   X_64bitry    s     Xgmm<A}}1h AAAAH EELL)AEEELL)AEII$$W-	88??7+
Gs   CC c                     [        U SSS9  g )NT)accept_large_sparser   )r   )ry  s    rT   1test_check_array_accept_large_sparse_no_exceptionr|    s    TFr   c                     Sn[         R                  " [        US9   [        U SSS9  S S S 5        g ! , (       d  f       g = f)NzbOnly sparse matrices with 32-bit integer indices are accepted. Got int64 indices. Please do reportr   TF)r   r{  r  )ry  r   s     rT   4test_check_array_accept_large_sparse_raise_exceptionr~    s4    	<  
z	-G4UK 
.	-	-s   1
?c                     Sn [         R                  " [        U S9   [        / /5        S S S 5        Sn [         R                  " [        U S9   [        / SS9  S S S 5        [        R
                  " S5      n [         R                  " [        U S9   [        SSS9  S S S 5        [        R                  " S5      n[        R                  " S	5      nS
n [         R                  " [        U S9   [        XSS9  S S S 5        [         R                  " [        U S9   [        XSSS9  S S S 5        [        R                  " S5      n[        R                  " S5      nSn [         R                  " [        U S9   [        XSS9  S S S 5        [         R                  " [        U S9   [        XSSS9  S S S 5        [        R                  " S5      R                  SS5      n[        R                  " S5      nSn [         R                  " [        U S9   [        X5        S S S 5        [        R                  " S5      n[        R                  " S5      n[        XSS9u  p4[        X5        [        X$5        g ! , (       d  f       GNG= f! , (       d  f       GN+= f! , (       d  f       GN= f! , (       d  f       GN= f! , (       d  f       GN= f! , (       d  f       GNP= f! , (       d  f       GN5= f! , (       d  f       N= f)NzC0 feature\(s\) \(shape=\(1, 0\)\) while a minimum of 1 is required.r   z@0 sample\(s\) \(shape=\(0,\)\) while a minimum of 1 is required.Fr   zgInput should have at least 1 dimension i.e. satisfy `len(x.shape) > 0`, got scalar `array(42)` instead.rG   )r   rX   r   zC1 sample\(s\) \(shape=\(1, 10\)\) while a minimum of 2 is required.r]   )ensure_min_samples)r  r   r   zD2 feature\(s\) \(shape=\(10, 2\)\) while a minimum of 3 is required.rW   )ensure_min_featuresT)r  r   r   rX   zD0 feature\(s\) \(shape=\(10, 0\)\) while a minimum of 1 is required.)rX   r      r  r   )rP   rQ   rR   r   reescaper   rJ   rb   r   emptyr   r!   )r   ry   r   r   	y_checkeds        rT   2test_check_array_min_samples_and_features_messagesr    s   
PC	z	-RD 
.
 NC	z	-B%( 
. ))BC 
y	,B%( 
- 	A

A
PC	z	-!1- 
.
 
z	-!1> 
.
 	A

A
QC	z	-!A. 
.
 
z	-!A= 
.
 	B"A
A
QC	z	-! 
. 	 A
A$QD9Iq$q$s 
.	- 
.	- 
-	, 
.	-
 
.	- 
.	-
 
.	- 
.	-s_   I)I;J(JJ1/KKK')
I8;
J

J
J.1
K 
K
K$'
K5c                     [         R                  " / SQ/ SQ/5      n [        R                  " [        SS9   [        U 5        S S S 5        / SQ/ SQ/n [        R                  " [        SS9   [        U 5        S S S 5        Sn [        R                  " [        SS9   [        U 5        S S S 5        [         R                  " / SQ5      [         R                  " / SQ5      /n [        R                  " [        SS9   [        U 5        S S S 5        [         R                  " / SQ5      [         R                  " / SQ5      4n [        R                  " [        SS9   [        U 5        S S S 5        [        [         R                  " / SQ/ SQ/5      5      n [        R                  " [        SS9   [        U 5        S S S 5        [        R                  " SS/SS//5      n [        R                  " [        SS9   [        U 5        S S S 5        [         R                  " / SQ5      n[        R                  " [        SS9   [        U5        S S S 5        g ! , (       d  f       GN= f! , (       d  f       GN= f! , (       d  f       GN= f! , (       d  f       GN= f! , (       d  f       GN8= f! , (       d  f       N= f! , (       d  f       N= f! , (       d  f       g = f)	N      ?       @      @      @      @      @       @      @      @      @      @      @zComplex data not supportedr   )r  r  r   r  )r  r  r  r  r  r  )
rJ   r   rP   rQ   rR   r   r   rr   	coo_arrayr4   )ry   r   s     rT   #test_check_array_complex_data_errorr  F  s   
*,DEFA	z)E	FA 
G 
"#;<A	z)E	FA 
G 	=A	z)E	FA 
G 
*	+RXX6N-OPA	z)E	FA 
G 
*	+RXX6N-OPA	z)E	FA 
G 	bhh 8:RSTUA	z)E	FA 
G 	q&kAq6*+A	z)E	FA 
G
 	ABA	z)E	F 
G	FI 
G	F
 
G	F
 
G	F
 
G	F
 
G	F
 
G	F
 
G	F 
G	Fs_   I	+II-7I?J&J#/J44K	
I
I*-
I<?
J
J #
J14
K
Kc                     [        [        S5      (       a   e[        [        S5      (       d   e[        [        S5      (       d   e[        [        5       S5      (       d   e " S S5      n [        U S5      (       d   S5       eg )Nr   c                   4    \ rS rSr\" S5      SS j5       rSrg)@test_has_fit_parameter.<locals>.TestClassWithDeprecatedFitMethodiv  z7Deprecated for the purpose of testing has_fit_parameterNc                     g Nrb  )selfry   r   r   s       rT   r   Dtest_has_fit_parameter.<locals>.TestClassWithDeprecatedFitMethod.fitw      r   rb  r  )r   
__module____qualname____firstlineno__r   r   __static_attributes__rb  r   rT    TestClassWithDeprecatedFitMethodr  v  s    	M	N	 
O	r   r  z=has_fit_parameter fails for class with deprecated fit method.)rD   r   r	   r   )r  s    rT   test_has_fit_parameterr  p  s|     !5GGGG2ODDDDS/2222SUO4444 
 =OO GOr   c            	      
   [         R                  " SS/SS//5      n [         R                  " S5      n[         R                  " SS/SS//5      nU[        R                  " U5      [        R
                  " U5      [        R                  " U5      [        R                  " U5      [        R                  " U5      [        R                  " U5      S.n[        R                  " [        5         [        U5        S S S 5        UR                  5        H  u  pE[        R                  " [         5         [        U5        S S S 5        [        R                  " [        5         [        USS9  S S S 5        [        USS9n[        R"                  " U5      (       a.  UR$                  U:X  d   e['        UR)                  5       U 5        M  ['        X`5        M     g ! , (       d  f       N= f! , (       d  f       N= f! , (       d  f       N= f)	Nr   r   r]   )denser   r   rg  r   lilrh  T)raise_exceptionF)raise_warning)rJ   r   rb   rr   	dok_arrayr   ru   r  	lil_array	bsr_arrayrP   rQ   rR   r   itemswarnsUserWarningissparser   r!   rt   )arr_symarr_badarr_asymtest_arrays
arr_formatrK  outputs          rT   test_check_symmetricr    s`   hhAA'(GggajGxx!Q!Q()H ||H%||H%||H%||H%||H%||H%K 
z	"  
# ',,.
\\+&C  ']]:&C6 ' !E:;;v==J...v~~/9v/ /	 
#	" '&&&s$   +G.G#G4
G #
G1	4
H	c                       " S S[         5      n [        R                  " [        5         [	        U " 5       5        S S S 5        [	        U " 5       R                  5       5        g ! , (       d  f       N-= f)Nc                        \ rS rSrS rS rSrg)6test_check_is_fitted_with_is_fitted.<locals>.Estimatori  c                     SU l         U $ )NTr8   r  kwargss     rT   r   :test_check_is_fitted_with_is_fitted.<locals>.Estimator.fit  s    "DOKr   c                 @    [        U S5      =(       a    U R                  $ )Nr8   )r   r8   r  s    rT   __sklearn_is_fitted__Ltest_check_is_fitted_with_is_fitted.<locals>.Estimator.__sklearn_is_fitted__  s    4.B4??Br   r  N)r   r  r  r  r   r  r  rb  r   rT   	Estimatorr    s    		Cr   r  )r   rP   rQ   r
   r>   r   )r  s    rT   #test_check_is_fitted_with_is_fittedr    sG    CM C 
~	&	$ 
'IKOO%& 
'	&s   A""
A0c                  B     " S S[         5      n [        U " 5       5        g)z;Check that check_is_fitted passes for stateless estimators.c                   .   ^  \ rS rSrS rU 4S jrSrU =r$ ):test_check_is_fitted_stateless.<locals>.StatelessEstimatori  c                     U $ r  rb  r  s     rT   r   >test_check_is_fitted_stateless.<locals>.StatelessEstimator.fit      Kr   c                 2   > [         TU ]  5       nSUl        U$ )NF)super__sklearn_tags__requires_fit)r  tagsr   s     rT   r  Ktest_check_is_fitted_stateless.<locals>.StatelessEstimator.__sklearn_tags__  s    7+-D %DKr   rb  )r   r  r  r  r   r  r  __classcell__)r   s   @rT   StatelessEstimatorr    s    		 	r   r  N)r   r>   )r  s    rT   test_check_is_fitted_statelessr    s    ]  &()r   c                     [         R                  " [        5         [        [        5        S S S 5        [         R                  " [        5         [        S5        S S S 5        [	        5       n [        5       n [         R                  " [        5         [        U 5        S S S 5        [         R                  " [        5         [        U5        S S S 5        SnSn[         R                  " [        US9   [        XS9  S S S 5        SnSn[         R                  " [        US9   [        XS9  S S S 5        U R                  " [        5       6   UR                  " [        5       6   [        U 5      b   e[        U5      b   eg ! , (       d  f       GNW= f! , (       d  f       GN;= f! , (       d  f       GN
= f! , (       d  f       N= f! [         a     S5       ef = f! , (       d  f       N= f! , (       d  f       N= f)	Nr   z&check_is_fitted failed with ValueErrorz!Random message %(name)s, %(name)sz+Random message ARDRegression, ARDRegressionr   )r   z"Another message %(name)s, %(name)szAnother message SVR, SVR)rP   rQ   r   r>   r   r   r
   rR   AttributeErrorr   r   )ardsvrr   r   s       rT   test_check_is_fittedr    sT   	y	!& 
"	y	! 
" /C
%C?]]>*C  +]]>*C  + .C9E	z	/% 
0 /C&E	~U	3% 
4 GGZ\GGZ\3'''3'''? 
"	!	!	! +*** ?>>>u? 
0	/
 
4	3sq   E;F6G F"G >F1
G /
G
G(;
F

F
F.)G 1
F?;G ?G G
G%(
G6c                      " S S[         5      n SnU " 5       n[        USS/S9(       a   e[        R                  " [        US9   [        USS/S9  S S S 5        [        USS/[        S9(       a   e[        R                  " [        US9   [        USS/[        S9  S S S 5        [        USS/[        S9(       a   e[        R                  " [        US9   [        USS/[        S9  S S S 5        S	Ul        [        USS/S9(       a   e[        R                  " [        US9   [        USS/S9  S S S 5        [        USS/[        S9(       a   e[        R                  " [        US9   [        USS/[        S9  S S S 5        [        USS/[        S9(       d   e[        USS/[        S9  S
Ul	        [        USS/S9(       d   e[        USS/S9  [        USS/[        S9(       d   e[        USS/[        S9  [        USS/[        S9(       d   e[        USS/[        S9  g ! , (       d  f       GN= f! , (       d  f       GN= f! , (       d  f       GNh= f! , (       d  f       GN2= f! , (       d  f       N= f)Nc                       \ rS rSrS rSrg)4test_check_is_fitted_attributes.<locals>.MyEstimatori  c                     U $ r  rb  r  ry   r   s      rT   r   8test_check_is_fitted_attributes.<locals>.MyEstimator.fit  r  r   rb  N)r   r  r  r  r   r  rb  r   rT   MyEstimatorr    s    	r   r  z
not fitteda_b_)
attributesr   )r  
all_or_anyr   r   )
r   r8   rP   rQ   r
   r>   allrx   r  r  )r  r   ests      rT   test_check_is_fitted_attributesr    s   m  C
-C#4,777	~S	1t5 
2#4,3GGG	~S	1tE 
2#4,3GGG	~S	1tE 
2 CF#4,777	~S	1t5 
2#4,3GGG	~S	1tE 
2ctTlsCCCCT4LSACFctTl333CT4L1ctTlsCCCCT4LSActTlsCCCCT4LSA3 
2	1 
2	1 
2	1
 
2	1 
2	1s<   H%H7I	#I)I-%
H47
I	
I
I*-
I;wrap)singlelistrs  )idsc                 ~   [        5       n[        R                  " [        SS9   [	        X" S/5      5        S S S 5        UR
                  " [        5       6   [	        X" S/5      5        [        R                  " [        SS9   [	        X" S/5      5        S S S 5        g ! , (       d  f       Nl= f! , (       d  f       g = f)Nzis not fitted yetr   coef_	coef_bad_)r   rP   rQ   r
   r>   r   r   )r  r  s     rT   $test_check_is_fitted_with_attributesr  	  s     /C	~-@	AT7)_- 
B GGZ\ Cwi) 
~-@	AT;-01 
B	A 
B	A 
B	As   BB.
B+.
B<c                     [        S/S/S/S/S/5        [        SS/SS///SS/SS/5        [        S/S[        R                  " S/5      [        R                  " S	5      5        [
        R                  " [        S
S9   [        SS/S/5        SSS5        [
        R                  " [        SS9   [        SS/S5        SSS5        [
        R                  " [        SS9   [        SS/[        5       5        SSS5        [
        R                  " [        5         [        SS/[        R                  " S5      5        SSS5        [
        R                  " [        SS9   [        SS/[        5       5        SSS5        g! , (       d  f       N= f! , (       d  f       N= f! , (       d  f       N= f! , (       d  f       Nz= f! , (       d  f       g= f)zlTest that `check_consistent_length` raises on inconsistent lengths and wrong
input types trigger TypeErrors.r   r]   rW   r   r^   r   r   )r]   r   r]   inconsistent numbers of samplesr   Nzgot <\w+ 'int'>zgot <\w+ 'object'>Expected sequence or array-like)r=   rJ   r   rr   r   rP   rQ   rR   r   ro   r	   rb  r   rT   test_check_consistent_lengthr    sK    QC!qcA34aVq!fX.Ac
CQCrxx}bll66JK	z)J	KA, 
L	y(:	;A* 
<	y(=	>A1 
?	y	!A4 
" 
y(I	JA(=(?@ 
K	J 
L	K	;	;	>	>	!	! 
K	Js<   >E</FF#F/G <
F

F
F,/
F= 
Gz(array_namespace, device_name, dtype_namec                     [        XU5      u  p4[        SS9   [        UR                  / SQUS9UR                  SS/SS/SS//US9/ SQ/ SQ[        R                  " S[
        S	9[        R                  " S
S/SS
/S
S
//5      5        [        R                  " [        SS9   [        UR                  SS/US9UR                  S/US95        SSS5        SSS5        g! , (       d  f       N= f! , (       d  f       g= f)zCTest that check_consistent_length works with different array types.Tarray_api_dispatchr   devicer   r]   rW   r!  rY   r   r  r   N)r   r   r=   r   rJ   ro   rr   r   rP   rQ   rR   )array_namespacedevice_name
dtype_namexpr  s        rT   &test_check_consistent_length_array_apir  /  s     &oJOJB	4	0JJyJ0JJAAA/J?JJf5LL1a&1a&1a&12	
 ]]:-NO#

Aq6&
1

A3v
. P 
1	0 PO 
1	0s$   B	C/!,CC/
C,	(C//
C=c                      [         R                  " S5      n [        R                  " / SQ/ SQ/ SQ/5      nU R	                  U/ SQS9n[        U5        g )Nr   r   r?  r@  )r   r   r   r4  )rP   r   rJ   r   r$  r=   )r   ry   rF  s      rT   "test_check_dataframe_fit_attributer  H  sD     
		X	&B
)Y	23A<<#4<5DD!r   c                     [         R                  " S[         R                  /5      n [        R                  " [
        5         [        U 5        S S S 5        [        R                  " SS9  [        U 5        [        R                  " SS9  [        R                  " [
        5         [        U 5        S S S 5        g ! , (       d  f       Np= f! , (       d  f       g = f)Nr   T)assume_finiteF)	rJ   r   infrP   rQ   rR   r<   sklearn
set_configr   s    rT   test_suppress_validationr  R  s    
!RVVA	z	"! 
#T*aU+	z	"! 
#	" 
#	"
 
#	"s   B7"C7
C
Cc                  N   [         R                  " S5      n [        U R                  / SQ5      SS9n[	        U[
        R                  " / SQ5      5        U R                  / SQ5      R                  S5      n[        US SS9n[	        U[
        R                  " / SQ[        S95        g )	Nr   r   Fr   r!  categoryr#  rY   )	rP   r   r   r   r!   rJ   r   rf   ro   )r   resss      rT   test_check_array_seriesr  ]  sx    			X	&B
bii	*e
<CsBHHY/0 			/"))*5A
atu
5CsBHH_FCDr   rZ   
bool_dtype)ri   booleanc           	      0   [         R                  " S5      nUR                  / SQ/ SQUR                  / SQUS9S./ SQS9n[	        X0S9nUR
                  [        R                  :X  d   e[        R                  " / SQ/ S	Q/ S
Q/[        S9n[        XE5        g )Nr   r   )r   r_    @TFTrY   )r   r   ri   r  )r          r  )r  r_   r  )r   r  r  )rP   r   r$  r   r   rZ   rJ   rh   r   r   r    )rZ   r	  r   dfr   expected_arrays         rT   'test_check_dataframe_mixed_float_dtypesr  i  s     
		X	&B	"II1ID	

 ) 
 
B (E;;"**$$$XX	/?;5N !7r   c                     [         R                  " S5      n U R                  S/ SQ05      n[        USS9nUR                  [
        R                  :X  d   e[        US/S/S//5        U R                  / SQ/ SQS	.SS
/S9n[        USS9nUR                  [
        R                  :X  d   e[        USS/SS/SS//5        g)z>Check that pandas.DataFrame with bool return a boolean arrays.r   ri   r  NrY   TFr   )ri   r   r   r  r  r   r   r]   rW   )	rP   r   r$  r   rZ   rJ   bool_r!   rg   r   r  r   s      rT   #test_check_dataframe_with_only_boolr    s    			X	&B	v23	4B$'E;;"(("""uvw78 
$Y7 
 
B ),E;;"(("""u1v1v1v67r   c                      [         R                  " S5      n U R                  SU R                  / SQSS905      n[	        USS9nUR
                  [        R                  :X  d   e[        US/S/S//5        g)	zMCheck that pandas.DataFrame with boolean return a float array with dtype=Noner   ri   r  r
  rY   NTF)	rP   r   r$  r   r   rZ   rJ   rh   r!   r  s      rT   &test_check_dataframe_with_only_booleanr    sl    			X	&B	vryy)<IyNO	PB$'E;;"**$$$uvw78r   c                       \ rS rSrS rSrg)DummyMemoryi  c                     U$ r  rb  )r  funcs     rT   cacheDummyMemory.cache  s    r   rb  N)r   r  r  r  r  r  rb  r   rT   r  r    s    r   r  c                       \ rS rSrSrg)WrongDummyMemoryi  rb  Nr   r  r  r  r  rb  r   rT   r  r    s    r   r  c                    [        U S-  5      n[        U5      nUR                  U:X  d   e[        S 5      nUR                  b   e[        5       n[        U5      nX#L d   eSn[        R
                  " [        US9   [        S5        S S S 5        [        5       nSR                  U5      n[        R
                  " [        US9   [        U5        S S S 5        g ! , (       d  f       NW= f! , (       d  f       g = f)Ncache_directoryzf'memory' should be None, a string or have the same interface as joblib.Memory. Got memory='1' instead.r   r   zg'memory' should be None, a string or have the same interface as joblib.Memory. Got memory='{}' instead.)	strr?   locationr  rP   rQ   rR   r  r   )tmp_pathr"  memorydummyr   s        rT   test_check_memoryr(    s    (%667O/*F??o---$F??"""ME% F??	2  
z	-Q 
.E	3396%=  
z	-U 
.	- 
.	- 
.	-s   <CC*
C'*
C8r\   c                     [         R                  " S5      n[        USS9 n[        X S9n[         R                  " X#5      U (       + :X  d   eUR
                  S   U :X  d   e S S S 5        g ! , (       d  f       g = f)N)r   r   r	mmap_moder[   	WRITEABLE)rJ   rb   r   r   may_share_memoryr   )r\   ry   X_memmapr   s       rT   test_check_array_memmapr0    sc    
A	A	%4	""87HEEE{+t333 
&	%	%s   A A++
A9zOestimator_name, estimator_value, delegates, expected_result, expected_exception
estimator_SubEstimatorrb  attribute_presentr   estimators_custom_estimatorno_estimatorattribute_absent)'fitted_estimator_with_default_delegates estimator_with_default_delegates#list_of_estimators_with_estimators_&custom_estimator_with_custom_delegates#no_estimator_with_default_delegates5estimator_with_default_delegates_but_absent_attributec                    Uc  [        S5      nO
[        SUS9n " S S5      nU" 5       n[        XpU5        U(       a(  [        R                  " U5         U" U5        SSS5        gU" U5      U:X  d   eg! , (       d  f       g= f)z
Tests the _estimator_has function by verifying:
- Functionality with default and custom delegates.
- Raises ValueError if delegates are missing.
- Raises AttributeError if the specified attribute is missing.
Nr3  )	delegatesc                       \ rS rSrSrg))test_estimator_has.<locals>.MockEstimatori  rb  Nr   rb  r   rT   MockEstimatorrA    s    r   rB  )r6   setattrrP   rQ   )estimator_nameestimator_valuer?  expected_resultexpected_exceptioncheckrB  r   s           rT   test_estimator_hasrI    s|    J 232iH  	AA/]]-.!H /. Qx?*** /.s   	A55
Bc                 <   [         R                  " / SQ/ SQ/ SQ/ SQ/5      nU " U5      n[        US5        U " SS/SS//5      n[        US5        SUS'   U " U5      n[        R                  " [
        SS9   [        US5        S S S 5        g ! , (       d  f       g = f)	N)r   r   r   r   )r   r   r   r   r   r   r   ra   z	Negative r   )rJ   r   r@   rP   rQ   rR   )r   r   ry   s      rT   test_check_non_negativerK  (  s    * 	,lLIJAq	Aq"AA Aq"AdGq	A	z	51b! 
6	5	5s   7B
Bc                  B   [         R                  " S5      n S nSn[        R                  " [        US9   [        X5        S S S 5        Sn[        R                  " [        US9   [        X[        5       S9  S S S 5        g ! , (       d  f       NE= f! , (       d  f       g = f)Nr]   r]   z;estimator requires y to be passed, but the target y is Noner   zGRandomForestRegressor requires y to be passed, but the target y is Noner   )rJ   rb   rP   rQ   rR   r   r	   )ry   r   r   s      rT    test_check_X_y_informative_errorrO  I  sq    
AA
GC	z	-! 
. TC	z	-!"7"9: 
.	-	 
.	- 
.	-s   A?#B?
B
Bc                      " S S5      n U " 5       n[        U5      [        U5      :X  d   e " S S5      n[        R                  " [        SS9   [        U" 5       5        SSS5         " S S	5      nU" [
        R                  " S
5      5      n[        U5      S
:X  d   eU" [
        R                  " S5      R                  S
S5      5      n[        U5      S
:X  d   eg! , (       d  f       N= f)z4Test _num_samples on different non standard input X.c                        \ rS rSrS rS rSrg)Ctest_num_samples_on_non_standard_shape.<locals>.TestNonNumericShapeiX  c                     SU l         g N)znot numericr   r  s    rT   __init__Ltest_num_samples_on_non_standard_shape.<locals>.TestNonNumericShape.__init__Y  	    )DJr   c                     [        / SQ5      $ )Nr   )lenr  s    rT   __len__Ktest_num_samples_on_non_standard_shape.<locals>.TestNonNumericShape.__len__\  s    y>!r   rU  N)r   r  r  r  rV  r[  r  rb  r   rT   TestNonNumericShaperR  X  s    	*	"r   r]  c                       \ rS rSrS rSrg)Ctest_num_samples_on_non_standard_shape.<locals>.TestNoLenWeirdShapeic  c                     SU l         g rT  rU  r  s    rT   rV  Ltest_num_samples_on_non_standard_shape.<locals>.TestNoLenWeirdShape.__init__d  rX  r   rU  N)r   r  r  r  rV  r  rb  r   rT   TestNoLenWeirdShaper_  c  s    	*r   rb  r  r   Nc                   $    \ rS rSrS rSS jrSrg)Ptest_num_samples_on_non_standard_shape.<locals>.TestNoLenNoShapeButArrayProtocolij  c                     Xl         g r  r   )r  r   s     rT   rV  Ytest_num_samples_on_non_standard_shape.<locals>.TestNoLenNoShapeButArrayProtocol.__init__k  s    Fr   Nc                 @    [         R                  " U R                  US9$ )NrY   )rJ   r   r   )r  rZ   r\   s      rT   	__array__Ztest_num_samples_on_non_standard_shape.<locals>.TestNoLenNoShapeButArrayProtocol.__array__n  s    ::dffE22r   r   )NN)r   r  r  r  rV  rh  r  rb  r   rT    TestNoLenNoShapeButArrayProtocolrd  j  s    		3r   rj  rW   r   r]   )r:   rZ  rP   rQ   r   rJ   rd   r   )r]  ry   rb  rj  s       rT   &test_num_samples_on_non_standard_shaperk  U  s    " " 	A?c!f$$$* * 
y(I	J(*+ 
K3 3 	)16A?a(1)=)=a)CDA?a 
K	Js   C
C+constructor_name)r  rs  r   seriespolars_seriesc                 b    [        [        [        S5      5      U 5      n[        U5      S:X  d   eg)z*Test _num_samples on different 1d input X.rW   N)r   r  ranger:   rl  ry   s     rT   test_num_samples_on_1drr  w  s+    
 	4a>+;<A?ar   )r  rs  r   sparser   pyarrowpolarsc                 P    [        SS/SS/SS//U 5      n[        U5      S:X  d   eg)z6Test _num_samples on different dataframe-like input X.r      r]      rW   !   N)r   r:   rq  s     rT   #test_num_samples_on_dataframe_likesrz    s6     	QGaWq"g68HIA?ar   r   )r]   rW   g      @r^   c           
          [         R                  " 5          [         R                  " S5        [        U S[        R
                  SSSS9nSSS5        WU :X  d   eg! , (       d  f       N= f)zLTest that check_scalar returns no error/warning if valid inputs are
providedrT  	test_namer]   r^   bothtarget_typemin_valmax_valinclude_boundariesN)rU  rV  rW  rB   numbersReal)r   scalars     rT   test_check_scalar_validr    sZ     
	 	 	"g&%
 
# Q;; 
#	"s   3A
A(zJx, target_name, target_type, min_val, max_val, include_boundaries, err_msg
test_name1r]   r   neitherz1test_name1 must be an instance of float, not int.z6test_name1 must be an instance of float, not NoneType.z4test_name1 must be an instance of int, not NoneType.z9test_name1 must be an instance of {float, bool}, not int.
test_name2ztest_name2 == 1, must be > 2.r^   
test_name3ztest_name3 == 5, must be < 4.
test_name4rightztest_name4 == 2, must be > 2.
test_name5leftztest_name5 == 4, must be < 4.
test_name6zbad parameter valuezyUnknown value for `include_boundaries`: 'bad parameter value'. Possible values are: ('left', 'right', 'both', 'neither').
test_name7zT`include_boundaries`='left' without specifying explicitly `min_val` is inconsistent.
test_name8zU`include_boundaries`='right' without specifying explicitly `max_val` is inconsistent.c           
         [         R                  " [        5       n[        U UUUUUS9  SSS5        [	        WR
                  5      [	        U5      :X  d   e[        UR
                  [        U5      5      (       d   eg! , (       d  f       NY= f)zHTest that check_scalar returns the right error if a wrong input is
givenr~  N)rP   rQ   	ExceptionrB   r#  r   r   r   )r   target_namer  r  r  r  r   raised_errors           rT   test_check_scalar_invalidr    sw    l 
y	!\#1	
 
" |!!"c'l222l(($w-8888 
"	!s   A==
Br  )r^   y        -C6
?zJThere are imaginary parts in eigenvalues \(1e\-05 of the maximum real part)r^   g-C6
gưz?There are negative eigenvalues \(1e\-06 of the maximum positiveg|۽z?There are negative eigenvalues \(1e\-10 of the maximum positive)r^   g-=z=the largest eigenvalue is more than 1e\+12 times the smallest)nominalnominal_np_arrayinsignificant_imagzinsignificant negzinsignificant neg float32zinsignificant neg float64zinsignificant posz(lambdas, expected_lambdas, w_type, w_msgenable_warningsc                 J   U(       d  S nUcC  [         R                  " 5          [         R                  " S[        5        [	        XS9nS S S 5        O&[
        R                  " X#S9   [	        XS9nS S S 5        [        UW5        g ! , (       d  f       N= f! , (       d  f       N,= f)NrT  )r  r   )rU  rV  rW  r   r1   rP   r  r   )lambdasexpected_lambdasw_typew_msgr  lambdas_fixeds         rT    test_check_psd_eigenvalues_validr  =  s     ~$$&!!'+BC2M '& \\&.2M /
 $m4 '& /.s   %B$
B
B
B")r^   y              @z/There are significant imaginary parts in eigenv)r   z,All eigenvalues are negative \(maximum is -1)r^   r   z*There are significant negative eigenvaluesga2U0*3?ggh㈵>g|)significant_imagzall negativezsignificant negzsignificant neg float32zsignificant neg float64zlambdas, err_type, err_msgc                 v    [         R                  " XS9   [        U 5        S S S 5        g ! , (       d  f       g = f)Nr   )rP   rQ   r1   )r  err_typer   s      rT   "test_check_psd_eigenvalues_invalidr  x  s$     
x	/w' 
0	/	/s   *
8c                 N   [        S U R                  S5      S9n[        [        U[        SS9[        R                  " S5      5        [        SU R                  S5      S9n[        [        U[        SS9S[        R                  " S5      -  5        [
        R                  " [        SS	9   [        U R                  S
5      U R                  S5      S9  S S S 5        [        R                  " SU R                  S5      R                   S35      n[
        R                  " [        US	9   [        U R                  S5      U R                  S5      S9  S S S 5        U R                  S5      nU R                  SU R                  S9n[        X5      nUR                  U R                  :X  d   eU R                  S5      nU R                  [        U5      5      nSUS'   Sn[
        R                  " [        US	9   [        XSS9  S S S 5        U R                  S5      nU R                  [        U5      5      nSn[
        R                  " [        US	9   [        XSS9  S S S 5        g ! , (       d  f       GN= f! , (       d  f       GN+= f! , (       d  f       N= f! , (       d  f       g = f)Nr^   r]   r   cpu)r  r  r^   r  r]   z)Sample weights must be 1D array or scalarr   )r]   r   rM  zsample_weight.shape == r   z, expected (2,)!rY   r   z1Negative values in data passed to `sample_weight`T)r   z9Sample weights must contain at least one non-zero number.F)allow_all_zero_weights)r3   rb   r   r   rJ   rP   rQ   rR   r  r  r   re   rZ   r:   zeros)r  r   r   ry   r   s        rT   _check_sample_weight_commonr    s    )AMGMb?L )@MGMb?RWWQZP 
z)U	VRWWV_@ 
W ))-bggaj.>.>-??OP
QC	z	-RWWQZ2776?; 
. 	AGGARZZG0M(:M"**,,, 	AGGLO,MM"AG	z	1]4H 
2 	AHH\!_-MIG	z	1]eL 
2	15 
W	V
 
.	- 
2	1 
2	1s0   ))I!&)I34JJ!
I03
J
J
J$c                     [         R                  " S5      S S S2   n U R                  S   (       a   e[        U [         R                  " S5      S9n U R                  S   (       d   e[	        [         5        [         R                  " S[
        S9n[        S XR                  S9n U R                  [         R                  :X  d   eg )NrX   r]   r   r^   r   r   r  rY   )rJ   rb   r   r3   r  r   rZ   rh   )r   ry   s     rT   test_check_sample_weightr    s    GGBK!$M"">222("''&/JM~...# 	c"A(q@M"**,,,r   c                 r   [        XU5      u  p4[        SS9   UR                  S5      S S S2   n[        U5      (       a  UR                  S   (       a   e[        XSR                  S5      S9n[        U5      (       a  UR                  S   (       d   e[        U5        S S S 5        g ! , (       d  f       g = f)NTr  rX   r]   r   r  r   )r   r   rb   r   r   r3   r  )r  r  r  r  r  r   s         rT   "test_check_sample_weight_array_apir    s    
 &oJOJB	4	0CaC(r""$**>:::,]ggfoNr"" &&~666#B' 
1	0	0s   BB((
B6y_truer   )r   r   r   )r   r   r   c                 (    [        S U 5      S:X  d   eg )Nr   )r0   r  s    rT    test_check_pos_label_consistencyr    s    'f5:::r   c                     [        XU5      u  pE[        SS9   UR                  X5S9n[        S U5      S:X  d   e S S S 5        g ! , (       d  f       g = f)NTr  r  r   )r   r   r   r0   r  r  r  r  r  r  rK  s          rT   *test_check_pos_label_consistency_array_apir    sK     &oJOJB	4	0jjj/+D#6!;;; 
1	0	0s   "A
A)r]   rW   r   r  c                     [         R                  " [        SS9   [        S U 5        S S S 5        [        SU 5      S:X  d   eg ! , (       d  f       N!= f)Ny_true takes value inr   r   )rP   rQ   rR   r0   r  s    rT   (test_check_pos_label_consistency_invalidr    sB    	z)@	A$T62 
B (V4;;; 
B	As   A
Ac                 (   [        XU5      u  pE[        SS9   UR                  X5S9n[        R                  " [
        SS9   [        S U5        S S S 5        [        SU5      S:X  d   e S S S 5        g ! , (       d  f       N*= f! , (       d  f       g = f)NTr  r  r  r   r   )r   r   r   rP   rQ   rR   r0   r  s          rT   2test_check_pos_label_consistency_invalid_array_apir    sx     &oJOJB	4	0jjj/]]:-DE(s3 F ,C5<<< 
1	0EE 
1	0s#   )BA2B2
B 	<B
Brt   c                     [         R                  " S5      R                  SS5      nU " U5      U " U5      p2[        X#5      (       d   eg )NrB  rW   rJ   rd   r   r,   rt   baser   r   s       rT   !test_allclose_dense_sparse_equalsr    s<    99Q<1%D4='$-q!!''''r   c                     [         R                  " S5      R                  SS5      nU " U5      U " US-   5      p2[        X#5      (       a   eg )NrB  rW   r   r  r  s       rT   %test_allclose_dense_sparse_not_equalsr    sD    99Q<1%D4='$(+q%a+++++r   c                     [         R                  " S5      R                  SS5      nU " US-   5      nSn[        R                  " [
        US9   [        X5        S S S 5        g ! , (       d  f       g = f)NrB  rW   r   zFCan only compare two sparse matrices, not a sparse matrix and an arrayr   )rJ   rd   r   rP   rQ   rR   r,   )rt   r   r   r   s       rT    test_allclose_dense_sparse_raiser    sP    
		!Q"AAA
RC	z	-q$ 
.	-	-s   A""
A0c                  V   [         SSS.S j5       n [        R                  " [        SS9   U " SSS5        S S S 5        [        R                  " [        SS9   U " SSSS	5        S S S 5        [         SSSSS
.S jj5       n[        R                  " [        SS9   U" SS5        S S S 5        [         SSS.S j5       n[        R                  " [        SS9   U" SS5        S S S 5        g ! , (       d  f       N= f! , (       d  f       N= f! , (       d  f       Nm= f! , (       d  f       g = f)Nr   r"  dc                    g r  rb  r   r   r"  r  s       rT   f1=test_deprecate_positional_args_warns_for_function.<locals>.f1      r   Pass c=3 as keyword argsr   r]   rW   Pass c=3, d=4 as keyword argsr   )r   r"  r  c                    g r  rb  r  s       rT   f2=test_deprecate_positional_args_warns_for_function.<locals>.f2"  r  r   zPass b=2 as keyword argsc                    g r  rb  r  s       rT   f3=test_deprecate_positional_args_warns_for_function.<locals>.f3*  r  r   )r   r5   rP   r  FutureWarning)r  r  r  s      rT   1test_deprecate_positional_args_warns_for_functionr    s   1    
m+F	G
1a 
H 
m+K	L
1aA 
M  Q!q    
m+F	G
1a 
H  1    
m+F	G
1a 
H	G% 
H	G 
M	L 
H	G 
H	Gs/   C'C8
D	
D'
C58
D	
D
D(c                      [        SS9S 5       n [        R                  " [        SS9   U " SS5        S S S 5        g ! , (       d  f       g = f)Nz1.1)versionc                    g r  rb  r  s     rT   r  Etest_deprecate_positional_args_warns_for_function_version.<locals>.f13  r  r   z,From version 1.1 passing these as positionalr   r   r]   r  )r  s    rT   9test_deprecate_positional_args_warns_for_function_versionr  2  sH    . / 
L
 	1a
 
 
s	   
<
A
c                      " S S5      n [         R                  " [        SS9   U " SSS5        S S S 5        [         R                  " [        SS9   U " SSSS	5        S S S 5         " S
 S5      n[         R                  " [        SS9   U" SSS5        S S S 5        [         R                  " [        SS9   U" SSSS	5        S S S 5        g ! , (       d  f       N= f! , (       d  f       N= f! , (       d  f       N^= f! , (       d  f       g = f)Nc                   .    \ rS rSr\SSS.S j5       rSrg):test_deprecate_positional_args_warns_for_class.<locals>.A1i>  r   r  c                    g r  rb  r  r   r   r"  r  s        rT   rV  Ctest_deprecate_positional_args_warns_for_class.<locals>.A1.__init__?  r  r   rb  Nr   r  r  r  r5   rV  r  rb  r   rT   A1r  >  s    	#&'1 	 
$	r   r  r  r   r   r]   rW   r  r   c                   2    \ rS rSr\SSSS.S jj5       rSrg):test_deprecate_positional_args_warns_for_class.<locals>.A2iI  r   r  c                    g r  rb  r  s        rT   rV  Ctest_deprecate_positional_args_warns_for_class.<locals>.A2.__init__J  r  r   rb  N)r   r   r  rb  r   rT   A2r  I  s    	#	!q 	 
$	r   r  )rP   r  r  )r  r  s     rT   .test_deprecate_positional_args_warns_for_classr  =  s     
 
m+F	G
1a 
H 
m+K	L
1aA 
M 
 
m+F	G
1a 
H 
m+K	L
1aA 
M	L 
H	G 
M	L 
H	G 
M	Ls/   CCC*3C;
C
C'*
C8;
D	rv  rW   c           
         [         R                  R                  SS5      n/ SQ[         R                  " / SQ5      [        R
                  " / SQ/5      R                  [        R
                  " / SQ/5      [        R                  " / SQ/5      R                  [        R                  " / SQ/5      SSS S.	n[        XU S9nU b  U O [        [        UR                  S   5      5      nS	 H  nX5   X%   L a  M   e   US
   [        US
   U5      :X  d   e[        US   [        US   U5      5        [        US   [        US   U5      5        [        US   [        US   U5      5        g )Nr   r]   )r   r]   rW   r   r   xxx)	r  r   sparse-col2sparse-row2
sparse-col
sparse-row
scalar-int
scalar-strNone)ri  rv  r   )r  r  r  r  r  r  r   r  r  )rJ   rK   randnr   rr   rs   r   ru   r/   r  rp  r   r   r!   r    )rv  ry   _paramsr  indices_keys         rT   test_check_method_paramsr  U  s9   
		1A,'}}l^466}}l^4llL>244llL>2
G "!WEF!-w4aggaj8I3JHP{gl*** Q &>^GFOXFFFFvgww7G(RS |nW\-BHM !}~gm.DhOr   	sp_format)Tr   rg  r   rh  c                 &   [         R                  " S5      n[        SS5      nUR                  R                  R                  U5      n[        X0S9nU SL a  Sn [        R                  " U5      (       d   eUR                  U :X  d   e[        X$5        g )Nr   rX   rW   ra  Tr   )rP   r   r   r$  rs  from_spmatrixr   rr   r  r   r    )r  r   sp_matsdfr  s        rT   "test_check_sparse_pandas_sp_formatr  s  s     
		X	&B"2q)F
,,


+
+F
3C6FD	;;v==I%%% 0r   c                     [         R                  " S5      n U R                  S[        R                  " SSS5      05      n[        SS5       HS  n[        R                  " S5      n[        R                  " S5      USS& U R                  R                  USS9nX1S	U 3'   MU     S
n[         R                  " [        US9   [        USS9  SSS5        UR                  SS9n[        US5      (       d   e[        R                   " 5          [        R"                  " S[        5        [        USS9  SSS5        g! , (       d  f       Nt= f! , (       d  f       g= f)zDTest that check_array warns on pandas dataframe with sparse columns.r   col_0r   r   rX   r   N)
fill_valuecol_z+pandas.DataFrame with sparse columns found.r   Tra  r  rs  rT  )rP   r   r$  rJ   linspacerp  r  rd   arraysSparseArrayr  r  r   dropr   rU  rV  rW  )r   r  rP  rK  r   s        rT   ,test_check_array_pd_sparse_dataframe_warningr
    s   			X	&B 
wAq" 56	7B1a[hhrl))A,BQii##CA#6T!:	  8C	k	-Bd+ 
. 
	!B2x    		 	 	"g{3Bd+ 
#	" 
.	- 
#	"s   >D7&E7
E
Ezntype1, ntype2)	)
longdoublerD  )rD  re   )re   double)rk   rc   )rc   long)byterm   )ushortrn   )rn   uint64)rl   rj   c           	          [         R                  " S5      nUR                  UR                  R	                  / SQU SS9UR                  R	                  / SQUSS9S.5      n[        USS/S	9  g
)zSCheck that pandas.DataFrame having sparse extension arrays with mixed dtypes
works.r   r   r   r   r   rZ   r  r   r   r   col1col2r   rg  ra  N)rP   r   r$  r  r  r   )ntype1ntype2r   r  s       rT   %test_check_pandas_sparse_mixed_dtypesr    si    " 
		X	&B	II)))6a)PII)))6a)P	

B 5%.1r   z ntype1, ntype2, expected_subtyper  r  r  re   rh   rj   r  shortrk   intcrc   intpr  r   rg   longlongint_ubyterl   rm   r  uintcrn   uintr  uintp	ulonglongc           	      ,   [         R                  " S5      nUR                  UR                  R	                  / SQU SS9UR                  R	                  / SQUSS9S.5      n[        USS/S	9n[        R                  " UR                  U5      (       d   eg )
Nr   r  r   r  r  r  r   rg  ra  )	rP   r   r$  r  r  r   rJ   
issubdtyperZ   )r  r  expected_subtyper   r  rK  s         rT   test_check_pandas_sparse_validr(    s    . 
		X	&B	II)))6a)PII)))6a)P	

B b
7C==$45555r   )r  rs  r   r   
sparse_csr
sparse_cscc                 L    / SQ/ SQ/n[        X5      n[        U5      S:X  d   eg)z$Check _num_features for array-likes.r   r?  rW   N)r   r9   rq  s     rT   test_num_featuresr,    s+     
IA1/Aq   r   r   r!  )FTF)r  g333333@g      @r   r   r"  )r   r#  ri   r   dict)r  rs  r   rm  c                    [        X5      n US:X  a  SnOUS:X  a  SnOUnSU 3n[        U S5      (       a  U[        R                  " S5      -  nO;[	        U S   [
        5      (       a  US	-  nO[	        U S   [        5      (       a  US
-  n[        R                  " [        US9   [        U 5        S S S 5        g ! , (       d  f       g = f)Nr   znumpy.ndarrayrm  zpandas.*Series5Unable to find the number of features from X of type r   z with shape (3,)r   z" where the samples are of type strz# where the samples are of type dictr   )r   r   r  r  r   r#  r-  rP   rQ   r   r9   )ry   rl  expected_type_namemessages       rT   &test_num_features_errors_1d_containersr2    s     	1/A7",	X	%--
?@R?ST  q'299/00	AaD#		77	AaD$		88	y	0a 
1	0	0s   $B99
C)r   r   Fr   )r   r#  ri   r   c                     S[        U 5      R                   3n[        R                  " [        US9   [        U 5        S S S 5        g ! , (       d  f       g = f)Nr/  r   )r   r  rP   rQ   r   r9   )ry   r   s     rT    test_num_features_errors_scalarsr4    s;    A$q'BVBVAW
XC	y	,a 
-	,	,s   A
Anamesr  )zlist-intrp  default
MultiIndexc                    [         R                  " S5      nUR                  SS/SS/SS//U S9n[        R                  " 5          [        R
                  " S[        5        [        U5      n S	S	S	5        U b   eg	! , (       d  f       N= f)
zGet feature names with pandas.DataFrames without warning.

Column names with consistent dtypes will not warn, such as int or MultiIndex.
r   r   r]   r   r^   r   r  rT  N)rP   r   r$  rU  rV  rW  r  r7   )r5  r   ry   s      rT   2test_get_feature_names_pandas_with_ints_no_warningr9    sy     
		X	&B
q!fq!fq!f-u=A		 	 	"g}5"1% 
# == 
#	"s   'A::
Bzconstructor_name, minversion))rt  z13.0.0)r   z1.5.0)ru  z0.18.2c                 \    / SQ/ SQ/n/ SQn[        X X1S9n[        U5      n[        XS5        g)z'Test _get_features_names on dataframes.)r   r   r]   )rW   rW   r   )r  col_1col_2)column_namesr3  N)r   r7   r!   )rl  r3  r   r4  r  feature_namess         rT   #test_get_feature_names_4_dataframesr?  "  s6     y!D)G	W
B 'r*M}.r   c                  \    [         R                  " / SQ/ SQ/5      n [        U 5      nUb   eg)z/Get feature names return None for numpy arrays.r   r?  N)rJ   r   r7   )ry   r5  s     rT   test_get_feature_names_numpyrA  2  s)    
)Y'(Aq!E==r   znames, dtypesz['int', 'str']pizzar  z['str', 'tuple']zstr-intz	str-tuplec                    [         R                  " S5      nUR                  SS/SS/SS//U S9n[        R                  " SU S	35      n[         R
                  " [        US
9   [        U5      n SSS5        g! , (       d  f       g= f)zAGet feature names errors when the feature names have mixed dtypesr   r   r]   r   r^   r   r  z]Feature names are only supported if all input features have string names, but your input has a.   as feature name / column name types. If you want feature names to be stored and validated, you must convert them all to strings, by using X.columns = X.columns.astype(str) for example. Otherwise you can remove feature / column names from your input data, or convert them all to a non-string data type.r   N)rP   r   r$  r  r  rQ   r   r7   )r5  r   r   ry   r   s        rT   %test_get_feature_names_invalid_dtypesrD  9  s     
		X	&B
q!fq!fq!f-u=A
))	$X &?	?C 
y	,"1% 
-	,	,s   #A88
Bc                   .    \ rS rSrSS jrS rSS jrSrg)PassthroughTransformeriR  Nc                     [        XSS9  U $ )NT)reset)rE   r  s      rT   r   PassthroughTransformer.fitS  s    dT*r   c                     U$ r  rb  )r  ry   s     rT   	transform PassthroughTransformer.transformW  s    r   c                     [        X5      $ r  )r.   )r  input_featuress     rT   get_feature_names_out,PassthroughTransformer.get_feature_names_outZ  s    &t<<r   rb  r  )r   r  r  r  r   rK  rO  r  rb  r   rT   rF  rF  R  s    =r   rF  )rl  r>  r   r   )x0x1x2z*input_features should have length equal tor   zinput_features is not equal toru  c                    [         R                  " / SQ/5      n[        X0/ SQS9n[        5       R	                  U5      nUR                  5       n[        XQ5        USS n[        R                  " [        US9   UR                  U5        SSS5        U?
U S:X  a3  [        R                  " [        SS9   UR                  5         SSS5        g[        UR                  5       U5        g! , (       d  f       Nd= f! , (       d  f       g= f)	z4Check behavior of check_feature_names_in for arrays.)r  r  r  r!  )r=  Nr]   r   r   z Unable to generate feature names)rJ   r   r   rF  r   rO  r!   rP   rQ   rR   n_features_in_)rl  r>  r   ry   r  r5  incorrect_len_namess          rT   test_check_feature_names_inrW  ^  s     	/"#A1_MA
 
"
&
&q
)C%%'Eu,'+	z	-!!"56 
. 	7"]]:-OP%%' QP 	3446F 
.	- QPs   8C(3C9(
C69
Dc                      Sn [         R                  " [        U S9   [        [	        5       S5        SSS5        g! , (       d  f       g= f)z@Check the error message when passing an unknown response method.zKRandomForestRegressor has none of the following attributes: unknown_method.r   unknown_methodN)rP   rQ   r  r2   r	   )r   s    rT   )test_check_response_method_unknown_methodrZ  |  s8     	V  
~W	5468HI 
6	5	5s	   :
Aresponse_method)decision_functionpredict_probapredictc                     SU  S3n[         R                  " [        US9   [        [	        5       U 5        SSS5        g! , (       d  f       g= f)zQCheck the error message when a response method is not supported by the
estimator.z7EstimatorWithFit has none of the following attributes: .r   N)rP   rQ   r  r2   r   )r[  r   s     rT   8test_check_response_method_not_supported_response_methodra    sB     B/ARRST  
~W	5/1?C 
6	5	5s	   >
Ac                  p   S/n [        U 5      nSnSS/nSSR                  U5       S3n[        R                  " [        US9   [        X5      " U5        S	S	S	5        SS/n[        X5      " U5      nUS:X  d   eSS/n [        U 5      n/ S
Qn[        X5      " U5      nUS:X  d   eg	! , (       d  f       NX= f)z0Check that we can pass a list of ordered method.r]  mocking_datar\  r^  zD_MockEstimatorOnOffPrediction has none of the following attributes: z, r`  r   N)r\  r^  r]  )r   joinrP   rQ   r  r2   )method_implementedmy_estimatorry   r[  r   method_name_predictings         rT   #test_check_response_method_list_strrh    s    )*01CDLA +I6ON99_%
&a	)  
~W	5|=a@ 
6 +O<O3LRSTU!_444 *9501CDLGO3LRSTU!Y... 
6	5s   B''
B5c                      [         R                  " S5      n [        U R                  SS/5      SS9n[        R
                  " SS/5      nUR                  UR                  :X  d   e[        X5        g)zRegression test for gh-25145r   TFr   N)rP   r   r   r   rJ   r   rZ   r!   )r   r  expecteds      rT   #test_boolean_series_remains_booleanrk    s[    			X	&B
biiu.%
@Cxxu&H99&&&s%r   input_values)r   r   r   r   r   r   c                     [         R                  " S5      nUR                  U SS9n[        USSSSS9n[        R
                  " UR                  R                  [        R                  5      (       d   e[        X05        g)zhCheck pandas array with extensions dtypes returns a numeric ndarray.

Non-regression test for gh-25637.
r   Int32rY   NF)rZ   r   r   r   )
rP   r   r   r   rJ   r&  rZ   rQ  floatingr   )rl  r   input_seriesr  s       rT   !test_pandas_array_returns_ndarrayrq    sn     
		X	&B88L88LF ==**BKK8888F)r   c                     [         R                  " S5      n U R                  U R                  SS/SU R                  S//U R                  S9n[        SS9   [         R                  " [        SS	9   [        U5        S
S
S
5        S
S
S
5        U R                  U R                  SS/SU R                  S//U R                  S9n[        SS9   [         R                  " [        SS	9   [        U5        S
S
S
5        S
S
S
5        g
! , (       d  f       N= f! , (       d  f       N= f! , (       d  f       N9= f! , (       d  f       g
= f)z9Checks that Array API arrays checks non-finite correctly.array_api_strictr   r   rW   rY   Tr  r   r   Nzinfinity or a value too large)
rP   r   r   rv   re   r   rQ   rR   r   r   )r  X_nanX_infs      rT   )test_check_array_array_api_has_non_finiterv    s     
		/	0BJJABFFA7rzzJJE	4	0]]:-BC D 
1 JJABFFA7rzzJJE	4	0]]:-LM N 
1	0	 DC 
1	0 NM 
1	0sH   D0D<DD5%D$1D5
D	D
D!$
D2	.D55
Ezextension_dtype, regular_dtype))r
  ri   )r9  rg   )r1  rh   )r  ro   include_objectc                 P   [         R                  " S5      nUR                  UR                  / SQUS9UR                  / SQSS9S.5      nU(       a  UR                  / SQSS9US	'   UR	                  US
   R                  U 5      S9n[        USS9n[        USS9n[        Xg5        g)zKCheck pandas extension arrays give the same result as non-extension arrays.r   )r   r   r   r   rY   )rB  r   rA  r   rg   )r   r"  r  ro   r   r   )r   N)rP   r   r$  r   assignrf   r   r!   )extension_dtyperegular_dtyperw  r   	X_regularX_extensionX_regular_checkedX_extension_checkeds           rT   $test_check_array_multiple_extensionsr    s     
		X	&B<}=<w7	
I #7xH	#""Ys^%:%:?%K"LK#IT:%k>(>r   r  output_format)r   rg  r   c                    U " SS/SS//[         R                  S9n[        US5      (       a/  UR                  R	                  [         R
                  5      Ul        O[        US5      (       a@  [        US5      (       a/  UR                  R	                  [         R
                  5      Ul        O~[        US5      (       am  [        US5      (       a\  UR                  R	                  [         R
                  5      Ul        UR                  R	                  [         R
                  5      Ul        [        X!S	9nUS
:X  aU  UR                  R                  [         R
                  :X  d   eUR                  R                  [         R
                  :X  d   egUR                  R                  [         R
                  :X  d   eUR                  R                  [         R
                  :X  d   eg)zGCheck the consistency of the indices dtype with sparse matrices/arrays.r   r   rY   offsetsrt  ru  rv  rw  ra  r   N)rJ   rh   r   r  rf   rc   rt  rv  rw  r   rZ   ru  )r  r  ry   r   s       rT   1test_check_array_dia_to_int32_indexed_csr_csc_coor    sL    	1a&1a&)<A q)II$$RXX.		E		wq%00RXX&	I		71h#7#7II$$RXX.	88??288,A;I}}""bhh...}}""bhh...  &&"((222%%111r   sequencec                     [        U 5      n[        U[        R                  5      (       d   eUR                  R
                  S:X  d   eUR                  S:X  d   eg )NOr   )r;   r   rJ   r   rZ   rQ  r   )r  outs     rT   test_to_object_arrayr  	  sI    
8
$Cc2::&&&&99>>S   88q==r   c                     S/ SQ4S/ SQ4S[         R                  " S5      S-  4S/ SQ4S/ S	Q4SS
/S/S//4S/ SQ/ SQ/4S/ SQ/4SS
S
/SS/SS
//4SSS
/SS/SS
//4S/ SQ/4S[         R                  " S5      R                  S5      4/n U  Hd  u  pUS;   a+  [        [	        U5      [         R
                  " U5      5        M6  [        R                  " [        5         [	        U5        S S S 5        Mf     g ! , (       d  f       Mx  = f)Nbinary)spameggr  )r   r   r   r   
continuousrX   g      4@
multiclassr   )r   r   r]   r]   r   r   r]   rW   zmultilabel-indicatorr  )r   r   r   zmulticlass-multioutputr^   r   zcontinuous-multioutput   )r   rW   )r  r  r  )	rJ   rd   r   r!   rC   r   rP   rQ   rR   )EXAMPLESy_typer   s      rT   test_column_or_1dr  	  s   	*+	< 	ryy}t+,	y!	'	aS1#'	)Y!78	!I;/	!QFQFQF#;<	!QFQFQF#;<	!I;/	!299R=#8#8#ABH 	;;|A<z*Q +*	  +*s   C88
D	c                  t   [         R                  R                  SS9n [        U SSS9n[         R                  " X5      (       d   eUR
                  R                  (       d   eSU R
                  l        [        U SSS9n[         R                  " X5      (       a   eUR
                  R                  (       d   eg)zqCheck the behavior of check_array when a writeable array is requested
without copy if possible, on numpy arrays.
r   sizeFTr\   force_writeableN)rJ   rK   uniformr   r.  r   	writeable)ry   r  s     rT   test_check_array_writeable_npr  6	  s     			x(A
aeT
:Cs&&&&99AGG
aeT
:C""3****99r   c                  z   [         R                  R                  SS9n [        U SS9n[	        USSS9n[         R
                  " X!5      (       d   eUR                  R                  (       d   e[        U SS9n[	        USSS9n[         R
                  " X!5      (       a   eUR                  R                  (       d   eg	)
a  Check the behavior of check_array when a writeable array is requested
without copy if possible, on a memory-map.

A common situation is when a meta-estimators run in parallel using multiprocessing
with joblib, which creates read-only memory-maps of large arrays.
r   r  zw+r+  FTr  r*  N)rJ   rK   r  r"   r   r.  r   r  )ry   mmapr  s      rT   test_check_array_writeable_mmapr  I	  s     			x(A$Q$7D
d
=Cs))))99$Q#6D
d
=C""3----99r   c                     [         R                  " S5      n [        R                  R	                  SS9nU R                  USS9n[        USSS9n[        R                  " X25      (       d   eUR                  R                  (       d   eSUR                  l	        U R                  USS9n[        USSS9n[        R                  " X25      (       a   eUR                  R                  (       d   eg)	zpCheck the behavior of check_array when a writeable array is requested
without copy if possible, on a dataframe.
r   r   r  Fr[   Tr  N)
rP   r   rJ   rK   r  r$  r   r.  r   r  )r   ry   r  r  s       rT   test_check_array_writeable_dfr  _	  s     
		X	&B
		x(A	ae	$B
bud
;Cs''''99AGG	ae	$B
bud
;C""3++++99r   c                  J   [         R                  " / SQ/ SQ/5      n [        SS9   [         R                  " [	        U SS95      (       d   e[
        R                  " [        5         [	        U 5        S S S 5        S S S 5        g ! , (       d  f       N= f! , (       d  f       g = f)Nr  r  Tr  ra  )rr   r   r   r  r   rP   rQ   r   )X_sps    rT   8test_check_array_on_sparse_inputs_with_array_api_enabledr  v	  sl    <<I./D	4	0{{;t4@AAAA]]9% & 
1	0 &% 
1	0s$   A B&B2B
B	B
B"ry   r   expected_error_messagezLFound array with dim 3, while dim <= 2 is required by RandomForestRegressor.z3Found array with dim 3, while dim <= 2 is required.c                 |    [         R                  " [        US9   [        XS9  S S S 5        g ! , (       d  f       g = f)Nr   rN  r  r  s      rT    test_check_array_allow_nd_errorsr  	  s(    " 
z)?	@A+ 
A	@	@s   
-
;categorical_featuresr  s   hellos   worldzMcategorical_features must be an array-like of bool, int or str, got: bytes40.g?zRcategorical_features must be an array-like of bool, int or str, got: bytes, float.zJcategorical_features set as integer indices must be in [0, n_features - 1])TTFFTzHcategorical_features set as a boolean mask must have shape (n_features,)c                     [         R                  R                  S5      nSu  p4UR                  SSX44S9n[        R
                  " [        US9   [        XP5        SSS5        g! , (       d  f       g= f)z<Test that check_categorical_features raises expected errors.r   r   rW   r  r   N)rJ   rK   rN   rO   rP   rQ   rR   r-   )r  r  rng	n_samples
n_featuresry   s         rT   &test_check_categorical_features_raisesr  	  sZ    F ))


"C"IAq	67A	z	6#A< 
7	6	6s   A$$
A2on_arrayFTTF)
from_dtypeF)r   r   ru  c                    [         R                  R                  S5      nSu  pEUR                  SSXE4S9nUS:X  a  U(       d  gUS:X  a  UR	                  [
        5      n[        UU/ SQS	S
/S9n[        X`5      n[        U/ SQ5        g)zHTest that check_categorical_features returns as expected on simple data.r   )r  r   rW   r  r   Nru  r  r   r"  )r=  categorical_feature_namesr  )	rJ   rK   rN   rO   rf   r#  r   r-   r   )r  r  rl  r  r  r  ry   r  s           rT   test_check_categorical_featuresr  	  s     ))


"C!IAq	67A7"8	X	%HHSM	)#&*		A )AFF67r   c                  t    [         R                  " S5        SSKJn   [	        U " / SQ/5      5      nUS:X  d   eg )Nrt  r   )chunked_array)r_   rJ  g333333?rW   )rP   r   rt  r  r:   )r  r  s     rT   !test_num_samples_pa_chunked_arrayr  	  s1    
	"%-(9:;FQ;;r   )__doc__r  r  rU  	itertoolsr   operatorr   tempfiler   numpyrJ   rP   scipy.sparsers  rr   r  sklearn._configr   sklearn.baser   sklearn.datasetsr   sklearn.ensembler	   sklearn.exceptionsr
   r   sklearn.linear_modelr   (sklearn.metrics.tests.test_score_objectsr   sklearn.neighborsr   sklearn.random_projectionr   sklearn.svmr   sklearn.utilsr   r   r   r   r   r   sklearn.utils._array_apir   r   r   sklearn.utils._mockingr   r   sklearn.utils._testingr   r   r   r   r    r!   r"   r#   sklearn.utils.estimator_checksr$   sklearn.utils.fixesr%   r&   r'   r(   r)   r*   sklearn.utils.validationr+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rU   r   markparametrizerK   r   r   r   r   r   rv   r   r   
csr_matrixr   r   r   r   r   ro   r   r   filterwarningsr
  r  r*  re   rh   r7  r=  rH  rN  rR  r_  rd  rf  fixturery  r|  r~  r  r  r  r  r  r  r  r  r  rs  r  r  r  r  r  r  r  r  r  r  r  r(  r0  r   rR   r  rI  rs   
coo_matrix
lil_matrix
bsr_matrix
dok_matrix
dia_matrixru   r  r  r  r  	dia_arrayrK  rO  rk  rr  rz  r  r   r   r  Integralri   r   r  _psd_cases_validr&  keysr  _psd_cases_invalidr  r  r  r  r  r  r  r  	CS_SPARSEr  r  r  r  r  r  r  r  r
  r  ro  integerunsignedintegerr(  r,  r2  r4  rp  r9  r?  rA  rD  rF  rW  rZ  ra  rh  rk  rq  rv  r  r  r  r  r  r  r  r  r  r  r  r  r  rb  r   rT   <module>r     s   *  	    '     * & ' 2 F . F 2 ;   
	 	 	 7        >0$(%V "))

7
#%9'%%P	Q11F ,& ffe_rvv{+bffe_= BJJbmm#LM/ N	
/ 5	T45	d78	$(OP	k#>?	T/0	d23	d23FF?		
 
Q,-& BJJbmm#LM
 N'(
 'BCBJJbmm#LM%1 N D%1P
;  HHq"&&k]#!	

 HHq"&&k]#!	

 HHq"&&k]#C	
 
Arvv;-v	.0UV$ ,tUm<G =%&G) QRA
 SA
H 
sc3Z 
3*sCj)5
3*sCj)5
d|$
4,t-T:	(	(-D J 
**bjj	!2::.	RZZ 	BJJ//:%*"GJ5=()V9>/ 34 5,G
L<%~'T  0F'*!(H"BJ 
Z]D%(.I  22A( .-/	*"	E rzz2::&

D)D ':;8 <848&9 
	 	6 $/4 04 U &94%@A	
 &94%@A	
 ^R*=t)DE O	
 &94%@A 	
 &94%@A	
 &8$%?@	
M-\	a  8r+s8r+< 
















(
")(
"	; D M   G 	  n- .  P IJ	
 LLNO	
 LM	
 DMQR	
 67	
 67	
 67	
 67	
 !M	
 #	
 #	
Cmpb9cpb9& !Q($31a&)288QF+;T2F
!QV	 %bhh1v&68OQST
!U2::.
!Qrzz*K	" 	!VBJJ/
!Qrzz*K	" 	
!QH	- > .		 	 	"#""$%  
 *T5M:5 ;54 	9 	7 	4 	$bjj14  	$rzz24 + :  		"	"	$%$$&'  
(
('MT- .-/(	( QC!Q"a)\#RS; T; .-/ QC!Q"a)\#RS< T	
< Iuq"g#>?< @< .-/ Iuq"g#>?	= @	
	= \\2==",,F	 RXXJ$:;( <( RXXJ$:;, <, I.% /%60 TAq6N3 4: &HI1 J1",4 

2
2 &	<-	9bkk*	9bkk*	$	'2::&	"**%	$	

#	*bjj)	$	'2--.	8R//0	(B../	2--.	+r112(6)(6 D!	! 
qC8c1X& 	0  
 +-QR S
* 28WX Y 	%(^U1XtsCj3*%=>6  

 "F	/		/ 
q#$
:	 23 
K   &&"	=] 	= 0	$&RS	?$DE	?$DEGG,J HDD/:& 1aAq"&&*ACU)VW* X*$ ) ) $ )D%=9? :?* ^#n4~E *?@2 A	
2, rxx{BHHQK&@Aq6Aq6BR%ST U 0&,. ) ) 0 HH1v1v&!Q!Q(89:!#%	
 HH1v1v&!Q!Q(89:A	
 ,! ,
 ^, x II 	
 HHh_F3II%	
 GII&	
 -II 	
- B=C B= Z(	#T*
Q
sU	 +-JK8 L8(r   