INNER CODE UNIT · Python

extend

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

    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]

    def __iter__(self) -> Iterator[Finding]:
        return iter(self._items)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…