#NEWLINE# def test_tril_indices( ) : #NEWLINE# #INDENT# 'Test numpy.tril_indices() replacement' #NEWLINE# il1 = _tril_indices ( 4 ) #NEWLINE# il2 = _tril_indices ( 4 , ( - 1 ) ) #NEWLINE# a = np . array ( [ [ 1 , 2 , 3 , 4 ] , [ 5 , 6 , 7 , 8 ] , [ 9 , 10 , 11 , 12 ] , [ 13 , 14 , 15 , 16 ] ] ) #NEWLINE# assert_array_equal ( a [ il2 ] , np . array ( [ 1 , 5 , 6 , 9 , 10 , 11 , 13 , 14 , 15 , 16 ] ) ) #NEWLINE# assert_array_equal ( a [ il2 ] , np . array ( [ 5 , 9 , 10 , 13 , 14 , 15 ] ) )