SYSUSELab/RustRepoTrans
Evaluating Large Language Models in Repository-level Code Translation RustRepoTrans is the first repository-level code translation benchmark described in the paper "RustRepoTrans: Repository-level Code Translation Benchmark Targeting Rust". Feel free to contact us to submit new results. Benchmark Dataset RustRepoTrans, the first repository-level code translation benchmark comprising 375 tasks targeting Rust, consists of 122 java-rust function pairs, 145 c-rust… See the full description on the dataset page: https://huggingface.co/datasets/SYSUSELab/RustRepoTrans.
3104
1import os
2import sys
3import shutil
4
5source_path = "function_pair_with_identical_functionality"
6target_project = sys.argv[1]
7
8projects = os.listdir(source_path)
9for project in projects:
10 if project == target_project :
11 pairs = os.listdir(os.path.join(source_path, project))
12 for pair in pairs:
13 function_files = os.listdir(os.path.join(source_path, project, pair))
14 for function_file in function_files:
15 with open(os.path.join(source_path, project, pair, function_file), 'r') as input_file:
16 context = input_file.read()
17 if context.startswith("None"):
18 os.remove(os.path.join(source_path, project, pair, function_file))