diff options
Diffstat (limited to 'quality_control')
-rw-r--r-- | quality_control/parsing.py | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/quality_control/parsing.py b/quality_control/parsing.py index 5fc5f62..5b21716 100644 --- a/quality_control/parsing.py +++ b/quality_control/parsing.py @@ -12,6 +12,8 @@ from quality_control.errors import ( from quality_control.headers import ( invalid_header, invalid_headings, duplicate_headings) +from functional_tools import take + class FileType(Enum): """Enumerate the expected file types""" AVERAGE = 1 @@ -121,15 +123,3 @@ def collect_errors( if update_progress: update_progress(line_number, line) - -def take(iterable: Iterable, num: int) -> list: - """Take at most `num` items from `iterable`.""" - iterator = iter(iterable) - items = [] - try: - for i in range(0, num): # pylint: disable=[unused-variable] - items.append(next(iterator)) - - return items - except StopIteration: - return items |