utilsΒΆ

Utility functions.

Functions

slice_equal(s1, s2, length)

Check if two slices are equal for a sequence of length length.

slice_index(s, i, length)

Find an index in the original sequence corresponding to index i of slice s.

slice_index_gen(s, length)

Generate indices in the original sequence corresponding to indices of slice s.

slice_len(s, length)

Get the length of slice s for a sequence of length length.

slice_of_slice(s1, s2, length)

Compose two slices.

slice_single_item(s, i, length)

Narrow a slice to another slice for a single item within it.

slice_to_tuple(s, length)

Get all indices in the original sequence corresponding to indices of slice s.