fumus.queries.itertools_mixin ============================= .. py:module:: fumus.queries.itertools_mixin Classes ------- .. autoapisummary:: fumus.queries.itertools_mixin.ItertoolsMixin Module Contents --------------- .. py:class:: ItertoolsMixin .. py:attribute:: NO_SIGNATURE_FUNCTIONS .. py:attribute:: NO_KWARGS_FUNCTIONS .. py:attribute:: iterable :value: None .. py:method:: use(it_function, **kwargs) Provides integration with itertools methods; pass corresponding parameters as kwargs .. py:method:: _handle_no_signature_functions(it_function, **kwargs) .. py:method:: _handle_no_kwargs_functions(signature, it_function, **kwargs) .. py:method:: _handle_default_signature_functions(signature, it_function, **kwargs) .. py:method:: tabulate(mapper, start=0) Returns function(0), function(1), ... .. py:method:: repeat_func(operation, times=None) Repeats calls to func with specified arguments .. py:method:: ncycles(count=0) Returns the query elements n times .. py:method:: consume(n=None) Advances the iterator n-steps ahead. If n is None, consumes query entirely .. py:method:: take_nth(idx, default=None) Returns Optional with the nth element of the query or a default value .. py:method:: all_equal(key=None) Returns True if all elements of the query are equal to each other .. py:method:: view(start=0, stop=None, step=None) Provides access to a selected part of the query .. py:method:: unique(key=None, reverse=False) Yields unique elements in sorted order. Supports unhashable inputs .. py:method:: _unique(iterable, key=None) :staticmethod: .. py:method:: unique_just_seen(key=None) Yields unique elements, preserving order. Remembers only the element just seen .. py:method:: unique_ever_seen(key=None) Yields unique elements, preserving order. Remembers all elements ever seen .. py:method:: _unique_ever_seen(iterable, key=None) :staticmethod: .. py:method:: sliding_window(n) Collects data into overlapping fixed-length chunks or blocks .. py:method:: _sliding_window(iterable, n) :staticmethod: .. py:method:: grouper(n, *, incomplete='fill', fill_value=None) Collects data into non-overlapping fixed-length chunks or blocks .. py:method:: _grouper(n, incomplete='fill', fill_value=None) .. py:method:: round_robin() Visits input iterables in a cycle until each is exhausted .. py:method:: _round_robin(iterable) :staticmethod: .. py:method:: partition(predicate) Partitions entries into true and false entries. Returns a query of two nested generators .. py:method:: subslices() Returns all contiguous non-empty sub-slices .. py:method:: find_indices(value, start=0, stop=None) Returns indices where a value occurs in a sequence or iterable .. py:method:: _find_indices(iterable, value, start=0, stop=None) :staticmethod: