Python Class Method Annotation Machine Learning