Datasets:
Commit ·
5b43763
1
Parent(s): 65e5c5c
Update tp3.py
Browse files
tp3.py
CHANGED
|
@@ -47,11 +47,8 @@ _LICENSE = "CC-BY-4.0"
|
|
| 47 |
_VERSION = "1.0.0"
|
| 48 |
|
| 49 |
_QUESTION_INFO_KEYS = {
|
| 50 |
-
"entry_fn_name",
|
| 51 |
-
"
|
| 52 |
-
"test_code",
|
| 53 |
-
"test_list",
|
| 54 |
-
"test_case_ids",
|
| 55 |
}
|
| 56 |
|
| 57 |
|
|
@@ -77,6 +74,17 @@ class TP3(datasets.GeneratorBasedBuilder):
|
|
| 77 |
DEFAULT_CONFIG_NAME = "all"
|
| 78 |
|
| 79 |
def _info(self):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
features = datasets.Features({
|
| 81 |
"qid": datasets.Value("string"),
|
| 82 |
"title": datasets.Value("string"),
|
|
@@ -86,11 +94,7 @@ class TP3(datasets.GeneratorBasedBuilder):
|
|
| 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':
|
|
@@ -129,7 +133,7 @@ class TP3(datasets.GeneratorBasedBuilder):
|
|
| 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
|
|
|
|
| 47 |
_VERSION = "1.0.0"
|
| 48 |
|
| 49 |
_QUESTION_INFO_KEYS = {
|
| 50 |
+
"entry_fn_name", "entry_cls_name", "test_code", "test_list",
|
| 51 |
+
"test_case_ids", "commands", "timeouts", "extension"
|
|
|
|
|
|
|
|
|
|
| 52 |
}
|
| 53 |
|
| 54 |
|
|
|
|
| 74 |
DEFAULT_CONFIG_NAME = "all"
|
| 75 |
|
| 76 |
def _info(self):
|
| 77 |
+
list_keys = ['timeouts', 'commands', 'test_case_ids']
|
| 78 |
+
question_info_type = {
|
| 79 |
+
k: datasets.Value(dtype="string")
|
| 80 |
+
for k in _QUESTION_INFO_KEYS
|
| 81 |
+
if k not in list_keys
|
| 82 |
+
}
|
| 83 |
+
question_info_type['test_case_ids'] = datasets.Sequence(
|
| 84 |
+
datasets.Value('string'))
|
| 85 |
+
question_info_type['commands'] = datasets.Sequence(
|
| 86 |
+
datasets.Sequence(datasets.Value('string')))
|
| 87 |
+
question_info_type['timeouts'] = datasets.Sequence(datasets.Value('int32'))
|
| 88 |
features = datasets.Features({
|
| 89 |
"qid": datasets.Value("string"),
|
| 90 |
"title": datasets.Value("string"),
|
|
|
|
| 94 |
"signature": datasets.Value("string"),
|
| 95 |
"arguments": datasets.Sequence(datasets.Value("string")),
|
| 96 |
"source": datasets.Value("string"),
|
| 97 |
+
"question_info": datasets.Features(question_info_type)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
})
|
| 99 |
description = _DESCRIPTION
|
| 100 |
if self.config.name != 'all':
|
|
|
|
| 133 |
question_info = {}
|
| 134 |
for k in _QUESTION_INFO_KEYS:
|
| 135 |
question_info[k] = d.pop(k)
|
| 136 |
+
|
| 137 |
question_info['test_list'] = json.dumps(question_info['test_list'])
|
| 138 |
|
| 139 |
d['question_info'] = question_info
|