
    iY                         S SK rS SKrS SKJrJr  S SKJrJr  S SKJ	r	  S SK
JrJr  S SK
Jr  S SK
Jr  SS	0rS
S	0rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS r  " S S\\5      r!\"S:X  a  \RF                  " 5         gg)    N)jitnjit)errorstypes)typeof)TestCaseMemoryLeakMixin)no_pyobj_flags)force_pyobj_flagsforceobjTnopythonc                     U u  pnXU4$ N )labcs       [/var/www/html/trading/venv/lib/python3.13/site-packages/numba/tests/test_unpack_sequence.pyunpack_listr      s    GA!!9    c                 .    U R                   u  pnX-   U-   $ r   shape)r   xyzs       r   unpack_shaper      s    ggGA!519r   c                  ,    [        S5      u  pnX-   U-   $ )N   ranger   r   r   s      r   unpack_ranger$          AhGA!519r   c                  ,    [        S5      u  pnX-   U-   $ )N   r!   r#   s      r   unpack_range_too_smallr(      r%   r   c                  ,    [        S5      u  pnX-   U-   $ )N   r!   r#   s      r   unpack_range_too_larger+   #   r%   r   c                      Su  pnX-   U-   $ )N   r'   r    r   r#   s      r   unpack_tupler/   (       GA!519r   c                      Su  pnX-   U-   $ )N)r.   r'   r   r#   s      r   unpack_tuple_too_smallr2   -   s    GA!519r   c                      Su  pnX-   U-   $ )N)r.   r'   r    r*   r   r#   s      r   unpack_tuple_too_larger4   2       GA!519r   c                      Su  pnX-   U-   $ )N)r.   y              @r   r#   s      r   $unpack_heterogeneous_tuple_too_smallr7   7   r0   r   c                      Su  pnX-   U-   $ )N)r.         @              @r*   r   r#   s      r   $unpack_heterogeneous_tuple_too_larger;   <   s    GA!519r   c                      Su  pnX-   U-   $ )N)r.   r9   r:   r   r#   s      r   unpack_heterogeneous_tupler=   A   r5   r   c                      Su  n u  pX-   U-   $ )N)r.   )r9   r:   r   r#   s      r   !unpack_nested_heterogeneous_tupler?   F   s    IAv519r   c                     U u  pX!4$ r   r   )seqr   r   s      r   unpack_arbitraryrB   K   s    DA4Kr   c                  n    [         R                  " S5      n [         R                  " S5      nX4nUu  p4X44$ )Nr.   r'   npzeros)r   r   tupalphabetas        r   
unpack_nrtrJ   P   s2    
A
A
$CKE;r   c                 ,    X4=nu  p4Uu  pVXV-   U-   U-   $ r   r   )r   r   r   r   r   des          r   chained_unpack_assign1rN   X   s'    AFQ519q=r   c                     U S:  a  XpX4$ )Nr   r   )r   r   s     r   conditional_swaprP   _   s    1u14Kr   c                       \ rS rSrS rS rS rS rS rS r	S r
S	 rS
 rS rS rS rS r\4S jrS r\\4S jrS rS rS rS rS rS rS rS r\4S jrS rS r S r!S r"S r#S r$g!)"
