how to call a function inside a class python