Download python_lora_dataset_builder/tests/test_sandbox_contract.py from api-relay/sadASDasd: direct link, hf CLI and curl.
- Browser
- Download file 371 Bytes
-
https://huggingface.co/datasets/api-relay/sadASDasd/resolve/main/python_lora_dataset_builder/tests/test_sandbox_contract.py
- Command line
-
hf download hf://datasets/api-relay/sadASDasd/python_lora_dataset_builder/tests/test_sandbox_contract.py
-
curl -L -o test_sandbox_contract.py https://huggingface.co/datasets/api-relay/sadASDasd/resolve/main/python_lora_dataset_builder/tests/test_sandbox_contract.py
371 Bytes
| from pipeline.sandbox import run_code | |
| def test_execution_status_passed(): | |
| result = run_code("x = 1\nprint(x)", timeout_seconds=5) | |
| assert result.status == "passed" | |
| assert result.passed | |
| def test_execution_status_failed(): | |
| result = run_code("raise RuntimeError('test')", timeout_seconds=5) | |
| assert result.status == "failed" | |
| assert not result.passed | |