
    e!h                     X    d dl Zd dlmZ d dlmZmZ d dlmZ d Z	d Z
d Zd Zd	 Zd
 Zy)    N)assert_array_equal)attach_uniquecached_unique)check_arrayc                      t        j                  g d      } t        |       }t        |j                  j
                  d   t        j                  g d             t        ||        y )N      r
         r      uniquer	   r
   r   r   r   )nparrayr   r   dtypemetadataarrarr_s     g/var/www/html/diagnosisapp-backend/venv/lib/python3.12/site-packages/sklearn/utils/tests/test_unique.py+test_attach_unique_attaches_unique_to_arrayr      sG    
(((
)CDtzz**84bhh6OPtS!    c                     t        j                  t         j                  dt        j                  ddg      i      } t        j                  g d|       }t	        t        |      t        j                  ddg             y )Nr   r	   r
   )r   r   )r   )r   r   float64r   r   r   )my_dtyper   s     r   (test_cached_unique_returns_cached_uniquer      sU    xx

h!Q8H-IJH
(((
9C}S)288QF+;<r   c                  .    g d} t        |       }|| u sJ y)z8Test that when not np.ndarray, we don't touch the array.r   N)r   r   s     r   test_attach_unique_not_ndarrayr      s    
CD3;;r   c                  h    t        j                  g d      } t        |       }|j                  | u sJ y)z4Test that attach_unique returns a view of the array.r   N)r   r   r   baser   s     r   test_attach_unique_returns_viewr"      s-    
(((
)CD99r   c                     t        j                  g d      } t        | d      }t        |t              sJ t        |      dk(  sJ t        |d   |        t        | d      }t        |t         j                        sJ t        ||        y)z+Test return_tuple argument of the function.r   T)return_tupler	   r   FN)r   r   r   
isinstancetuplelenr   ndarray)r   	arr_tuple
arr_singles      r   test_attach_unique_return_tupler+   #   sw    
(((
)Cc5Ii'''y>Qy|S)s7Jj"**---z3'r   c                      t        j                  g dg      } t        |       }t        |      }t	        |j
                  j                  d   t        j                  g d             t	        ||        y)z0Test that check_array keeps the unique metadata.r   r   r   N)r   r   r   r   r   r   r   r   s     r   test_check_array_keeps_uniquer-   0   sT    
(()*
+CDtDtzz**84bhh6OPtS!r   )numpyr   numpy.testingr   sklearn.utils._uniquer   r   sklearn.utils.validationr   r   r   r   r"   r+   r-    r   r   <module>r3      s/     , > 0"=
("r   