U
    #cs                  
   @   s>  d dl Z d dlZd dlmZmZmZmZmZm	Z	m
Z
mZmZmZmZ d dlmZmZmZmZ d dlmZmZmZmZmZmZmZ G dd dZG dd dZG d	d
 d
ZG dd dZG dd dZ G dd dZ!dd Z"e j#$dd ge j#$ddddddge j#$ddddddgd d! Z%G d"d# d#Z&d$d% Z'dS )&    N)arrayarange
atleast_1d
atleast_2d
atleast_3dblockvstackhstacknewaxisconcatenatestack)_block_dispatcher_block_setup_block_concatenate_block_slicing)assert_assert_raisesassert_array_equalassert_equalassert_raises_regexassert_warnsIS_PYPYc                   @   s4   e Zd Zdd Zdd Zdd Zdd Zd	d
 ZdS )TestAtleast1dc                 C   sB   t d}t d}t|t|g}t dgt dgg}t|| d S N      r   r   r   selfabresdesired r#   D/tmp/pip-unpacked-wheel-b2rbor69/numpy/core/tests/test_shape_base.pytest_0D_array   s
    zTestAtleast1d.test_0D_arrayc                 C   sN   t ddg}t ddg}t|t|g}t ddgt ddgg}t|| d S Nr   r      r   r   r#   r#   r$   test_1D_array   s
    zTestAtleast1d.test_1D_arrayc                 C   sN   t ddgddgg}t ddgddgg}t|t|g}||g}t|| d S r&   r   r   r#   r#   r$   test_2D_array   s
    zTestAtleast1d.test_2D_arrayc                 C   sf   t ddgddgg}t ddgddgg}t ||g}t ||g}t|t|g}||g}t|| d S r&   r   r   r#   r#   r$   test_3D_array%   s    zTestAtleast1d.test_3D_arrayc                 C   sX   t tdjdk t tdjdk t tdjdk t tddgddggjdk d	S )
zB Test to make sure equivalent Travis O's r1array function
        r'   r                 @      @r         r   r   N)r   r   shaper   r#   r#   r$   test_r1array.   s    zTestAtleast1d.test_r1arrayN)__name__
__module____qualname__r%   r(   r)   r*   r3   r#   r#   r#   r$   r      s
   	r   c                   @   s4   e Zd Zdd Zdd Zdd Zdd Zd	d
 ZdS )TestAtleast2dc                 C   sF   t d}t d}t|t|g}t dggt dggg}t|| d S r   r   r   r   r   r#   r#   r$   r%   8   s
    zTestAtleast2d.test_0D_arrayc                 C   sR   t ddg}t ddg}t|t|g}t ddggt ddggg}t|| d S r&   r8   r   r#   r#   r$   r(   ?   s
    zTestAtleast2d.test_1D_arrayc                 C   sN   t ddgddgg}t ddgddgg}t|t|g}||g}t|| d S r&   r8   r   r#   r#   r$   r)   F   s
    zTestAtleast2d.test_2D_arrayc                 C   sf   t ddgddgg}t ddgddgg}t ||g}t ||g}t|t|g}||g}t|| d S r&   r8   r   r#   r#   r$   r*   M   s    zTestAtleast2d.test_3D_arrayc                 C   sZ   t tdjdk t tddgjdk t tddgddggddgddgggjd	k d
S )zB Test to make sure equivalent Travis O's r2array function
        r'   r   r   r,   r   r   r   r.   r/   r   r   r   r   N)r   r   r1   r2   r#   r#   r$   test_r2arrayV   s    zTestAtleast2d.test_r2arrayN)r4   r5   r6   r%   r(   r)   r*   r<   r#   r#   r#   r$   r7   7   s
   	r7   c                   @   s,   e Zd Zdd Zdd Zdd Zdd Zd	S )
TestAtleast3dc                 C   sJ   t d}t d}t|t|g}t dgggt dgggg}t|| d S r   r   r   r   r   r#   r#   r$   r%   _   s
    zTestAtleast3d.test_0D_arrayc                 C   sZ   t ddg}t ddg}t|t|g}t dgdgggt dgdgggg}t|| d S r&   r>   r   r#   r#   r$   r(   f   s
    $zTestAtleast3d.test_1D_arrayc                 C   sr   t ddgddgg}t ddgddgg}t|t|g}|d d d d tf |d d d d tf g}t|| d S r&   )r   r   r
   r   r   r#   r#   r$   r)   m   s
    ,zTestAtleast3d.test_2D_arrayc                 C   sf   t ddgddgg}t ddgddgg}t ||g}t ||g}t|t|g}||g}t|| d S r&   r>   r   r#   r#   r$   r*   t   s    zTestAtleast3d.test_3D_arrayN)r4   r5   r6   r%   r(   r)   r*   r#   r#   r#   r$   r=   ^   s   r=   c                   @   sL   e Zd Zdd Zdd Zdd Zdd Zd	d
 Zdd Zdd Z	dd Z
