medcat.utils.iterutils
Functions:
-
callback_iterator–Get an iterable with callback function to identify number of items.
Attributes:
-
T–
callback_iterator
callback_iterator(identifier: str, data_iterator: Iterable[T], callback: Callable[[str, int], None]) -> Iterable[T]
Get an iterable with callback function to identify number of items.
If the data has a size (i.e list or dict), the length of the data will be reported before iteration.
If the data doesn't have a size (i.e a generator), the number of items iterated will be reported after the iteration is done.
Parameters:
-
(identifierstr) –The identifier / name for the iterator.
-
(data_iteratorIterable[T]) –The iterator.
-
(callbackCallable[[str, int], None]) –The callback method.
Returns:
Source code in medcat-v2/medcat/utils/iterutils.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | |