polymerist.genutils.sequences.seqops ==================================== .. py:module:: polymerist.genutils.sequences.seqops .. autoapi-nested-parse:: Generic operations for indexing, generating, and iterating over sequences Attributes ---------- .. autoapisummary:: polymerist.genutils.sequences.seqops.T polymerist.genutils.sequences.seqops.S Functions --------- .. autoapisummary:: polymerist.genutils.sequences.seqops.is_unique polymerist.genutils.sequences.seqops.int_complement polymerist.genutils.sequences.seqops.pad_sequence polymerist.genutils.sequences.seqops.cycle_items Module Contents --------------- .. py:data:: T .. py:data:: S .. py:function:: is_unique(seq: Sequence) -> bool Whether or not a Sequence contains repeating items .. py:function:: int_complement(integers: Sequence[int], bounded: bool = False) -> Generator[int, None, None] Generate ordered non-negative integers which don't appear in a sequence of integers .. py:function:: pad_sequence(target_list: Sequence[T], to_length: int, pad_value: S = 0, from_left: bool = False) -> list[Union[T, S]] Pad a given list with a particular value .. py:function:: cycle_items(seq: Sequence[T], places: int = 1) -> list[T] Cyclically shift all items in a sequence over by the target number of indices By default shifts right, but can also move to left with negative "places" argument Examples: cycle_items([1,2,3,4], 2) -> [3,4,1,2] cycle_items([1,2,3,4], -1) -> [4,1,2,3]