dS )
TestHstackc                 C   s   t ttd d S Nr   )r   	TypeErrorr	   r2   r#   r#   r$   test_non_iterable   s    zTestHstack.test_non_iterablec                 C   s   t ttd d S Nr#   )r   
ValueErrorr	   r2   r#   r#   r$   test_empty_input   s    zTestHstack.test_empty_inputc                 C   s6   t d}t d}t||g}t ddg}t|| d S r   r   r	   r   r   r#   r#   r$   r%      s
    zTestHstack.test_0D_arrayc                 C   s:   t dg}t dg}t||g}t ddg}t|| d S r   rF   r   r#   r#   r$   r(      s
    

zTestHstack.test_1D_arrayc                 C   sN   t dgdgg}t dgdgg}t||g}t ddgddgg}t|| d S r   rF   r   r#   r#   r$   r)      s
    zTestHstack.test_2D_arrayc              	   C   sZ   t t tdd tdD  W 5 Q R X t t ttdd td W 5 Q R X d S )Nc                 s   s   | ]}t d V  qdS r'   Nnpr   .0_r#   r#   r$   	<genexpr>   s     z,TestHstack.test_generator.<locals>.<genexpr>r   c                 S   s   | S Nr#   )xr#   r#   r$   <lambda>       z+TestHstack.test_generator.<locals>.<lambda>)r'   r   )r   FutureWarningr	   rangemaprI   onesr2   r#   r#   r$   test_generator   s    
 
zTestHstack.test_generatorc                 C   sZ   t dddg}t dddg}t j||fdt jd}t dddddd	g}t|| d S 
Nr   r   r'         @      @      @unsafecastingdtyper.   )rI   r   r	   int64r   r   r   r    r!   expected_resr#   r#   r$   test_casting_and_dtype   s
    z!TestHstack.test_casting_and_dtypec              	   C   sN   t dddg}t dddg}tt t||fdt jd W 5 Q R X d S 	Nr   r   r'   rX   rY   rZ   safer\   )rI   r   pytestraisesrA   r	   r_   r   r   r    r#   r#   r$   !test_casting_and_dtype_type_error   s    z,TestHstack.test_casting_and_dtype_type_errorN)r4   r5   r6   rB   rE   r%   r(   r)   rV   rb   rh   r#   r#   r#   r$   r?   ~   s   r?   c                   @   sT   e Zd Zdd Zdd Zdd Zdd Zd	d
 Zdd Zdd Z	dd Z
dd ZdS )
TestVstackc                 C   s   t ttd d S r@   )r   rA   r   r2   r#   r#   r$   rB      s    zTestVstack.test_non_iterablec                 C   s   t ttd d S rC   )r   rD   r   r2   r#   r#   r$   rE      s    zTestVstack.test_empty_inputc                 C   s:   t d}t d}t||g}t dgdgg}t|| d S r   r   r   r   r   r#   r#   r$   r%      s
    zTestVstack.test_0D_arrayc                 C   s>   t dg}t dg}t||g}t dgdgg}t|| d S r   rj   r   r#   r#   r$   r(      s
    

zTestVstack.test_1D_arrayc                 C   sR   t dgdgg}t dgdgg}t||g}t dgdgdgdgg}t|| d S r   rj   r   r#   r#   r$   r)      s
    zTestVstack.test_2D_arrayc                 C   sF   t ddg}t ddg}t||g}t ddgddgg}t|| d S r   rj   r   r#   r#   r$   test_2D_array2   s
    zTestVstack.test_2D_array2c              	   C   s.   t t tdd tdD  W 5 Q R X d S )Nc                 s   s   | ]}t d V  qdS rG   rH   rJ   r#   r#   r$   rM      s     z,TestVstack.test_generator.<locals>.<genexpr>r   )r   rR   r   rS   r2   r#   r#   r$   rV      s    
