fixed python codegen