Implement a robust Python generator | Google