add generator and decorator in python