I did not work with parakeet before. I tried but could not really implement a version of that function with parakeet and I don't want to spend much more time on this. If you are interested in the result you should implement that. However, I compared the speed of the cython version and the python version of that function on the digits dataset:

cython -> 2.7 s
python -> 3.9 s