The Python implementation of KNN algorithm.