Download testbed/Textualize__rich/rich/_stack.py from hc99/FEA-Bench: direct link, hf CLI and curl.
- Browser
- Download file 351 Bytes
-
https://huggingface.co/datasets/hc99/FEA-Bench/resolve/main/testbed/Textualize__rich/rich/_stack.py
- Command line
-
hf download hf://datasets/hc99/FEA-Bench/testbed/Textualize__rich/rich/_stack.py
-
curl -L -o _stack.py https://huggingface.co/datasets/hc99/FEA-Bench/resolve/main/testbed/Textualize__rich/rich/_stack.py
351 Bytes
| from typing import List, TypeVar | |
| T = TypeVar("T") | |
| class Stack(List[T]): | |
| """A small shim over builtin list.""" | |
| def top(self) -> T: | |
| """Get top of stack.""" | |
| return self[-1] | |
| def push(self, item: T) -> None: | |
| """Push an item on to the stack (append in stack nomenclature).""" | |
| self.append(item) | |