zTestVstack.test_generatorc                 C   s^   t dddg}t dddg}t j||fdt jd}t dddgddd	gg}t|| d S rW   )rI   r   r   r_   r   r`   r#   r#   r$   rb      s
    z!TestVstack.test_casting_and_dtypec              	   C   sN   t dddg}t dddg}tt t||fdt jd W 5 Q R X d S rc   )rI   r   re   rf   rA   r   r_   rg   r#   r#   r$   rh      s    z,TestVstack.test_casting_and_dtype_type_errorN)r4   r5   r6   rB   rE   r%   r(   r)   rk   rV   rb   rh   r#   r#   r#   r$   ri      s   ri   c                
   @   s0  e Zd Zdd Zdd Zdd Zdd Zd	d
 Zej	j
edddd Zdd Zej	dddgej	dddddddgej	dddddd gd!d" Zej	dddgej	d#d$d%d&d'gej	d(d)gfd)gd*gfdgd+gd,gfgd-d. Zej	dddgd/d0 Zej	dddgd1d2 ZdS )3TestConcatenatec                 C   s6   t d}t |g}d|d< |d |d ks2td S Nr'   r   )r   r   )rI   eyer   AssertionErrorrg   r#   r#   r$   test_returns_copy   s    
z!TestConcatenate.test_returns_copyc                 C   s\  dD ]Z}t d| }t j||fdd tt jt j||f|d tt jt j||f|d  d qtttd tttt df ttdt jt dt df t d}t d	}t	t
d
}t
d
D ]}t j||f|d d ttd|t j||f|d d ttt j||f|d d t |dd}t |dd}||d qtttd d S )Nr   r   r'   r+   r   axisr   )r   zall the input arrays must have same number of dimensions, but the array at index 0 has 1 dimension\(s\) and the array at index 1 has 2 dimension\(s\)r9   r   r   r'   r'   zall the input array dimensions except for the concatenation axis must match exactly, but along dimension {}, the array at index 0 has size 1 and the array at index 1 has size 2r   r#   )rI   rU   r   r   	AxisErrorrD   r   r   zeroslistrS   formatZmoveaxisappendpop)r   ndimr   r    rs   ir#   r#   r$   test_exceptions   s@      

  zTestConcatenate.test_exceptionsc              	   C   s  t jdt jdd}ttd}dg}t j||fd d}t|j|j t|j	d t j||fd d}t|j
|j
t|  t|j|j t j|||fd dd	}td
dddddddg}t|| t |j
t| }t j||fd d}t j||fd |d}t||k t|| d S )Nr.   r^   r0   r'   rO   rr   r   U)rs   r^   z0.0z1.0z2.0z3.0012)rs   out)rI   r   Zfloat64reshaperx   rS   r   r   r^   r|   sizelenr   r   rw   r   )r   r   r    crdr   routr#   r#   r$   test_concatenate_axis_None  s,    
   
z*TestConcatenate.test_concatenate_axis_Nonec                 C   s<   t dd}t |d }t|| t |d}t|| d S )Nr   d   )rI   r   r   r   )r   rO   r   r#   r#   r$    test_large_concatenate_axis_None)  s
    
z0TestConcatenate.test_large_concatenate_axis_Nonec                 C   s@  t td}tt|f| ttt|f| ttt|f| t td}tt||f||  ttt||f||  ttt||f||  tt||fd||  tt||fd||  tdddgdd	d
gg}tdddgg}tdddgdd	d
gdddgg}tt||f| tt||fd| tt|j|jfd|j tt|j|jfd|j ttt|j|jfd t	d
d}|dd df }|dddf }|ddd f }tt|||fd| tt|||fd| tt|j|j|jfd|j | }	t|||fd|	d}
t|	|
k t||
 d S )Nr.   r'   r   ru   
                  r   r   *   )r   r'      .   r   )rx   rS   r   r   tupler   Tr   rD   r   r   copyr   r   )r   Zr4Zr3Za23Za13r!   Za0Za1Za2r   r   r#   r#   r$   test_concatenate4  s:     z TestConcatenate.test_concatenatez7PYPY handles sq_concat, nb_add differently than cpython)reasonc                 C   s   dd l }tddg}tddg}ddg}tddddg}tt|j|| tt|j|| tt|j|| tt|j|d tt|jd| d S )Nr   r   r   r'   r.   )operatorr   r   rA   concat)r   r   r   r    nr!   r#   r#   r$   test_operator_concat^  s    z$TestConcatenate.test_operator_concatc                 C   s   t ddg}t ddg}ttt||ftdd ttt||ftdd ttt||ftdd t||ftdd d S )	Nr   r   r'   r.   r/   r   )r.   r   )r   r.   )r   r   rD   r   rI   emptyrg   r#   r#   r$   test_bad_out_shapek  s    z"TestConcatenate.test_bad_out_shapers   Nr   	out_dtypec8f4f8>f8i8ZS4r]   noequivrd   	same_kindr[   c              	   C   s   t jd|d}tddgtddgf}t j|d ||dstt t||||d	 W 5 Q R X tt t||j||d
 W 5 Q R X nFt||||d	}t||j||d
}||kstt	|| |j|ksttt t||||d W 5 Q R X d S )Nr.   r   g?g@gffffff
@g@r   r]   r   rs   r]   r^   rs   r]   r   r^   rs   )
rI   r   r   can_castr   rA   r   r^   ro   r   )r   rs   r   r]   r   	to_concatres_out	res_dtyper#   r#   r$   test_out_and_dtypet  s.    

   

z"TestConcatenate.test_out_and_dtype	string_dtSr   ZS0ZU0arrsg        r   string      ?c                 C   s2   t j|||dd}|jt d|jks.td S )Nr[   )rs   r^   r]   r   )rI   r   r^   r   Zastypero   )r   r   r   rs   r!   r#   r#   r$   test_dtype_with_promotion  s    z)TestConcatenate.test_dtype_with_promotionc              	   C   s`   t t tjd gdgfd|d W 5 Q R X t t tjd gdgfd|d W 5 Q R X d S )Nr   r   r^   rs   r   re   rf   rA   rI   r   r   rs   r#   r#   r$   "test_string_dtype_does_not_inspect  s    "z2TestConcatenate.test_string_dtype_does_not_inspectc              	   C   s6   t jtdd tjdgdgfd|d W 5 Q R X d S )Nz.*subarray dtype)matchr   z(2,)ir   r   r   r#   r#   r$   test_subarray_error  s    z#TestConcatenate.test_subarray_error)r4   r5   r6   rp   r~   r   r   r   re   markZskipifr   r   r   parametrizer   r   r   r   r#   r#   r#   r$   rl      s0   )*
	 
