Download python_lora_dataset_builder/tests/test_tiers.py from api-relay/sadASDasd: direct link, hf CLI and curl.
- Browser
- Download file 759 Bytes
-
https://huggingface.co/datasets/api-relay/sadASDasd/resolve/main/python_lora_dataset_builder/tests/test_tiers.py
- Command line
-
hf download hf://datasets/api-relay/sadASDasd/python_lora_dataset_builder/tests/test_tiers.py
-
curl -L -o test_tiers.py https://huggingface.co/datasets/api-relay/sadASDasd/resolve/main/python_lora_dataset_builder/tests/test_tiers.py
759 Bytes
| from pipeline.tiers import classify_tier, TIER1_BASIC, TIER2_PER_LIBRARY, TIER3_REAL_WORLD | |
| LIBS = {"json": "...", "os": "...", "requests": "..."} | |
| def test_no_imports_is_tier1(): | |
| assert classify_tier([], LIBS) == (TIER1_BASIC, None) | |
| def test_single_known_library_is_tier2(): | |
| assert classify_tier(["json"], LIBS) == (TIER2_PER_LIBRARY, "json") | |
| def test_multiple_known_libraries_tags_alphabetically_first(): | |
| assert classify_tier(["requests", "json"], LIBS) == (TIER2_PER_LIBRARY, "json") | |
| def test_unknown_import_is_tier3(): | |
| assert classify_tier(["some_unknown_pkg"], LIBS) == (TIER3_REAL_WORLD, None) | |
| def test_mixed_known_and_unknown_is_tier3(): | |
| assert classify_tier(["json", "some_unknown_pkg"], LIBS) == (TIER3_REAL_WORLD, None) | |