Download fixtures/pattern_lab/src/widgets.py from tailot/codex-python: direct link, hf CLI and curl.
- Browser
- Download file 635 Bytes
-
https://huggingface.co/datasets/tailot/codex-python/resolve/main/fixtures/pattern_lab/src/widgets.py
- Command line
-
hf download hf://datasets/tailot/codex-python/fixtures/pattern_lab/src/widgets.py
-
curl -L -o widgets.py https://huggingface.co/datasets/tailot/codex-python/resolve/main/fixtures/pattern_lab/src/widgets.py
635 Bytes
| """Boxes, shutters and a grille: three constructors, three different shapes. | |
| Box is the constructor the constructor-chain card of this bundle claims: it takes | |
| self alone, names no base, and builds without opening the chain. Shutter already | |
| opens the chain first, and Grille takes an argument the rule cannot forward. | |
| """ | |
| class Box: | |
| def __init__(self): | |
| self.sides = 4 | |
| self.closed = False | |
| def area(self): | |
| return self.sides * self.sides | |
| class Shutter: | |
| def __init__(self): | |
| super().__init__() | |
| self.open = False | |
| class Grille: | |
| def __init__(self, bars): | |
| self.bars = bars | |