Allow specifying drivers as "inactive" and replace Logan Sargeant with Franco Colapinto
All checks were successful
Build Formula10 Docker Image / build-docker (push) Successful in 1m27s

This commit is contained in:
2024-08-30 20:47:06 +02:00
parent 3340b77efe
commit b4c459ffe7
19 changed files with 160 additions and 95 deletions

View File

@ -76,6 +76,19 @@ def find_multiple_strict(predicate: Callable[[_T], bool], iterable: Iterable[_T]
return filtered
def find_atleast_strict(predicate: Callable[[_T], bool], iterable: Iterable[_T], count: int = 0) -> List[_T]:
"""
Finds at least <count> elements in a sequence matching a predicate.
Throws exception if fewer elements were found than specified.
"""
filtered = list(filter(predicate, iterable))
if len(filtered) < count:
raise Exception(f"find_atleast found {len(filtered)} matching elements but expected at least {count}")
return filtered
def find_single_strict(predicate: Callable[[_T], bool], iterable: Iterable[_T]) -> _T:
"""
Find a single element in a sequence matching a predicate.