Datasets:
gabeorlanski
commited on
Commit
•
92f2381
1
Parent(s):
3618cd0
Update bc-transcoder.py
Browse files- bc-transcoder.py +14 -5
bc-transcoder.py
CHANGED
@@ -48,12 +48,16 @@ _VERSION = "1.0.0"
|
|
48 |
|
49 |
_KEYS_REMOVE = {"text", "signature_with_docstring"}
|
50 |
|
|
|
51 |
_QUESTION_INFO_KEYS = {
|
52 |
"entry_fn_name",
|
53 |
"entry_cls_name",
|
54 |
"test_code",
|
55 |
"test_list",
|
56 |
"test_case_ids",
|
|
|
|
|
|
|
57 |
}
|
58 |
|
59 |
class BCTranscoder(datasets.GeneratorBasedBuilder):
|
@@ -78,6 +82,15 @@ class BCTranscoder(datasets.GeneratorBasedBuilder):
|
|
78 |
DEFAULT_CONFIG_NAME = "all"
|
79 |
|
80 |
def _info(self):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
features = datasets.Features({
|
82 |
"qid": datasets.Value("string"),
|
83 |
"title": datasets.Value("string"),
|
@@ -86,11 +99,7 @@ class BCTranscoder(datasets.GeneratorBasedBuilder):
|
|
86 |
"arguments": datasets.Sequence(datasets.Value("string")),
|
87 |
"source_py": datasets.Value("string"),
|
88 |
"source_cpp": 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':
|
|
|
48 |
|
49 |
_KEYS_REMOVE = {"text", "signature_with_docstring"}
|
50 |
|
51 |
+
|
52 |
_QUESTION_INFO_KEYS = {
|
53 |
"entry_fn_name",
|
54 |
"entry_cls_name",
|
55 |
"test_code",
|
56 |
"test_list",
|
57 |
"test_case_ids",
|
58 |
+
"commands",
|
59 |
+
"timeouts",
|
60 |
+
"extension"
|
61 |
}
|
62 |
|
63 |
class BCTranscoder(datasets.GeneratorBasedBuilder):
|
|
|
82 |
DEFAULT_CONFIG_NAME = "all"
|
83 |
|
84 |
def _info(self):
|
85 |
+
list_keys = ['timeouts', 'commands', 'test_case_ids']
|
86 |
+
question_info_type = {
|
87 |
+
k:datasets.Value(dtype="string")
|
88 |
+
for k in _QUESTION_INFO_KEYS if k not in list_keys
|
89 |
+
}
|
90 |
+
question_info_type['test_case_ids'] = datasets.Sequence(datasets.Value('string'))
|
91 |
+
question_info_type['commands'] = datasets.Sequence(datasets.Sequence(datasets.Value('string')))
|
92 |
+
question_info_type['timeouts'] = datasets.Sequence(datasets.Value('int32'))
|
93 |
+
|
94 |
features = datasets.Features({
|
95 |
"qid": datasets.Value("string"),
|
96 |
"title": datasets.Value("string"),
|
|
|
99 |
"arguments": datasets.Sequence(datasets.Value("string")),
|
100 |
"source_py": datasets.Value("string"),
|
101 |
"source_cpp": datasets.Value("string"),
|
102 |
+
"question_info": datasets.Features(question_info_type)
|
|
|
|
|
|
|
|
|
103 |
})
|
104 |
description = _DESCRIPTION
|
105 |
if self.config.name != 'all':
|