how to calculate accuracy in python without sklearn