(sample, print_all_preds=False)
| 302 | |
| 303 | |
| 304 | def show_sample(sample, print_all_preds=False): |
| 305 | print("==" * 20) |
| 306 | for key in ["idx", "type", "level", "dataset"]: |
| 307 | if key in sample: |
| 308 | # capitalize |
| 309 | print("{}: {}".format(key[0].upper() + key[1:], sample[key])) |
| 310 | print("Question:", repr(sample["question"])) |
| 311 | if "code" in sample: |
| 312 | if print_all_preds: |
| 313 | for code in sample["code"]: |
| 314 | print("-" * 20) |
| 315 | print("code:", code) |
| 316 | print("Execution:", sample["report"]) |
| 317 | else: |
| 318 | print("Solution:\n", sample["code"][0]) |
| 319 | print("Execution:", sample["report"][0]) |
| 320 | if "pred" in sample: |
| 321 | print("Prediction:", repr(sample["pred"][0])) |
| 322 | for key in ["gt", "score", "unit", "gt_cot"]: |
| 323 | if key in sample: |
| 324 | _key = key_map.get(key, key) |
| 325 | print("{}: {}".format(_key, repr(sample[key]))) |
| 326 | print() |
nothing calls this directly
no outgoing calls
no test coverage detected