ó
    Ñ]jœ  ã                   óD   • S SK rS SKJr  S rSS.S jrS
S jrSS.S	 jrg)é    N)Úget_namespacec                 ó8  • [        U [        R                  5      (       d  U $  SU R                  R                  ;   a  U $  [        R                  " U 5      n[        R                  " U R                  SU0S9nU R                  US9$ ! [
        [        4 a     NXf = f)z‚Attach unique values of y to y and return the result.

The result is a view of y, and the metadata (unique) is not attached to y.
Úunique)Úmetadata)Údtype)	Ú
isinstanceÚnpÚndarrayr   r   ÚAttributeErrorÚ	TypeErrorr   Úview)Úyr   Úunique_dtypes      ÚR/home/mande/repo/quber/.venv/lib/python3.13/site-packages/sklearn/utils/_unique.pyÚ_attach_uniquer   	   s�   € ô
 �aœŸ™×$Ñ$Øˆðà�q—w‘w×'Ñ'Ó'ØˆHð (ô
 �YŠY�q‹\€FÜ—8’8˜AŸG™G¨x¸Ð.@ÑA€LØ�6‰6˜ˆ6Ð%Ð%øô œIÐ&ó Ùðús   £B ÂBÂBF)Úreturn_tuplec                 ó`   • [        S U 5       5      n[        U5      S:X  a  U (       d  US   $ U$ )aŸ  Attach unique values of ys to ys and return the results.

The result is a view of y, and the metadata (unique) is not attached to y.

IMPORTANT: The output of this function should NEVER be returned in functions.
This is to avoid this pattern:

.. code:: python

    y = np.array([1, 2, 3])
    y = attach_unique(y)
    y[1] = -1
    # now np.unique(y) will be different from cached_unique(y)

Parameters
----------
*ys : sequence of array-like
    Input data arrays.

return_tuple : bool, default=False
    If True, always return a tuple even if there is only one array.

Returns
-------
ys : tuple of array-like or array-like
    Input data with unique values attached.
c              3   ó8   #   • U  H  n[        U5      v •  M     g 7f©N)r   )Ú.0r   s     r   Ú	<genexpr>Ú attach_unique.<locals>.<genexpr>8   s   é € Ð.ª2 a”˜q×!Ð!ª2ùs   ‚é   r   ©ÚtupleÚlen)r   ÚysÚress      r   Úattach_uniquer      s/   € ô8 Ñ.©2Ó.Ó
.€CÜ
ˆ3ƒx�1ƒ}ž\Ø�1‰vˆØ€Jó    c                 óð   •  U R                   R                  b3  SU R                   R                  ;   a  U R                   R                  S   $ [        XS9u  pUR	                  U 5      $ ! [         a     N(f = f)z×Return the unique values of y.

Use the cached values from dtype.metadata if present.

This function does NOT cache the values in y, i.e. it doesn't change y.

Call `attach_unique` to attach the unique values to y.
r   ©Úxp)r   r   r   r   Úunique_values)r   r#   Ú_s      r   Ú_cached_uniquer&   >   sp   € ðØ�7‰7×ÑÑ'¨H¸¿¹×8HÑ8HÓ,HØ—7‘7×#Ñ# HÑ-Ð-ô ˜!Ñ#�E€BØ×Ñ˜AÓÐøô	 ó áðús   ‚A	A( Á(
A5Á4A5r"   c                 óZ   ^ • [        U 4S jU 5       5      n[        U5      S:X  a  US   $ U$ )a@  Return the unique values of ys.

Use the cached values from dtype.metadata if present.

This function does NOT cache the values in y, i.e. it doesn't change y.

Call `attach_unique` to attach the unique values to y.

Parameters
----------
*ys : sequence of array-like
    Input data arrays.

xp : module, default=None
    Precomputed array namespace module. When passed, typically from a caller
    that has already performed inspection of its own inputs, skips array
    namespace inspection.

Returns
-------
res : tuple of array-like or array-like
    Unique values of ys.
c              3   ó8   >#   • U  H  n[        UTS 9v •  M     g7f)r"   N)r&   )r   r   r#   s     €r   r   Ú cached_unique.<locals>.<genexpr>i   s   øé € Ð5²"¨Q”˜q RÖ(²"ùs   ƒr   r   r   )r#   r   r   s   `  r   Úcached_uniquer*   Q   s.   ø€ ô0 Ô5±"Ó5Ó
5€CÜ
ˆ3ƒx�1ƒ}Ø�1‰vˆØ€Jr    r   )Únumpyr	   Úsklearn.utils._array_apir   r   r   r&   r*   © r    r   Ú<module>r.      s,   ðó å 2ò&ð& %*õ ôDð& ö r    