<s> import numpy as np <EOL> import time <EOL> import parakeet <EOL> from parakeet . testing_helpers import expect_each , run_local_tests <EOL> size = ( <NUM_LIT:5> , <NUM_LIT:5> ) <EOL> float_mat = np . random . uniform ( <NUM_LIT:0> , <NUM_LIT:1> , size = size ) <EOL> int_mat = np . random . random_integers ( <NUM_LIT:0> , <NUM_LIT:255> , size = size ) <EOL> matrices = [ float_mat , int_mat ] <EOL> def harris ( I ) : <EOL> m , n = I . shape <EOL> dx = ( I [ <NUM_LIT:1> : , : ] - I [ : m - <NUM_LIT:1> , : ] ) [ : , <NUM_LIT:1> : ] <EOL> dy = ( I [ : , <NUM_LIT:1> : ] - I [ : , : n - <NUM_LIT:1> ] ) [ <NUM_LIT:1> : , : ] <EOL> A = dx * dx <EOL> B = dy * dy <EOL> C = dx * dy <EOL> tr = A + B <EOL> det = A * B - C * C <EOL> k = <NUM_LIT> <EOL> return det - k * tr * tr <EOL> def test_harris ( ) : <EOL> expect_each ( harris , harris , matrices ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> run_local_tests ( ) </s>
