%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/
Upload File :
Create Path :
Current File : //opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyo

�
�9Zc@`s�ddlmZmZmZddlZddlZddlZddlZddl	m
Z
ddlmZddl
mZmZmZmZmZmZmZy(ejjdejjj�ZeZWnek
r�eZnXdefd��YZd	efd
��YZ defd��YZ!d
efd��YZ"defd��YZ#defd��YZ$defd��YZ%defd��YZ&e'dkr�e�ndS(i(tdivisiontabsolute_importtprint_functionN(tarray_indexing(tproduct(tTestCasetrun_module_suitetassert_tassert_equalt
assert_raisestassert_array_equaltassert_warnst
multiarraytTestIndexingcB`seZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(cC`sOtjdddg�}t|d|tj�t|dj|jd�dS(Niii(tnptarrayRtNonetnewaxistndim(tselfta((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_none_indexscC`s�tjdddg�}t|d
|�t|dj|k�tjd�}tt|dtj��tj��tj	ddt
�tjdg�}tt|dtj��tjtjd�gd	t�}tt|dtj
��WdQXdS(
Niiiitignoretg�?gtdtype((((RRRRtbaset
isinstancetint_twarningstcatch_warningstfilterwarningstDeprecationWarningtfloat_tobjecttndarray(RR((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_empty_tuple_indexs
!cC`s6tjd�}|jtj�}tjd�}t||||�tjd�||<t|tjd��tjd�jdd�}t||||�tjd�dd�df||<t|tjd�dd�dfjddd��tjd�jdd�}t|||f|||f�dS(Nii
itaxisii(RtarangetastypetuintpR
treshapeRtrepeat(Rtindextu_indextarr((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_same_kind_index_casting0s#5cC`s�tjdddg�}t|gg�t|gj|j�tjgdtj�}t|gg�t|gj|j�tjg�}tt|j|�dS(NiiiR(RRRRtintpR	t
IndexErrort__getitem__(RRtb((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_empty_fancy_indexDscC`s�tjdddgdddgddd	gg�}t|d
|�t|d
j|k�t|d|d�t|d
|ddd�f�t|d|dd�df�t|dtjd��tjd�}d|tf<t|d�dS(Niiiiiiiii	.i(i.(i.(.i(i.i(RRRRRtEllipsis(RRR1((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_ellipsis_indexRs!!
cC`s�tjdddgdddgddd	gg�}t|d
dddg�t|dddd	g�tt|jd�tt|jd�dS(Niiiiiiiii	ii����ii@i@l(RRRR	R/R0(RR((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_single_int_indexiscC`sotjdddgdddgddd	gg�}tt|jtjt��tt|jtjt��dS(
Niiiiiiiii	(RRR	R/R0tTruetFalse(RR((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_single_bool_indexws

cC`sktjdddgg�}tjtgdt�}t|||�d||<t|dddgg�dS(NgRg�?(RRR6tboolR(RRR1((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_boolean_indexing_onedim�s

cC`sktjd�}d�}tt||g�tt||dddg�tt||d dddg�dS(NicS`s|||dk<dS(Ni����((Rtv((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pytf�siii(RR%R	t
ValueError(RRR<((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyt&test_boolean_assignment_value_mismatch�s
	cC`sqtjd�}tjddt�}t|d*tjddt�||<tjd�}d|d*t||�dS(Ni�Ridi(RtzerosR9R6tonesR!R
(RR,tindxtexpected((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyt!test_boolean_assignment_needs_api�s

cC`stjdddgdddgddd	gg�}tjtttgtttgtttgg�}t||ddddd	g�t||ddddgg�t||d
||d�d
||<t|d
dd
gdd
dgd
dd
gg�dS(Niiiiiiiii	i(RRR6R7R(RRR1((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_boolean_indexing_twodim�s !
cC`s�tjd�}tjddtj�ddd�}tjd�ddd�}|||<t|dd�tjd�}tjd�jdd�ddd�}|||dd�f<t|dddg�dS(	NiRi����iii
i(ii(RR@R?R.R%RR((RRR1tc((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyt,test_reverse_strides_and_subspace_bufferinit�s%
(cC`sxtjd�dd�df}tjd�ddd�}t||||jd��tjd�jdd�}dS(Ni
i����tCii(RR%RR
tcopyR((RRti((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyt'test_reversed_strides_result_allocation�scC`s�tjdd�}tjdd�}tjd
�jddd�j|ddg<tjd�jddd�jj�|ddg<t||�dS(
Niiii����ii(iii(iiiiiii(RtfullR%R(tTRHR(RRR1((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyt%test_uncontiguous_subspace_assignment�s
+1cC`s=tjdd�}tt|jtjdg�fd�dS(Nii i(i(RR@R	R/R0R(RR((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyt(test_too_many_fancy_indices_special_case�scC`satjd�}t|tjt�|tjt��t|tjt�|tjt��dS(Ni(RRRtbool_R6R7(RR((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_scalar_array_bool�s'cC`sLtjd�}t||dk	�t||dk	�t||k	�dS(Ni.((RR%R(RR((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_everything_returns_views�scC`sftjd�}tt|jddgdddgf�tt|jddgdddgfd�dS(Niiii(ii(RR?R	R/R0t__setitem__(RR((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_broaderrors_indexings(cC`s�tjd�}tjddtj�}d|d<tt|j|�tt|j|d�tjddtj�}d|d<tt|j|�tt|j|d�dS(NiiRi
i����ii(RR?R@R.R	R/R0RR(RRtind((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyt test_trivial_fancy_out_of_boundss

cC`s�dtjfd��Y}tjd�}|j�jd|�}|jd�||ddddd	gdd�f<t|dkj��||dd�ddddd	gf<t|dkj��|jd�||d
<t|dkj��dS(NtSubClasscB`seZd�ZRS(cS`s|jd�dS(Nic(tfill(Rtold((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyt__array_finalize__s(t__name__t
__module__RY(((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyRVsittypeiiiii.(ii(RR"R?RHtviewRWRtall(RRVRts((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_nonbaseclass_valuess
%%

cC`s�tjjdddgdddg�}tjtttgdt�}t||jj�tjddg�}t||jj�t|d
jj�t|djj�dS(NtNGC1001itNGC1002g�?tNGC1003RttargettS20tV_mags>f4ii.(Rai(Rbg�?(Rcg�?(RdRe(Rfs>f4(	RtrecRR7R6R9Rtflagst	writeable(RtdRT((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_subclass_writeable&scC`sqtjd�}tjd�jdd�j}t||jj�|jdd�}t||dfjj�dS(Ni
iii����ii(RR%R(RLRRhtf_contiguous(RRR1((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_memory_order0s
cC`s�dtfd��Y}|�}dtfd��Y}tjd�}tt|d	tj��tjd�}tt||tj��tjd
�}tt||tjd�ftj��tt|||�ftj��tjd�}tjddt�}||d<tt|dtj��tj|dg�}tt||tj��tj|dgg�}tt||tjd�ftj��tt|||�ftj��dS(
NtZerocB`seZd�ZRS(cS`sdS(Ni((R((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyt	__index__@s(RZR[Ro(((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyRn>st	ArrayLikecB`seZd�ZRS(cS`s
tjd�S(Ni(RR(R((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyt	__array__Gs(RZR[Rq(((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyRpEsiiR(((ii(((	R!RR?RRR RR"R(RRntzRpRR1((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_scalar_return_type;s&	)#
)cC`s�tjdg�}tjtjtj��}d|tjdgdtj�<d|tjdgdtj�<tt|j	tjdgdtj�d�tt|j	tjdgdtj�d�t
tjtjtj��|�dS(NiiR(RRtsystgetrefcountRR.tuint8R	R/RRR(RRtrefcount((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_small_regressions]scC`s�tjddtj�td�dd!}|jtjd��}tjddtj�td�dd!}|jtjd��}tjddd
�|d<tj|j�}t	|||�|||<tj|jd�jtj�dtj
d�jd!}|jtj
�|j }tj|j�|d<t	||jtj
�|�|||jtj
�<||d
dk|ddd
�||d
dk<dS(Ni@RRii����tS8iR1itS.iitbbbbbbbb(RR?tint8tordR]RRR%tsizeRR.titemsizeR&tint16(RR;RjtxR1((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_unalignedks))
:cC`sxtjd�}dtfd��Y}dgdgf}||�}t||jdk�t||fjdk�dS(Nit
TupleSubclasscB`seZRS((RZR[(((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyR��si(ii(i(i(RR@ttupleRtshape(RR,R�R*((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_tuple_subclass�scC`s�dtfd��Y}tjd�}t||�||�f�tjd	dd
dg�}t||�||�f�dS(NtSequenceLikecB`s#eZd�Zd�Zd�ZRS(cS`sdS(Ni((R((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyRo�scS`sdS(Ni((R((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyt__len__�scS`std��dS(NsNot possible(R/(Rtitem((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyR0�s(RZR[RoR�R0(((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyR��s		i
iRtf1ti8tf2(i(R�R�(R�R�(R!RR%R
R?(RR�R,((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyt!test_broken_sequence_not_nd_index�s

cC`s�tjd�}tjd�}tjd�dd�dddf}tj|d�}t||||j��tjddtj�}t|||f||j�|f�dS(Ni
ii7iR(i
i(i
i7ii(	RR@R%Rtbroadcast_toR
RHR?R.(RR�tx2RTtzind((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyt!test_indexing_array_weird_strides�s%(RZR[RR#R-R2R4R5R8R:R>RCRDRFRJRMRNRPRQRSRUR`RkRmRsRxR�R�R�R�(((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyR
s8								
									
					
		"				tTestFieldIndexingcB`seZd�ZRS(cC`sPtjddg�}tt|dtj��tt|dgtj��dS(NRtf8((RR�(RR?RRR"(RR((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyRs�s(RZR[Rs(((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyR��stTestBroadcastedAssignmentscB`s>eZd�Zd�Zd�Zd�Zd�Zd�ZRS(cC`s|||<|S(N((RRRTtval((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pytassign�s
cC`s�tjd�}tjd�|d<tjd�|dddgdd�f<tjd	�|dd�ddgf<tjd
�|dgdgdggddgf<dS(Niii.i(ii(iii(iii(iii(iii(RR?R@(RR((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_prepending_ones�s
(%c
C`s�|j}tj}tjd�}tt|||dtjd��tj��vtj	dt
�tt
|||dddgftjd��tt
|||dgdggftjd	��WdQXdS(
Ni.iiterrori(ii(ii(iii(R�Rts_R?R	R=R@RRtsimplefilterR(RR�R�R((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_prepend_not_one�s		#
"cC`s|j}tj}tjd�}tt|||dtjd��tt|||dtjd��tt|||dd�dgftjd	��tt|||dd�dgftjd
��tt|||dgdd�ftjd��dS(Nii.ii(ii(ii(ii(ii(ii(ii(R�RR�R?R	R=(RR�R�R((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_simple_broadcasting_errors�s		##22cC`s|tjd�}dddg|dgdgdggdddgf<t|dd�dd�fdddgkj��dS(Niiiiii(ii(RR?RR^(RR((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_index_is_larger�s4cC`s{tjd�}tjd�dd�df}tjd�ddd�}|||<t|ddd�|kj��dS(Nidi����(idid(RR?R%RRR^(RRR;R1((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_broadcast_subspace�s

(RZR[R�R�R�R�R�R�(((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyR��s		
		
	tTestSubclassescB`s#eZd�Zd�Zd�ZRS(cC`s�dtjfd��Y}tjd�j|�}tt|d |��t|d j|k�tt|dddg|��tt||dk|��dS(NRVcB`seZRS((RZR[(((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyRV�siiiii(RR"R%R]RRR(RRVR_((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyt
test_basic�s cC`s�tjddgddgg�}tt|dddgdd�ftj��tjtjd�jdd��}t|dd�tjd	�f|dd�d	fj	�dS(
Niiiiii2ii
i����(
RtmatrixRRtasmatrixR%R(RRRL(RtmR�((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_matrix_fancys!/$cC`s�dtjfd��Y}tjd�j|�}|d }t|j|�t|j|�|ddddg}t|j|�t|j|�||dk}t|j|�t|j|�dS(NRVcB`seZd�ZRS(cS`stj|�|_||_dS(N(RRtfinalize_statusRX(RRX((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyRYs(RZR[RY(((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyRVsi
iiii(RR"R%R]R
R�RX(RRVR_tnew_s((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_finalize_gets_full_infos
(RZR[R�R�R�(((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyR��s		
tTestFancingIndexingCastcB`seZd�ZRS(cC`s�d}tj|�jt�}t|d<tj|�}tjdg�||<t|d	d�ttj|j	dgdgftjd
g��t|dd�ttj|j	|tjdg��t|dd�dS(
Nii?iiiy�?(ii?(ii(iiy@�?(ii(ii(
RR?R&R9R6RRRtComplexWarningRR(RR�t
bool_indext
zero_array((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_boolean_index_cast_assign(s
	(	(RZR[R�(((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyR�'stTestFancyIndexingEquivalencecB`seZd�Zd�ZRS(cC`s�tjddt�}|j�}dd
dg|d*dddg|dddg<t||�tjddt�ddd�f}dddgg|dgdd�f<t||d�|j}dgd
gdgg|dd�dgf<t||dd�df�tjddt�}|j�}dgdgdgdggg|dd�df<dgdgdgdggg|dgdf<t||�|jd	�}dgdgdgdggg|dgdf<t||�dS(NiRiiiii.tF(ii(ii(ii(ii(iii(RR%R!RHR
RRLR@(RRR1R,tcmp_arr((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_object_assign>s&
%%	+1.
.cC`s�tjd�}|j�}tjdddg�|d*tjdddg�|dddg<t||�tjd�ddd�f}tjdddgg�|dgdd�f<t||d�dS(	Nit2s-3s-1iiii(RR%RHRR
R(RRR1((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_cast_equivalence^s%
.(RZR[R�R�(((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyR�=s	 tTestMultiIndexingAutomatedcB`sVeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
RS(	s�
     These test use code to mimic the C-Code indexing for selection.

     NOTE: * This still lacks tests for complex item setting.
           * If you change behavior of indexing, you might want to modify
             these tests to try more combinations.
           * Behavior was written to match numpy version 1.8. (though a
             first version matched 1.7.)
           * Only tuple indices are supported by the mimicking code.
             (and tested as of writing this)
           * Error types should match most of the time as long as there
             is only one error. For multiple errors, what gets raised
             will usually not be the same one. They are *not* tested.
    cC`stjtjddddg��jdddd�|_tjd�|_dtdtjt	�tjt
t	t	g�tjt
t	gt	t
gg�tjt	t	gt	t	ggg�tddd�tddd	�td
dd�tddd
�tjddtj
�tjdddg�tjdgdgdgg�tjddgddggdtjd�j��tjddgdtj�tjdgddt�tjddg�g|_tdddgtjt
g�dg|_tdd�dg|_dS(Niiiiitskipi����iidii����i����i����RR.igg�?(iiii(iii(RR%tprodR(RtemptyR1R3RR7R6tsliceRR.RtnewbyteorderR|R?tinttcomplex_indicestsimple_indicestfill_indices(R((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pytsetUp}s*9!3*cC`sft|�}g}t}d}d}t}d}d}	xmt|�D]_\}
}|dkraqCnt|tj�r�|jt	kr�t}|j
dkr�t�n||j
7}||j
7}qCn|tkr�|	dkr�|
}	qCnt�nt|t
�r|d7}qCnt|tj�sCtj|dtj�}|||
<n3|jjdkrv|jjdkrvtd��n|j
dkr�t}n|d7}|d7}qCW|j
|dkr�t�n|dkr�d|kr�|j�|fS|	dk	r!t
dd�g|j
|||	|	d+nx�t|�D]�\}}t|t
�r�tj|j|j|��}|jd|g�q.n_|dkr�|jdtjdgdtj�g�|j|j| d|j|�}q.nt|tj�r�|jt	kr�|j|j|||j
!kr*t�ny6tjtj|�|j|||j
!d	d
�}
Wn2t}tjdg|j�dtj�}
nX|j
dkr�|j|j| tj|j|||j
!�f|j||j
�}|
}qAt�nB|j
dkrA||j|ks5||j|krAt�qAn|j
dkr�||j|ksw||j|kr�t�q�nt|�dkr�|dddkr�||	kr�|dj|�q.|d7}|jd|g�q.W|dkr|r|}tt|j
��}g}|jddg�d}d}x�|D]�}|d7}|ddkr�|dj|d�||=|d8}xBt||t|d��D] }|j|�|j|�q�Wn|t|�d7}qEW|}|j ||�}nd}xO|D]G}|ddkr5t|�dkr?qn|j}|||t|d�!}|j|j| tj|�j!t"�f|j|t|d��}tj#|d�}|j$dkrL|r�t�nxmt%|d|�D]U\}}|j$dkrq�ntj&||k�s<tj&||k�r�t�q�q�Wnt|d�t|�kr�tj'|�dkr�y tj|d|d	d
�}Wq�td
��q�Xq�tj|d|d	d�}nt(�|j)|j*�d|�}|j|j| |j|j|d�}||j
7}qn|j)|dd|�}|d7}qW||fS(s�Mimic multi dimensional indexing.

        Parameters
        ----------
        arr : ndarray
            Array to be indexed.
        indices : tuple of index objects

        Returns
        -------
        out : ndarray
            An array equivalent to the indexing operation (but always a copy).
            `arr[indices]` should be identical.
        no_copy : bool
            Whether the indexing operation requires a copy. If this is `True`,
            `np.may_share_memory(arr, arr[indicies])` should be `True` (with
            some exceptions for scalars and possibly 0-d arrays).

        Notes
        -----
        While the function may mostly match the errors of normal indexing this
        is generally not the case.
        iiRR1RIs;arrays used as indices must be of integer (or boolean) typeR_tntmodetraisei����R<sinvalid index into 0-sizedtwrapR$N(i(+tlistR6R7Rt	enumerateRRR"RR9RR/R3R�RR.tkindRHR%tindicesR�tappendR(travel_multi_indextnonzerotsumR�tlentrangetinserttextendtremovet	transposeR&R�t	broadcastR~tziptanyRR=ttaketravel(RR,R�t
in_indicestno_copyt	num_fancyt	fancy_dimterror_unless_broadcast_to_emptyRtellipsis_posRIRAtaxt	flat_indxtnew_indicestaxest
fancy_axestnitait
orig_shapet
orig_slicetrest_indxt_sizetmi((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyt_get_multi_index�s�!	

	

$	
	+(%! 	$)C		''2



$

	B	 + &
cC`s�y|j||�\}}Wn`tk
r~tj|�}tt|j|�tt|j|d�t|tj|��dSX|j||||�dS(sCheck a multi index item getting and simple setting.

        Parameters
        ----------
        arr : ndarray
            Array to be indexed, must be a reshaped arange.
        index : tuple of indexing objects
            Index being tested.
        iN(	R�t	ExceptionRtRuR	R0RRRt_compare_index_result(RR,R*t	mimic_getR�t
prev_refcount((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyt_check_multi_index{s
cC`s�y|j||f�\}}Wn`tk
r�tj|�}tt|j|�tt|j|d�t|tj|��dSX|j||||�dS(sWCheck a single index item getting and simple setting.

        Parameters
        ----------
        arr : ndarray
            Array to be indexed, must be an arange.
        index : indexing object
            Index being tested. Must be a single index and not a tuple
            of indexing objects (see also `_check_multi_index`).
        iN(	R�R�RtRuR	R0RRRR�(RR,R*R�R�R�((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyt_check_single_index�s
cC`s|j�}||}t||�|jdkr�|jdkr�ttj||�|k�|r|ttj	|�d�q�ttj	|�d�n|j�}|d||<|jdkr�dS|r�|jdkr�|d7}t||�dS|j
|j�cd7<t||�dS(s4Compare mimicked result to indexing result.
        iiii�N(RHR
R~RRRtmay_share_memoryRRtRutflatR�(RR,R*R�R�tindexed_arrR1((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyR��s$



cC`s�tjd�}t|tjt�d�d|tjt�<t|d�|j|jtj|jdt�f�|j|jtj|jdt�df�|j|jtj|jdt�df�dS(NiiR.i(.i(N.(	RRRR6R�Rt
zeros_likeR9R(RR((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_boolean�s
(,c	`s�tj���tjddt�tjddtj�d��x�dddgD]�}|j|j|j|jg}|j||<xVt	|�D]H}t
�fd�|D��}|j|j|�|j|j
|�q�WqOWWdQX|j|jd	�|j|j
d
�tt|jjd�tt|jjdd�tt|jjdddgddf�tt|jjdddgddfd�dS(
NR�RcS`st|t�o|dkS(NR�(Rtstr(tidx((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pytisskip�siiic3`s!|]}�|�s|VqdS(N((t.0RI(R�(sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pys	<genexpr>�si(iiii(iiii(iiiii(iiiii(RRRRRtVisibleDeprecationWarningR�R�R�RR�R�RR1R	R/R0RR(Rt
simple_posttocheckR*((R�sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyt
test_multidim�s$
	
!(cC`s`tjd�}tj��?tjddtj�x!|jD]}|j||�q<WWdQXdS(Ni
R�R(RR%RRRR�R�R�(RRR*((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_1d�s

(RZR[t__doc__R�R�R�R�R�R�R�R�(((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyR�ms		�					tTestCApiAccesscB`seZd�Zd�ZRS(cC`s�tjtd�}tt|tjd	�d�tt|tjd�d�tt|tjd�d�tt|tjd
�d�tt|tjd�d�tjd�}t|d||d��|j	dd�}t|d||d��dS(Nii
ii����iiii����((i
i
(i
i
(
t	functoolstpartialRR	R/RR@R%R
R((Rt	subscriptR((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_getitem�scC`s9tjtd�}tt|tjd�d�tt|tjd
�dd�tt|tjd�dd�tt|tjd�dd�tt|tjd�dd�tt|tjd�dd�tjd�}||dd�t	|ddk�|j
dd�}||dd�t|d	ddg�dS(
Nii
iii����iiii����((i
i
(i
i
(R�RRR	R=RR@R/R%RR(R
(RR�R((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyttest_setitems(RZR[RR(((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyR��s	t__main__((t
__future__RRRRtRR�tnumpyRtnumpy.core.multiarray_testsRt	itertoolsRt
numpy.testingRRRRR	R
Rt	ctypeslibtload_librarytcoreRt__file__tcdllR6t
_HAS_CTYPEtImportErrorR7R
R�R�R�R�R�R�R�RZ(((sQ/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_indexing.pyt<module>s04


��	<-0��'

Zerion Mini Shell 1.0