Add generate.py for reference