Péter Gergely Dániel
[Add & Upd] Derived all modules/abstract modules from BaseModule; Derived all module output types from DataObject; Added batch processing support for all modules and pipeline
64fab87 Download src/core/base_constraint.py from slityak/kpo: direct link, hf CLI and curl.
- Browser
- Download file 609 Bytes
-
https://huggingface.co/spaces/slityak/kpo/resolve/main/src/core/base_constraint.py
- Command line
-
hf download hf://spaces/slityak/kpo/src/core/base_constraint.py
-
curl -L -o base_constraint.py https://huggingface.co/spaces/slityak/kpo/resolve/main/src/core/base_constraint.py
609 Bytes
| """ | |
| Általános keret a modulok megengedett bemenetére vonatkozó korlátozások definiálásához. | |
| """ | |
| from abc import ABC, abstractmethod | |
| from .data_object import DataObject | |
| class Constraint(ABC): | |
| """ | |
| Ellenőrzi, hogy a paraméterben kapott adat megfelel-e a korlátorásoknak. | |
| Return: Igen -> True | Nem -> False | |
| """ | |
| def check(self, data: DataObject) -> bool: | |
| pass | |
| """ | |
| Leírja, hogy a megfelelő adatnak milyen tulajdonságokkal kell rendelkeznie. | |
| """ | |
| def description(self) -> str: | |
| return self.__class__.__name__ |