Xnhyacinth's picture
Upload HarnessMix codegen train and held-out eval data
01a492e verified
Raw
History Blame Contribute Delete
6.67 kB
import subprocess
import sys
from pathlib import Path
cases = [{'input': '2\n6\n1\n', 'output': '133337\n1337\n'}, {'input': '10\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n', 'output': '1337\n13377\n13337\n133737\n1337737\n133337\n1337337\n13377337\n133777337\n1333337\n'}, {'input': '10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n', 'output': '13373337\n133773337\n1337773337\n13377773337\n13333337\n133733337\n1337733337\n13377733337\n133777733337\n1337777733337\n'}, {'input': '10\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n', 'output': '133333337\n1337333337\n13377333337\n133777333337\n1337777333337\n13377777333337\n133777777333337\n1333333337\n13373333337\n133773333337\n'}, {'input': '10\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n', 'output': '1337773333337\n13377773333337\n133777773333337\n1337777773333337\n13377777773333337\n13333333337\n133733333337\n1337733333337\n13377733333337\n133777733333337\n'}, {'input': '10\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n', 'output': '1337777733333337\n13377777733333337\n133777777733333337\n1337777777733333337\n133333333337\n1337333333337\n13377333333337\n133777333333337\n1337777333333337\n13377777333333337\n'}, {'input': '10\n51\n52\n53\n54\n55\n56\n57\n58\n59\n60\n', 'output': '133777777333333337\n1337777777333333337\n13377777777333333337\n133777777777333333337\n1333333333337\n13373333333337\n133773333333337\n1337773333333337\n13377773333333337\n133777773333333337\n'}, {'input': '10\n61\n62\n63\n64\n65\n66\n67\n68\n69\n70\n', 'output': '1337777773333333337\n13377777773333333337\n133777777773333333337\n1337777777773333333337\n13377777777773333333337\n13333333333337\n133733333333337\n1337733333333337\n13377733333333337\n133777733333333337\n'}, {'input': '10\n71\n72\n73\n74\n75\n76\n77\n78\n79\n80\n', 'output': '1337777733333333337\n13377777733333333337\n133777777733333333337\n1337777777733333333337\n13377777777733333333337\n133777777777733333333337\n1337777777777733333333337\n133333333333337\n1337333333333337\n13377333333333337\n'}, {'input': '10\n81\n82\n83\n84\n85\n86\n87\n88\n89\n90\n', 'output': '133777333333333337\n1337777333333333337\n13377777333333333337\n133777777333333333337\n1337777777333333333337\n13377777777333333333337\n133777777777333333333337\n1337777777777333333333337\n13377777777777333333333337\n133777777777777333333333337\n'}, {'input': '10\n91\n92\n93\n94\n95\n96\n97\n98\n99\n100\n', 'output': '1333333333333337\n13373333333333337\n133773333333333337\n1337773333333333337\n13377773333333333337\n133777773333333333337\n1337777773333333333337\n13377777773333333333337\n133777777773333333333337\n1337777777773333333333337\n'}, {'input': '10\n101\n102\n103\n104\n105\n106\n107\n108\n109\n110\n', 'output': '13377777777773333333333337\n133777777777773333333333337\n1337777777777773333333333337\n13377777777777773333333333337\n13333333333333337\n133733333333333337\n1337733333333333337\n13377733333333333337\n133777733333333333337\n1337777733333333333337\n'}, {'input': '10\n111\n112\n113\n114\n115\n116\n117\n118\n119\n120\n', 'output': '13377777733333333333337\n133777777733333333333337\n1337777777733333333333337\n13377777777733333333333337\n133777777777733333333333337\n1337777777777733333333333337\n13377777777777733333333333337\n133777777777777733333333333337\n1337777777777777733333333333337\n133333333333333337\n'}, {'input': '10\n121\n122\n123\n124\n125\n126\n127\n128\n129\n130\n', 'output': '1337333333333333337\n13377333333333333337\n133777333333333333337\n1337777333333333333337\n13377777333333333333337\n133777777333333333333337\n1337777777333333333333337\n13377777777333333333333337\n133777777777333333333333337\n1337777777777333333333333337\n'}, {'input': '10\n131\n132\n133\n134\n135\n136\n137\n138\n139\n140\n', 'output': '13377777777777333333333333337\n133777777777777333333333333337\n1337777777777777333333333333337\n13377777777777777333333333333337\n133777777777777777333333333333337\n1333333333333333337\n13373333333333333337\n133773333333333333337\n1337773333333333333337\n13377773333333333333337\n'}, {'input': '10\n141\n142\n143\n144\n145\n146\n147\n148\n149\n150\n', 'output': '133777773333333333333337\n1337777773333333333333337\n13377777773333333333333337\n133777777773333333333333337\n1337777777773333333333333337\n13377777777773333333333333337\n133777777777773333333333333337\n1337777777777773333333333333337\n13377777777777773333333333333337\n133777777777777773333333333333337\n'}, {'input': '10\n151\n152\n153\n154\n155\n156\n157\n158\n159\n160\n', 'output': '1337777777777777773333333333333337\n13377777777777777773333333333333337\n13333333333333333337\n133733333333333333337\n1337733333333333333337\n13377733333333333333337\n133777733333333333333337\n1337777733333333333333337\n13377777733333333333333337\n133777777733333333333333337\n'}, {'input': '10\n161\n162\n163\n164\n165\n166\n167\n168\n169\n170\n', 'output': '1337777777733333333333333337\n13377777777733333333333333337\n133777777777733333333333333337\n1337777777777733333333333333337\n13377777777777733333333333333337\n133777777777777733333333333333337\n1337777777777777733333333333333337\n13377777777777777733333333333333337\n133777777777777777733333333333333337\n1337777777777777777733333333333333337\n'}, {'input': '10\n171\n172\n173\n174\n175\n176\n177\n178\n179\n180\n', 'output': '133333333333333333337\n1337333333333333333337\n13377333333333333333337\n133777333333333333333337\n1337777333333333333333337\n13377777333333333333333337\n133777777333333333333333337\n1337777777333333333333333337\n13377777777333333333333333337\n133777777777333333333333333337\n'}, {'input': '10\n181\n182\n183\n184\n185\n186\n187\n188\n189\n190\n', 'output': '1337777777777333333333333333337\n13377777777777333333333333333337\n133777777777777333333333333333337\n1337777777777777333333333333333337\n13377777777777777333333333333333337\n133777777777777777333333333333333337\n1337777777777777777333333333333333337\n13377777777777777777333333333333333337\n133777777777777777777333333333333333337\n1333333333333333333337\n'}]
solution = Path(__file__).with_name("solution.py")
for index, case in enumerate(cases):
proc = subprocess.run(
[sys.executable, str(solution)],
input=case["input"],
text=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
timeout=10,
)
if proc.returncode != 0:
raise AssertionError(f"case {index} exited {proc.returncode}: {proc.stderr}")
got = proc.stdout.strip()
expected = case["output"].strip()
if got.split() != expected.split():
raise AssertionError(
f"case {index} output mismatch\nexpected={expected!r}\ngot={got!r}\nstderr={proc.stderr}"
)
print('deepcoder_primeintellect_io')