python implementation of naive-bayes classification