1{2 "document_id": "exec_00111_2000",3 "family": "exec",4 "split": "dev",5 "document_hash": "9f3d9d2caa1830b0bf0b983179f4de3251ec9bb8648c710bf43f0fb6c531ef85",6 "questions": [7 {8 "question_id": "q00_exec",9 "qtype": "exec",10 "question": "Rewrite the Python function net_revenue(rows) so that it implements ALL the agreed rules in the ticket. Output only Python code defining net_revenue; no explanations, no markdown fences.",11 "answer": "\ndef net_revenue(rows):\n total = 0.0\n for r in rows:\n if r['returned']:\n continue\n if r['region'] == 'Sud':\n continue\n if r['units'] < 6:\n continue\n total += r['units'] * r['unit_price'] * (1 - r['discount_pct'] / 100.0)\n total = total * (1 + 5.0 / 100.0)\n return round(total, 1)\n",12 "answer_type": "exec",13 "tolerance": 0.0,14 "supporting_fact_ids": [15 "spec"16 ],17 "answer_position_frac": 0.02,18 "aliases": []19 }20 ],21 "facts": [22 {23 "fact_id": "spec",24 "entity": "net_revenue",25 "attribute": "rules",26 "value": "{\"thr_days\": 3, \"min_units\": 6, \"excl_region\": \"Sud\", \"rounding\": 1, \"tax\": 5.0}",27 "kind": "spec",28 "sentence": "Bug report BR-8832: the function net_revenue(rows) must compute the total net revenue of the rows list (each row is a dict with keys ['region', 'product', 'units', 'unit_price', 'discount_pct', 'returned', 'shipped_days']). Rules agreed with the client on 21 June 2031: (1) exclude returned rows; (2) exclude rows whose region is 'Sud'; (3) exclude rows with fewer than 6 units; (4) line revenue = units * unit_price * (1 - discount_pct/100); (5) apply a tax of 5.0 % on the sum; (6) return the result rounded to 1 decimals (Python round). The current implementation forgets rule (2) and applies no tax.",29 "char_start": 20,30 "char_end": 62331 }32 ],33 "hidden_tests": [34 {35 "input": [36 {37 "region": "Ouest",38 "product": "epsilon",39 "units": 22,40 "unit_price": 15.33,41 "discount_pct": 5,42 "returned": false,43 "shipped_days": 444 },45 {46 "region": "Centre",47 "product": "beta",48 "units": 34,49 "unit_price": 79.79,50 "discount_pct": 0,51 "returned": false,52 "shipped_days": 253 },54 {55 "region": "Ouest",56 "product": "zeta",57 "units": 5,58 "unit_price": 38.72,59 "discount_pct": 25,60 "returned": true,61 "shipped_days": 362 },63 {64 "region": "Est",65 "product": "epsilon",66 "units": 24,67 "unit_price": 74.2,68 "discount_pct": 15,69 "returned": false,70 "shipped_days": 171 },72 {73 "region": "Nord",74 "product": "beta",75 "units": 22,76 "unit_price": 9.67,77 "discount_pct": 25,78 "returned": false,79 "shipped_days": 1480 }81 ],82 "expected": 4941.883 },84 {85 "input": [86 {87 "region": "Nord",88 "product": "zeta",89 "units": 28,90 "unit_price": 60.82,91 "discount_pct": 15,92 "returned": false,93 "shipped_days": 1394 },95 {96 "region": "Ouest",97 "product": "zeta",98 "units": 5,99 "unit_price": 38.72,100 "discount_pct": 25,101 "returned": true,102 "shipped_days": 3103 },104 {105 "region": "Sud",106 "product": "alpha",107 "units": 38,108 "unit_price": 59.68,109 "discount_pct": 15,110 "returned": false,111 "shipped_days": 6112 },113 {114 "region": "Centre",115 "product": "beta",116 "units": 34,117 "unit_price": 79.79,118 "discount_pct": 0,119 "returned": false,120 "shipped_days": 2121 },122 {123 "region": "Ouest",124 "product": "epsilon",125 "units": 22,126 "unit_price": 15.33,127 "discount_pct": 5,128 "returned": false,129 "shipped_days": 4130 }131 ],132 "expected": 4704.8133 },134 {135 "input": [136 {137 "region": "Ouest",138 "product": "zeta",139 "units": 5,140 "unit_price": 38.72,141 "discount_pct": 25,142 "returned": true,143 "shipped_days": 3144 },145 {146 "region": "Ouest",147 "product": "epsilon",148 "units": 22,149 "unit_price": 15.33,150 "discount_pct": 5,151 "returned": false,152 "shipped_days": 4153 },154 {155 "region": "Sud",156 "product": "alpha",157 "units": 38,158 "unit_price": 59.68,159 "discount_pct": 15,160 "returned": false,161 "shipped_days": 6162 },163 {164 "region": "Est",165 "product": "epsilon",166 "units": 24,167 "unit_price": 74.2,168 "discount_pct": 15,169 "returned": false,170 "shipped_days": 1171 },172 {173 "region": "Est",174 "product": "epsilon",175 "units": 27,176 "unit_price": 38.23,177 "discount_pct": 10,178 "returned": false,179 "shipped_days": 1180 },181 {182 "region": "Centre",183 "product": "delta",184 "units": 15,185 "unit_price": 45.17,186 "discount_pct": 25,187 "returned": false,188 "shipped_days": 1189 },190 {191 "region": "Est",192 "product": "epsilon",193 "units": 22,194 "unit_price": 32.07,195 "discount_pct": 25,196 "returned": false,197 "shipped_days": 4198 },199 {200 "region": "Ouest",201 "product": "alpha",202 "units": 17,203 "unit_price": 20.69,204 "discount_pct": 10,205 "returned": false,206 "shipped_days": 7207 },208 {209 "region": "Sud",210 "product": "epsilon",211 "units": 34,212 "unit_price": 46.48,213 "discount_pct": 0,214 "returned": false,215 "shipped_days": 12216 },217 {218 "region": "Nord",219 "product": "beta",220 "units": 22,221 "unit_price": 9.67,222 "discount_pct": 25,223 "returned": false,224 "shipped_days": 14225 },226 {227 "region": "Ouest",228 "product": "gamma",229 "units": 16,230 "unit_price": 49.47,231 "discount_pct": 10,232 "returned": false,233 "shipped_days": 9234 },235 {236 "region": "Centre",237 "product": "beta",238 "units": 34,239 "unit_price": 79.79,240 "discount_pct": 0,241 "returned": false,242 "shipped_days": 2243 }244 ],245 "expected": 8086.8246 },247 {248 "input": [249 {250 "region": "Est",251 "product": "epsilon",252 "units": 22,253 "unit_price": 32.07,254 "discount_pct": 25,255 "returned": false,256 "shipped_days": 4257 },258 {259 "region": "Nord",260 "product": "zeta",261 "units": 28,262 "unit_price": 60.82,263 "discount_pct": 15,264 "returned": false,265 "shipped_days": 13266 },267 {268 "region": "Sud",269 "product": "epsilon",270 "units": 2,271 "unit_price": 62.29,272 "discount_pct": 10,273 "returned": false,274 "shipped_days": 5275 },276 {277 "region": "Centre",278 "product": "beta",279 "units": 34,280 "unit_price": 79.79,281 "discount_pct": 0,282 "returned": false,283 "shipped_days": 2284 }285 ],286 "expected": 4924.0287 },288 {289 "input": [290 {291 "region": "Nord",292 "product": "beta",293 "units": 22,294 "unit_price": 9.67,295 "discount_pct": 25,296 "returned": false,297 "shipped_days": 14298 },299 {300 "region": "Nord",301 "product": "zeta",302 "units": 28,303 "unit_price": 60.82,304 "discount_pct": 15,305 "returned": false,306 "shipped_days": 13307 },308 {309 "region": "Sud",310 "product": "epsilon",311 "units": 2,312 "unit_price": 62.29,313 "discount_pct": 10,314 "returned": false,315 "shipped_days": 5316 },317 {318 "region": "Sud",319 "product": "epsilon",320 "units": 34,321 "unit_price": 46.48,322 "discount_pct": 0,323 "returned": false,324 "shipped_days": 12325 },326 {327 "region": "Centre",328 "product": "delta",329 "units": 15,330 "unit_price": 45.17,331 "discount_pct": 25,332 "returned": false,333 "shipped_days": 1334 }335 ],336 "expected": 2221.0337 }338 ]339}