Tommysha commited on
Commit
bbc5c85
·
verified ·
1 Parent(s): f431db7

Add mbppplus 378, codeforces 408, cc_valid 117 independent val configs

Browse files
README.md ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ task_categories: [text-generation]
4
+ tags: [code, zevo, validation]
5
+ configs:
6
+ - config_name: mbppplus
7
+ data_files:
8
+ - split: validation
9
+ path: mbppplus/validation-*.parquet
10
+ - config_name: codeforces
11
+ data_files:
12
+ - split: validation
13
+ path: codeforces/validation-*.parquet
14
+ - config_name: cc_valid
15
+ data_files:
16
+ - split: validation
17
+ path: cc_valid/validation-*.parquet
18
+ ---
19
+
20
+ # zero-code L1 independent validation sets
21
+
22
+ Three **separate** configs. Not mixed into one split. Task test stays `Tommysha/zero-code-l1-lcb-v5-test` (LCB v5 279).
23
+
24
+ | config | split | rows | source | Zevo independent val |
25
+ |---|---|---:|---|---|
26
+ | `mbppplus` | validation | 378 | `evalplus/mbppplus` test, as-is plus `id`/`entry_point` | yes (≥200) |
27
+ | `codeforces` | validation | 408 | `agentica-org/DeepCoder-Preview-Dataset` `codeforces` test, plus `id` | yes (≥200) |
28
+ | `cc_valid` | validation | 117 | `Tommysha/zero-code-l1-cc-valid` / `deepmind/code_contests` valid | Hub copy only. Zevo rejects independent val < 200 |
29
+
30
+ Gold solutions are not in `mbppplus` (`code` dropped). Each config has its own `evaluator.py` and `sample_submission.csv`.
cc_valid/evaluator.py ADDED
@@ -0,0 +1,697 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Zevo custom evaluator for zero-code L1 CodeContests valid (117 problems), pass@1.
3
+ Schema matches LiveCodeBench rows so the same testing_util grades stdin tests.
4
+
5
+
6
+ Usage (Zevo protocol): python3 evaluator.py PREDICTIONS_CSV SCORING_SET METRICS_JSON
7
+ PREDICTIONS_CSV: columns id,prediction (raw model output; the last ``` fenced block is the program)
8
+ SCORING_SET: the Test set rows (parquet / jsonl / json / csv) with id, public_test_cases,
9
+ private_test_cases, metadata
10
+ METRICS_JSON: written as {"score": pass@1, "correct": ..., "total": ..., "by_difficulty": {...}}
11
+ Grading is LiveCodeBench's own testing_util (vendored verbatim below, numpy import dropped: it was unused),
12
+ with LCB's defaults: timeout 6 s per test, all public + private tests must pass, missing prediction = fail.
13
+ Stdlib only (pyarrow/pandas needed only if SCORING_SET is parquet).
14
+ """
15
+ # ---------------- vendored: lcb_runner/evaluation/testing_util.py @ 28fef95 ----------------
16
+ import ast
17
+ import json
18
+ import sys
19
+ import faulthandler
20
+ import platform
21
+
22
+ # used for debugging to time steps
23
+ from datetime import datetime
24
+
25
+ # to run the solution files we're using a timing based approach
26
+ import signal
27
+
28
+
29
+ from io import StringIO
30
+
31
+ # used for testing the code that reads from input
32
+ from unittest.mock import patch, mock_open
33
+
34
+ # from pyext import RuntimeModule
35
+ from types import ModuleType
36
+
37
+ from enum import Enum
38
+ from decimal import Decimal
39
+ import time
40
+
41
+ import_string = "from string import *\nfrom re import *\nfrom datetime import *\nfrom collections import *\nfrom heapq import *\nfrom bisect import *\nfrom copy import *\nfrom math import *\nfrom random import *\nfrom statistics import *\nfrom itertools import *\nfrom functools import *\nfrom operator import *\nfrom io import *\nfrom sys import *\nfrom json import *\nfrom builtins import *\nfrom typing import *\nimport string\nimport re\nimport datetime\nimport collections\nimport heapq\nimport bisect\nimport copy\nimport math\nimport random\nimport statistics\nimport itertools\nimport functools\nimport operator\nimport io\nimport sys\nimport json\nsys.setrecursionlimit(50000)\n"
42
+
43
+
44
+ def truncatefn(s, length=300):
45
+ if isinstance(s, str):
46
+ pass
47
+ else:
48
+ s = str(s)
49
+ if len(s) <= length:
50
+ return s
51
+
52
+ return s[: length // 2] + "...(truncated) ..." + s[-length // 2 :]
53
+
54
+
55
+ class CODE_TYPE(Enum):
56
+ call_based = 0
57
+ standard_input = 1
58
+
59
+
60
+ # stuff for setting up signal timer
61
+ class TimeoutException(Exception):
62
+ pass
63
+
64
+
65
+ def timeout_handler(signum, frame):
66
+ print("timeout occured: alarm went off")
67
+ raise TimeoutException
68
+
69
+
70
+ # used to capture stdout as a list
71
+ # from https://stackoverflow.com/a/16571630/6416660
72
+ # alternative use redirect_stdout() from contextlib
73
+ class Capturing(list):
74
+ def __enter__(self):
75
+ self._stdout = sys.stdout
76
+ sys.stdout = self._stringio = StringIO()
77
+ # Make closing the StringIO a no-op
78
+ self._stringio.close = lambda x: 1
79
+ return self
80
+
81
+ def __exit__(self, *args):
82
+ self.append(self._stringio.getvalue())
83
+ del self._stringio # free up some memory
84
+ sys.stdout = self._stdout
85
+
86
+
87
+ # Custom mock for sys.stdin that supports buffer attribute
88
+ class MockStdinWithBuffer:
89
+ def __init__(self, inputs: str):
90
+ self.inputs = inputs
91
+ self._stringio = StringIO(inputs)
92
+ self.buffer = MockBuffer(inputs)
93
+
94
+ def read(self, *args):
95
+ return self.inputs
96
+
97
+ def readline(self, *args):
98
+ return self._stringio.readline(*args)
99
+
100
+ def readlines(self, *args):
101
+ return self.inputs.split("\n")
102
+
103
+ def __getattr__(self, name):
104
+ # Delegate other attributes to StringIO
105
+ return getattr(self._stringio, name)
106
+
107
+
108
+ class MockBuffer:
109
+ def __init__(self, inputs: str):
110
+ self.inputs = inputs.encode("utf-8") # Convert to bytes
111
+
112
+ def read(self, *args):
113
+ # Return as byte strings that can be split
114
+ return self.inputs
115
+
116
+ def readline(self, *args):
117
+ return self.inputs.split(b"\n")[0] + b"\n"
118
+
119
+
120
+ def clean_if_name(code: str) -> str:
121
+ try:
122
+ astree = ast.parse(code)
123
+ last_block = astree.body[-1]
124
+ if isinstance(last_block, ast.If):
125
+ condition = last_block.test
126
+ if ast.unparse(condition).strip() == "__name__ == '__main__'":
127
+ code = (
128
+ ast.unparse(astree.body[:-1]) + "\n" + ast.unparse(last_block.body) # type: ignore
129
+ )
130
+ except:
131
+ pass
132
+
133
+ return code
134
+
135
+
136
+ def make_function(code: str) -> str:
137
+ try:
138
+ import_stmts = []
139
+ all_other_stmts = []
140
+ astree = ast.parse(code)
141
+ for stmt in astree.body:
142
+ if isinstance(stmt, (ast.Import, ast.ImportFrom)):
143
+ import_stmts.append(stmt)
144
+ else:
145
+ all_other_stmts.append(stmt)
146
+
147
+ function_ast = ast.FunctionDef(
148
+ name="wrapped_function",
149
+ args=ast.arguments(
150
+ posonlyargs=[], args=[], kwonlyargs=[], kw_defaults=[], defaults=[]
151
+ ),
152
+ body=all_other_stmts,
153
+ decorator_list=[],
154
+ lineno=-1,
155
+ )
156
+ main_code = (
157
+ import_string
158
+ + "\n"
159
+ + ast.unparse(import_stmts) # type: ignore
160
+ + "\n"
161
+ + ast.unparse(function_ast) # type: ignore
162
+ )
163
+ return main_code
164
+ except Exception as e:
165
+ return code
166
+
167
+
168
+ def call_method(method, inputs):
169
+
170
+ if isinstance(inputs, list):
171
+ inputs = "\n".join(inputs)
172
+
173
+ inputs_line_iterator = iter(inputs.split("\n"))
174
+
175
+ # Create custom stdin mock with buffer support
176
+ mock_stdin = MockStdinWithBuffer(inputs)
177
+
178
+ # sys.setrecursionlimit(10000)
179
+
180
+ # @patch('builtins.input', side_effect=inputs.split("\n"))
181
+ @patch("builtins.open", mock_open(read_data=inputs))
182
+ @patch("sys.stdin", mock_stdin) # Use our custom mock instead of StringIO
183
+ @patch("sys.stdin.readline", lambda *args: next(inputs_line_iterator))
184
+ @patch("sys.stdin.readlines", lambda *args: inputs.split("\n"))
185
+ @patch("sys.stdin.read", lambda *args: inputs)
186
+ # @patch('sys.stdout.write', print)
187
+ def _inner_call_method(_method):
188
+ try:
189
+ return _method()
190
+ except SystemExit as e:
191
+ pass
192
+ finally:
193
+ pass
194
+
195
+ return _inner_call_method(method)
196
+
197
+
198
+ def get_function(compiled_sol, fn_name: str): # type: ignore
199
+ try:
200
+ assert hasattr(compiled_sol, fn_name)
201
+ return getattr(compiled_sol, fn_name)
202
+ except Exception as e:
203
+ return
204
+
205
+
206
+ def compile_code(code: str, timeout: int):
207
+ signal.alarm(timeout)
208
+ try:
209
+ tmp_sol = ModuleType("tmp_sol", "")
210
+ exec(code, tmp_sol.__dict__)
211
+ if "class Solution" in code:
212
+ # leetcode wraps solutions in `Solution`
213
+ # this is a hack to check if it is leetcode solution or not
214
+ # currently livecodebench only supports LeetCode but
215
+ # else condition allows future extensibility to other platforms
216
+ compiled_sol = tmp_sol.Solution()
217
+ else:
218
+ # do nothing in the other case since function is accesible
219
+ compiled_sol = tmp_sol
220
+
221
+ assert compiled_sol is not None
222
+ finally:
223
+ signal.alarm(0)
224
+
225
+ return compiled_sol
226
+
227
+
228
+ def convert_line_to_decimals(line: str) -> tuple[bool, list[Decimal]]:
229
+ try:
230
+ decimal_line = [Decimal(elem) for elem in line.split()]
231
+ except:
232
+ return False, []
233
+ return True, decimal_line
234
+
235
+
236
+ def get_stripped_lines(val: str):
237
+ ## you don't want empty lines to add empty list after splitlines!
238
+ val = val.strip()
239
+
240
+ return [val_line.strip() for val_line in val.split("\n")]
241
+
242
+
243
+ def grade_call_based(
244
+ code: str, all_inputs: list, all_outputs: list, fn_name: str, timeout: int
245
+ ):
246
+ # call-based clean up logic
247
+ # need to wrap in try-catch logic after to catch the correct errors, but for now this is fine.
248
+ code = import_string + "\n\n" + code
249
+ compiled_sol = compile_code(code, timeout)
250
+
251
+ if compiled_sol is None:
252
+ return
253
+
254
+ method = get_function(compiled_sol, fn_name)
255
+
256
+ if method is None:
257
+ return
258
+
259
+ all_inputs = [
260
+ [json.loads(line) for line in inputs.split("\n")] for inputs in all_inputs
261
+ ]
262
+
263
+ all_outputs = [json.loads(output) for output in all_outputs]
264
+
265
+ total_execution = 0
266
+ all_results = []
267
+ for idx, (gt_inp, gt_out) in enumerate(zip(all_inputs, all_outputs)):
268
+ signal.alarm(timeout)
269
+ faulthandler.enable()
270
+ try:
271
+ # can lock here so time is useful
272
+ start = time.time()
273
+ prediction = method(*gt_inp)
274
+ total_execution += time.time() - start
275
+ signal.alarm(0)
276
+
277
+ # don't penalize model if it produces tuples instead of lists
278
+ # ground truth sequences are not tuples
279
+ if isinstance(prediction, tuple):
280
+ prediction = list(prediction)
281
+
282
+ tmp_result = prediction == gt_out
283
+
284
+ # handle floating point comparisons
285
+
286
+ all_results.append(tmp_result)
287
+
288
+ if not tmp_result:
289
+ return all_results, {
290
+ "output": truncatefn(prediction),
291
+ "inputs": truncatefn(gt_inp),
292
+ "expected": truncatefn(gt_out),
293
+ "error_code": -2,
294
+ "error_message": "Wrong Answer",
295
+ }
296
+ except Exception as e:
297
+ signal.alarm(0)
298
+ if "timeoutexception" in repr(e).lower():
299
+ all_results.append(-3)
300
+ return all_results, {
301
+ "error": repr(e),
302
+ "error_code": -3,
303
+ "error_message": "Time Limit Exceeded",
304
+ "inputs": truncatefn(gt_inp),
305
+ "expected": truncatefn(gt_out),
306
+ }
307
+ else:
308
+ all_results.append(-4)
309
+ return all_results, {
310
+ "error": repr(e),
311
+ "error_code": -4,
312
+ "error_message": "Runtime Error",
313
+ "inputs": truncatefn(gt_inp),
314
+ "expected": truncatefn(gt_out),
315
+ }
316
+
317
+ finally:
318
+ signal.alarm(0)
319
+ faulthandler.disable()
320
+
321
+ return all_results, {"execution time": total_execution}
322
+
323
+
324
+ def grade_stdio(
325
+ code: str,
326
+ all_inputs: list,
327
+ all_outputs: list,
328
+ timeout: int,
329
+ ):
330
+ ## runtime doesn't interact well with __name__ == '__main__'
331
+ code = clean_if_name(code)
332
+
333
+ ## we wrap the given code inside another function
334
+ code = make_function(code)
335
+
336
+ compiled_sol = compile_code(code, timeout)
337
+ if compiled_sol is None:
338
+ return
339
+
340
+ method = get_function(compiled_sol, "wrapped_function")
341
+
342
+ if method is None:
343
+ return
344
+
345
+ all_results = []
346
+ total_execution_time = 0
347
+ for idx, (gt_inp, gt_out) in enumerate(zip(all_inputs, all_outputs)):
348
+ signal.alarm(timeout)
349
+ faulthandler.enable()
350
+
351
+ signal.alarm(timeout)
352
+ with Capturing() as captured_output:
353
+ try:
354
+ start = time.time()
355
+ call_method(method, gt_inp)
356
+ total_execution_time += time.time() - start
357
+ # reset the alarm
358
+ signal.alarm(0)
359
+ except Exception as e:
360
+ signal.alarm(0)
361
+ if "timeoutexception" in repr(e).lower():
362
+ all_results.append(-3)
363
+ return all_results, {
364
+ "error": repr(e),
365
+ "error_code": -3,
366
+ "error_message": "Time Limit Exceeded",
367
+ "inputs": truncatefn(gt_inp),
368
+ "expected": truncatefn(gt_out),
369
+ }
370
+ else:
371
+ all_results.append(-4)
372
+ return all_results, {
373
+ "error": repr(e),
374
+ "error_code": -4,
375
+ "error_message": "Runtime Error",
376
+ "inputs": truncatefn(gt_inp),
377
+ "expected": truncatefn(gt_out),
378
+ }
379
+
380
+ finally:
381
+ signal.alarm(0)
382
+ faulthandler.disable()
383
+
384
+ prediction = captured_output[0]
385
+
386
+ stripped_prediction_lines = get_stripped_lines(prediction)
387
+ stripped_gt_out_lines = get_stripped_lines(gt_out)
388
+
389
+ ## WA happens in multiple circumstances
390
+ ## so cache the return to make it clean!
391
+ WA_send_args = {
392
+ "output": truncatefn(prediction),
393
+ "inputs": truncatefn(gt_inp),
394
+ "expected": truncatefn(gt_out),
395
+ "error_code": -2,
396
+ }
397
+
398
+ if len(stripped_prediction_lines) != len(stripped_gt_out_lines):
399
+ all_results.append(-2)
400
+ WA_send_args["error_message"] = "Wrong answer: mismatched output length"
401
+ return all_results, WA_send_args
402
+
403
+ for output_line_idx, (
404
+ stripped_prediction_line,
405
+ stripped_gt_out_line,
406
+ ) in enumerate(zip(stripped_prediction_lines, stripped_gt_out_lines)):
407
+ WA_send_args["error_message"] = (
408
+ f"Wrong answer at {output_line_idx=}: {truncatefn(stripped_prediction_line)} != {truncatefn(stripped_gt_out_line)}"
409
+ )
410
+
411
+ ## CASE 1: exact match
412
+ if stripped_prediction_line == stripped_gt_out_line:
413
+ continue
414
+
415
+ ## CASE 2: element-wise comparision
416
+ ## if there are floating elements
417
+ ## use `decimal` library for good floating point comparision
418
+ ## otherwise gotcha: np.isclose(50000000000000000, 50000000000000001) = True
419
+ ## note that we should always be able to convert to decimals
420
+
421
+ success, decimal_prediction_line = convert_line_to_decimals(
422
+ stripped_prediction_line
423
+ )
424
+ if not success:
425
+ all_results.append(-2)
426
+ return all_results, WA_send_args
427
+ success, decimal_gtout_line = convert_line_to_decimals(stripped_gt_out_line)
428
+ if not success:
429
+ all_results.append(-2)
430
+ return all_results, WA_send_args
431
+
432
+ if decimal_prediction_line == decimal_gtout_line:
433
+ continue
434
+
435
+ all_results.append(-2)
436
+ return all_results, WA_send_args
437
+ all_results.append(True)
438
+
439
+ return all_results, {"execution time": total_execution_time}
440
+
441
+
442
+ def run_test(sample, test=None, debug=False, timeout=6):
443
+ """
444
+ if test(generated_code) is not None it'll try to run the code.
445
+ otherwise it'll just return an input and output pair.
446
+ """
447
+ signal.signal(signal.SIGALRM, timeout_handler)
448
+
449
+ # Disable functionalities that can make destructive changes to the test.
450
+ # max memory is set to 4GB
451
+ reliability_guard()
452
+
453
+ if debug:
454
+ print(f"start = {datetime.now().time()}")
455
+
456
+ try:
457
+ in_outs = json.loads(sample["input_output"])
458
+ except ValueError as e:
459
+ raise e
460
+ in_outs = None
461
+
462
+ if in_outs:
463
+ if in_outs.get("fn_name") is None:
464
+ which_type = CODE_TYPE.standard_input # Standard input
465
+ method_name = None
466
+
467
+ else:
468
+ which_type = CODE_TYPE.call_based # Call-based
469
+ method_name = in_outs["fn_name"]
470
+
471
+ if debug:
472
+ print(f"loaded input_output = {datetime.now().time()}")
473
+
474
+ if test is None:
475
+ assert False, "should not happen: test code is none"
476
+ return in_outs, {"error": "no test code provided"}
477
+ elif test is not None:
478
+ results = []
479
+ sol = import_string
480
+ if debug:
481
+ print(f"loading test code = {datetime.now().time()}")
482
+
483
+ if which_type == CODE_TYPE.call_based:
484
+ signal.alarm(timeout)
485
+ try:
486
+ results, metadata = grade_call_based(
487
+ code=test,
488
+ all_inputs=in_outs["inputs"],
489
+ all_outputs=in_outs["outputs"],
490
+ fn_name=method_name,
491
+ timeout=timeout,
492
+ )
493
+ return results, metadata
494
+ except Exception as e:
495
+ return [-4], {
496
+ "error_code": -4,
497
+ "error_message": f"Error during testing: {e}",
498
+ }
499
+ finally:
500
+ signal.alarm(0)
501
+ elif which_type == CODE_TYPE.standard_input:
502
+ # sol
503
+ # if code has if __name__ == "__main__": then remove it
504
+
505
+ signal.alarm(timeout)
506
+ try:
507
+ results, metadata = grade_stdio(
508
+ code=test,
509
+ all_inputs=in_outs["inputs"],
510
+ all_outputs=in_outs["outputs"],
511
+ timeout=timeout,
512
+ )
513
+ return results, metadata
514
+ except Exception as e:
515
+ return [-4], {
516
+ "error_code": -4,
517
+ "error_message": f"Error during testing: {e}",
518
+ }
519
+ finally:
520
+ signal.alarm(0)
521
+
522
+
523
+ def reliability_guard(maximum_memory_bytes=None):
524
+ """
525
+ This disables various destructive functions and prevents the generated code
526
+ from interfering with the test (e.g. fork bomb, killing other processes,
527
+ removing filesystem files, etc.)
528
+ WARNING
529
+ This function is NOT a security sandbox. Untrusted code, including, model-
530
+ generated code, should not be blindly executed outside of one. See the
531
+ Codex paper for more information about OpenAI's code sandbox, and proceed
532
+ with caution.
533
+ """
534
+
535
+ if maximum_memory_bytes is not None:
536
+ import resource
537
+
538
+ resource.setrlimit(
539
+ resource.RLIMIT_AS, (maximum_memory_bytes, maximum_memory_bytes)
540
+ )
541
+ resource.setrlimit(
542
+ resource.RLIMIT_DATA, (maximum_memory_bytes, maximum_memory_bytes)
543
+ )
544
+ if not platform.uname().system == "Darwin":
545
+ resource.setrlimit(
546
+ resource.RLIMIT_STACK, (maximum_memory_bytes, maximum_memory_bytes)
547
+ )
548
+
549
+ faulthandler.disable()
550
+
551
+ import builtins
552
+
553
+ # builtins.exit = None
554
+ builtins.quit = None
555
+
556
+ import os
557
+
558
+ os.environ["OMP_NUM_THREADS"] = "1"
559
+
560
+ os.kill = None
561
+ os.system = None
562
+ os.putenv = None
563
+ os.remove = None
564
+ os.removedirs = None
565
+ os.rmdir = None
566
+ os.fchdir = None
567
+ os.setuid = None
568
+ os.fork = None
569
+ os.forkpty = None
570
+ os.killpg = None
571
+ os.rename = None
572
+ os.renames = None
573
+ os.truncate = None
574
+ os.replace = None
575
+ os.unlink = None
576
+ os.fchmod = None
577
+ os.fchown = None
578
+ os.chmod = None
579
+ os.chown = None
580
+ os.chroot = None
581
+ os.fchdir = None
582
+ os.lchflags = None
583
+ os.lchmod = None
584
+ os.lchown = None
585
+ os.getcwd = None
586
+ os.chdir = None
587
+
588
+ import shutil
589
+
590
+ shutil.rmtree = None
591
+ shutil.move = None
592
+ shutil.chown = None
593
+
594
+ import subprocess
595
+
596
+ subprocess.Popen = None # type: ignore
597
+
598
+ # run as __main__ (Zevo), __builtins__ is the module, not its dict
599
+ (__builtins__ if isinstance(__builtins__, dict) else __builtins__.__dict__)["help"] = None
600
+
601
+ import sys
602
+
603
+ sys.modules["ipdb"] = None
604
+ sys.modules["joblib"] = None
605
+ sys.modules["resource"] = None
606
+ sys.modules["psutil"] = None
607
+ sys.modules["tkinter"] = None
608
+
609
+ # ---------------- Zevo entry point ----------------
610
+ import base64, csv, multiprocessing, pickle, zlib, os
611
+ from concurrent.futures import ProcessPoolExecutor
612
+
613
+
614
+ def extract_code(output: str) -> str:
615
+ # LCB extract_code for chat/R1 styles: text between the last two ``` lines.
616
+ lines = output.split("\n")
617
+ idx = [i for i, line in enumerate(lines) if "```" in line]
618
+ if len(idx) < 2:
619
+ return ""
620
+ return "\n".join(lines[idx[-2] + 1: idx[-1]])
621
+
622
+
623
+ def decode_tests(row):
624
+ pub = json.loads(row["public_test_cases"])
625
+ priv = row["private_test_cases"]
626
+ try:
627
+ priv = json.loads(priv)
628
+ except Exception:
629
+ priv = json.loads(pickle.loads(zlib.decompress(base64.b64decode(priv.encode("utf-8")))))
630
+ meta = row["metadata"] if isinstance(row["metadata"], dict) else json.loads(row["metadata"] or "{}")
631
+ tests = pub + priv
632
+ return {"input_output": json.dumps({"inputs": [t["input"] for t in tests],
633
+ "outputs": [t["output"] for t in tests],
634
+ "fn_name": meta.get("func_name")})}
635
+
636
+
637
+ def _run(sample, code, result, timeout):
638
+ res, _ = run_test(sample, test=code, debug=False, timeout=timeout)
639
+ result.append(res)
640
+
641
+
642
+ def check(args):
643
+ # LCB check_correctness: run in a child process with a global timeout.
644
+ sample, code, timeout = args
645
+ if not code.strip():
646
+ return False
647
+ manager = multiprocessing.Manager()
648
+ result = manager.list()
649
+ p = multiprocessing.Process(target=_run, args=(sample, code, result, timeout))
650
+ p.start()
651
+ n = len(json.loads(sample["input_output"])["inputs"])
652
+ p.join(timeout=(timeout + 1) * n + 5)
653
+ if p.is_alive():
654
+ p.kill()
655
+ if not result:
656
+ return False
657
+ res = result[0]
658
+ return bool(res) and all(r is True or (not isinstance(r, bool) and r == 1) for r in res)
659
+
660
+
661
+ def load_rows(path):
662
+ ext = os.path.splitext(path)[1].lower()
663
+ if ext == ".parquet":
664
+ import pyarrow.parquet as pq
665
+ return pq.read_table(path).to_pylist()
666
+ if ext == ".jsonl":
667
+ return [json.loads(l) for l in open(path, encoding="utf-8") if l.strip()]
668
+ if ext == ".json":
669
+ d = json.load(open(path, encoding="utf-8"))
670
+ return d if isinstance(d, list) else d.get("data", d.get("rows"))
671
+ csv.field_size_limit(sys.maxsize)
672
+ return list(csv.DictReader(open(path, newline="", encoding="utf-8")))
673
+
674
+
675
+ def main():
676
+ pred_path, set_path, out_path = sys.argv[1:4]
677
+ csv.field_size_limit(sys.maxsize)
678
+ preds = {r["id"]: r.get("prediction") or "" for r in csv.DictReader(open(pred_path, newline="", encoding="utf-8"))}
679
+ rows = load_rows(set_path)
680
+ jobs = [(decode_tests(r), extract_code(preds.get(str(r["id"]), "")), 6) for r in rows]
681
+ workers = int(os.environ.get("LCB_EVAL_WORKERS", min(16, os.cpu_count() or 1)))
682
+ with ProcessPoolExecutor(max_workers=workers) as ex:
683
+ ok = list(ex.map(check, jobs))
684
+ by = {}
685
+ for r, k in zip(rows, ok):
686
+ d = by.setdefault(r.get("difficulty", "all"), [0, 0])
687
+ d[0] += k; d[1] += 1
688
+ total = len(rows); correct = sum(ok)
689
+ out = {"score": correct / total if total else 0.0, "correct": correct, "total": total,
690
+ "missing_predictions": sum(str(r["id"]) not in preds for r in rows),
691
+ "by_difficulty": {k: round(v[0] / v[1], 4) for k, v in by.items()}}
692
+ json.dump(out, open(out_path, "w", encoding="utf-8"))
693
+ print(json.dumps(out))
694
+
695
+
696
+ if __name__ == "__main__":
697
+ main()
cc_valid/sample_submission.csv ADDED
@@ -0,0 +1,352 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ id,prediction
2
+ 1548_C._The_Three_Little_Pigs,"```python
3
+ # solution
4
+ ```"
5
+ 1548_D1._Gregor_and_the_Odd_Cows_Easy,"```python
6
+ # solution
7
+ ```"
8
+ 1548_D2._Gregor_and_the_Odd_Cows_Hard,"```python
9
+ # solution
10
+ ```"
11
+ 1548_E._Gregor_and_the_Two_Painters,"```python
12
+ # solution
13
+ ```"
14
+ 1549_A._Gregor_and_Cryptography,"```python
15
+ # solution
16
+ ```"
17
+ 1549_B._Gregor_and_the_Pawn_Game,"```python
18
+ # solution
19
+ ```"
20
+ 1549_C._Web_of_Lies,"```python
21
+ # solution
22
+ ```"
23
+ 1549_D._Integers_Have_Friends,"```python
24
+ # solution
25
+ ```"
26
+ 1551_A._Polycarp_and_Coins,"```python
27
+ # solution
28
+ ```"
29
+ 1551_B1._Wonderful_Coloring_-_1,"```python
30
+ # solution
31
+ ```"
32
+ 1551_B2._Wonderful_Coloring_-_2,"```python
33
+ # solution
34
+ ```"
35
+ 1551_C._Interesting_Story,"```python
36
+ # solution
37
+ ```"
38
+ 1551_D1._Domino_easy_version,"```python
39
+ # solution
40
+ ```"
41
+ 1551_D2._Domino_hard_version,"```python
42
+ # solution
43
+ ```"
44
+ 1551_E._Fixed_Points,"```python
45
+ # solution
46
+ ```"
47
+ 1551_F._Equidistant_Vertices,"```python
48
+ # solution
49
+ ```"
50
+ 1552_A._Subsequence_Permutation,"```python
51
+ # solution
52
+ ```"
53
+ 1552_B._Running_for_Gold,"```python
54
+ # solution
55
+ ```"
56
+ 1552_C._Maximize_the_Intersections,"```python
57
+ # solution
58
+ ```"
59
+ 1552_D._Array_Differentiation,"```python
60
+ # solution
61
+ ```"
62
+ 1552_E._Colors_and_Intervals,"```python
63
+ # solution
64
+ ```"
65
+ 1552_F._Telepanting,"```python
66
+ # solution
67
+ ```"
68
+ 1552_G._A_Serious_Referee,"```python
69
+ # solution
70
+ ```"
71
+ 1552_I._Organizing_a_Music_Festival,"```python
72
+ # solution
73
+ ```"
74
+ 1553_A._Digits_Sum,"```python
75
+ # solution
76
+ ```"
77
+ 1553_B._Reverse_String,"```python
78
+ # solution
79
+ ```"
80
+ 1553_C._Penalty,"```python
81
+ # solution
82
+ ```"
83
+ 1553_D._Backspace,"```python
84
+ # solution
85
+ ```"
86
+ 1553_E._Permutation_Shift,"```python
87
+ # solution
88
+ ```"
89
+ 1553_F._Pairwise_Modulo,"```python
90
+ # solution
91
+ ```"
92
+ 1553_G._Common_Divisor_Graph,"```python
93
+ # solution
94
+ ```"
95
+ 1553_H._XOR_and_Distance,"```python
96
+ # solution
97
+ ```"
98
+ 1553_I._Stairs,"```python
99
+ # solution
100
+ ```"
101
+ 1554_A._Cherry,"```python
102
+ # solution
103
+ ```"
104
+ 1554_B._Cobb,"```python
105
+ # solution
106
+ ```"
107
+ 1554_C._Mikasa,"```python
108
+ # solution
109
+ ```"
110
+ 1554_D._Diane,"```python
111
+ # solution
112
+ ```"
113
+ 1554_E._You,"```python
114
+ # solution
115
+ ```"
116
+ 1555_A._PizzaForces,"```python
117
+ # solution
118
+ ```"
119
+ 1555_B._Two_Tables,"```python
120
+ # solution
121
+ ```"
122
+ 1555_C._Coin_Rows,"```python
123
+ # solution
124
+ ```"
125
+ 1555_D._Say_No_to_Palindromes,"```python
126
+ # solution
127
+ ```"
128
+ 1555_E._Boring_Segments,"```python
129
+ # solution
130
+ ```"
131
+ 1555_F._Good_Graph,"```python
132
+ # solution
133
+ ```"
134
+ 1556_A._A_Variety_of_Operations,"```python
135
+ # solution
136
+ ```"
137
+ 1556_B._Take_Your_Places,"```python
138
+ # solution
139
+ ```"
140
+ 1556_C._Compressed_Bracket_Sequence,"```python
141
+ # solution
142
+ ```"
143
+ 1556_D._Take_a_Guess,"```python
144
+ # solution
145
+ ```"
146
+ 1556_E._Equilibrium,"```python
147
+ # solution
148
+ ```"
149
+ 1556_F._Sports_Betting,"```python
150
+ # solution
151
+ ```"
152
+ 1556_G._Gates_to_Another_World,"```python
153
+ # solution
154
+ ```"
155
+ 1556_H._DIY_Tree,"```python
156
+ # solution
157
+ ```"
158
+ 1557_A._Ezzat_and_Two_Subsequences,"```python
159
+ # solution
160
+ ```"
161
+ 1557_B._Moamen_and_k-subarrays,"```python
162
+ # solution
163
+ ```"
164
+ 1557_C._Moamen_and_XOR,"```python
165
+ # solution
166
+ ```"
167
+ 1557_D._Ezzat_and_Grid,"```python
168
+ # solution
169
+ ```"
170
+ 1557_E._Assiut_Chess,"```python
171
+ # solution
172
+ ```"
173
+ 1558_C._Bottom-Tier_Reversals,"```python
174
+ # solution
175
+ ```"
176
+ 1558_D._Top-Notch_Insertions,"```python
177
+ # solution
178
+ ```"
179
+ 1558_E._Down_Below,"```python
180
+ # solution
181
+ ```"
182
+ 1559_A._Mocha_and_Math,"```python
183
+ # solution
184
+ ```"
185
+ 1559_B._Mocha_and_Red_and_Blue,"```python
186
+ # solution
187
+ ```"
188
+ 1559_C._Mocha_and_Hiking,"```python
189
+ # solution
190
+ ```"
191
+ 1559_D1._Mocha_and_Diana_Easy_Version,"```python
192
+ # solution
193
+ ```"
194
+ 1559_D2._Mocha_and_Diana_Hard_Version,"```python
195
+ # solution
196
+ ```"
197
+ 1559_E._Mocha_and_Stars,"```python
198
+ # solution
199
+ ```"
200
+ 1560_A._Dislike_of_Threes,"```python
201
+ # solution
202
+ ```"
203
+ 1560_B._Who_s_Opposite,"```python
204
+ # solution
205
+ ```"
206
+ 1560_C._Infinity_Table,"```python
207
+ # solution
208
+ ```"
209
+ 1560_D._Make_a_Power_of_Two,"```python
210
+ # solution
211
+ ```"
212
+ 1560_E._Polycarp_and_String_Transformation,"```python
213
+ # solution
214
+ ```"
215
+ 1560_F1._Nearest_Beautiful_Number_easy_version,"```python
216
+ # solution
217
+ ```"
218
+ 1560_F2._Nearest_Beautiful_Number_hard_version,"```python
219
+ # solution
220
+ ```"
221
+ 1561_A._Simply_Strange_Sort,"```python
222
+ # solution
223
+ ```"
224
+ 1561_B._Charmed_by_the_Game,"```python
225
+ # solution
226
+ ```"
227
+ 1561_C._Deep_Down_Below,"```python
228
+ # solution
229
+ ```"
230
+ 1561_D1._Up_the_Strip_simplified_version,"```python
231
+ # solution
232
+ ```"
233
+ 1561_D2._Up_the_Strip,"```python
234
+ # solution
235
+ ```"
236
+ 1562_A._The_Miracle_and_the_Sleeper,"```python
237
+ # solution
238
+ ```"
239
+ 1562_B._Scenes_From_a_Memory,"```python
240
+ # solution
241
+ ```"
242
+ 1562_C._Rings,"```python
243
+ # solution
244
+ ```"
245
+ 1562_D1._Two_Hundred_Twenty_One_easy_version,"```python
246
+ # solution
247
+ ```"
248
+ 1562_D2._Two_Hundred_Twenty_One_hard_version,"```python
249
+ # solution
250
+ ```"
251
+ 1562_E._Rescue_Niwen,"```python
252
+ # solution
253
+ ```"
254
+ 1566_A._Median_Maximization,"```python
255
+ # solution
256
+ ```"
257
+ 1566_B._MIN-MEX_Cut,"```python
258
+ # solution
259
+ ```"
260
+ 1566_C._MAX-MEX_Cut,"```python
261
+ # solution
262
+ ```"
263
+ 1566_D1._Seating_Arrangements_easy_version,"```python
264
+ # solution
265
+ ```"
266
+ 1566_D2._Seating_Arrangements_hard_version,"```python
267
+ # solution
268
+ ```"
269
+ 1566_E._Buds_Re-hanging,"```python
270
+ # solution
271
+ ```"
272
+ 1566_F._Points_Movement,"```python
273
+ # solution
274
+ ```"
275
+ 1566_G._Four_Vertices,"```python
276
+ # solution
277
+ ```"
278
+ 1566_H._Xor-quiz,"```python
279
+ # solution
280
+ ```"
281
+ 1567_B._MEXor_Mixup,"```python
282
+ # solution
283
+ ```"
284
+ 1567_C._Carrying_Conundrum,"```python
285
+ # solution
286
+ ```"
287
+ 1567_D._Expression_Evaluation_Error,"```python
288
+ # solution
289
+ ```"
290
+ 1567_E._Non-Decreasing_Dilemma,"```python
291
+ # solution
292
+ ```"
293
+ 1567_F._One-Four_Overload,"```python
294
+ # solution
295
+ ```"
296
+ 1569_A._Balanced_Substring,"```python
297
+ # solution
298
+ ```"
299
+ 1569_B._Chess_Tournament,"```python
300
+ # solution
301
+ ```"
302
+ 1569_C._Jury_Meeting,"```python
303
+ # solution
304
+ ```"
305
+ 1569_D._Inconvenient_Pairs,"```python
306
+ # solution
307
+ ```"
308
+ 1569_E._Playoff_Restoration,"```python
309
+ # solution
310
+ ```"
311
+ 1569_F._Palindromic_Hamiltonian_Path,"```python
312
+ # solution
313
+ ```"
314
+ 1572_B._Xor_of_3,"```python
315
+ # solution
316
+ ```"
317
+ 1572_C._Paint,"```python
318
+ # solution
319
+ ```"
320
+ 1572_D._Bridge_Club,"```python
321
+ # solution
322
+ ```"
323
+ 1572_E._Polygon,"```python
324
+ # solution
325
+ ```"
326
+ 1572_F._Stations,"```python
327
+ # solution
328
+ ```"
329
+ 1573_A._Countdown,"```python
330
+ # solution
331
+ ```"
332
+ 1573_C._Book,"```python
333
+ # solution
334
+ ```"
335
+ 1574_A._Regular_Bracket_Sequences,"```python
336
+ # solution
337
+ ```"
338
+ 1574_B._Combinatorics_Homework,"```python
339
+ # solution
340
+ ```"
341
+ 1574_C._Slay_the_Dragon,"```python
342
+ # solution
343
+ ```"
344
+ 1574_D._The_Strongest_Build,"```python
345
+ # solution
346
+ ```"
347
+ 1574_E._Coloring,"```python
348
+ # solution
349
+ ```"
350
+ 1574_F._Occurrences,"```python
351
+ # solution
352
+ ```"
cc_valid/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:92cc93ed23ca9635a84bbdd5ee66025010df30a3fe88f5edd83477733fd9acbe
3
+ size 234595
codeforces/evaluator.py ADDED
@@ -0,0 +1,689 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Zevo custom evaluator for DeepCoder Codeforces val (408), pass@1.
3
+
4
+ Hub: Tommysha/zero-code-l1-val config codeforces split validation.
5
+ Rows: id, problem, tests (JSON list of {input, output} stdin cases).
6
+
7
+ Usage: python3 evaluator.py PREDICTIONS_CSV SCORING_SET METRICS_JSON
8
+ Stdlib only (pyarrow only if SCORING_SET is parquet). Timeout 6 s per test.
9
+ """
10
+ # ---------------- vendored: lcb_runner/evaluation/testing_util.py @ 28fef95 ----------------
11
+ import ast
12
+ import json
13
+ import sys
14
+ import faulthandler
15
+ import platform
16
+
17
+ # used for debugging to time steps
18
+ from datetime import datetime
19
+
20
+ # to run the solution files we're using a timing based approach
21
+ import signal
22
+
23
+
24
+ from io import StringIO
25
+
26
+ # used for testing the code that reads from input
27
+ from unittest.mock import patch, mock_open
28
+
29
+ # from pyext import RuntimeModule
30
+ from types import ModuleType
31
+
32
+ from enum import Enum
33
+ from decimal import Decimal
34
+ import time
35
+
36
+ import_string = "from string import *\nfrom re import *\nfrom datetime import *\nfrom collections import *\nfrom heapq import *\nfrom bisect import *\nfrom copy import *\nfrom math import *\nfrom random import *\nfrom statistics import *\nfrom itertools import *\nfrom functools import *\nfrom operator import *\nfrom io import *\nfrom sys import *\nfrom json import *\nfrom builtins import *\nfrom typing import *\nimport string\nimport re\nimport datetime\nimport collections\nimport heapq\nimport bisect\nimport copy\nimport math\nimport random\nimport statistics\nimport itertools\nimport functools\nimport operator\nimport io\nimport sys\nimport json\nsys.setrecursionlimit(50000)\n"
37
+
38
+
39
+ def truncatefn(s, length=300):
40
+ if isinstance(s, str):
41
+ pass
42
+ else:
43
+ s = str(s)
44
+ if len(s) <= length:
45
+ return s
46
+
47
+ return s[: length // 2] + "...(truncated) ..." + s[-length // 2 :]
48
+
49
+
50
+ class CODE_TYPE(Enum):
51
+ call_based = 0
52
+ standard_input = 1
53
+
54
+
55
+ # stuff for setting up signal timer
56
+ class TimeoutException(Exception):
57
+ pass
58
+
59
+
60
+ def timeout_handler(signum, frame):
61
+ print("timeout occured: alarm went off")
62
+ raise TimeoutException
63
+
64
+
65
+ # used to capture stdout as a list
66
+ # from https://stackoverflow.com/a/16571630/6416660
67
+ # alternative use redirect_stdout() from contextlib
68
+ class Capturing(list):
69
+ def __enter__(self):
70
+ self._stdout = sys.stdout
71
+ sys.stdout = self._stringio = StringIO()
72
+ # Make closing the StringIO a no-op
73
+ self._stringio.close = lambda x: 1
74
+ return self
75
+
76
+ def __exit__(self, *args):
77
+ self.append(self._stringio.getvalue())
78
+ del self._stringio # free up some memory
79
+ sys.stdout = self._stdout
80
+
81
+
82
+ # Custom mock for sys.stdin that supports buffer attribute
83
+ class MockStdinWithBuffer:
84
+ def __init__(self, inputs: str):
85
+ self.inputs = inputs
86
+ self._stringio = StringIO(inputs)
87
+ self.buffer = MockBuffer(inputs)
88
+
89
+ def read(self, *args):
90
+ return self.inputs
91
+
92
+ def readline(self, *args):
93
+ return self._stringio.readline(*args)
94
+
95
+ def readlines(self, *args):
96
+ return self.inputs.split("\n")
97
+
98
+ def __getattr__(self, name):
99
+ # Delegate other attributes to StringIO
100
+ return getattr(self._stringio, name)
101
+
102
+
103
+ class MockBuffer:
104
+ def __init__(self, inputs: str):
105
+ self.inputs = inputs.encode("utf-8") # Convert to bytes
106
+
107
+ def read(self, *args):
108
+ # Return as byte strings that can be split
109
+ return self.inputs
110
+
111
+ def readline(self, *args):
112
+ return self.inputs.split(b"\n")[0] + b"\n"
113
+
114
+
115
+ def clean_if_name(code: str) -> str:
116
+ try:
117
+ astree = ast.parse(code)
118
+ last_block = astree.body[-1]
119
+ if isinstance(last_block, ast.If):
120
+ condition = last_block.test
121
+ if ast.unparse(condition).strip() == "__name__ == '__main__'":
122
+ code = (
123
+ ast.unparse(astree.body[:-1]) + "\n" + ast.unparse(last_block.body) # type: ignore
124
+ )
125
+ except:
126
+ pass
127
+
128
+ return code
129
+
130
+
131
+ def make_function(code: str) -> str:
132
+ try:
133
+ import_stmts = []
134
+ all_other_stmts = []
135
+ astree = ast.parse(code)
136
+ for stmt in astree.body:
137
+ if isinstance(stmt, (ast.Import, ast.ImportFrom)):
138
+ import_stmts.append(stmt)
139
+ else:
140
+ all_other_stmts.append(stmt)
141
+
142
+ function_ast = ast.FunctionDef(
143
+ name="wrapped_function",
144
+ args=ast.arguments(
145
+ posonlyargs=[], args=[], kwonlyargs=[], kw_defaults=[], defaults=[]
146
+ ),
147
+ body=all_other_stmts,
148
+ decorator_list=[],
149
+ lineno=-1,
150
+ )
151
+ main_code = (
152
+ import_string
153
+ + "\n"
154
+ + ast.unparse(import_stmts) # type: ignore
155
+ + "\n"
156
+ + ast.unparse(function_ast) # type: ignore
157
+ )
158
+ return main_code
159
+ except Exception as e:
160
+ return code
161
+
162
+
163
+ def call_method(method, inputs):
164
+
165
+ if isinstance(inputs, list):
166
+ inputs = "\n".join(inputs)
167
+
168
+ inputs_line_iterator = iter(inputs.split("\n"))
169
+
170
+ # Create custom stdin mock with buffer support
171
+ mock_stdin = MockStdinWithBuffer(inputs)
172
+
173
+ # sys.setrecursionlimit(10000)
174
+
175
+ # @patch('builtins.input', side_effect=inputs.split("\n"))
176
+ @patch("builtins.open", mock_open(read_data=inputs))
177
+ @patch("sys.stdin", mock_stdin) # Use our custom mock instead of StringIO
178
+ @patch("sys.stdin.readline", lambda *args: next(inputs_line_iterator))
179
+ @patch("sys.stdin.readlines", lambda *args: inputs.split("\n"))
180
+ @patch("sys.stdin.read", lambda *args: inputs)
181
+ # @patch('sys.stdout.write', print)
182
+ def _inner_call_method(_method):
183
+ try:
184
+ return _method()
185
+ except SystemExit as e:
186
+ pass
187
+ finally:
188
+ pass
189
+
190
+ return _inner_call_method(method)
191
+
192
+
193
+ def get_function(compiled_sol, fn_name: str): # type: ignore
194
+ try:
195
+ assert hasattr(compiled_sol, fn_name)
196
+ return getattr(compiled_sol, fn_name)
197
+ except Exception as e:
198
+ return
199
+
200
+
201
+ def compile_code(code: str, timeout: int):
202
+ signal.alarm(timeout)
203
+ try:
204
+ tmp_sol = ModuleType("tmp_sol", "")
205
+ exec(code, tmp_sol.__dict__)
206
+ if "class Solution" in code:
207
+ # leetcode wraps solutions in `Solution`
208
+ # this is a hack to check if it is leetcode solution or not
209
+ # currently livecodebench only supports LeetCode but
210
+ # else condition allows future extensibility to other platforms
211
+ compiled_sol = tmp_sol.Solution()
212
+ else:
213
+ # do nothing in the other case since function is accesible
214
+ compiled_sol = tmp_sol
215
+
216
+ assert compiled_sol is not None
217
+ finally:
218
+ signal.alarm(0)
219
+
220
+ return compiled_sol
221
+
222
+
223
+ def convert_line_to_decimals(line: str) -> tuple[bool, list[Decimal]]:
224
+ try:
225
+ decimal_line = [Decimal(elem) for elem in line.split()]
226
+ except:
227
+ return False, []
228
+ return True, decimal_line
229
+
230
+
231
+ def get_stripped_lines(val: str):
232
+ ## you don't want empty lines to add empty list after splitlines!
233
+ val = val.strip()
234
+
235
+ return [val_line.strip() for val_line in val.split("\n")]
236
+
237
+
238
+ def grade_call_based(
239
+ code: str, all_inputs: list, all_outputs: list, fn_name: str, timeout: int
240
+ ):
241
+ # call-based clean up logic
242
+ # need to wrap in try-catch logic after to catch the correct errors, but for now this is fine.
243
+ code = import_string + "\n\n" + code
244
+ compiled_sol = compile_code(code, timeout)
245
+
246
+ if compiled_sol is None:
247
+ return
248
+
249
+ method = get_function(compiled_sol, fn_name)
250
+
251
+ if method is None:
252
+ return
253
+
254
+ all_inputs = [
255
+ [json.loads(line) for line in inputs.split("\n")] for inputs in all_inputs
256
+ ]
257
+
258
+ all_outputs = [json.loads(output) for output in all_outputs]
259
+
260
+ total_execution = 0
261
+ all_results = []
262
+ for idx, (gt_inp, gt_out) in enumerate(zip(all_inputs, all_outputs)):
263
+ signal.alarm(timeout)
264
+ faulthandler.enable()
265
+ try:
266
+ # can lock here so time is useful
267
+ start = time.time()
268
+ prediction = method(*gt_inp)
269
+ total_execution += time.time() - start
270
+ signal.alarm(0)
271
+
272
+ # don't penalize model if it produces tuples instead of lists
273
+ # ground truth sequences are not tuples
274
+ if isinstance(prediction, tuple):
275
+ prediction = list(prediction)
276
+
277
+ tmp_result = prediction == gt_out
278
+
279
+ # handle floating point comparisons
280
+
281
+ all_results.append(tmp_result)
282
+
283
+ if not tmp_result:
284
+ return all_results, {
285
+ "output": truncatefn(prediction),
286
+ "inputs": truncatefn(gt_inp),
287
+ "expected": truncatefn(gt_out),
288
+ "error_code": -2,
289
+ "error_message": "Wrong Answer",
290
+ }
291
+ except Exception as e:
292
+ signal.alarm(0)
293
+ if "timeoutexception" in repr(e).lower():
294
+ all_results.append(-3)
295
+ return all_results, {
296
+ "error": repr(e),
297
+ "error_code": -3,
298
+ "error_message": "Time Limit Exceeded",
299
+ "inputs": truncatefn(gt_inp),
300
+ "expected": truncatefn(gt_out),
301
+ }
302
+ else:
303
+ all_results.append(-4)
304
+ return all_results, {
305
+ "error": repr(e),
306
+ "error_code": -4,
307
+ "error_message": "Runtime Error",
308
+ "inputs": truncatefn(gt_inp),
309
+ "expected": truncatefn(gt_out),
310
+ }
311
+
312
+ finally:
313
+ signal.alarm(0)
314
+ faulthandler.disable()
315
+
316
+ return all_results, {"execution time": total_execution}
317
+
318
+
319
+ def grade_stdio(
320
+ code: str,
321
+ all_inputs: list,
322
+ all_outputs: list,
323
+ timeout: int,
324
+ ):
325
+ ## runtime doesn't interact well with __name__ == '__main__'
326
+ code = clean_if_name(code)
327
+
328
+ ## we wrap the given code inside another function
329
+ code = make_function(code)
330
+
331
+ compiled_sol = compile_code(code, timeout)
332
+ if compiled_sol is None:
333
+ return
334
+
335
+ method = get_function(compiled_sol, "wrapped_function")
336
+
337
+ if method is None:
338
+ return
339
+
340
+ all_results = []
341
+ total_execution_time = 0
342
+ for idx, (gt_inp, gt_out) in enumerate(zip(all_inputs, all_outputs)):
343
+ signal.alarm(timeout)
344
+ faulthandler.enable()
345
+
346
+ signal.alarm(timeout)
347
+ with Capturing() as captured_output:
348
+ try:
349
+ start = time.time()
350
+ call_method(method, gt_inp)
351
+ total_execution_time += time.time() - start
352
+ # reset the alarm
353
+ signal.alarm(0)
354
+ except Exception as e:
355
+ signal.alarm(0)
356
+ if "timeoutexception" in repr(e).lower():
357
+ all_results.append(-3)
358
+ return all_results, {
359
+ "error": repr(e),
360
+ "error_code": -3,
361
+ "error_message": "Time Limit Exceeded",
362
+ "inputs": truncatefn(gt_inp),
363
+ "expected": truncatefn(gt_out),
364
+ }
365
+ else:
366
+ all_results.append(-4)
367
+ return all_results, {
368
+ "error": repr(e),
369
+ "error_code": -4,
370
+ "error_message": "Runtime Error",
371
+ "inputs": truncatefn(gt_inp),
372
+ "expected": truncatefn(gt_out),
373
+ }
374
+
375
+ finally:
376
+ signal.alarm(0)
377
+ faulthandler.disable()
378
+
379
+ prediction = captured_output[0]
380
+
381
+ stripped_prediction_lines = get_stripped_lines(prediction)
382
+ stripped_gt_out_lines = get_stripped_lines(gt_out)
383
+
384
+ ## WA happens in multiple circumstances
385
+ ## so cache the return to make it clean!
386
+ WA_send_args = {
387
+ "output": truncatefn(prediction),
388
+ "inputs": truncatefn(gt_inp),
389
+ "expected": truncatefn(gt_out),
390
+ "error_code": -2,
391
+ }
392
+
393
+ if len(stripped_prediction_lines) != len(stripped_gt_out_lines):
394
+ all_results.append(-2)
395
+ WA_send_args["error_message"] = "Wrong answer: mismatched output length"
396
+ return all_results, WA_send_args
397
+
398
+ for output_line_idx, (
399
+ stripped_prediction_line,
400
+ stripped_gt_out_line,
401
+ ) in enumerate(zip(stripped_prediction_lines, stripped_gt_out_lines)):
402
+ WA_send_args["error_message"] = (
403
+ f"Wrong answer at {output_line_idx=}: {truncatefn(stripped_prediction_line)} != {truncatefn(stripped_gt_out_line)}"
404
+ )
405
+
406
+ ## CASE 1: exact match
407
+ if stripped_prediction_line == stripped_gt_out_line:
408
+ continue
409
+
410
+ ## CASE 2: element-wise comparision
411
+ ## if there are floating elements
412
+ ## use `decimal` library for good floating point comparision
413
+ ## otherwise gotcha: np.isclose(50000000000000000, 50000000000000001) = True
414
+ ## note that we should always be able to convert to decimals
415
+
416
+ success, decimal_prediction_line = convert_line_to_decimals(
417
+ stripped_prediction_line
418
+ )
419
+ if not success:
420
+ all_results.append(-2)
421
+ return all_results, WA_send_args
422
+ success, decimal_gtout_line = convert_line_to_decimals(stripped_gt_out_line)
423
+ if not success:
424
+ all_results.append(-2)
425
+ return all_results, WA_send_args
426
+
427
+ if decimal_prediction_line == decimal_gtout_line:
428
+ continue
429
+
430
+ all_results.append(-2)
431
+ return all_results, WA_send_args
432
+ all_results.append(True)
433
+
434
+ return all_results, {"execution time": total_execution_time}
435
+
436
+
437
+ def run_test(sample, test=None, debug=False, timeout=6):
438
+ """
439
+ if test(generated_code) is not None it'll try to run the code.
440
+ otherwise it'll just return an input and output pair.
441
+ """
442
+ signal.signal(signal.SIGALRM, timeout_handler)
443
+
444
+ # Disable functionalities that can make destructive changes to the test.
445
+ # max memory is set to 4GB
446
+ reliability_guard()
447
+
448
+ if debug:
449
+ print(f"start = {datetime.now().time()}")
450
+
451
+ try:
452
+ in_outs = json.loads(sample["input_output"])
453
+ except ValueError as e:
454
+ raise e
455
+ in_outs = None
456
+
457
+ if in_outs:
458
+ if in_outs.get("fn_name") is None:
459
+ which_type = CODE_TYPE.standard_input # Standard input
460
+ method_name = None
461
+
462
+ else:
463
+ which_type = CODE_TYPE.call_based # Call-based
464
+ method_name = in_outs["fn_name"]
465
+
466
+ if debug:
467
+ print(f"loaded input_output = {datetime.now().time()}")
468
+
469
+ if test is None:
470
+ assert False, "should not happen: test code is none"
471
+ return in_outs, {"error": "no test code provided"}
472
+ elif test is not None:
473
+ results = []
474
+ sol = import_string
475
+ if debug:
476
+ print(f"loading test code = {datetime.now().time()}")
477
+
478
+ if which_type == CODE_TYPE.call_based:
479
+ signal.alarm(timeout)
480
+ try:
481
+ results, metadata = grade_call_based(
482
+ code=test,
483
+ all_inputs=in_outs["inputs"],
484
+ all_outputs=in_outs["outputs"],
485
+ fn_name=method_name,
486
+ timeout=timeout,
487
+ )
488
+ return results, metadata
489
+ except Exception as e:
490
+ return [-4], {
491
+ "error_code": -4,
492
+ "error_message": f"Error during testing: {e}",
493
+ }
494
+ finally:
495
+ signal.alarm(0)
496
+ elif which_type == CODE_TYPE.standard_input:
497
+ # sol
498
+ # if code has if __name__ == "__main__": then remove it
499
+
500
+ signal.alarm(timeout)
501
+ try:
502
+ results, metadata = grade_stdio(
503
+ code=test,
504
+ all_inputs=in_outs["inputs"],
505
+ all_outputs=in_outs["outputs"],
506
+ timeout=timeout,
507
+ )
508
+ return results, metadata
509
+ except Exception as e:
510
+ return [-4], {
511
+ "error_code": -4,
512
+ "error_message": f"Error during testing: {e}",
513
+ }
514
+ finally:
515
+ signal.alarm(0)
516
+
517
+
518
+ def reliability_guard(maximum_memory_bytes=None):
519
+ """
520
+ This disables various destructive functions and prevents the generated code
521
+ from interfering with the test (e.g. fork bomb, killing other processes,
522
+ removing filesystem files, etc.)
523
+ WARNING
524
+ This function is NOT a security sandbox. Untrusted code, including, model-
525
+ generated code, should not be blindly executed outside of one. See the
526
+ Codex paper for more information about OpenAI's code sandbox, and proceed
527
+ with caution.
528
+ """
529
+
530
+ if maximum_memory_bytes is not None:
531
+ import resource
532
+
533
+ resource.setrlimit(
534
+ resource.RLIMIT_AS, (maximum_memory_bytes, maximum_memory_bytes)
535
+ )
536
+ resource.setrlimit(
537
+ resource.RLIMIT_DATA, (maximum_memory_bytes, maximum_memory_bytes)
538
+ )
539
+ if not platform.uname().system == "Darwin":
540
+ resource.setrlimit(
541
+ resource.RLIMIT_STACK, (maximum_memory_bytes, maximum_memory_bytes)
542
+ )
543
+
544
+ faulthandler.disable()
545
+
546
+ import builtins
547
+
548
+ # builtins.exit = None
549
+ builtins.quit = None
550
+
551
+ import os
552
+
553
+ os.environ["OMP_NUM_THREADS"] = "1"
554
+
555
+ os.kill = None
556
+ os.system = None
557
+ os.putenv = None
558
+ os.remove = None
559
+ os.removedirs = None
560
+ os.rmdir = None
561
+ os.fchdir = None
562
+ os.setuid = None
563
+ os.fork = None
564
+ os.forkpty = None
565
+ os.killpg = None
566
+ os.rename = None
567
+ os.renames = None
568
+ os.truncate = None
569
+ os.replace = None
570
+ os.unlink = None
571
+ os.fchmod = None
572
+ os.fchown = None
573
+ os.chmod = None
574
+ os.chown = None
575
+ os.chroot = None
576
+ os.fchdir = None
577
+ os.lchflags = None
578
+ os.lchmod = None
579
+ os.lchown = None
580
+ os.getcwd = None
581
+ os.chdir = None
582
+
583
+ import shutil
584
+
585
+ shutil.rmtree = None
586
+ shutil.move = None
587
+ shutil.chown = None
588
+
589
+ import subprocess
590
+
591
+ subprocess.Popen = None # type: ignore
592
+
593
+ # run as __main__ (Zevo), __builtins__ is the module, not its dict
594
+ (__builtins__ if isinstance(__builtins__, dict) else __builtins__.__dict__)["help"] = None
595
+
596
+ import sys
597
+
598
+ sys.modules["ipdb"] = None
599
+ sys.modules["joblib"] = None
600
+ sys.modules["resource"] = None
601
+ sys.modules["psutil"] = None
602
+ sys.modules["tkinter"] = None
603
+
604
+ # ---------------- Zevo entry point ----------------
605
+ import base64, csv, multiprocessing, pickle, zlib, os
606
+ from concurrent.futures import ProcessPoolExecutor
607
+
608
+
609
+ def extract_code(output: str) -> str:
610
+ lines = output.split("\n")
611
+ idx = [i for i, line in enumerate(lines) if "```" in line]
612
+ if len(idx) >= 2:
613
+ return "\n".join(lines[idx[-2] + 1: idx[-1]])
614
+ return (output or "").strip()
615
+
616
+
617
+ def decode_tests(row):
618
+ ts = row["tests"]
619
+ if isinstance(ts, str):
620
+ ts = json.loads(ts)
621
+ ts = ts or []
622
+ return {"input_output": json.dumps({
623
+ "inputs": [t.get("input", "") for t in ts],
624
+ "outputs": [t.get("output", "") for t in ts],
625
+ "fn_name": None,
626
+ })}
627
+
628
+
629
+ def _run(sample, code, result, timeout):
630
+ res, _ = run_test(sample, test=code, debug=False, timeout=timeout)
631
+ result.append(res)
632
+
633
+
634
+ def check(args):
635
+ # LCB check_correctness: run in a child process with a global timeout.
636
+ sample, code, timeout = args
637
+ if not code.strip():
638
+ return False
639
+ manager = multiprocessing.Manager()
640
+ result = manager.list()
641
+ p = multiprocessing.Process(target=_run, args=(sample, code, result, timeout))
642
+ p.start()
643
+ n = len(json.loads(sample["input_output"])["inputs"])
644
+ p.join(timeout=(timeout + 1) * n + 5)
645
+ if p.is_alive():
646
+ p.kill()
647
+ if not result:
648
+ return False
649
+ res = result[0]
650
+ return bool(res) and all(r is True or (not isinstance(r, bool) and r == 1) for r in res)
651
+
652
+
653
+ def load_rows(path):
654
+ ext = os.path.splitext(path)[1].lower()
655
+ if ext == ".parquet":
656
+ import pyarrow.parquet as pq
657
+ return pq.read_table(path).to_pylist()
658
+ if ext == ".jsonl":
659
+ return [json.loads(l) for l in open(path, encoding="utf-8") if l.strip()]
660
+ if ext == ".json":
661
+ d = json.load(open(path, encoding="utf-8"))
662
+ return d if isinstance(d, list) else d.get("data", d.get("rows"))
663
+ csv.field_size_limit(sys.maxsize)
664
+ return list(csv.DictReader(open(path, newline="", encoding="utf-8")))
665
+
666
+
667
+ def main():
668
+ pred_path, set_path, out_path = sys.argv[1:4]
669
+ csv.field_size_limit(sys.maxsize)
670
+ preds = {r["id"]: r.get("prediction") or "" for r in csv.DictReader(open(pred_path, newline="", encoding="utf-8"))}
671
+ rows = load_rows(set_path)
672
+ jobs = [(decode_tests(r), extract_code(preds.get(str(r["id"]), "")), 6) for r in rows]
673
+ workers = int(os.environ.get("LCB_EVAL_WORKERS", min(16, os.cpu_count() or 1)))
674
+ with ProcessPoolExecutor(max_workers=workers) as ex:
675
+ ok = list(ex.map(check, jobs))
676
+ by = {}
677
+ for r, k in zip(rows, ok):
678
+ d = by.setdefault(r.get("difficulty", "all"), [0, 0])
679
+ d[0] += k; d[1] += 1
680
+ total = len(rows); correct = sum(ok)
681
+ out = {"score": correct / total if total else 0.0, "correct": correct, "total": total,
682
+ "missing_predictions": sum(str(r["id"]) not in preds for r in rows),
683
+ "by_difficulty": {k: round(v[0] / v[1], 4) for k, v in by.items()}}
684
+ json.dump(out, open(out_path, "w", encoding="utf-8"))
685
+ print(json.dumps(out))
686
+
687
+
688
+ if __name__ == "__main__":
689
+ main()
codeforces/sample_submission.csv ADDED
@@ -0,0 +1,1225 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ id,prediction
2
+ cf-7523ff0de46ffb62,"```python
3
+ # solution
4
+ ```"
5
+ cf-c02443ec23f88353,"```python
6
+ # solution
7
+ ```"
8
+ cf-7ac66687aa5eab54,"```python
9
+ # solution
10
+ ```"
11
+ cf-e76762ee2f865346,"```python
12
+ # solution
13
+ ```"
14
+ cf-8a7b37d147fff9f2,"```python
15
+ # solution
16
+ ```"
17
+ cf-d64ea36c259258bd,"```python
18
+ # solution
19
+ ```"
20
+ cf-71cdab7c3ed2a9e3,"```python
21
+ # solution
22
+ ```"
23
+ cf-d5bc0040e507c601,"```python
24
+ # solution
25
+ ```"
26
+ cf-c9dc2fe6951af63c,"```python
27
+ # solution
28
+ ```"
29
+ cf-f022f97a83aecd81,"```python
30
+ # solution
31
+ ```"
32
+ cf-03989708ba80f434,"```python
33
+ # solution
34
+ ```"
35
+ cf-6b96f12da81e3aa6,"```python
36
+ # solution
37
+ ```"
38
+ cf-27257141f88d7919,"```python
39
+ # solution
40
+ ```"
41
+ cf-0c54c4db17b4a002,"```python
42
+ # solution
43
+ ```"
44
+ cf-d269d3c95353659a,"```python
45
+ # solution
46
+ ```"
47
+ cf-2846ab5c0f8efc0a,"```python
48
+ # solution
49
+ ```"
50
+ cf-7ae26c5706fd4fd1,"```python
51
+ # solution
52
+ ```"
53
+ cf-3a92d2c8dbf1ac59,"```python
54
+ # solution
55
+ ```"
56
+ cf-d894a01fb8ac77eb,"```python
57
+ # solution
58
+ ```"
59
+ cf-6d4279adcb1fad9f,"```python
60
+ # solution
61
+ ```"
62
+ cf-d0e6b6fcda95bed7,"```python
63
+ # solution
64
+ ```"
65
+ cf-aa9efedb39810f70,"```python
66
+ # solution
67
+ ```"
68
+ cf-2900b66654b363c3,"```python
69
+ # solution
70
+ ```"
71
+ cf-d3d645b73b59c21d,"```python
72
+ # solution
73
+ ```"
74
+ cf-5500d3fcb5e5722a,"```python
75
+ # solution
76
+ ```"
77
+ cf-1aa2747d93916bb1,"```python
78
+ # solution
79
+ ```"
80
+ cf-faae40af5e76d60b,"```python
81
+ # solution
82
+ ```"
83
+ cf-5bdc7b104350f60f,"```python
84
+ # solution
85
+ ```"
86
+ cf-4dcb5afc4dd0896d,"```python
87
+ # solution
88
+ ```"
89
+ cf-eb141c5086038eac,"```python
90
+ # solution
91
+ ```"
92
+ cf-56bd4e1044a4fc5a,"```python
93
+ # solution
94
+ ```"
95
+ cf-241362537a821837,"```python
96
+ # solution
97
+ ```"
98
+ cf-2504211e2da6bf85,"```python
99
+ # solution
100
+ ```"
101
+ cf-fe72bd8119780ec8,"```python
102
+ # solution
103
+ ```"
104
+ cf-1ca08b48bd892578,"```python
105
+ # solution
106
+ ```"
107
+ cf-7f5b6e4b96fcd311,"```python
108
+ # solution
109
+ ```"
110
+ cf-79fa4a4184718719,"```python
111
+ # solution
112
+ ```"
113
+ cf-11cfb743bc719098,"```python
114
+ # solution
115
+ ```"
116
+ cf-80c6887ef976a83f,"```python
117
+ # solution
118
+ ```"
119
+ cf-0ca0714ae890d497,"```python
120
+ # solution
121
+ ```"
122
+ cf-ee1166e86da8a5bc,"```python
123
+ # solution
124
+ ```"
125
+ cf-01dda202b0218b62,"```python
126
+ # solution
127
+ ```"
128
+ cf-94ba82d61a989906,"```python
129
+ # solution
130
+ ```"
131
+ cf-686973a2ba447968,"```python
132
+ # solution
133
+ ```"
134
+ cf-1087f5de081a27de,"```python
135
+ # solution
136
+ ```"
137
+ cf-bf629747f8647fbd,"```python
138
+ # solution
139
+ ```"
140
+ cf-200064be45810647,"```python
141
+ # solution
142
+ ```"
143
+ cf-978389c1f63e8c56,"```python
144
+ # solution
145
+ ```"
146
+ cf-53bbfadfc69af54a,"```python
147
+ # solution
148
+ ```"
149
+ cf-b15b42ca21d6498c,"```python
150
+ # solution
151
+ ```"
152
+ cf-09d4b3eee7968b29,"```python
153
+ # solution
154
+ ```"
155
+ cf-97100ad837e06861,"```python
156
+ # solution
157
+ ```"
158
+ cf-cc1dd97084442fd7,"```python
159
+ # solution
160
+ ```"
161
+ cf-61505319ac981d75,"```python
162
+ # solution
163
+ ```"
164
+ cf-2e5b5d04f1d95a7f,"```python
165
+ # solution
166
+ ```"
167
+ cf-336a44a84724d94f,"```python
168
+ # solution
169
+ ```"
170
+ cf-1bc44fec8f5fbeb5,"```python
171
+ # solution
172
+ ```"
173
+ cf-4857ca2b46ac76e5,"```python
174
+ # solution
175
+ ```"
176
+ cf-83c9c92eee2f2fad,"```python
177
+ # solution
178
+ ```"
179
+ cf-546e2bfd848ad791,"```python
180
+ # solution
181
+ ```"
182
+ cf-c5781db3fd9b0c93,"```python
183
+ # solution
184
+ ```"
185
+ cf-6b1da5c26358bb68,"```python
186
+ # solution
187
+ ```"
188
+ cf-bc5062c8c3e0ab6e,"```python
189
+ # solution
190
+ ```"
191
+ cf-d0c531ba295dc35b,"```python
192
+ # solution
193
+ ```"
194
+ cf-7ab2686a86e7e11b,"```python
195
+ # solution
196
+ ```"
197
+ cf-46b5d0f266fb5973,"```python
198
+ # solution
199
+ ```"
200
+ cf-575a7dd3dacefcac,"```python
201
+ # solution
202
+ ```"
203
+ cf-62950c42317da0ea,"```python
204
+ # solution
205
+ ```"
206
+ cf-4035efd555f39da9,"```python
207
+ # solution
208
+ ```"
209
+ cf-71583b418f5b422f,"```python
210
+ # solution
211
+ ```"
212
+ cf-d9a92f5b1ca467a7,"```python
213
+ # solution
214
+ ```"
215
+ cf-ee148c8d94fef8f0,"```python
216
+ # solution
217
+ ```"
218
+ cf-12ded724e7b4e8ce,"```python
219
+ # solution
220
+ ```"
221
+ cf-e3b3e78d8d33ea08,"```python
222
+ # solution
223
+ ```"
224
+ cf-6948ecd6286e913c,"```python
225
+ # solution
226
+ ```"
227
+ cf-5fdd0e04ea336294,"```python
228
+ # solution
229
+ ```"
230
+ cf-50b61b3d8c1fef5e,"```python
231
+ # solution
232
+ ```"
233
+ cf-895ee117276fc985,"```python
234
+ # solution
235
+ ```"
236
+ cf-b9be4f453fa811fd,"```python
237
+ # solution
238
+ ```"
239
+ cf-35558baff322d158,"```python
240
+ # solution
241
+ ```"
242
+ cf-39dc6d797ec012dc,"```python
243
+ # solution
244
+ ```"
245
+ cf-26164dd358b25b03,"```python
246
+ # solution
247
+ ```"
248
+ cf-85d614b42c653847,"```python
249
+ # solution
250
+ ```"
251
+ cf-3b24035b37b7e3d0,"```python
252
+ # solution
253
+ ```"
254
+ cf-5f489f6285179bc0,"```python
255
+ # solution
256
+ ```"
257
+ cf-4d8452a6dc8692ee,"```python
258
+ # solution
259
+ ```"
260
+ cf-3210cc15125b1902,"```python
261
+ # solution
262
+ ```"
263
+ cf-68791d88924e8208,"```python
264
+ # solution
265
+ ```"
266
+ cf-d81d9c8ba952a505,"```python
267
+ # solution
268
+ ```"
269
+ cf-5fa3fb3b49dbd702,"```python
270
+ # solution
271
+ ```"
272
+ cf-a7fa9759eff61255,"```python
273
+ # solution
274
+ ```"
275
+ cf-5118104022fa64fe,"```python
276
+ # solution
277
+ ```"
278
+ cf-7d90be3588221da2,"```python
279
+ # solution
280
+ ```"
281
+ cf-650d93f12b4cd5ba,"```python
282
+ # solution
283
+ ```"
284
+ cf-2034d12ca0220544,"```python
285
+ # solution
286
+ ```"
287
+ cf-8a750ad6391674a9,"```python
288
+ # solution
289
+ ```"
290
+ cf-1f0b89e27db09b4b,"```python
291
+ # solution
292
+ ```"
293
+ cf-f90a85e39db3bde3,"```python
294
+ # solution
295
+ ```"
296
+ cf-9474cceabd190d0e,"```python
297
+ # solution
298
+ ```"
299
+ cf-10c296908f2b0a5f,"```python
300
+ # solution
301
+ ```"
302
+ cf-221072dc36214997,"```python
303
+ # solution
304
+ ```"
305
+ cf-8f39e6c702501551,"```python
306
+ # solution
307
+ ```"
308
+ cf-669639e067f94619,"```python
309
+ # solution
310
+ ```"
311
+ cf-b3cdd9336cdbad21,"```python
312
+ # solution
313
+ ```"
314
+ cf-5e9d0047aca5fcd3,"```python
315
+ # solution
316
+ ```"
317
+ cf-50a8c0c707c1b907,"```python
318
+ # solution
319
+ ```"
320
+ cf-5bae67e9f7e11a8b,"```python
321
+ # solution
322
+ ```"
323
+ cf-09fb79acee3ca230,"```python
324
+ # solution
325
+ ```"
326
+ cf-a5588da658a1be0c,"```python
327
+ # solution
328
+ ```"
329
+ cf-f82bf3ec8a29e0fa,"```python
330
+ # solution
331
+ ```"
332
+ cf-c5eb57e3cf07b61f,"```python
333
+ # solution
334
+ ```"
335
+ cf-30ba13a749db8bc7,"```python
336
+ # solution
337
+ ```"
338
+ cf-a7e1dfb8e3b12bc1,"```python
339
+ # solution
340
+ ```"
341
+ cf-f798fd88bad8fc48,"```python
342
+ # solution
343
+ ```"
344
+ cf-e7510edf5c14124e,"```python
345
+ # solution
346
+ ```"
347
+ cf-0aab0be1d320d720,"```python
348
+ # solution
349
+ ```"
350
+ cf-b8b2a08f1a3286a6,"```python
351
+ # solution
352
+ ```"
353
+ cf-dffe1fc7a37fd6bc,"```python
354
+ # solution
355
+ ```"
356
+ cf-8ee59b3823b970d0,"```python
357
+ # solution
358
+ ```"
359
+ cf-77f4f41be4eba94f,"```python
360
+ # solution
361
+ ```"
362
+ cf-3748298c6fa84b8d,"```python
363
+ # solution
364
+ ```"
365
+ cf-0c93176b7ce4364f,"```python
366
+ # solution
367
+ ```"
368
+ cf-03c511813008a86d,"```python
369
+ # solution
370
+ ```"
371
+ cf-b09aec76d1837c24,"```python
372
+ # solution
373
+ ```"
374
+ cf-391bac3dfdc536db,"```python
375
+ # solution
376
+ ```"
377
+ cf-46174ab40f15f729,"```python
378
+ # solution
379
+ ```"
380
+ cf-7fcf6af9ecb30c92,"```python
381
+ # solution
382
+ ```"
383
+ cf-9efc6692005e91ce,"```python
384
+ # solution
385
+ ```"
386
+ cf-2943e7e34664e8c5,"```python
387
+ # solution
388
+ ```"
389
+ cf-d69c116dbaad1972,"```python
390
+ # solution
391
+ ```"
392
+ cf-d01ce37257534804,"```python
393
+ # solution
394
+ ```"
395
+ cf-7e9f19df18c2ba41,"```python
396
+ # solution
397
+ ```"
398
+ cf-0309babcf9dda96c,"```python
399
+ # solution
400
+ ```"
401
+ cf-006d0934620370cc,"```python
402
+ # solution
403
+ ```"
404
+ cf-2a52cabaf43650dc,"```python
405
+ # solution
406
+ ```"
407
+ cf-c9f48f65ee0d3d5b,"```python
408
+ # solution
409
+ ```"
410
+ cf-59cd2c8e2e10e192,"```python
411
+ # solution
412
+ ```"
413
+ cf-70f7ff90284b48c2,"```python
414
+ # solution
415
+ ```"
416
+ cf-9f97358eb1d62bec,"```python
417
+ # solution
418
+ ```"
419
+ cf-5567773d14325bc8,"```python
420
+ # solution
421
+ ```"
422
+ cf-13aef844372c5001,"```python
423
+ # solution
424
+ ```"
425
+ cf-b14e6b9c9dcf66b9,"```python
426
+ # solution
427
+ ```"
428
+ cf-cbbcd7f62b037500,"```python
429
+ # solution
430
+ ```"
431
+ cf-a321048f5888ef51,"```python
432
+ # solution
433
+ ```"
434
+ cf-397118f1dab2c7fb,"```python
435
+ # solution
436
+ ```"
437
+ cf-98130539ebad9e70,"```python
438
+ # solution
439
+ ```"
440
+ cf-ff3ec5fb2b0cc895,"```python
441
+ # solution
442
+ ```"
443
+ cf-624a4450163844ef,"```python
444
+ # solution
445
+ ```"
446
+ cf-cf90f5c1db71888e,"```python
447
+ # solution
448
+ ```"
449
+ cf-d67c6cc0447e5f8c,"```python
450
+ # solution
451
+ ```"
452
+ cf-44618e82f0098b93,"```python
453
+ # solution
454
+ ```"
455
+ cf-7d2a5031279c6736,"```python
456
+ # solution
457
+ ```"
458
+ cf-4ed3d1f699f7dddc,"```python
459
+ # solution
460
+ ```"
461
+ cf-25c02b9bea693993,"```python
462
+ # solution
463
+ ```"
464
+ cf-3619874544e5ccea,"```python
465
+ # solution
466
+ ```"
467
+ cf-12dc8eda8f35fdfa,"```python
468
+ # solution
469
+ ```"
470
+ cf-a984e5ceced107d1,"```python
471
+ # solution
472
+ ```"
473
+ cf-61cbafb0ef257ccc,"```python
474
+ # solution
475
+ ```"
476
+ cf-4cc55667fe935a5a,"```python
477
+ # solution
478
+ ```"
479
+ cf-a4f027f8e14a0af2,"```python
480
+ # solution
481
+ ```"
482
+ cf-04727798f98b4a4c,"```python
483
+ # solution
484
+ ```"
485
+ cf-b2ff548846ed597d,"```python
486
+ # solution
487
+ ```"
488
+ cf-eaab552d285cde6c,"```python
489
+ # solution
490
+ ```"
491
+ cf-365ba03e7f5b85b7,"```python
492
+ # solution
493
+ ```"
494
+ cf-8b79081aebc62bc7,"```python
495
+ # solution
496
+ ```"
497
+ cf-a302895c661ba29f,"```python
498
+ # solution
499
+ ```"
500
+ cf-75772844aa9cad85,"```python
501
+ # solution
502
+ ```"
503
+ cf-99080af17eb1bf1c,"```python
504
+ # solution
505
+ ```"
506
+ cf-e8e17264de612d6e,"```python
507
+ # solution
508
+ ```"
509
+ cf-6f4343760a24ac63,"```python
510
+ # solution
511
+ ```"
512
+ cf-ad0962212fea178b,"```python
513
+ # solution
514
+ ```"
515
+ cf-8362c209625003cf,"```python
516
+ # solution
517
+ ```"
518
+ cf-a2c4cb90b1253c45,"```python
519
+ # solution
520
+ ```"
521
+ cf-c125dbf9485fd3ed,"```python
522
+ # solution
523
+ ```"
524
+ cf-84a3c25300a6786d,"```python
525
+ # solution
526
+ ```"
527
+ cf-07f17213c5153858,"```python
528
+ # solution
529
+ ```"
530
+ cf-ee48ac1d46404f98,"```python
531
+ # solution
532
+ ```"
533
+ cf-5e6dca6776327096,"```python
534
+ # solution
535
+ ```"
536
+ cf-3d117b411889e077,"```python
537
+ # solution
538
+ ```"
539
+ cf-76bcb693a884b96a,"```python
540
+ # solution
541
+ ```"
542
+ cf-613410f2f2802e71,"```python
543
+ # solution
544
+ ```"
545
+ cf-9a28ec78eb695a72,"```python
546
+ # solution
547
+ ```"
548
+ cf-c920adb1f14fead4,"```python
549
+ # solution
550
+ ```"
551
+ cf-1c2348462e0ffb5b,"```python
552
+ # solution
553
+ ```"
554
+ cf-5a56f3b6d7d96629,"```python
555
+ # solution
556
+ ```"
557
+ cf-b403ad23f9df01b5,"```python
558
+ # solution
559
+ ```"
560
+ cf-8a01dee6edff6646,"```python
561
+ # solution
562
+ ```"
563
+ cf-36dd48709d4c6cec,"```python
564
+ # solution
565
+ ```"
566
+ cf-e5b32d29e5e18804,"```python
567
+ # solution
568
+ ```"
569
+ cf-a55eb159ec9f7c5e,"```python
570
+ # solution
571
+ ```"
572
+ cf-3038f57f582b92b7,"```python
573
+ # solution
574
+ ```"
575
+ cf-dd14fb3b657481f5,"```python
576
+ # solution
577
+ ```"
578
+ cf-4ee06e376cf46d6d,"```python
579
+ # solution
580
+ ```"
581
+ cf-25416861a5241d3c,"```python
582
+ # solution
583
+ ```"
584
+ cf-daf5280b3d547cdc,"```python
585
+ # solution
586
+ ```"
587
+ cf-dcd26549d309c08f,"```python
588
+ # solution
589
+ ```"
590
+ cf-de92f4a76c782ead,"```python
591
+ # solution
592
+ ```"
593
+ cf-a61cf5630d697657,"```python
594
+ # solution
595
+ ```"
596
+ cf-e75d947160f43f48,"```python
597
+ # solution
598
+ ```"
599
+ cf-19a2223b29a4e32b,"```python
600
+ # solution
601
+ ```"
602
+ cf-8d9c2ecd53154735,"```python
603
+ # solution
604
+ ```"
605
+ cf-fae8a3c0ea1ddda9,"```python
606
+ # solution
607
+ ```"
608
+ cf-56d0d66fd32f536a,"```python
609
+ # solution
610
+ ```"
611
+ cf-b6ae539aa0ece0b5,"```python
612
+ # solution
613
+ ```"
614
+ cf-89c6dc80bc6e178e,"```python
615
+ # solution
616
+ ```"
617
+ cf-82930680859be479,"```python
618
+ # solution
619
+ ```"
620
+ cf-bdc784eca7e75ac8,"```python
621
+ # solution
622
+ ```"
623
+ cf-85d6865110fbdf3d,"```python
624
+ # solution
625
+ ```"
626
+ cf-10527c7c686d8515,"```python
627
+ # solution
628
+ ```"
629
+ cf-4c4b8d8245f50929,"```python
630
+ # solution
631
+ ```"
632
+ cf-9c0469c0fcf57c19,"```python
633
+ # solution
634
+ ```"
635
+ cf-9ef290c1a24d9496,"```python
636
+ # solution
637
+ ```"
638
+ cf-431573f1d7bb301d,"```python
639
+ # solution
640
+ ```"
641
+ cf-6509e4f0d2d3100d,"```python
642
+ # solution
643
+ ```"
644
+ cf-5bdb7848972b5212,"```python
645
+ # solution
646
+ ```"
647
+ cf-8221d090c4c1cba5,"```python
648
+ # solution
649
+ ```"
650
+ cf-959ea79f76be5608,"```python
651
+ # solution
652
+ ```"
653
+ cf-9b1e3b8346a5605b,"```python
654
+ # solution
655
+ ```"
656
+ cf-415b4a43628643f6,"```python
657
+ # solution
658
+ ```"
659
+ cf-c9470bcbb7ff7c74,"```python
660
+ # solution
661
+ ```"
662
+ cf-e252fafef16e86e1,"```python
663
+ # solution
664
+ ```"
665
+ cf-08e76c4162c3d5d6,"```python
666
+ # solution
667
+ ```"
668
+ cf-7e7d615540984d8a,"```python
669
+ # solution
670
+ ```"
671
+ cf-7473fec259254b1c,"```python
672
+ # solution
673
+ ```"
674
+ cf-a57c0f59d3211ae9,"```python
675
+ # solution
676
+ ```"
677
+ cf-bb8f0c3d3c490a16,"```python
678
+ # solution
679
+ ```"
680
+ cf-48ed90584336d45b,"```python
681
+ # solution
682
+ ```"
683
+ cf-af0cc196db1195da,"```python
684
+ # solution
685
+ ```"
686
+ cf-ccab0ea22013d32a,"```python
687
+ # solution
688
+ ```"
689
+ cf-62aff2d5503b50d8,"```python
690
+ # solution
691
+ ```"
692
+ cf-251153bc63e3b74c,"```python
693
+ # solution
694
+ ```"
695
+ cf-37283be4276e6343,"```python
696
+ # solution
697
+ ```"
698
+ cf-ad009460a07112af,"```python
699
+ # solution
700
+ ```"
701
+ cf-4141bfa06ec30e04,"```python
702
+ # solution
703
+ ```"
704
+ cf-0757720cc194cf68,"```python
705
+ # solution
706
+ ```"
707
+ cf-373d6eae4d68b10f,"```python
708
+ # solution
709
+ ```"
710
+ cf-066d7b94a8ba2f5e,"```python
711
+ # solution
712
+ ```"
713
+ cf-a91e4148a27de25b,"```python
714
+ # solution
715
+ ```"
716
+ cf-ef4740448ba278f7,"```python
717
+ # solution
718
+ ```"
719
+ cf-ccc3594c0c1b5c2c,"```python
720
+ # solution
721
+ ```"
722
+ cf-dedaaf5226c93873,"```python
723
+ # solution
724
+ ```"
725
+ cf-46fd459513a94580,"```python
726
+ # solution
727
+ ```"
728
+ cf-4fdc1ced5ae60f9b,"```python
729
+ # solution
730
+ ```"
731
+ cf-bf4e0736612c9400,"```python
732
+ # solution
733
+ ```"
734
+ cf-d87021af5ddc9f8b,"```python
735
+ # solution
736
+ ```"
737
+ cf-349680720454272a,"```python
738
+ # solution
739
+ ```"
740
+ cf-0526124d47568401,"```python
741
+ # solution
742
+ ```"
743
+ cf-91f7b911644f0970,"```python
744
+ # solution
745
+ ```"
746
+ cf-8fedf6fe29ad244c,"```python
747
+ # solution
748
+ ```"
749
+ cf-af684689a8afbcf6,"```python
750
+ # solution
751
+ ```"
752
+ cf-8ee03fd4c2b09cb3,"```python
753
+ # solution
754
+ ```"
755
+ cf-510311b247c2a19e,"```python
756
+ # solution
757
+ ```"
758
+ cf-e7ae750c92c8e0f5,"```python
759
+ # solution
760
+ ```"
761
+ cf-af009a97dd4077c8,"```python
762
+ # solution
763
+ ```"
764
+ cf-9f6e7573a17c06b7,"```python
765
+ # solution
766
+ ```"
767
+ cf-c0f526bb96097552,"```python
768
+ # solution
769
+ ```"
770
+ cf-b7147a313054c784,"```python
771
+ # solution
772
+ ```"
773
+ cf-17d6a269c86fedc9,"```python
774
+ # solution
775
+ ```"
776
+ cf-680e009b3b57c60e,"```python
777
+ # solution
778
+ ```"
779
+ cf-f07bcf245f7c6329,"```python
780
+ # solution
781
+ ```"
782
+ cf-0877e2b8639e3e16,"```python
783
+ # solution
784
+ ```"
785
+ cf-dbe9ec8bfe54400e,"```python
786
+ # solution
787
+ ```"
788
+ cf-3ef1867eaeef3d80,"```python
789
+ # solution
790
+ ```"
791
+ cf-fdcc0441621400eb,"```python
792
+ # solution
793
+ ```"
794
+ cf-e0db689e88ac0b62,"```python
795
+ # solution
796
+ ```"
797
+ cf-6e18c7a2f8068bd1,"```python
798
+ # solution
799
+ ```"
800
+ cf-40f91b03df8c336b,"```python
801
+ # solution
802
+ ```"
803
+ cf-1dad6e6e625a63cf,"```python
804
+ # solution
805
+ ```"
806
+ cf-5d662d4b78832aff,"```python
807
+ # solution
808
+ ```"
809
+ cf-7ea47ac04494131d,"```python
810
+ # solution
811
+ ```"
812
+ cf-3ab136690610c574,"```python
813
+ # solution
814
+ ```"
815
+ cf-290abc7279c8a39e,"```python
816
+ # solution
817
+ ```"
818
+ cf-7f0558cfec9091ee,"```python
819
+ # solution
820
+ ```"
821
+ cf-97ab4138236f1ad7,"```python
822
+ # solution
823
+ ```"
824
+ cf-7519982cbe364897,"```python
825
+ # solution
826
+ ```"
827
+ cf-bb72f5fc8c85820f,"```python
828
+ # solution
829
+ ```"
830
+ cf-ef9780f611bdc70e,"```python
831
+ # solution
832
+ ```"
833
+ cf-1747e3b07ad42b08,"```python
834
+ # solution
835
+ ```"
836
+ cf-56826b2758490b0f,"```python
837
+ # solution
838
+ ```"
839
+ cf-7fb65d4554f7be7b,"```python
840
+ # solution
841
+ ```"
842
+ cf-a671a8189b7eee8f,"```python
843
+ # solution
844
+ ```"
845
+ cf-afe72577721c1c8a,"```python
846
+ # solution
847
+ ```"
848
+ cf-d73f65b6c744baaf,"```python
849
+ # solution
850
+ ```"
851
+ cf-ac1d78d8afe1b4d5,"```python
852
+ # solution
853
+ ```"
854
+ cf-a5fcf217bcab67d1,"```python
855
+ # solution
856
+ ```"
857
+ cf-0adfcf12b9b5542a,"```python
858
+ # solution
859
+ ```"
860
+ cf-20b67af882fa6c9e,"```python
861
+ # solution
862
+ ```"
863
+ cf-864d08c8ea8064b6,"```python
864
+ # solution
865
+ ```"
866
+ cf-ba65a57637e12845,"```python
867
+ # solution
868
+ ```"
869
+ cf-85a8951962050b3c,"```python
870
+ # solution
871
+ ```"
872
+ cf-2fcacee04da27b58,"```python
873
+ # solution
874
+ ```"
875
+ cf-1c9e12b94ae11466,"```python
876
+ # solution
877
+ ```"
878
+ cf-3d0b086e89aea455,"```python
879
+ # solution
880
+ ```"
881
+ cf-3a59d9bb53941e81,"```python
882
+ # solution
883
+ ```"
884
+ cf-0fd4c8078bb81537,"```python
885
+ # solution
886
+ ```"
887
+ cf-aa2d4497db2db3d5,"```python
888
+ # solution
889
+ ```"
890
+ cf-e3147c5900e6cc63,"```python
891
+ # solution
892
+ ```"
893
+ cf-676fd6d86ea858b3,"```python
894
+ # solution
895
+ ```"
896
+ cf-b060389d148d7399,"```python
897
+ # solution
898
+ ```"
899
+ cf-165031e106d9579e,"```python
900
+ # solution
901
+ ```"
902
+ cf-927ef5ee37abb90f,"```python
903
+ # solution
904
+ ```"
905
+ cf-7353ae3e3d5f3d0b,"```python
906
+ # solution
907
+ ```"
908
+ cf-ea1f1541b5c8454f,"```python
909
+ # solution
910
+ ```"
911
+ cf-15e45b1911b3e4e7,"```python
912
+ # solution
913
+ ```"
914
+ cf-6fef6d1056feef04,"```python
915
+ # solution
916
+ ```"
917
+ cf-94b6b03e91be2643,"```python
918
+ # solution
919
+ ```"
920
+ cf-6ab0ad36a045292b,"```python
921
+ # solution
922
+ ```"
923
+ cf-76d6ed3b05e44cc5,"```python
924
+ # solution
925
+ ```"
926
+ cf-ccc86e312b9a72b6,"```python
927
+ # solution
928
+ ```"
929
+ cf-e46f5d10f4f6b9e2,"```python
930
+ # solution
931
+ ```"
932
+ cf-e80ee4f1bd66e00c,"```python
933
+ # solution
934
+ ```"
935
+ cf-3ff70330e9bd5851,"```python
936
+ # solution
937
+ ```"
938
+ cf-66b44d18bf3f1229,"```python
939
+ # solution
940
+ ```"
941
+ cf-436f82981620c033,"```python
942
+ # solution
943
+ ```"
944
+ cf-89eea5f86fb6ebb4,"```python
945
+ # solution
946
+ ```"
947
+ cf-706e3e333b48079e,"```python
948
+ # solution
949
+ ```"
950
+ cf-d54a1d5f15855120,"```python
951
+ # solution
952
+ ```"
953
+ cf-843c7943207d0df5,"```python
954
+ # solution
955
+ ```"
956
+ cf-5fbb4804b2415192,"```python
957
+ # solution
958
+ ```"
959
+ cf-71cf2d6283f94dfd,"```python
960
+ # solution
961
+ ```"
962
+ cf-67aa378e15b57d64,"```python
963
+ # solution
964
+ ```"
965
+ cf-43fb67e72853e2e5,"```python
966
+ # solution
967
+ ```"
968
+ cf-3ce83ec5e0603ae5,"```python
969
+ # solution
970
+ ```"
971
+ cf-19a38180e0e87858,"```python
972
+ # solution
973
+ ```"
974
+ cf-df0dc437c0fbbdeb,"```python
975
+ # solution
976
+ ```"
977
+ cf-73e865e4391e99f0,"```python
978
+ # solution
979
+ ```"
980
+ cf-7e8845d65ed86a24,"```python
981
+ # solution
982
+ ```"
983
+ cf-d512d677498083dd,"```python
984
+ # solution
985
+ ```"
986
+ cf-a4dc6a5905b6f0a7,"```python
987
+ # solution
988
+ ```"
989
+ cf-9f6d0188dbcd667c,"```python
990
+ # solution
991
+ ```"
992
+ cf-ad3dd8ea8e119aa8,"```python
993
+ # solution
994
+ ```"
995
+ cf-281938abb20c7d61,"```python
996
+ # solution
997
+ ```"
998
+ cf-d667316e2d79898f,"```python
999
+ # solution
1000
+ ```"
1001
+ cf-f95b769319395f3e,"```python
1002
+ # solution
1003
+ ```"
1004
+ cf-07291d50bf76371a,"```python
1005
+ # solution
1006
+ ```"
1007
+ cf-aefaed1c66d42f67,"```python
1008
+ # solution
1009
+ ```"
1010
+ cf-2efb650f65bf54c1,"```python
1011
+ # solution
1012
+ ```"
1013
+ cf-eb056907043004f5,"```python
1014
+ # solution
1015
+ ```"
1016
+ cf-69860e572ae76e65,"```python
1017
+ # solution
1018
+ ```"
1019
+ cf-f167a4c521d758ef,"```python
1020
+ # solution
1021
+ ```"
1022
+ cf-04ab4db50fee9878,"```python
1023
+ # solution
1024
+ ```"
1025
+ cf-a20b0f12afdb98d1,"```python
1026
+ # solution
1027
+ ```"
1028
+ cf-096ac99dd6272319,"```python
1029
+ # solution
1030
+ ```"
1031
+ cf-76e6da6b6bf3d9eb,"```python
1032
+ # solution
1033
+ ```"
1034
+ cf-7ef1f384d514abab,"```python
1035
+ # solution
1036
+ ```"
1037
+ cf-16bd8fc76704aa81,"```python
1038
+ # solution
1039
+ ```"
1040
+ cf-dc923558da033b1c,"```python
1041
+ # solution
1042
+ ```"
1043
+ cf-7c13dfa0ef352a16,"```python
1044
+ # solution
1045
+ ```"
1046
+ cf-c98fee3bc1536f4e,"```python
1047
+ # solution
1048
+ ```"
1049
+ cf-d65b9cb01a214927,"```python
1050
+ # solution
1051
+ ```"
1052
+ cf-9de31a6b4b6c49e1,"```python
1053
+ # solution
1054
+ ```"
1055
+ cf-4af7a96237e05e2b,"```python
1056
+ # solution
1057
+ ```"
1058
+ cf-a4f2e07ca1096000,"```python
1059
+ # solution
1060
+ ```"
1061
+ cf-13dfdd9a1d14bc2f,"```python
1062
+ # solution
1063
+ ```"
1064
+ cf-25378698aa2a5f89,"```python
1065
+ # solution
1066
+ ```"
1067
+ cf-536c180a69717c33,"```python
1068
+ # solution
1069
+ ```"
1070
+ cf-045a216da08d07f3,"```python
1071
+ # solution
1072
+ ```"
1073
+ cf-f64a6806bfedd6a7,"```python
1074
+ # solution
1075
+ ```"
1076
+ cf-8b1215cf044e376e,"```python
1077
+ # solution
1078
+ ```"
1079
+ cf-8ab490bf85751d6a,"```python
1080
+ # solution
1081
+ ```"
1082
+ cf-f0a263534d579fe0,"```python
1083
+ # solution
1084
+ ```"
1085
+ cf-f533054f83e34460,"```python
1086
+ # solution
1087
+ ```"
1088
+ cf-1668e0321983a6ae,"```python
1089
+ # solution
1090
+ ```"
1091
+ cf-8720db27d7cd975a,"```python
1092
+ # solution
1093
+ ```"
1094
+ cf-292ab5a75e2207ef,"```python
1095
+ # solution
1096
+ ```"
1097
+ cf-61b2729dbba80f00,"```python
1098
+ # solution
1099
+ ```"
1100
+ cf-d5deaceac78834a9,"```python
1101
+ # solution
1102
+ ```"
1103
+ cf-03d5b1dd2e52eb5b,"```python
1104
+ # solution
1105
+ ```"
1106
+ cf-8f8bd06f486e8d1c,"```python
1107
+ # solution
1108
+ ```"
1109
+ cf-20b318abdf7ae6d9,"```python
1110
+ # solution
1111
+ ```"
1112
+ cf-32977146b46780d6,"```python
1113
+ # solution
1114
+ ```"
1115
+ cf-c7d80a8a8df85cd6,"```python
1116
+ # solution
1117
+ ```"
1118
+ cf-e51817fc02f9f753,"```python
1119
+ # solution
1120
+ ```"
1121
+ cf-45e99b03d772395c,"```python
1122
+ # solution
1123
+ ```"
1124
+ cf-246910d3d3940676,"```python
1125
+ # solution
1126
+ ```"
1127
+ cf-deb17639a6b2b215,"```python
1128
+ # solution
1129
+ ```"
1130
+ cf-6658c2b63bd7a06b,"```python
1131
+ # solution
1132
+ ```"
1133
+ cf-bc8d0c3f3a71c6b8,"```python
1134
+ # solution
1135
+ ```"
1136
+ cf-fb6a192dbcaa9a01,"```python
1137
+ # solution
1138
+ ```"
1139
+ cf-af2def7b035bf294,"```python
1140
+ # solution
1141
+ ```"
1142
+ cf-ed181f91c348aa5d,"```python
1143
+ # solution
1144
+ ```"
1145
+ cf-f5920212ad402b18,"```python
1146
+ # solution
1147
+ ```"
1148
+ cf-2a0e1ce2ca1fc740,"```python
1149
+ # solution
1150
+ ```"
1151
+ cf-2915154b1688e74a,"```python
1152
+ # solution
1153
+ ```"
1154
+ cf-4e32f442e57c2a77,"```python
1155
+ # solution
1156
+ ```"
1157
+ cf-010ecd306c4e0a9f,"```python
1158
+ # solution
1159
+ ```"
1160
+ cf-ce04106a30b8ac00,"```python
1161
+ # solution
1162
+ ```"
1163
+ cf-957b94809727ae81,"```python
1164
+ # solution
1165
+ ```"
1166
+ cf-ad33e1233cd4c342,"```python
1167
+ # solution
1168
+ ```"
1169
+ cf-d5491a1f34bd4b65,"```python
1170
+ # solution
1171
+ ```"
1172
+ cf-bc4af4d11e791351,"```python
1173
+ # solution
1174
+ ```"
1175
+ cf-0de916666c619ddf,"```python
1176
+ # solution
1177
+ ```"
1178
+ cf-2b49b989c0a12b12,"```python
1179
+ # solution
1180
+ ```"
1181
+ cf-a8b24e975163e76d,"```python
1182
+ # solution
1183
+ ```"
1184
+ cf-355edd46e49305a6,"```python
1185
+ # solution
1186
+ ```"
1187
+ cf-5f35ca6cc5422f64,"```python
1188
+ # solution
1189
+ ```"
1190
+ cf-86515d2a498d71a5,"```python
1191
+ # solution
1192
+ ```"
1193
+ cf-56de34d27bf720f6,"```python
1194
+ # solution
1195
+ ```"
1196
+ cf-173f76cf8bfaef3b,"```python
1197
+ # solution
1198
+ ```"
1199
+ cf-996e5eed51fcd7b6,"```python
1200
+ # solution
1201
+ ```"
1202
+ cf-17e1fa836091feb2,"```python
1203
+ # solution
1204
+ ```"
1205
+ cf-c59ddc4c20e3d5e6,"```python
1206
+ # solution
1207
+ ```"
1208
+ cf-fe1630ecb3faa5a3,"```python
1209
+ # solution
1210
+ ```"
1211
+ cf-b5ce86eaa1b00bf4,"```python
1212
+ # solution
1213
+ ```"
1214
+ cf-0ad302842053c28d,"```python
1215
+ # solution
1216
+ ```"
1217
+ cf-e48325d6d4340252,"```python
1218
+ # solution
1219
+ ```"
1220
+ cf-becab5c5e88a3441,"```python
1221
+ # solution
1222
+ ```"
1223
+ cf-554cbdf43b3fb726,"```python
1224
+ # solution
1225
+ ```"
codeforces/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:186fdac5b30ff50b3122ebbdf1728aef48960457cd3ab852f8993e3381127b00
3
+ size 306700
mbppplus/evaluator.py ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Zevo custom evaluator for MBPP+ val (378), pass@1.
3
+
4
+ Hub: Tommysha/zero-code-l1-val config mbppplus split validation.
5
+ Rows: id, prompt, entry_point, test_imports, test_list, test (EvalPlus plus harness).
6
+ Does not use the gold `code` column.
7
+
8
+ Usage: python3 evaluator.py PREDICTIONS_CSV SCORING_SET METRICS_JSON
9
+ Stdlib only (pyarrow only if SCORING_SET is parquet). Timeout 10 s per problem.
10
+ If numpy is missing, a tiny shim satisfies `import numpy as np` in the plus harness.
11
+ """
12
+ import ast
13
+ import csv
14
+ import json
15
+ import multiprocessing
16
+ import os
17
+ import sys
18
+ import traceback
19
+ from concurrent.futures import ProcessPoolExecutor
20
+
21
+ TIMEOUT = 10
22
+
23
+
24
+ def extract_code(output: str) -> str:
25
+ lines = (output or "").split("\n")
26
+ idx = [i for i, line in enumerate(lines) if "```" in line]
27
+ if len(idx) >= 2:
28
+ body = "\n".join(lines[idx[-2] + 1: idx[-1]])
29
+ if body.lstrip().startswith("python"):
30
+ body = "\n".join(body.split("\n")[1:])
31
+ return body
32
+ return (output or "").strip()
33
+
34
+
35
+ def _numpy_shim():
36
+ class _NP:
37
+ ndarray = type("ndarray", (), {})
38
+ float64 = "float64"
39
+ float32 = "float32"
40
+
41
+ @staticmethod
42
+ def allclose(a, b, rtol=1e-07, atol=1e-06, equal_nan=False):
43
+ def _flat(x):
44
+ if isinstance(x, (list, tuple, set)):
45
+ out = []
46
+ for i in x:
47
+ out.extend(_flat(i))
48
+ return out
49
+ return [x]
50
+ aa, bb = _flat(a), _flat(b)
51
+ if len(aa) != len(bb):
52
+ return False
53
+ for x, y in zip(aa, bb):
54
+ try:
55
+ xf, yf = float(x), float(y)
56
+ except (TypeError, ValueError):
57
+ if x != y:
58
+ return False
59
+ continue
60
+ if xf != xf or yf != yf:
61
+ if not equal_nan:
62
+ return False
63
+ continue
64
+ scale = max(abs(yf), abs(xf))
65
+ if abs(xf - yf) > atol + rtol * scale:
66
+ return False
67
+ return True
68
+
69
+ return _NP()
70
+
71
+
72
+ def _run_one(code, test, test_list, test_imports, result):
73
+ try:
74
+ ns = {}
75
+ for imp in test_imports or []:
76
+ exec(imp, ns, ns)
77
+ exec(code, ns, ns)
78
+ plus = (test or "").strip()
79
+ if plus:
80
+ if "numpy" not in sys.modules:
81
+ try:
82
+ import numpy # noqa: F401
83
+ except Exception:
84
+ sys.modules["numpy"] = _numpy_shim()
85
+ exec(plus, ns, ns)
86
+ else:
87
+ for stmt in test_list or []:
88
+ exec(stmt, ns, ns)
89
+ result.append(True)
90
+ except Exception:
91
+ result.append(False)
92
+
93
+
94
+ def check(args):
95
+ code, test, test_list, test_imports = args
96
+ if not (code or "").strip():
97
+ return False
98
+ try:
99
+ ast.parse(code)
100
+ except SyntaxError:
101
+ return False
102
+ manager = multiprocessing.Manager()
103
+ result = manager.list()
104
+ p = multiprocessing.Process(
105
+ target=_run_one, args=(code, test, test_list, test_imports, result)
106
+ )
107
+ p.start()
108
+ p.join(timeout=TIMEOUT + 2)
109
+ if p.is_alive():
110
+ p.kill()
111
+ p.join(1)
112
+ return bool(result) and result[0] is True
113
+
114
+
115
+ def load_rows(path):
116
+ ext = os.path.splitext(path)[1].lower()
117
+ if ext == ".parquet":
118
+ import pyarrow.parquet as pq
119
+ return pq.read_table(path).to_pylist()
120
+ if ext == ".jsonl":
121
+ return [json.loads(l) for l in open(path, encoding="utf-8") if l.strip()]
122
+ if ext == ".json":
123
+ d = json.load(open(path, encoding="utf-8"))
124
+ return d if isinstance(d, list) else d.get("data", d.get("rows"))
125
+ csv.field_size_limit(sys.maxsize)
126
+ return list(csv.DictReader(open(path, newline="", encoding="utf-8")))
127
+
128
+
129
+ def _list_field(v):
130
+ if v is None:
131
+ return []
132
+ if isinstance(v, list):
133
+ return v
134
+ if isinstance(v, str):
135
+ s = v.strip()
136
+ if not s:
137
+ return []
138
+ try:
139
+ parsed = json.loads(s)
140
+ if isinstance(parsed, list):
141
+ return parsed
142
+ except Exception:
143
+ pass
144
+ return [s]
145
+ return list(v)
146
+
147
+
148
+ def main():
149
+ pred_path, set_path, out_path = sys.argv[1:4]
150
+ csv.field_size_limit(sys.maxsize)
151
+ preds = {r["id"]: r.get("prediction") or "" for r in csv.DictReader(open(pred_path, newline="", encoding="utf-8"))}
152
+ rows = load_rows(set_path)
153
+ jobs = []
154
+ for r in rows:
155
+ jobs.append((
156
+ extract_code(preds.get(str(r["id"]), "")),
157
+ r.get("test") or "",
158
+ _list_field(r.get("test_list")),
159
+ _list_field(r.get("test_imports")),
160
+ ))
161
+ workers = int(os.environ.get("LCB_EVAL_WORKERS", min(8, os.cpu_count() or 1)))
162
+ with ProcessPoolExecutor(max_workers=workers) as ex:
163
+ ok = list(ex.map(check, jobs))
164
+ total = len(rows)
165
+ correct = sum(ok)
166
+ out = {
167
+ "score": correct / total if total else 0.0,
168
+ "correct": correct,
169
+ "total": total,
170
+ "missing_predictions": sum(str(r["id"]) not in preds for r in rows),
171
+ }
172
+ json.dump(out, open(out_path, "w", encoding="utf-8"))
173
+ print(json.dumps(out))
174
+
175
+
176
+ if __name__ == "__main__":
177
+ main()
mbppplus/sample_submission.csv ADDED
@@ -0,0 +1,1135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ id,prediction
2
+ Mbpp/2,"```python
3
+ # solution
4
+ ```"
5
+ Mbpp/3,"```python
6
+ # solution
7
+ ```"
8
+ Mbpp/4,"```python
9
+ # solution
10
+ ```"
11
+ Mbpp/6,"```python
12
+ # solution
13
+ ```"
14
+ Mbpp/7,"```python
15
+ # solution
16
+ ```"
17
+ Mbpp/8,"```python
18
+ # solution
19
+ ```"
20
+ Mbpp/9,"```python
21
+ # solution
22
+ ```"
23
+ Mbpp/11,"```python
24
+ # solution
25
+ ```"
26
+ Mbpp/12,"```python
27
+ # solution
28
+ ```"
29
+ Mbpp/14,"```python
30
+ # solution
31
+ ```"
32
+ Mbpp/16,"```python
33
+ # solution
34
+ ```"
35
+ Mbpp/17,"```python
36
+ # solution
37
+ ```"
38
+ Mbpp/18,"```python
39
+ # solution
40
+ ```"
41
+ Mbpp/19,"```python
42
+ # solution
43
+ ```"
44
+ Mbpp/20,"```python
45
+ # solution
46
+ ```"
47
+ Mbpp/56,"```python
48
+ # solution
49
+ ```"
50
+ Mbpp/57,"```python
51
+ # solution
52
+ ```"
53
+ Mbpp/58,"```python
54
+ # solution
55
+ ```"
56
+ Mbpp/59,"```python
57
+ # solution
58
+ ```"
59
+ Mbpp/61,"```python
60
+ # solution
61
+ ```"
62
+ Mbpp/62,"```python
63
+ # solution
64
+ ```"
65
+ Mbpp/63,"```python
66
+ # solution
67
+ ```"
68
+ Mbpp/64,"```python
69
+ # solution
70
+ ```"
71
+ Mbpp/65,"```python
72
+ # solution
73
+ ```"
74
+ Mbpp/66,"```python
75
+ # solution
76
+ ```"
77
+ Mbpp/67,"```python
78
+ # solution
79
+ ```"
80
+ Mbpp/68,"```python
81
+ # solution
82
+ ```"
83
+ Mbpp/69,"```python
84
+ # solution
85
+ ```"
86
+ Mbpp/70,"```python
87
+ # solution
88
+ ```"
89
+ Mbpp/71,"```python
90
+ # solution
91
+ ```"
92
+ Mbpp/72,"```python
93
+ # solution
94
+ ```"
95
+ Mbpp/74,"```python
96
+ # solution
97
+ ```"
98
+ Mbpp/75,"```python
99
+ # solution
100
+ ```"
101
+ Mbpp/77,"```python
102
+ # solution
103
+ ```"
104
+ Mbpp/79,"```python
105
+ # solution
106
+ ```"
107
+ Mbpp/80,"```python
108
+ # solution
109
+ ```"
110
+ Mbpp/82,"```python
111
+ # solution
112
+ ```"
113
+ Mbpp/84,"```python
114
+ # solution
115
+ ```"
116
+ Mbpp/85,"```python
117
+ # solution
118
+ ```"
119
+ Mbpp/86,"```python
120
+ # solution
121
+ ```"
122
+ Mbpp/87,"```python
123
+ # solution
124
+ ```"
125
+ Mbpp/88,"```python
126
+ # solution
127
+ ```"
128
+ Mbpp/89,"```python
129
+ # solution
130
+ ```"
131
+ Mbpp/90,"```python
132
+ # solution
133
+ ```"
134
+ Mbpp/91,"```python
135
+ # solution
136
+ ```"
137
+ Mbpp/92,"```python
138
+ # solution
139
+ ```"
140
+ Mbpp/93,"```python
141
+ # solution
142
+ ```"
143
+ Mbpp/94,"```python
144
+ # solution
145
+ ```"
146
+ Mbpp/95,"```python
147
+ # solution
148
+ ```"
149
+ Mbpp/96,"```python
150
+ # solution
151
+ ```"
152
+ Mbpp/97,"```python
153
+ # solution
154
+ ```"
155
+ Mbpp/98,"```python
156
+ # solution
157
+ ```"
158
+ Mbpp/99,"```python
159
+ # solution
160
+ ```"
161
+ Mbpp/100,"```python
162
+ # solution
163
+ ```"
164
+ Mbpp/101,"```python
165
+ # solution
166
+ ```"
167
+ Mbpp/102,"```python
168
+ # solution
169
+ ```"
170
+ Mbpp/103,"```python
171
+ # solution
172
+ ```"
173
+ Mbpp/104,"```python
174
+ # solution
175
+ ```"
176
+ Mbpp/105,"```python
177
+ # solution
178
+ ```"
179
+ Mbpp/106,"```python
180
+ # solution
181
+ ```"
182
+ Mbpp/108,"```python
183
+ # solution
184
+ ```"
185
+ Mbpp/109,"```python
186
+ # solution
187
+ ```"
188
+ Mbpp/111,"```python
189
+ # solution
190
+ ```"
191
+ Mbpp/113,"```python
192
+ # solution
193
+ ```"
194
+ Mbpp/116,"```python
195
+ # solution
196
+ ```"
197
+ Mbpp/118,"```python
198
+ # solution
199
+ ```"
200
+ Mbpp/119,"```python
201
+ # solution
202
+ ```"
203
+ Mbpp/120,"```python
204
+ # solution
205
+ ```"
206
+ Mbpp/123,"```python
207
+ # solution
208
+ ```"
209
+ Mbpp/124,"```python
210
+ # solution
211
+ ```"
212
+ Mbpp/125,"```python
213
+ # solution
214
+ ```"
215
+ Mbpp/126,"```python
216
+ # solution
217
+ ```"
218
+ Mbpp/127,"```python
219
+ # solution
220
+ ```"
221
+ Mbpp/128,"```python
222
+ # solution
223
+ ```"
224
+ Mbpp/129,"```python
225
+ # solution
226
+ ```"
227
+ Mbpp/130,"```python
228
+ # solution
229
+ ```"
230
+ Mbpp/131,"```python
231
+ # solution
232
+ ```"
233
+ Mbpp/132,"```python
234
+ # solution
235
+ ```"
236
+ Mbpp/133,"```python
237
+ # solution
238
+ ```"
239
+ Mbpp/135,"```python
240
+ # solution
241
+ ```"
242
+ Mbpp/137,"```python
243
+ # solution
244
+ ```"
245
+ Mbpp/138,"```python
246
+ # solution
247
+ ```"
248
+ Mbpp/139,"```python
249
+ # solution
250
+ ```"
251
+ Mbpp/140,"```python
252
+ # solution
253
+ ```"
254
+ Mbpp/141,"```python
255
+ # solution
256
+ ```"
257
+ Mbpp/142,"```python
258
+ # solution
259
+ ```"
260
+ Mbpp/145,"```python
261
+ # solution
262
+ ```"
263
+ Mbpp/160,"```python
264
+ # solution
265
+ ```"
266
+ Mbpp/161,"```python
267
+ # solution
268
+ ```"
269
+ Mbpp/162,"```python
270
+ # solution
271
+ ```"
272
+ Mbpp/165,"```python
273
+ # solution
274
+ ```"
275
+ Mbpp/166,"```python
276
+ # solution
277
+ ```"
278
+ Mbpp/167,"```python
279
+ # solution
280
+ ```"
281
+ Mbpp/168,"```python
282
+ # solution
283
+ ```"
284
+ Mbpp/170,"```python
285
+ # solution
286
+ ```"
287
+ Mbpp/171,"```python
288
+ # solution
289
+ ```"
290
+ Mbpp/172,"```python
291
+ # solution
292
+ ```"
293
+ Mbpp/222,"```python
294
+ # solution
295
+ ```"
296
+ Mbpp/223,"```python
297
+ # solution
298
+ ```"
299
+ Mbpp/224,"```python
300
+ # solution
301
+ ```"
302
+ Mbpp/226,"```python
303
+ # solution
304
+ ```"
305
+ Mbpp/227,"```python
306
+ # solution
307
+ ```"
308
+ Mbpp/230,"```python
309
+ # solution
310
+ ```"
311
+ Mbpp/232,"```python
312
+ # solution
313
+ ```"
314
+ Mbpp/233,"```python
315
+ # solution
316
+ ```"
317
+ Mbpp/234,"```python
318
+ # solution
319
+ ```"
320
+ Mbpp/235,"```python
321
+ # solution
322
+ ```"
323
+ Mbpp/237,"```python
324
+ # solution
325
+ ```"
326
+ Mbpp/238,"```python
327
+ # solution
328
+ ```"
329
+ Mbpp/239,"```python
330
+ # solution
331
+ ```"
332
+ Mbpp/240,"```python
333
+ # solution
334
+ ```"
335
+ Mbpp/242,"```python
336
+ # solution
337
+ ```"
338
+ Mbpp/244,"```python
339
+ # solution
340
+ ```"
341
+ Mbpp/245,"```python
342
+ # solution
343
+ ```"
344
+ Mbpp/247,"```python
345
+ # solution
346
+ ```"
347
+ Mbpp/250,"```python
348
+ # solution
349
+ ```"
350
+ Mbpp/251,"```python
351
+ # solution
352
+ ```"
353
+ Mbpp/252,"```python
354
+ # solution
355
+ ```"
356
+ Mbpp/253,"```python
357
+ # solution
358
+ ```"
359
+ Mbpp/255,"```python
360
+ # solution
361
+ ```"
362
+ Mbpp/256,"```python
363
+ # solution
364
+ ```"
365
+ Mbpp/257,"```python
366
+ # solution
367
+ ```"
368
+ Mbpp/259,"```python
369
+ # solution
370
+ ```"
371
+ Mbpp/260,"```python
372
+ # solution
373
+ ```"
374
+ Mbpp/261,"```python
375
+ # solution
376
+ ```"
377
+ Mbpp/262,"```python
378
+ # solution
379
+ ```"
380
+ Mbpp/264,"```python
381
+ # solution
382
+ ```"
383
+ Mbpp/265,"```python
384
+ # solution
385
+ ```"
386
+ Mbpp/266,"```python
387
+ # solution
388
+ ```"
389
+ Mbpp/267,"```python
390
+ # solution
391
+ ```"
392
+ Mbpp/268,"```python
393
+ # solution
394
+ ```"
395
+ Mbpp/269,"```python
396
+ # solution
397
+ ```"
398
+ Mbpp/270,"```python
399
+ # solution
400
+ ```"
401
+ Mbpp/271,"```python
402
+ # solution
403
+ ```"
404
+ Mbpp/272,"```python
405
+ # solution
406
+ ```"
407
+ Mbpp/273,"```python
408
+ # solution
409
+ ```"
410
+ Mbpp/274,"```python
411
+ # solution
412
+ ```"
413
+ Mbpp/276,"```python
414
+ # solution
415
+ ```"
416
+ Mbpp/277,"```python
417
+ # solution
418
+ ```"
419
+ Mbpp/278,"```python
420
+ # solution
421
+ ```"
422
+ Mbpp/279,"```python
423
+ # solution
424
+ ```"
425
+ Mbpp/280,"```python
426
+ # solution
427
+ ```"
428
+ Mbpp/281,"```python
429
+ # solution
430
+ ```"
431
+ Mbpp/282,"```python
432
+ # solution
433
+ ```"
434
+ Mbpp/283,"```python
435
+ # solution
436
+ ```"
437
+ Mbpp/284,"```python
438
+ # solution
439
+ ```"
440
+ Mbpp/285,"```python
441
+ # solution
442
+ ```"
443
+ Mbpp/286,"```python
444
+ # solution
445
+ ```"
446
+ Mbpp/287,"```python
447
+ # solution
448
+ ```"
449
+ Mbpp/290,"```python
450
+ # solution
451
+ ```"
452
+ Mbpp/292,"```python
453
+ # solution
454
+ ```"
455
+ Mbpp/293,"```python
456
+ # solution
457
+ ```"
458
+ Mbpp/294,"```python
459
+ # solution
460
+ ```"
461
+ Mbpp/296,"```python
462
+ # solution
463
+ ```"
464
+ Mbpp/297,"```python
465
+ # solution
466
+ ```"
467
+ Mbpp/299,"```python
468
+ # solution
469
+ ```"
470
+ Mbpp/300,"```python
471
+ # solution
472
+ ```"
473
+ Mbpp/301,"```python
474
+ # solution
475
+ ```"
476
+ Mbpp/305,"```python
477
+ # solution
478
+ ```"
479
+ Mbpp/306,"```python
480
+ # solution
481
+ ```"
482
+ Mbpp/308,"```python
483
+ # solution
484
+ ```"
485
+ Mbpp/309,"```python
486
+ # solution
487
+ ```"
488
+ Mbpp/310,"```python
489
+ # solution
490
+ ```"
491
+ Mbpp/311,"```python
492
+ # solution
493
+ ```"
494
+ Mbpp/312,"```python
495
+ # solution
496
+ ```"
497
+ Mbpp/388,"```python
498
+ # solution
499
+ ```"
500
+ Mbpp/389,"```python
501
+ # solution
502
+ ```"
503
+ Mbpp/390,"```python
504
+ # solution
505
+ ```"
506
+ Mbpp/391,"```python
507
+ # solution
508
+ ```"
509
+ Mbpp/392,"```python
510
+ # solution
511
+ ```"
512
+ Mbpp/394,"```python
513
+ # solution
514
+ ```"
515
+ Mbpp/395,"```python
516
+ # solution
517
+ ```"
518
+ Mbpp/397,"```python
519
+ # solution
520
+ ```"
521
+ Mbpp/398,"```python
522
+ # solution
523
+ ```"
524
+ Mbpp/404,"```python
525
+ # solution
526
+ ```"
527
+ Mbpp/405,"```python
528
+ # solution
529
+ ```"
530
+ Mbpp/406,"```python
531
+ # solution
532
+ ```"
533
+ Mbpp/409,"```python
534
+ # solution
535
+ ```"
536
+ Mbpp/410,"```python
537
+ # solution
538
+ ```"
539
+ Mbpp/412,"```python
540
+ # solution
541
+ ```"
542
+ Mbpp/413,"```python
543
+ # solution
544
+ ```"
545
+ Mbpp/414,"```python
546
+ # solution
547
+ ```"
548
+ Mbpp/415,"```python
549
+ # solution
550
+ ```"
551
+ Mbpp/418,"```python
552
+ # solution
553
+ ```"
554
+ Mbpp/419,"```python
555
+ # solution
556
+ ```"
557
+ Mbpp/420,"```python
558
+ # solution
559
+ ```"
560
+ Mbpp/421,"```python
561
+ # solution
562
+ ```"
563
+ Mbpp/422,"```python
564
+ # solution
565
+ ```"
566
+ Mbpp/424,"```python
567
+ # solution
568
+ ```"
569
+ Mbpp/425,"```python
570
+ # solution
571
+ ```"
572
+ Mbpp/426,"```python
573
+ # solution
574
+ ```"
575
+ Mbpp/427,"```python
576
+ # solution
577
+ ```"
578
+ Mbpp/428,"```python
579
+ # solution
580
+ ```"
581
+ Mbpp/429,"```python
582
+ # solution
583
+ ```"
584
+ Mbpp/430,"```python
585
+ # solution
586
+ ```"
587
+ Mbpp/432,"```python
588
+ # solution
589
+ ```"
590
+ Mbpp/433,"```python
591
+ # solution
592
+ ```"
593
+ Mbpp/435,"```python
594
+ # solution
595
+ ```"
596
+ Mbpp/436,"```python
597
+ # solution
598
+ ```"
599
+ Mbpp/437,"```python
600
+ # solution
601
+ ```"
602
+ Mbpp/439,"```python
603
+ # solution
604
+ ```"
605
+ Mbpp/440,"```python
606
+ # solution
607
+ ```"
608
+ Mbpp/441,"```python
609
+ # solution
610
+ ```"
611
+ Mbpp/445,"```python
612
+ # solution
613
+ ```"
614
+ Mbpp/446,"```python
615
+ # solution
616
+ ```"
617
+ Mbpp/447,"```python
618
+ # solution
619
+ ```"
620
+ Mbpp/448,"```python
621
+ # solution
622
+ ```"
623
+ Mbpp/450,"```python
624
+ # solution
625
+ ```"
626
+ Mbpp/451,"```python
627
+ # solution
628
+ ```"
629
+ Mbpp/453,"```python
630
+ # solution
631
+ ```"
632
+ Mbpp/454,"```python
633
+ # solution
634
+ ```"
635
+ Mbpp/455,"```python
636
+ # solution
637
+ ```"
638
+ Mbpp/456,"```python
639
+ # solution
640
+ ```"
641
+ Mbpp/457,"```python
642
+ # solution
643
+ ```"
644
+ Mbpp/458,"```python
645
+ # solution
646
+ ```"
647
+ Mbpp/459,"```python
648
+ # solution
649
+ ```"
650
+ Mbpp/460,"```python
651
+ # solution
652
+ ```"
653
+ Mbpp/462,"```python
654
+ # solution
655
+ ```"
656
+ Mbpp/463,"```python
657
+ # solution
658
+ ```"
659
+ Mbpp/465,"```python
660
+ # solution
661
+ ```"
662
+ Mbpp/468,"```python
663
+ # solution
664
+ ```"
665
+ Mbpp/470,"```python
666
+ # solution
667
+ ```"
668
+ Mbpp/471,"```python
669
+ # solution
670
+ ```"
671
+ Mbpp/472,"```python
672
+ # solution
673
+ ```"
674
+ Mbpp/473,"```python
675
+ # solution
676
+ ```"
677
+ Mbpp/474,"```python
678
+ # solution
679
+ ```"
680
+ Mbpp/475,"```python
681
+ # solution
682
+ ```"
683
+ Mbpp/476,"```python
684
+ # solution
685
+ ```"
686
+ Mbpp/477,"```python
687
+ # solution
688
+ ```"
689
+ Mbpp/478,"```python
690
+ # solution
691
+ ```"
692
+ Mbpp/479,"```python
693
+ # solution
694
+ ```"
695
+ Mbpp/554,"```python
696
+ # solution
697
+ ```"
698
+ Mbpp/555,"```python
699
+ # solution
700
+ ```"
701
+ Mbpp/556,"```python
702
+ # solution
703
+ ```"
704
+ Mbpp/557,"```python
705
+ # solution
706
+ ```"
707
+ Mbpp/558,"```python
708
+ # solution
709
+ ```"
710
+ Mbpp/559,"```python
711
+ # solution
712
+ ```"
713
+ Mbpp/560,"```python
714
+ # solution
715
+ ```"
716
+ Mbpp/562,"```python
717
+ # solution
718
+ ```"
719
+ Mbpp/563,"```python
720
+ # solution
721
+ ```"
722
+ Mbpp/564,"```python
723
+ # solution
724
+ ```"
725
+ Mbpp/565,"```python
726
+ # solution
727
+ ```"
728
+ Mbpp/566,"```python
729
+ # solution
730
+ ```"
731
+ Mbpp/567,"```python
732
+ # solution
733
+ ```"
734
+ Mbpp/568,"```python
735
+ # solution
736
+ ```"
737
+ Mbpp/569,"```python
738
+ # solution
739
+ ```"
740
+ Mbpp/572,"```python
741
+ # solution
742
+ ```"
743
+ Mbpp/573,"```python
744
+ # solution
745
+ ```"
746
+ Mbpp/576,"```python
747
+ # solution
748
+ ```"
749
+ Mbpp/577,"```python
750
+ # solution
751
+ ```"
752
+ Mbpp/578,"```python
753
+ # solution
754
+ ```"
755
+ Mbpp/579,"```python
756
+ # solution
757
+ ```"
758
+ Mbpp/580,"```python
759
+ # solution
760
+ ```"
761
+ Mbpp/581,"```python
762
+ # solution
763
+ ```"
764
+ Mbpp/583,"```python
765
+ # solution
766
+ ```"
767
+ Mbpp/585,"```python
768
+ # solution
769
+ ```"
770
+ Mbpp/586,"```python
771
+ # solution
772
+ ```"
773
+ Mbpp/587,"```python
774
+ # solution
775
+ ```"
776
+ Mbpp/588,"```python
777
+ # solution
778
+ ```"
779
+ Mbpp/589,"```python
780
+ # solution
781
+ ```"
782
+ Mbpp/590,"```python
783
+ # solution
784
+ ```"
785
+ Mbpp/591,"```python
786
+ # solution
787
+ ```"
788
+ Mbpp/592,"```python
789
+ # solution
790
+ ```"
791
+ Mbpp/593,"```python
792
+ # solution
793
+ ```"
794
+ Mbpp/594,"```python
795
+ # solution
796
+ ```"
797
+ Mbpp/596,"```python
798
+ # solution
799
+ ```"
800
+ Mbpp/597,"```python
801
+ # solution
802
+ ```"
803
+ Mbpp/598,"```python
804
+ # solution
805
+ ```"
806
+ Mbpp/599,"```python
807
+ # solution
808
+ ```"
809
+ Mbpp/600,"```python
810
+ # solution
811
+ ```"
812
+ Mbpp/602,"```python
813
+ # solution
814
+ ```"
815
+ Mbpp/603,"```python
816
+ # solution
817
+ ```"
818
+ Mbpp/604,"```python
819
+ # solution
820
+ ```"
821
+ Mbpp/605,"```python
822
+ # solution
823
+ ```"
824
+ Mbpp/606,"```python
825
+ # solution
826
+ ```"
827
+ Mbpp/607,"```python
828
+ # solution
829
+ ```"
830
+ Mbpp/608,"```python
831
+ # solution
832
+ ```"
833
+ Mbpp/610,"```python
834
+ # solution
835
+ ```"
836
+ Mbpp/611,"```python
837
+ # solution
838
+ ```"
839
+ Mbpp/612,"```python
840
+ # solution
841
+ ```"
842
+ Mbpp/614,"```python
843
+ # solution
844
+ ```"
845
+ Mbpp/615,"```python
846
+ # solution
847
+ ```"
848
+ Mbpp/616,"```python
849
+ # solution
850
+ ```"
851
+ Mbpp/618,"```python
852
+ # solution
853
+ ```"
854
+ Mbpp/619,"```python
855
+ # solution
856
+ ```"
857
+ Mbpp/620,"```python
858
+ # solution
859
+ ```"
860
+ Mbpp/622,"```python
861
+ # solution
862
+ ```"
863
+ Mbpp/623,"```python
864
+ # solution
865
+ ```"
866
+ Mbpp/624,"```python
867
+ # solution
868
+ ```"
869
+ Mbpp/626,"```python
870
+ # solution
871
+ ```"
872
+ Mbpp/628,"```python
873
+ # solution
874
+ ```"
875
+ Mbpp/629,"```python
876
+ # solution
877
+ ```"
878
+ Mbpp/630,"```python
879
+ # solution
880
+ ```"
881
+ Mbpp/631,"```python
882
+ # solution
883
+ ```"
884
+ Mbpp/632,"```python
885
+ # solution
886
+ ```"
887
+ Mbpp/633,"```python
888
+ # solution
889
+ ```"
890
+ Mbpp/635,"```python
891
+ # solution
892
+ ```"
893
+ Mbpp/637,"```python
894
+ # solution
895
+ ```"
896
+ Mbpp/638,"```python
897
+ # solution
898
+ ```"
899
+ Mbpp/639,"```python
900
+ # solution
901
+ ```"
902
+ Mbpp/641,"```python
903
+ # solution
904
+ ```"
905
+ Mbpp/643,"```python
906
+ # solution
907
+ ```"
908
+ Mbpp/644,"```python
909
+ # solution
910
+ ```"
911
+ Mbpp/720,"```python
912
+ # solution
913
+ ```"
914
+ Mbpp/721,"```python
915
+ # solution
916
+ ```"
917
+ Mbpp/722,"```python
918
+ # solution
919
+ ```"
920
+ Mbpp/723,"```python
921
+ # solution
922
+ ```"
923
+ Mbpp/724,"```python
924
+ # solution
925
+ ```"
926
+ Mbpp/725,"```python
927
+ # solution
928
+ ```"
929
+ Mbpp/726,"```python
930
+ # solution
931
+ ```"
932
+ Mbpp/728,"```python
933
+ # solution
934
+ ```"
935
+ Mbpp/730,"```python
936
+ # solution
937
+ ```"
938
+ Mbpp/731,"```python
939
+ # solution
940
+ ```"
941
+ Mbpp/732,"```python
942
+ # solution
943
+ ```"
944
+ Mbpp/733,"```python
945
+ # solution
946
+ ```"
947
+ Mbpp/734,"```python
948
+ # solution
949
+ ```"
950
+ Mbpp/735,"```python
951
+ # solution
952
+ ```"
953
+ Mbpp/736,"```python
954
+ # solution
955
+ ```"
956
+ Mbpp/737,"```python
957
+ # solution
958
+ ```"
959
+ Mbpp/739,"```python
960
+ # solution
961
+ ```"
962
+ Mbpp/740,"```python
963
+ # solution
964
+ ```"
965
+ Mbpp/741,"```python
966
+ # solution
967
+ ```"
968
+ Mbpp/742,"```python
969
+ # solution
970
+ ```"
971
+ Mbpp/743,"```python
972
+ # solution
973
+ ```"
974
+ Mbpp/744,"```python
975
+ # solution
976
+ ```"
977
+ Mbpp/745,"```python
978
+ # solution
979
+ ```"
980
+ Mbpp/748,"```python
981
+ # solution
982
+ ```"
983
+ Mbpp/749,"```python
984
+ # solution
985
+ ```"
986
+ Mbpp/750,"```python
987
+ # solution
988
+ ```"
989
+ Mbpp/751,"```python
990
+ # solution
991
+ ```"
992
+ Mbpp/752,"```python
993
+ # solution
994
+ ```"
995
+ Mbpp/753,"```python
996
+ # solution
997
+ ```"
998
+ Mbpp/754,"```python
999
+ # solution
1000
+ ```"
1001
+ Mbpp/755,"```python
1002
+ # solution
1003
+ ```"
1004
+ Mbpp/757,"```python
1005
+ # solution
1006
+ ```"
1007
+ Mbpp/758,"```python
1008
+ # solution
1009
+ ```"
1010
+ Mbpp/759,"```python
1011
+ # solution
1012
+ ```"
1013
+ Mbpp/760,"```python
1014
+ # solution
1015
+ ```"
1016
+ Mbpp/762,"```python
1017
+ # solution
1018
+ ```"
1019
+ Mbpp/763,"```python
1020
+ # solution
1021
+ ```"
1022
+ Mbpp/764,"```python
1023
+ # solution
1024
+ ```"
1025
+ Mbpp/765,"```python
1026
+ # solution
1027
+ ```"
1028
+ Mbpp/766,"```python
1029
+ # solution
1030
+ ```"
1031
+ Mbpp/767,"```python
1032
+ # solution
1033
+ ```"
1034
+ Mbpp/769,"```python
1035
+ # solution
1036
+ ```"
1037
+ Mbpp/770,"```python
1038
+ # solution
1039
+ ```"
1040
+ Mbpp/771,"```python
1041
+ # solution
1042
+ ```"
1043
+ Mbpp/772,"```python
1044
+ # solution
1045
+ ```"
1046
+ Mbpp/773,"```python
1047
+ # solution
1048
+ ```"
1049
+ Mbpp/775,"```python
1050
+ # solution
1051
+ ```"
1052
+ Mbpp/777,"```python
1053
+ # solution
1054
+ ```"
1055
+ Mbpp/778,"```python
1056
+ # solution
1057
+ ```"
1058
+ Mbpp/780,"```python
1059
+ # solution
1060
+ ```"
1061
+ Mbpp/781,"```python
1062
+ # solution
1063
+ ```"
1064
+ Mbpp/782,"```python
1065
+ # solution
1066
+ ```"
1067
+ Mbpp/784,"```python
1068
+ # solution
1069
+ ```"
1070
+ Mbpp/785,"```python
1071
+ # solution
1072
+ ```"
1073
+ Mbpp/786,"```python
1074
+ # solution
1075
+ ```"
1076
+ Mbpp/787,"```python
1077
+ # solution
1078
+ ```"
1079
+ Mbpp/788,"```python
1080
+ # solution
1081
+ ```"
1082
+ Mbpp/790,"```python
1083
+ # solution
1084
+ ```"
1085
+ Mbpp/791,"```python
1086
+ # solution
1087
+ ```"
1088
+ Mbpp/792,"```python
1089
+ # solution
1090
+ ```"
1091
+ Mbpp/793,"```python
1092
+ # solution
1093
+ ```"
1094
+ Mbpp/794,"```python
1095
+ # solution
1096
+ ```"
1097
+ Mbpp/796,"```python
1098
+ # solution
1099
+ ```"
1100
+ Mbpp/797,"```python
1101
+ # solution
1102
+ ```"
1103
+ Mbpp/798,"```python
1104
+ # solution
1105
+ ```"
1106
+ Mbpp/799,"```python
1107
+ # solution
1108
+ ```"
1109
+ Mbpp/800,"```python
1110
+ # solution
1111
+ ```"
1112
+ Mbpp/801,"```python
1113
+ # solution
1114
+ ```"
1115
+ Mbpp/803,"```python
1116
+ # solution
1117
+ ```"
1118
+ Mbpp/804,"```python
1119
+ # solution
1120
+ ```"
1121
+ Mbpp/805,"```python
1122
+ # solution
1123
+ ```"
1124
+ Mbpp/806,"```python
1125
+ # solution
1126
+ ```"
1127
+ Mbpp/807,"```python
1128
+ # solution
1129
+ ```"
1130
+ Mbpp/808,"```python
1131
+ # solution
1132
+ ```"
1133
+ Mbpp/809,"```python
1134
+ # solution
1135
+ ```"
mbppplus/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:92fbabbe5baa241ba2db11e2ac3ba1f14981fd24df071d459735ce14acdcc0ac
3
+ size 1107237