rl   c               	   C   s  t ttd dtdtdtdgtdtdtdgfD ]} tt| dddg qFtdddg}tdddg}tdddgdddgg}tt||f| ttj||fdd|j ttt||g| ttt||g| d	d
 t	dD }ddddg}ddddg}t
||D ]\}}tt||j| q*ttjdt|dd ttjdt|dd dd
 t	dD }ddddddg}ddddddg}t
||D ]\}}tt||j| qttg g g gjdk ttg g g gddjdk t|}	tj||f|	d t|	| ttdtg  ttdtdtdg ttdttddg ttdttddgdd ttdttdtdgdd ttdttdtdg tt tdd t	dD }
W 5 Q R X t|
tdddg tdddg}tdd d!g}tj||fdd"tjd#}tddgddgddgg}t|| t t t||ftjdd$d% W 5 Q R X d S )&Nr   rq   r   r'   r.   r/   r   rr   c                 S   s   g | ]}t jd qS )r'   rI   randomZrandnrJ   r#   r#   r$   
<listcomp>  s     ztest_stack.<locals>.<listcomp>r   r   ru   )r   r'   )r'   r   zout of boundsc                 S   s   g | ]}t jd dqS r'   r.   r   rJ   r#   r#   r$   r     s     )r   r'   r.   )r'   r   r.   )r'   r.   r   )r'   r   )r   r'   r   zneed at least one arrayzmust have the same shaper'   r'   c                 s   s   | ]
}|V  qd S rN   r#   )rK   rO   r#   r#   r$   rM     s     ztest_stack.<locals>.<genexpr>rX   rY   rZ   r[   )rs   r]   r^   rd   r   )r   rA   r   rI   Zint32r   r   r   rx   rS   zipr   r1   r   rv   r   
zeros_likerD   r   rw   r   rR   r_   )Zinput_r   r    Zr1arraysZaxesZexpected_shapesrs   Zexpected_shaper   resultr!   ra   r#   r#   r$   
test_stack  s      

       
 

