
    (phB'                       S SK Jr  S SKJrJrJrJrJr  \(       a  SSKJ	r	J
r
JrJrJr  S SKJr  SSKJr  S SKrS rSSSS	.         S!S
 jjr  S"SSS.           S#S jjjrSSS.       S$S jjrSSS.       S%S jjr S&S SSS.           S'S jjjrS(S jrSSS.         S)S jjrSSS.         S*S jjrSSSS.             S+S jjrSS.S,S jjrSSS.       S$S jjrSSS.       S%S jjr S S.S-S jjr!S S.S-S jjr"SSS.       S$S jjr#SSS.       S%S  jjr$g).    )annotations)TYPE_CHECKINGListOptionalTupleUnion   )ArrayDeviceDtypeNestedSequenceSupportsBufferProtocol)Sequence)_all_dtypesNc                D    S[         -    H	  nXL d  M	    g    [        S5      e)NNz)dtype must be one of the supported dtypes)r   
ValueError)dtypeds     V/var/www/html/venv/lib/python3.13/site-packages/numpy/array_api/_creation_functions.py_check_valid_dtyper      s)    
 {": # @
AA    )r   devicecopyc              <   SSK Jn  [        U5        US;  a  [        SU< 35      eUS[        R
                  R                  4;   a  [        S5      e[        X5      (       ag  Ub  U R                  U:w  a  SnUS[        R
                  R                  4;   a0  UR                  " [        R                  " U R                  SUS95      $ U $ Uc,  [        U [        5      (       a  U S	:  d  U S
:  a  [        S5      e[        R                   " XS9nUR                  " U5      $ )zr
Array API compatible wrapper for :py:func:`np.asarray <numpy.asarray>`.

See its docstring for more information.
r	   r
   cpuNUnsupported device Fz!copy=False is not yet implementedT)r   r   l            l         z&Integer out of bounds for array dtypesr   )_array_objectr
   r   r   np	_CopyMode	IF_NEEDEDNotImplementedError
isinstancer   ALWAYS_newarray_arrayintOverflowErrorasarray)objr   r   r   r
   ress         r   r-   r-      s    , %u]".vj9::r||--..!"EFF#e!3DD",,--..::bhhszzEJKK
}C--3=C*DT DEE
**S
&C::c?r   )r   r   c         	         SSK Jn  [        U5        US;  a  [        SU< 35      eUR                  " [
        R                  " XX#S95      $ )zp
Array API compatible wrapper for :py:func:`np.arange <numpy.arange>`.

See its docstring for more information.
r	   r   r   r   )stopstepr   )r!   r
   r   r   r(   r"   arange)startr1   r2   r   r   r
   s         r   r3   r3   K   sD     %u]".vj9::::biitIJJr   c                   SSK Jn  [        U5        US;  a  [        SU< 35      eUR                  " [
        R                  " XS95      $ )zn
Array API compatible wrapper for :py:func:`np.empty <numpy.empty>`.

See its docstring for more information.
r	   r   r   r   r    )r!   r
   r   r   r(   r"   emptyshaper   r   r
   s       r   r6   r6   a   B     %u]".vj9::::bhhu233r   c                  SSK Jn  [        U5        US;  a  [        SU< 35      eUR                  " [
        R                  " U R                  US95      $ )zx
Array API compatible wrapper for :py:func:`np.empty_like <numpy.empty_like>`.

See its docstring for more information.
r	   r   r   r   r    )r!   r
   r   r   r(   r"   
empty_liker*   xr   r   r
   s       r   r;   r;   t   H     %u]".vj9::::bmmAHHE:;;r   )kr   r   c         	         SSK Jn  [        U5        US;  a  [        SU< 35      eUR                  " [
        R                  " XX#S95      $ )zj
Array API compatible wrapper for :py:func:`np.eye <numpy.eye>`.

See its docstring for more information.
r	   r   r   r   )Mr?   r   )r!   r
   r   r   r(   r"   eye)n_rowsn_colsr?   r   r   r
   s         r   rB   rB      sD     %u]".vj9::::bffV@AAr   c               Z    SSK Jn  UR                  " [        R                  " U 5      5      $ )Nr	   r   )r!   r
   r(   r"   from_dlpack)r=   r
   s     r   rF   rF      s    $::bnnQ'((r   c               2   SSK Jn  [        U5        US;  a  [        SU< 35      e[	        X5      (       a  UR
                  S:X  a  UR                  n[        R                  " XUS9nUR                  [        ;  a  [        S5      eUR                  " U5      $ )zl
Array API compatible wrapper for :py:func:`np.full <numpy.full>`.

See its docstring for more information.
r	   r   r   r   r   r    zInvalid input to full)r!   r
   r   r   r&   ndimr*   r"   fullr   r   	TypeErrorr(   )r8   
fill_valuer   r   r
   r/   s         r   rI   rI      s     %u]".vj9::*$$A)=&&

''%5
1C
yy# /00::c?r   c                  SSK Jn  [        U5        US;  a  [        SU< 35      e[        R
                  " U R                  XS9nUR                  [        ;  a  [        S5      eUR                  " U5      $ )zv
Array API compatible wrapper for :py:func:`np.full_like <numpy.full_like>`.

See its docstring for more information.
r	   r   r   r   r    zInvalid input to full_like)r!   r
   r   r   r"   	full_liker*   r   r   rJ   r(   )r=   rK   r   r   r
   r/   s         r   rM   rM      sf     %u]".vj9::
,,qxx
9C
yy# 455::c?r   T)r   r   endpointc         
         SSK Jn  [        U5        US;  a  [        SU< 35      eUR                  " [
        R                  " XX#US95      $ )zt
Array API compatible wrapper for :py:func:`np.linspace <numpy.linspace>`.

See its docstring for more information.
r	   r   r   r   )r   rN   )r!   r
   r   r   r(   r"   linspace)r4   r1   numr   r   rN   r
   s          r   rP   rP      sF     %u]".vj9::::bkk%s(STTr   xy)indexingc                6   SSK Jn  [        U Vs1 s H  o3R                  iM     sn5      S:  a  [	        S5      e[
        R                  " U Vs/ s H  o3R                  PM     snSU 06 Vs/ s H  nUR                  " U5      PM     sn$ s  snf s  snf s  snf )zt
