polymerist.genutils.sequences ============================= .. py:module:: polymerist.genutils.sequences .. autoapi-nested-parse:: Tools for working with ordered sequences (i.e. collections of elements with definite length and order) Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/polymerist/genutils/sequences/discernment/index /autoapi/polymerist/genutils/sequences/seqops/index /autoapi/polymerist/genutils/sequences/similarity/index Attributes ---------- .. autoapisummary:: polymerist.genutils.sequences.T polymerist.genutils.sequences.S Functions --------- .. autoapisummary:: polymerist.genutils.sequences.is_unique polymerist.genutils.sequences.int_complement polymerist.genutils.sequences.pad_sequence polymerist.genutils.sequences.cycle_items Package 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]