Apply PEP8 to generator.py