Download fixtures/pattern_lab/src/labels.py from tailot/codex-python: direct link, hf CLI and curl.
- Browser
- Download file 437 Bytes
-
https://huggingface.co/datasets/tailot/codex-python/resolve/main/fixtures/pattern_lab/src/labels.py
- Command line
-
hf download hf://datasets/tailot/codex-python/fixtures/pattern_lab/src/labels.py
-
curl -L -o labels.py https://huggingface.co/datasets/tailot/codex-python/resolve/main/fixtures/pattern_lab/src/labels.py
437 Bytes
| """Naming a value by what it holds. | |
| One function asks whether a value is None with the equality operators, and that is the | |
| shape the identity comparison pattern rewrites. The other already asks with identity, | |
| and the pattern says so. | |
| """ | |
| def label_for(value): | |
| if value == None: | |
| return "none" | |
| if value != None and value == "": | |
| return "blank" | |
| return "given" | |
| def is_missing(value): | |
| return value is None | |