o
    Ô­jõ  ã                   @  s¶   d dl mZ ddlmZ ddlmZ d dlmZmZm	Z	m
Z
 d dlZd dœd)dd„Zd*dd„Zddœd+dd„Zd,dd„Zddœd-dd „Zddœd.d#d$„Zd/d%d&„Zd dœd0d'd(„ZdS )1é    )Úannotationsé   )ÚArray)Úresult_type)ÚListÚOptionalÚTupleÚUnionN©ÚaxisÚarraysú%Union[Tuple[Array, ...], List[Array]]r   úOptional[int]Úreturnr   c               C  s0   t | Ž }tdd„ | D ƒƒ} t tj| ||d�¡S )z†
    Array API compatible wrapper for :py:func:`np.concatenate <numpy.concatenate>`.

    See its docstring for more information.
    c                 s  ó   � | ]}|j V  qd S ©N©Ú_array©Ú.0Úa© r   úd/var/www/html/CropPilot/venv/lib/python3.10/site-packages/numpy/array_api/_manipulation_functions.pyÚ	<genexpr>   ó   € zconcat.<locals>.<genexpr>)r   Údtype)r   Útupler   Ú_newÚnpÚconcatenate)r   r   r   r   r   r   Úconcat   s   
r    ÚxÚintc               C  ó   t  t | j|¡¡S )z†
    Array API compatible wrapper for :py:func:`np.expand_dims <numpy.expand_dims>`.

    See its docstring for more information.
    )r   r   r   Úexpand_dimsr   ©r!   r   r   r   r   r$      ó   r$   ú%Optional[Union[int, Tuple[int, ...]]]c               C  ó   t  tj| j|d�¡S )zx
    Array API compatible wrapper for :py:func:`np.flip <numpy.flip>`.

    See its docstring for more information.
    r
   )r   r   r   Úflipr   r%   r   r   r   r)   #   ó   r)   ÚaxesúTuple[int, ...]c                C  r#   )z‚
    Array API compatible wrapper for :py:func:`np.transpose <numpy.transpose>`.

    See its docstring for more information.
    )r   r   r   Ú	transposer   )r!   r+   r   r   r   Úpermute_dims.   r&   r.   )ÚcopyÚshaper/   úOptional[Bool]c               C  sF   | j }|r
t |¡}t ||¡}|du rt ||¡stdƒ‚t |¡S )z~
    Array API compatible wrapper for :py:func:`np.reshape <numpy.reshape>`.

    See its docstring for more information.
    Fz-Incompatible shape for in-place modification.)r   r   r/   ÚreshapeÚshares_memoryÚAttributeErrorr   r   )r!   r0   r/   ÚdataÚreshapedr   r   r   r2   8   s   

r2   ÚshiftúUnion[int, Tuple[int, ...]]c               C  s   t  tj| j||d�¡S )zx
    Array API compatible wrapper for :py:func:`np.roll <numpy.roll>`.

    See its docstring for more information.
    r
   )r   r   r   Úrollr   )r!   r7   r   r   r   r   r9   O   s   r9   c                C  r(   )z~
    Array API compatible wrapper for :py:func:`np.squeeze <numpy.squeeze>`.

    See its docstring for more information.
    r
   )r   r   r   Úsqueezer   r%   r   r   r   r:   ^   r*   r:   c               C  s.   t | Ž  tdd„ | D ƒƒ} t tj| |d�¡S )zz
    Array API compatible wrapper for :py:func:`np.stack <numpy.stack>`.

    See its docstring for more information.
    c                 s  r   r   r   r   r   r   r   r   o   r   zstack.<locals>.<genexpr>r
   )r   r   r   r   r   Ústack)r   r   r   r   r   r;   g   s   r;   )r   r   r   r   r   r   )r!   r   r   r"   r   r   )r!   r   r   r'   r   r   )r+   r,   r!   r   r   r   )r0   r,   r!   r   r/   r1   r   r   )r7   r8   r!   r   r   r'   r   r   )r   r8   r!   r   r   r   )r   r   r   r"   r   r   )Ú
__future__r   Ú_array_objectr   Ú_data_type_functionsr   Útypingr   r   r   r	   Únumpyr   r    r$   r)   r.   r2   r9   r:   r;   r   r   r   r   Ú<module>   s     ÿ
	
üû
	