TestUnpackf   c                 R    [        U5      nU R                  U" 5       U" 5       5        g r   )r   assertPreciseEqualselfpyfunccfuncs      r   check_nullary_npmTestUnpack.check_nullary_npmh   s    V2r   c                 Z    [        SS9" U5      nU R                  U" 5       U" 5       5        g )NTr   )r   rU   rV   s      r   check_nullary_objmode TestUnpack.check_nullary_objmodel   s%    T"6*2r   c                 r    [         n[        SS9" U5      n/ SQnU R                  U" U5      U" U5      5        g )NTr]   r-   )r   r   assertEqual)rW   rX   rY   r   s       r   test_unpack_listTestUnpack.test_unpack_listp   s3    T"6*q6!9-r   c                    [         n[        [        R                  " [        R                  SSS94SS9" U5      n[
        R                  " SS9R                  [
        R                  5      nU R                  U" U5      U" U5      5        g )Nr    CdtypendimlayoutTr]   r-   r   )	r   r   r   Arrayint32rE   rF   astyperU   rW   rX   rY   r   s       r   test_unpack_shapeTestUnpack.test_unpack_shapev   sg    U[[u{{3GI!##)+HH9%,,RXX6a&)4r   c                    [         n[        [        R                  " [        R                  SSS945      " U5      n[
        R                  " SS9R                  [
        R                  5      nU R                  U" U5      U" U5      5        g )Nr    re   rf   r-   r   )	r   r   r   rj   rk   rE   rF   rl   rU   rm   s       r   test_unpack_shape_npm TestUnpack.test_unpack_shape_npm}   sd    ekk!CHJ HH9%,,RXX6a&)4r   c                 .    U R                  [        5        g r   )r^   r$   rW   s    r   test_unpack_rangeTestUnpack.test_unpack_range       ""<0r   c                 .    U R                  [        5        g r   )rZ   r$   rt   s    r   test_unpack_range_npm TestUnpack.test_unpack_range_npm       |,r   c                 .    U R                  [        5        g r   )r^   r/   rt   s    r   test_unpack_tupleTestUnpack.test_unpack_tuple   rw   r   c                 .    U R                  [        5        g r   )rZ   r/   rt   s    r   test_unpack_tuple_npm TestUnpack.test_unpack_tuple_npm   r{   r   c                 .    U R                  [        5        g r   )r^   r=   rt   s    r   test_unpack_heterogeneous_tuple*TestUnpack.test_unpack_heterogeneous_tuple   s    ""#=>r   c                 .    U R                  [        5        g r   )rZ   r=   rt   s    r   #test_unpack_heterogeneous_tuple_npm.TestUnpack.test_unpack_heterogeneous_tuple_npm   s    9:r   c                 .    U R                  [        5        g r   )r^   r?   rt   s    r   &test_unpack_nested_heterogeneous_tuple1TestUnpack.test_unpack_nested_heterogeneous_tuple   s    ""#DEr   c                 .    U R                  [        5        g r   )rZ   r?   rt   s    r   *test_unpack_nested_heterogeneous_tuple_npm5TestUnpack.test_unpack_nested_heterogeneous_tuple_npm   s    @Ar   c                     [         n[        [        R                  [        R                  440 UD6" U5      nSnU R	                  U" U6 U" U6 5        g )N)r*      )rN   r   r   rk   rU   )rW   flagsrX   rY   argss        r   test_chained_unpack_assign%TestUnpack.test_chained_unpack_assign   sE    'U[[%++.8%8@tfdm<r   c                 *    U R                  [        S9  g )N)r   )r   r
   rt   s    r   test_chained_unpack_assign_npm)TestUnpack.test_chained_unpack_assign_npm   s    ''n'=r   c                     U R                  U5         [        S0 UD6" U5      nU" 5         S S S 5        g ! , (       d  f       g = f)N)r   )assertRaisesr   )rW   rX   r   excrY   s        r   check_unpack_errorTestUnpack.check_unpack_error   s3    s#$e$V,EG $##s	   4
Ac                 X    U R                  [        5        U R                  [        5        g r   )r   r2   r7   rt   s    r   test_unpack_tuple_too_small&TestUnpack.test_unpack_tuple_too_small         67 DEr   c                     U R                  [        [        [        R                  5        U R                  [
        [        [        R                  5        g r   )r   r2   r
   r   TypingErrorr7   rt   s    r   test_unpack_tuple_too_small_npm*TestUnpack.test_unpack_tuple_too_small_npm   ;     6 & 2 2	4 D .0B0B	Dr   c                 X    U R                  [        5        U R                  [        5        g r   )r   r4   r;   rt   s    r   test_unpack_tuple_too_large&TestUnpack.test_unpack_tuple_too_large   r   r   c                     U R                  [        [        [        R                  5        U R                  [
        [        [        R                  5        g r   )r   r4   r
   r   r   r;   rt   s    r   test_unpack_tuple_too_large_npm*TestUnpack.test_unpack_tuple_too_large_npm   r   r   c                 .    U R                  [        5        g r   )r   r(   rt   s    r   test_unpack_range_too_small&TestUnpack.test_unpack_range_too_small        67r   c                 8    U R                  [        [        5        g r   )r   r(   r
   rt   s    r   test_unpack_range_too_small_npm*TestUnpack.test_unpack_range_too_small_npm        6Gr   c                 .    U R                  [        5        g r   )r   r+   rt   s    r   test_unpack_range_too_large&TestUnpack.test_unpack_range_too_large   r   r   c                 8    U R                  [        [        5        g r   )r   r+   r
   rt   s    r   test_unpack_range_too_large_npm*TestUnpack.test_unpack_range_too_large_npm   r   r   c                     [        [        R                  [        R                  440 UD6" [        5      nU R	                  U" SS5      S5        U R	                  U" SS5      S5        g )Nr*   r   )r   r*   r   )r   r   )r   r   rk   rP   rU   )rW   r   rY   s      r   check_conditional_swap!TestUnpack.check_conditional_swap   sP    U[[%++.8%89IJaV4aV4r   c                 $    U R                  5         g r   )r   rt   s    r   test_conditional_swap TestUnpack.test_conditional_swap   s    ##%r   c                 .    U R                  [        5        g r   )r   r
   rt   s    r   test_conditional_swap_npm$TestUnpack.test_conditional_swap_npm   s    ##N3r   c                     [        S [        S5       5       5      n[        U5      n[        n[	        U45      " U5      nU R                  U" U5      U" U5      5        g )Nc              3   T   #    U  H  n[         R                  " US -   5      v   M      g7f)r.   NrD   ).0is     r   	<genexpr>9TestUnpack.test_unpack_tuple_of_arrays.<locals>.<genexpr>   s     6XBHHQUOOXs   &(r'   )tupler"   r   rB   r   rU   )rW   rG   tuptyrX   rY   s        r   test_unpack_tuple_of_arrays&TestUnpack.test_unpack_tuple_of_arrays   sL    6U1X66s!eXv&c
F3K8r   c                 j    [         n[        S5      " U5      nU R                  U" 5       U" 5       5        g )Nr   )rJ   r   rU   rV   s      r   test_unpack_nrtTestUnpack.test_unpack_nrt   s)    R	&!2r   c                    [         nU R                  [        R                  5       n[	        [
        R                  45      " U5        S S S 5        U R                  S[        WR                  5      5        g ! , (       d  f       N4= f)Nzfailed to unpack int32)
rB   r   r   r   r   r   rk   assertInstr	exception)rW   rX   raisess      r   test_invalid_unpackTestUnpack.test_invalid_unpack   sX    !v112f%++ ( 3.F4D4D0EF 32s   !A55
Br   N)%__name__
__module____qualname____firstlineno__rZ   r^   rb   rn   rq   ru   ry   r}   r   r   r   r   r   r   r   r   
ValueErrorr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   __static_attributes__r   r   r   rR   rR   f   s    33.551-1-?;FB 0A => 0A)FDFD8H8H ,= 5
&493
Gr   rR   __main__)$numpyrE   unittestnumbar   r   
numba.corer   r   r   numba.tests.supportr   r	   r
   nullary_no_pyobj_flagsr   nullary_force_pyobj_flagsr   r   r$   r(   r+   r/   r2   r4   r7   r;   r=   r?   rB   rJ   rN   rP   rR   r   mainr   r   r   <module>r      s       $  9 H N& d#












@G( @GF zMMO r   