Python model for code generation