Datasets:
gabeorlanski
commited on
Commit
·
3587674
1
Parent(s):
5807e44
Update tp3.py
Browse files
tp3.py
CHANGED
@@ -46,6 +46,14 @@ _LICENSE = "CC-BY-4.0"
|
|
46 |
|
47 |
_VERSION = "1.0.0"
|
48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
class TP3(datasets.GeneratorBasedBuilder):
|
51 |
"""TP3"""
|
@@ -77,12 +85,12 @@ class TP3(datasets.GeneratorBasedBuilder):
|
|
77 |
"signature_with_docstring": datasets.Value("string"),
|
78 |
"signature": datasets.Value("string"),
|
79 |
"arguments": datasets.Sequence(datasets.Value("string")),
|
80 |
-
"entry_fn_name": datasets.Value("string"),
|
81 |
-
"entry_cls_name": datasets.Value("string"),
|
82 |
-
"test_code": datasets.Value("string"),
|
83 |
"source": datasets.Value("string"),
|
84 |
-
"
|
85 |
-
|
|
|
|
|
|
|
86 |
})
|
87 |
description = _DESCRIPTION
|
88 |
if self.config.name != 'all':
|
@@ -118,7 +126,13 @@ class TP3(datasets.GeneratorBasedBuilder):
|
|
118 |
if self.config.name != 'all' and d['language'] != self.config.name:
|
119 |
continue
|
120 |
|
121 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
d['source'] = d.pop('solution_python')
|
123 |
|
124 |
yield id_, d
|
|
|
46 |
|
47 |
_VERSION = "1.0.0"
|
48 |
|
49 |
+
_QUESTION_INFO_KEYS = {
|
50 |
+
"entry_fn_name",
|
51 |
+
"entry_cls_name",
|
52 |
+
"test_code",
|
53 |
+
"test_list",
|
54 |
+
"test_case_ids",
|
55 |
+
}
|
56 |
+
|
57 |
|
58 |
class TP3(datasets.GeneratorBasedBuilder):
|
59 |
"""TP3"""
|
|
|
85 |
"signature_with_docstring": datasets.Value("string"),
|
86 |
"signature": datasets.Value("string"),
|
87 |
"arguments": datasets.Sequence(datasets.Value("string")),
|
|
|
|
|
|
|
88 |
"source": datasets.Value("string"),
|
89 |
+
"question_info":
|
90 |
+
datasets.Features({
|
91 |
+
k:datasets.Value(dtype="string")
|
92 |
+
for k in _QUESTION_INFO_KEYS
|
93 |
+
})
|
94 |
})
|
95 |
description = _DESCRIPTION
|
96 |
if self.config.name != 'all':
|
|
|
126 |
if self.config.name != 'all' and d['language'] != self.config.name:
|
127 |
continue
|
128 |
|
129 |
+
question_info = {}
|
130 |
+
for k in _QUESTION_INFO_KEYS:
|
131 |
+
question_info[k] = d.pop(k)
|
132 |
+
|
133 |
+
question_info['test_list'] = json.dumps(question_info['test_list'])
|
134 |
+
|
135 |
+
d['question_info'] = question_info
|
136 |
d['source'] = d.pop('solution_python')
|
137 |
|
138 |
yield id_, d
|