r   rs   r   r   r   r   r   r   r]   r   r   rd   r   r[   c              	   C   s   t ddgt ddgf}t ddgddgg}t|}tj|d ||dsptt t||| |d W 5 Q R X nDt||| |d}t||| |d}||kstt|| |j	|ksttt t|||| d	 W 5 Q R X d S )
Nr   r   r'   r.   r   r   r   r   r   )
r   rI   r   r   r   rA   r   ro   r   r^   )rs   r   r]   r   r!   r   r   r   r#   r#   r$   test_stack_out_and_dtype  s,    

   

r   c                   @   s   e Zd Zejdddgddd Zdd Zd	d
 Zdd Zdd Z	dd Z
dd Zdd Zdd Zdd Zdd Zdd Zdd Zdd  Zd!d" Zd#d$ Zd%d& Zd'd( Zd)d* Zd+d, Zd-S ).	TestBlockr   force_concatenateforce_slicing)paramsc                 C   sF   dd }dd }|j dkr|S |j dkr,|S |j dkr:tS tdd S )	Nc                 S   s   t | \} }}}t| ||S rN   )r   r   r   Z	list_ndimZresult_ndimrL   r#   r#   r$   _block_force_concatenate  s    z1TestBlock.block.<locals>._block_force_concatenatec                 S   s   t | \} }}}t| ||S rN   )r   r   r   r#   r#   r$   _block_force_slicing  s    z-TestBlock.block.<locals>._block_force_slicingr   r   r   z7Unknown blocking request. There is a typo in the tests.)paramr   rD   )r   requestr   r   r#   r#   r$   r     s    	


zTestBlock.blockc                 C   s2   t d}||}d|d< |d |d ks.td S rm   )rI   rn   ro   )r   r   r   r    r#   r#   r$   rp     s    
zTestBlock.test_returns_copyc                 C   s   t dg\}}}}|dkstt dgg\}}}}|dks>tt ddgg\}}}}|dks`tt dgdgg\}}}}|dkstt ddgddgg\}}}}|dkstd S Nr   r   r'   r.   )r   ro   )r   r   rL   Z
total_sizer#   r#   r$   test_block_total_size_estimate%  s    z(TestBlock.test_block_total_size_estimatec                 C   sJ   t d}d| }t ddddgddddgg}|||g}t|| d S Nr0   r   r   rI   rU   r   r   )r   r   a_2db_2dr"   r   r#   r#   r$   test_block_simple_row_wise5  s    

z$TestBlock.test_block_simple_row_wisec                 C   sR   t d}d| }t ddgddgddgddgg}||g|gg}t|| d S r   r   )r   r   r   r   expectedr   r#   r#   r$   test_block_simple_column_wise=  s    

z'TestBlock.test_block_simple_column_wisec                 C   sP   t dddg}t dddg}t ddddddg}|||g}t|| d S r   rI   r   r   r   r   r   r    r   r   r#   r#   r$   "test_block_with_1d_arrays_row_wiseG  s
    z,TestBlock.test_block_with_1d_arrays_row_wisec              	   C   sh   t dddg}t dddg}t ddddddgddddddgg}|||g||gg}t|| d S r   r   r   r#   r#   r$   'test_block_with_1d_arrays_multiple_rowsO  s    z1TestBlock.test_block_with_1d_arrays_multiple_rowsc                 C   sX   t dddg}t dddg}t dddgdddgg}||g|gg}t|| d S r   r   )r   r   Za_1db_1dr   r   r#   r#   r$   %test_block_with_1d_arrays_column_wiseW  s    z/TestBlock.test_block_with_1d_arrays_column_wisec                 C   sR   t d}t ddg}||g|gg}t ddgddgddgg}t|| d S r   r   )r   r   r   r   r   r   r#   r#   r$   test_block_mixed_1d_and_2d`  s    

z$TestBlock.test_block_mixed_1d_and_2dc                 C   s  t dddgg}t dddgg}t ddddddgg}t ddddddg}t d}t dddddg}t d}t ddddddgddddddgddddddgddddddgddddddgddddddgg}	|||g|g|g||g|gg}
t|
|	 d S 	Nr   r   r'   r.   r/   r   )r   r   r   rI   r   rw   r   )r   r   Zone_2dZtwo_2dZthree_2dZfour_1dZfive_0dZsix_1dZzero_2dr   r   r#   r#   r$   test_block_complicatedi  s*    

