
    -i                     X    S SK rS SKJr  S SKJrJr  S SKJr  S r	S r
S rS rS	 rS
 rg)    N)assert_array_equal)attach_uniquecached_unique)check_arrayc                      [         R                  " / SQ5      n [        U 5      n[        UR                  R
                  S   [         R                  " / SQ5      5        [        X5        g )N      r
         r      uniquer	   r
   r   r   r   )nparrayr   r   dtypemetadataarrarr_s     R/var/www/html/venv/lib/python3.13/site-packages/sklearn/utils/tests/test_unique.py+test_attach_unique_attaches_unique_to_arrayr      sE    
(((
)CDtzz**84bhh6OPt!    c                      [         R                  " [         R                  S[         R                  " SS/5      0S9n [         R                  " / SQU S9n[	        [        U5      [         R                  " SS/5      5        g )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                  .    / SQn [        U 5      nXL d   eg)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;;r   c                  l    [         R                  " / SQ5      n [        U 5      nUR                  U L d   eg)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                  "   [         R                  " / SQ5      n [        U SS9n[        U[        5      (       d   e[        U5      S:X  d   e[        US   U 5        [        U SS9n[        U[         R                  5      (       d   e[        X 5        g)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+   #   s{    
(((
)Cc5Ii''''y>Qy|S)s7Jj"**----z'r   c                      [         R                  " / SQ/5      n [        U 5      n[        U5      n[	        UR
                  R                  S   [         R                  " / SQ5      5        [	        X5        g)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   sR    
(()*
+CDtDtzz**84bhh6OPt!r   )numpyr   numpy.testingr   sklearn.utils._uniquer   r   sklearn.utils.validationr   r   r   r   r"   r+   r-    r   r   <module>r3      s/     , > 0"=
("r   