o
    1ήc                     @  sL   d dl mZ ddlmZ d dlZdddddddZdddddddZdS )    )annotations   )ArrayNFT)axis
descendingstablexr   r   intr   boolr   returnc               C  s   |rdnd}|st j| j||d}n)t jt jt j| j|d||d|d}|dkr+|n| j| }| j| d }|| }t|S )z~
    Array API compatible wrapper for :py:func:`np.argsort <numpy.argsort>`.

    See its docstring for more information.
    r   	quicksortr   kindr   r   r   )npargsort_arrayflipndimshaper   _new)r	   r   r   r   r   resnormalised_axismax_i r   I/tmp/pip-target-vg8gfxp4/lib/python/numpy/array_api/_sorting_functions.pyr   	   s   	
r   c               C  s:   |rdnd}t j| j||d}|rt j||d}t|S )zx
    Array API compatible wrapper for :py:func:`np.sort <numpy.sort>`.

    See its docstring for more information.
    r   r   r   r   )r   sortr   r   r   r   )r	   r   r   r   r   r   r   r   r   r   $   s
   	
r   )
r	   r   r   r
   r   r   r   r   r   r   )
__future__r   _array_objectr   numpyr   r   r   r   r   r   r   <module>   s    