o
    T=ºi†  ã                   @  sˆ   d dl mZ ddlmZ d dlmZ d dlZG dd„ deƒZG dd	„ d	eƒZ	G d
d„ deƒZ
ddd„Zddd„Zddd„Zddd„ZdS )é    )Úannotationsé   )ÚArray)Ú
NamedTupleNc                   @  s.   e Zd ZU ded< ded< ded< ded< dS )ÚUniqueAllResultr   ÚvaluesÚindicesÚinverse_indicesÚcountsN©Ú__name__Ú
__module__Ú__qualname__Ú__annotations__© r   r   údC:\Users\psant\Downloads\PAF backend\school\venv\Lib\site-packages\numpy/array_api/_set_functions.pyr      s
   
 r   c                   @  ó   e Zd ZU ded< ded< dS )ÚUniqueCountsResultr   r   r
   Nr   r   r   r   r   r      ó   
 r   c                   @  r   )ÚUniqueInverseResultr   r   r	   Nr   r   r   r   r   r   !   r   r   Úxr   Úreturnc                C  sN   t j| jdddd�\}}}}| | j¡}tt |¡t |¡t |¡t |¡ƒS )ú|
    Array API compatible wrapper for :py:func:`np.unique <numpy.unique>`.

    See its docstring for more information.
    T©Zreturn_countsZreturn_indexZreturn_inverseN)ÚnpÚuniqueÚ_arrayÚreshapeÚshaper   r   Ú_new)r   r   r   r	   r
   r   r   r   Ú
unique_all&   s   üür    c                C  s&   t j| jdddd�}tdd„ |D ƒŽ S )NTFr   c                 S  s   g | ]}t  |¡‘qS r   )r   r   )Ú.0Úir   r   r   Ú
<listcomp>E   s    z!unique_counts.<locals>.<listcomp>)r   r   r   r   ©r   Úresr   r   r   Úunique_counts=   s   ür&   c                C  s:   t j| jdddd�\}}| | j¡}tt |¡t |¡ƒS )r   FTr   N)r   r   r   r   r   r   r   r   )r   r   r	   r   r   r   Úunique_inverseH   s   
ür'   c                C  s   t j| jdddd�}t |¡S )r   Fr   N)r   r   r   r   r   r$   r   r   r   Úunique_valuesZ   s   ü
r(   )r   r   r   r   )r   r   r   r   )r   r   r   r   )r   r   r   r   )Ú
__future__r   Z_array_objectr   Útypingr   Znumpyr   r   r   r   r    r&   r'   r(   r   r   r   r   Ú<module>   s    


