Accuracy Function In Python Definition