<s> import numpy as np <EOL> from parakeet . testing_helpers import expect , run_local_tests <EOL> from parakeet import config <EOL> config . print_specialized_function = False <EOL> config . print_loopy_function = False <EOL> vec = np . arange ( <NUM_LIT:16> ) <EOL> mat = vec . reshape ( <NUM_LIT:4> , <NUM_LIT:4> ) <EOL> def negative_stop_1d ( x ) : <EOL> return x [ : - <NUM_LIT:2> ] <EOL> def test_negative_stop_1d_vec ( ) : <EOL> expect ( negative_stop_1d , [ vec ] , negative_stop_1d ( vec ) ) <EOL> def test_negative_stop_1d_mat ( ) : <EOL> expect ( negative_stop_1d , [ mat ] , negative_stop_1d ( mat ) ) <EOL> def negative_stop_2d ( x ) : <EOL> return x [ : - <NUM_LIT:2> , : - <NUM_LIT:3> ] <EOL> def test_negative_stop_2d ( ) : <EOL> expect ( negative_stop_2d , [ mat ] , negative_stop_2d ( mat ) ) <EOL> def negative_start_1d ( x ) : <EOL> return x [ - <NUM_LIT:2> : ] <EOL> def test_negative_start_1d_vec ( ) : <EOL> expect ( negative_start_1d , [ vec ] , vec [ - <NUM_LIT:2> : ] ) <EOL> def test_negative_start_1d_mat ( ) : <EOL> expect ( negative_start_1d , [ mat ] , mat [ - <NUM_LIT:2> : ] ) <EOL> def negative_start_2d ( x ) : <EOL> return x [ - <NUM_LIT:2> : , - <NUM_LIT:3> : ] <EOL> def test_negative_start_2d ( ) : <EOL> expect ( negative_start_2d , [ mat ] , mat [ - <NUM_LIT:2> : , - <NUM_LIT:3> : ] ) <EOL> def negative_step_1d ( x ) : <EOL> return x [ : : - <NUM_LIT:2> ] <EOL> def test_negative_step_1d_vec ( ) : <EOL> expect ( negative_step_1d , [ vec ] , vec [ : : - <NUM_LIT:2> ] ) <EOL> def test_negative_step_1d_mat ( ) : <EOL> expect ( negative_step_1d , [ mat ] , mat [ : : - <NUM_LIT:2> ] ) <EOL> def negative_step_2d ( x ) : <EOL> return x [ : : - <NUM_LIT:2> , : : - <NUM_LIT:3> ] <EOL> def test_negative_step_2d ( ) : <EOL> expect ( negative_step_2d , [ mat ] , mat [ : : - <NUM_LIT:2> , : : - <NUM_LIT:3> ] ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> run_local_tests ( ) </s>
