Verified Commit 55b51e70 authored by Jakob Moser's avatar Jakob Moser
Browse files

Reformat

parent e1677bb1
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -5,5 +5,8 @@ from collections.abc import Iterable, Iterator
T = TypeVar("T")
S = TypeVar("S")

def group_by(iterable: Iterable[T], key: Callable[[T], S]) -> Iterator[tuple[S, Iterator[T]]]:

def group_by(
    iterable: Iterable[T], key: Callable[[T], S]
) -> Iterator[tuple[S, Iterator[T]]]:
    return itertools.groupby(sorted(iterable, key=key), key)