<s> import datashape <EOL> import pytest <EOL> def test_scalar_subarray ( ) : <EOL> assert datashape . int32 . subarray ( <NUM_LIT:0> ) == datashape . int32 <EOL> with pytest . raises ( IndexError ) : <EOL> datashape . int32 . subarray ( <NUM_LIT:1> ) <EOL> assert datashape . string . subarray ( <NUM_LIT:0> ) == datashape . string <EOL> with pytest . raises ( IndexError ) : <EOL> datashape . string . subarray ( <NUM_LIT:1> ) <EOL> def test_array_subarray ( ) : <EOL> assert ( datashape . dshape ( '<STR_LIT>' ) . subarray ( <NUM_LIT:0> ) == <EOL> datashape . dshape ( '<STR_LIT>' ) ) <EOL> assert ( datashape . dshape ( '<STR_LIT>' ) . subarray ( <NUM_LIT:1> ) == <EOL> datashape . DataShape ( datashape . int32 ) ) <EOL> assert ( str ( datashape . dshape ( '<STR_LIT>' ) . subarray ( <NUM_LIT:2> ) ) == <EOL> str ( datashape . dshape ( '<STR_LIT>' ) ) ) <EOL> assert ( str ( datashape . dshape ( '<STR_LIT>' ) . subarray ( <NUM_LIT:3> ) ) == <EOL> str ( datashape . float64 ) ) <EOL> def test_dshape_compare ( ) : <EOL> assert datashape . int32 != datashape . dshape ( '<STR_LIT>' ) </s>