Array API compatible wrapper for :py:func:`np.meshgrid <numpy.meshgrid>`.

See its docstring for more information.
r	   r   z,meshgrid inputs must all have the same dtyperS   )	r!   r
   lenr   r   r"   meshgridr*   r(   )rS   arraysr
   ar)   s        r   rV   rV      s     %
 V$VGGV$%)GHH [[V"<V88V"<PxPPE 	

5P  %
 #=s   BB-Bc                   SSK Jn  [        U5        US;  a  [        SU< 35      eUR                  " [
        R                  " XS95      $ )zl
Array API compatible wrapper for :py:func:`np.ones <numpy.ones>`.

See its docstring for more information.
r	   r   r   r   r    )r!   r
   r   r   r(   r"   onesr7   s       r   rZ   rZ      sB     %u]".vj9::::bgge122r   c                  SSK Jn  [        U5        US;  a  [        SU< 35      eUR                  " [
        R                  " U R                  US95      $ )zv
Array API compatible wrapper for :py:func:`np.ones_like <numpy.ones_like>`.

See its docstring for more information.
r	   r   r   r   r    )r!   r
   r   r   r(   r"   	ones_liker*   r<   s       r   r\   r\     sH     %u]".vj9::::bll18859::r   r?   c                  SSK Jn  U R                  S:  a  [        S5      eUR                  " [
        R                  " U R                  US95      $ )zl
Array API compatible wrapper for :py:func:`np.tril <numpy.tril>`.

See its docstring for more information.
r	   r      z)x must be at least 2-dimensional for trilr]   )r!   r
   rH   r   r(   r"   trilr*   r=   r?   r
   s      r   r`   r`   #  <     %vvzDEE::bggahh!,--r   c                  SSK Jn  U R                  S:  a  [        S5      eUR                  " [
        R                  " U R                  US95      $ )zl
Array API compatible wrapper for :py:func:`np.triu <numpy.triu>`.

See its docstring for more information.
r	   r   r_   z)x must be at least 2-dimensional for triur]   )r!   r
   rH   r   r(   r"   triur*   ra   s      r   rd   rd   1  rb   r   c                   SSK Jn  [        U5        US;  a  [        SU< 35      eUR                  " [
        R                  " XS95      $ )zn
Array API compatible wrapper for :py:func:`np.zeros <numpy.zeros>`.

See its docstring for more information.
r	   r   r   r   r    )r!   r
   r   r   r(   r"   zerosr7   s       r   rf   rf   ?  r9   r   c                  SSK Jn  [        U5        US;  a  [        SU< 35      eUR                  " [
        R                  " U R                  US95      $ )zx
Array API compatible wrapper for :py:func:`np.zeros_like <numpy.zeros_like>`.

See its docstring for more information.
r	   r   r   r   r    )r!   r
   r   r   r(   r"   
zeros_liker*   r<   s       r   rh   rh   R  r>   r   )
r.   zZUnion[Array, bool, int, float, NestedSequence[bool | int | float], SupportsBufferProtocol]r   Optional[Dtype]r   Optional[Device]r   z#Optional[Union[bool, np._CopyMode]]returnr
   )Nr	   )r1   zOptional[Union[int, float]]r2   Union[int, float]r4   rl   r   ri   r   rj   rk   r
   )r8   Union[int, Tuple[int, ...]]r   ri   r   rj   rk   r
   )r=   r
   r   ri   r   rj   rk   r
   r   )rC   r+   rD   zOptional[int]r?   r+   r   ri   r   rj   rk   r
   )r=   objectrk   r
   )
r8   rm   rK   rl   r   ri   r   rj   rk   r
   )
rK   rl   r=   r
   r   ri   r   rj   rk   r
   )rQ   r+   r4   rl   r1   rl   r   ri   r   rj   rN   boolrk   r
   )rW   r
   rS   strrk   zList[Array])r=   r
   r?   r+   rk   r
   )%
__future__r   typingr   r   r   r   r   _typingr
   r   r   r   r   collections.abcr   _dtypesr   numpyr"   r   r-   r3   r6   r;   rB   rF   rI   rM   rP   rV   rZ   r\   r`   rd   rf   rh    r   r   <module>rx      s;   " ? >  )   B, "#04)
) ) ) .) )^ )-	K "#K &K 	KK K K K2 "#	4&4 4 	4
 4( .2d<<*<;K<
<$ !B
 !#BBB
 B B B B,) "#&! 	
  @ "# "
   @ "#U 
	UU
U U U U U. .2 . "#	3&3 3 	3
 3( .2d;;*;;K;
;  #$ . #$ ." "#	4&4 4 	4
 4( .2d<<*<;K<
<r   