Spaces:
Sleeping
Sleeping
Download scripts/check_100k_algorithms.py from kumar6591/data-quality-env: direct link, hf CLI and curl.
- Browser
- Download file 863 Bytes
-
https://huggingface.co/spaces/kumar6591/data-quality-env/resolve/main/scripts/check_100k_algorithms.py
- Command line
-
hf download hf://spaces/kumar6591/data-quality-env/scripts/check_100k_algorithms.py
-
curl -L -o check_100k_algorithms.py https://huggingface.co/spaces/kumar6591/data-quality-env/resolve/main/scripts/check_100k_algorithms.py
863 Bytes
| from __future__ import annotations | |
| import sys | |
| from pathlib import Path | |
| ROOT = Path(__file__).resolve().parents[1] | |
| if str(ROOT) not in sys.path: | |
| sys.path.insert(0, str(ROOT)) | |
| from env.algorithm_bank import algorithm_rule_check, generate_100k_algorithms | |
| def main() -> None: | |
| algos = generate_100k_algorithms() | |
| assert len(algos) == 100_000, f"Expected 100000 algorithms, got {len(algos)}" | |
| # Representative safe probe set aligned with environment constraints. | |
| queries = [ | |
| "SELECT * FROM customers LIMIT 5", | |
| "SELECT COUNT(*) FROM orders", | |
| "WITH t AS (SELECT AVG(amount) a FROM transactions_current) SELECT * FROM t", | |
| ] | |
| valid = sum(1 for a in algos if algorithm_rule_check(a, queries, max_steps=10)) | |
| print({"total_algorithms": len(algos), "valid_algorithms": valid}) | |
| if __name__ == "__main__": | |
| main() | |