z TestBlock.test_block_complicatedc                 C   s  t dddg}t dddgdddgdddgg}t dddg}t dddg}t d}t dddddg}t d}|||g|g|gg|g||g|gg}	t ddddddgddddddgddddddgddddddgddddddgddddddgg}
t|	|
 d S r   r   )r   r   ZoneZtwoZthreeZfourZfivesixZzeror   r   r#   r#   r$   test_nested  s4    "

zTestBlock.test_nestedc                 C   s  t dtd }t dtd }t dtd }t dtd }t d	td
 }t dtd }t dtd }t dtd }	|||g||gg||g||	ggg}
tdddddgdddddgddd
d
d
gddd
d
d
gddd
d
d
ggdddddgdddddgddd
d
d
gddd
d
d
gddd
d
d
ggdddddgdddddgdddddgdddddgdddddggdddddgdddddgdddddgdddddgdddddggdddddgdddddgdddddgdddddgdddddggg}t|
| d S )Nr;   r   )r'   r   r   r   )r   r'   r   r'   rt   r.   )r   r'   r'   r/   )r'   r   r'   r   )r'   r'   r   r   r'   r'   r'      )rI   rU   intr   r   )r   r   Za000Za100Za010Za001Za011Za101Za110Za111r   r   r#   r#   r$   test_3d  s`    
zTestBlock.test_3dc                 C   sp   t ddg}t d}tt|||g tt|||g t dt dgt dt dgg}tt|| d S )Nr   r   )r   r'   r0   )rI   r   rn   r   rD   rU   )r   r   r   r    Zto_blockr#   r#   r$    test_block_with_mismatched_shape  s    
z*TestBlock.test_block_with_mismatched_shapec                 C   s2   t |dtd t |tdtd d S )Nr   r'   )r   rI   r   rn   r   r   r#   r#   r$   test_no_lists  s    zTestBlock.test_no_listsc                 C   sx   d}t t||ddgg t t||dg g t t||dgdg t t||g dg t t||dgdggddggdgg d S )Nzdepths are mismatchedr   r   r'   r.   r/   r   rD   )r   r   msgr#   r#   r$   test_invalid_nesting  s    
zTestBlock.test_invalid_nestingc                 C   s6   t td|g  t td|g g t td|dgg g d S )Nr   r   r   r   r#   r#   r$   test_empty_lists  s    zTestBlock.test_empty_listsc                 C   s0   t td|ddgddgf t td|ddg d S )Nr   r   r   r'   r.   r:   r   )r   rA   r   r#   r#   r$   
test_tuple  s    zTestBlock.test_tuplec                 C   sV   d}dt d }dt d }||||g}t ddddddggg}t|| d S )Nr   r   r:   r'   )r   r   r'          @r-   r   r   r   r   r    r   r   r   r#   r#   r$   test_different_ndims  s    zTestBlock.test_different_ndimsc                 C   sd   d}dt d }dt d }|||g|gg}t dddgdddgdddggg}t|| d S )Nr   r   r:   r'   rq   r   r-   r   r   r#   r#   r$   test_different_ndims_depths  s    z%TestBlock.test_different_ndims_depthsc                 C   s   t jddd}t jddd}||g||gg||g||ggg}||g||gg||g||ggg}||jd snt||jd stt jddd}t jddd}||g||gg}||g||gg}||jd st||jd std S )Nr   C)orderFZC_CONTIGUOUSZF_CONTIGUOUSr   )rI   rw   flagsro   )r   r   Zarr_cZarr_fZb_cZb_fr#   r#   r$   test_block_memory_order  s8    z!TestBlock.test_block_memory_orderN)r4   r5   r6   re   Zfixturer   rp   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r#   r#   r#   r$   r     s*   

		7	
r   c                  C   s   G dd d} |  }|  }|  }t tt||g t tt|g|g t tt||g||g t tt|g||ggg|||g t tt||f||fg d S )Nc                   @   s   e Zd ZdS )z(test_block_dispatcher.<locals>.ArrayLikeN)r4   r5   r6   r#   r#   r#   r$   	ArrayLike.  s   r  )r   rx   r   )r  r   r    r   r#   r#   r$   test_block_dispatcher-  s    $r  )(re   ZnumpyrI   Z
numpy.corer   r   r   r   r   r   r   r	   r
   r   r   Znumpy.core.shape_baser   r   r   r   Znumpy.testingr   r   r   r   r   r   r   r   r7   r=   r?   ri   rl   r   r   r   r   r   r  r#   r#   r#   r$   <module>   s,   4$(' 06 DC  +