Download python_lora_dataset_builder/tests/test_static_checks.py from api-relay/sadASDasd: direct link, hf CLI and curl.
- Browser
- Download file 504 Bytes
-
https://huggingface.co/datasets/api-relay/sadASDasd/resolve/main/python_lora_dataset_builder/tests/test_static_checks.py
- Command line
-
hf download hf://datasets/api-relay/sadASDasd/python_lora_dataset_builder/tests/test_static_checks.py
-
curl -L -o test_static_checks.py https://huggingface.co/datasets/api-relay/sadASDasd/resolve/main/python_lora_dataset_builder/tests/test_static_checks.py
504 Bytes
| from pipeline.static_checks import inspect_code, is_basic_syntax_candidate | |
| def test_valid_code(): | |
| result = inspect_code("x = 1\nprint(x)") | |
| assert result.ast_valid | |
| assert result.compile_valid | |
| assert not result.secret_found | |
| def test_invalid_code(): | |
| result = inspect_code("def broken(:\n pass") | |
| assert not result.ast_valid | |
| def test_import_is_later_tier(): | |
| result = inspect_code("import json\nprint(json.dumps({}))") | |
| assert not is_basic_syntax_candidate(result.imports) | |