from collections import Counter
from itertools import islice
-from typing import Any, Iterator, List, Mapping
+from typing import Any, Iterator, List, Mapping, Sequence
def shard(lst: List[Any], size: int) -> Iterator[Any]:
return list(set(lst))
+def uniq(lst: List[Any]) -> List[Any]:
+ """
+ Alias for dedup_list.
+
+ """
+ return dedup_list(lst)
+
+
+def ngrams(lst: Sequence[Any], n):
+ for i in range(len(lst) - n + 1):
+ yield lst[i:i + n]
+
+
if __name__ == '__main__':
import doctest
doctest.testmod()