
    0Ph                        d dl Zd dlZd dlmZ d dlmZmZ ej        	                    de
dge
dgedgf          d             Zej        	                    di ej        fd	 ej        ej                  j        iej        fd	 ej        ej                  j        dz   iej        fg          d
             Zej        	                    dd ej        ddgej                  iej        fd ej        ddgej                   ej        ddgej                  fiej        fd ej        ddgej                   ej        ddgej                  fiej        fd ej        ddgej                  iej        f ej        ddgej                   ej        ej                  j        dz   dej        fg          d             Zej        	                    d ej        g ej                   ej        g ej                  fddej        f ej        dgej                  ddej        f ej         ej        ej                  j        dz   gej                  ddej        f ej        dgej                  d ej        ej                  j        dz   dej        f ej         ej        ej                  j        dz   gej                  dddej        fg          d             Zej        	                    dd	 ej        ej                  j        dz   iedfd ej        ddgej                  iedfdddgiedfg          d             ZdS )    N)assert_array_equal)_object_dtype_isnan _smallest_admissible_index_dtypez
dtype, val   ac                     t          j        |t           j        gt           j        |gg|           }t          j        ddgddgg          }t          |          }t	          ||           d S )NdtypeFT)nparraynanr   r   )r
   valXexpected_maskmasks        ^/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/sklearn/utils/tests/test_fixes.pytest_object_dtype_isnanr      sf    
3-"&#/u===AHudmdE];<<Mq!!Dt]+++++    zparams, expected_dtypemaxvalc                 *    t          di | |k    sJ dS )zlCheck the behaviour of `smallest_admissible_index_dtype` depending only on the
    `max_val` parameter.
    N r   paramsexpected_dtypes     r   ,test_smallest_admissible_index_dtype_max_valr      s)     ,55f55GGGGGGr   arrays   r	   )r   r   c                 *    t          di | |k    sJ dS )zCheck the behaviour of `smallest_admissible_index_dtype` using the passed
    arrays but without checking the contents of the arrays.
    Nr   r   r   s     r   >test_smallest_admissible_index_dtype_without_checking_contentsr    %   s*    \ ,55f55GGGGGGr   T)r   check_contents)r   r!   r   c                 *    t          di | |k    sJ dS )zyCheck the behaviour of `smallest_admissible_index_dtype` using the dtype of the
    arrays but as well the contents.
    Nr   r   r   s     r   9test_smallest_admissible_index_dtype_by_checking_contentsr#   V   s*    h ,55f55GGGGGGr   zparams, err_type, err_msgz)is to large to be represented as np.int64z$Array dtype float64 is not supportedz#Arrays should be of type np.ndarrayc                 |    t          j        ||          5  t          di |  ddd           dS # 1 swxY w Y   dS )z-Check that we raise the proper error message.)matchNr   )pytestraisesr   )r   err_typeerr_msgs      r   *test_smallest_admissible_index_dtype_errorr*      s    $ 
xw	/	/	/ 3 3(2262223 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3s   155)numpyr   r&   sklearn.utils._testingr   sklearn.utils.fixesr   r   markparametrizeobjectfloatr   int32iinfomaxint64r   r   int8r    uint32r#   
ValueErrorfloat64	TypeErrorr*   r   r   r   <module>r;      s        5 5 5 5 5 5 U U U U U U U U fc]UAJ'OPP, , QP, 	RX
HBHRX&&*	+RX6
HBHRX&&*Q.	/: H H H  HBHaV28444	5rx@
 BHaV28444BHaV28444 H	
 BHaV28444BHaV28444 H	
 HBHaV27333	4bh?
 #"(Aq6:::""(28,,014  H	
;$' 'PH HQ' 'PH 
 $28Bbh777"BH9U9U9UV"&  H	
  rx28444MMH	
 #"(HBHRX$6$6$:Q$>#?ryQQQ"&  H	
 #"(A3bh777"&""(28,,014 
 H	
 #"(HBHRX$6$6$:Q$>#?ryQQQ"& 
 H	
I,/ /`H Ha/ /`H  xrx))-127	
 xrxAbj999:2	

 QF	Y(MN  3 3!  3 3 3r   