FudanSELab commited on
Commit
599abd4
1 Parent(s): 291ed0e

Update ClassEval.py

Browse files
Files changed (1) hide show
  1. ClassEval.py +28 -14
ClassEval.py CHANGED
@@ -89,17 +89,31 @@ class ClassEval(datasets.GeneratorBasedBuilder):
89
  with open(filepath, encoding = 'utf-8') as f:
90
  cont = json.load(f)
91
  for row in cont:
92
- key += 1
93
- yield key, {
94
- "task_id": row["task_id"],
95
- "skeleton": row["skeleton"],
96
- "test": row["test"],
97
- "solution_code": row["solution_code"],
98
- "import_statement": row["import_statement"],
99
- "class_description": row["class_description"],
100
- "class_name": row["class_name"],
101
- "test_classes": row["test_classes"],
102
- "class_constructor": row["class_constructor"],
103
- "fields": row["fields"],
104
- # "methods_info": row["methods_info"],
105
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  with open(filepath, encoding = 'utf-8') as f:
90
  cont = json.load(f)
91
  for row in cont:
92
+ for method_info in row["methods_info"]:
93
+ for dependency in method_info["dependencies"]:
94
+ yield key, {
95
+ "task_id": row["task_id"],
96
+ "skeleton": row["skeleton"],
97
+ "test": row["test"],
98
+ "solution_code": row["solution_code"],
99
+ "import_statement": row["import_statement"],
100
+ "class_description": row["class_description"],
101
+ "class_name": row["class_name"],
102
+ "test_classes": row["test_classes"],
103
+ "class_constructor": row["class_constructor"],
104
+ "fields": row["fields"],
105
+ "methods_info": {
106
+ "method_name": method_info["method_name"],
107
+ "method_description": method_info["method_description"],
108
+ "test_class": method_info["test_class"],
109
+ "test_code": method_info["test_code"],
110
+ "solution_code": method_info["solution_code"],
111
+ "dependencies": {
112
+ "Standalone": dependency["Standalone"],
113
+ "lib_dependencies": dependency["lib_dependencies"],
114
+ "field_dependencies": dependency["field_dependencies"],
115
+ "method_dependencies": dependency["method_dependencies"],
116
+ },
117
+ },
118
+ }
119
+ key += 1