zmc
2023-10-12 ed135d79df12a2466b52dae1a82326941211dcc9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
U
O±dQã@s:ddlZddlZddlmZmZmZmZGdd„dƒZdS)éN)Úassert_Ú assert_raisesÚassert_array_equalÚ HAS_REFCOUNTc@s4eZdZdd„Zdd„Zdd„Zdd„Zd    d
„Zd S) ÚTestTakec Cs¼ddgddgg}ddgddgg}d    d
d g}d dg}tjd tjdtjtƒtjdtjdtjdg}dtdœdd dœd ddœdœ}ttt dg¡f}|D]}tjt     |tj
¡r²|n||d}    t |    j   ¡ƒ}
|D]æ} | jd krüd| j|
d _d| j|
d_|D]²} |D]¦} || | }|tkrP| jd krP|  d | ¡tt|    j| | ddn\| jd krˆ|  d | ¡|    j| | dd}t||
|ƒn$|    j| | dd}t|jd| jkƒqqqÎq–dS)Nééééó1ó2ó3ó4ÚraiseÚwrapÚclipéÿÿÿÿr©Údtype)rr)rr
)rrr)ÚÚi2r    )r)ÚmodeZaxis)ÚnpÚemptyZintpÚtupleÚ
IndexErrorÚintÚobjectrÚarrayZ
issubdtypeÚnumberÚlistÚTÚcopyÚsizeÚshapeÚputrÚtakerr)ÚselfÚaZa_strÚmodesÚindicesZ index_arraysZ real_indicesÚtypesÚtÚtaZtresultZ index_arrayrÚindexZ
real_indexÚres©r0ú[d:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\numpy/core/tests/test_item_selection.pyÚ test_simple
sF
þþ
 
 
ÿ  zTestTake.test_simplec    CsÀdd„tdƒDƒ}dD]¤}t |¡}t ddddddg¡}|j||dd    …|d
~trnttd d „|Dƒƒƒt |d¡ddd…}|j||dd    …|d
~trttd d „|DƒƒƒqdS)NcSsg|]
}tƒ‘qSr0)r)Ú.0Úir0r0r1Ú
<listcomp>2sz-TestTake.test_refcounting.<locals>.<listcomp>é
)rrrrr
ér    é)Úoutrcss|]}t |¡dkVqdS©r    N©ÚsysÚ getrefcount©r3Úor0r0r1Ú    <genexpr>9sz,TestTake.test_refcounting.<locals>.<genexpr>css|]}t |¡dkVqdSr:r;r>r0r0r1r@?s)Úrangerrr&rrÚall)r'Zobjectsrr(Úbr0r0r1Útest_refcounting1s
zTestTake.test_refcountingcCs*t d¡}d d¡}tt|jd|ddS)Nr6säÚUTF8r7)r)rZarangeÚdecoderÚ
ValueErrorr&)r'ÚdÚkr0r0r1Útest_unicode_modeAs
 
zTestTake.test_unicode_modecCsBt ddddddg¡}| ¡}| tjgtjd¡t||ƒdS)Nrrr
r8ér6r)rrr"Ú    partitionÚint16r)r'Z
a_originalr(r0r0r1Útest_empty_partitionFszTestTake.test_empty_partitioncCsPt ddddddg¡}| tjgtjd¡}t dddd    dd
g¡}t||ƒdS) Nrrr
r8rKr6rrr    r7)rrZ argpartitionrMr)r'r(rCr0r0r1Útest_empty_argpartitionPsz TestTake.test_empty_argpartitionN)Ú__name__Ú
__module__Ú __qualname__r2rDrJrNrOr0r0r0r1r    s
'
r)    r<ÚnumpyrZ numpy.testingrrrrrr0r0r0r1Ú<module>s