Python model code generation tool