diff --git a/prover/evaluate.py b/prover/evaluate.py index 6becb9d..0868680 100644 --- a/prover/evaluate.py +++ b/prover/evaluate.py @@ -66,11 +66,17 @@ def _get_theorems_from_files( repo = LeanGitRepo(t["url"], t["commit"]) theorems.append(Theorem(repo, t["file_path"], t["full_name"])) positions.append(Pos(*t["start"])) - # jointly sort theorems and positions + + # Jointly sort theorems and positions theorems_and_positions = list(zip(theorems, positions)) - theorems_and_positions.sort(key=lambda x: hashlib.md5(f"{x[0].file_path}:{x[0].full_name}".encode()).hexdigest()) + theorems_and_positions.sort( + key=lambda x: hashlib.md5( + f"{x[0].file_path}:{x[0].full_name}".encode() + ).hexdigest() + ) theorems, positions = zip(*theorems_and_positions) theorems, positions = list(theorems), list(positions) + if num_theorems is not None: theorems = theorems[:num_theorems] positions = positions[:num_theorems]