INNER CODE UNIT · Python

error

llm-d/llm-d · scripts/guide.py:126

    def error(self, message: str, *, source: str = "yaml", line: int | None = None) -> None:
        self._items.append(Finding(message, source, line, "error"))

    def extend(self, other: "Findings" | Iterable[Finding]) -> "Findings":
        self._items.extend(other if not isinstance(other, Findings) else other._items)
        return self

    # -- querying ----------------------------------------------------------

    @property
    def errors(self) -> list[Finding]:
        return [f for f in self._items if f.severity == "error"]

    def ok(self) -> bool:
        return not self.errors

    def for_source(self, source: str) -> list[Finding]:
        return [f for f in self._items if f.source == source]

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…