medcat.utils.iterutils ====================== .. py:module:: medcat.utils.iterutils Attributes ---------- .. autoapisummary:: medcat.utils.iterutils.T Functions --------- .. autoapisummary:: medcat.utils.iterutils._callback_iterator_iterable medcat.utils.iterutils.callback_iterator Module Contents --------------- .. py:data:: T .. py:function:: _callback_iterator_iterable(identifier, data_iterator, callback) .. py:function:: callback_iterator(identifier, data_iterator, callback) 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. :param identifier: The identifier / name for the iterator. :type identifier: str :param data_iterator: The iterator. :type data_iterator: Iterable[T] :param callback: The callback method. :type callback: Callable[[str, int], None] :Returns: **Iterable[T]** -- The wrapped iterator.