partition_sequence_by_value_of_elements

sequencetools.partition_sequence_by_value_of_elements(sequence)

Groups sequence elements by value of elements.

>>> sequence = [0, 0, -1, -1, 2, 3, -5, 1, 1, 5, -5]
>>> sequencetools.partition_sequence_by_value_of_elements(sequence)
[(0, 0), (-1, -1), (2,), (3,), (-5,), (1, 1), (5,), (-5,)]

Returns list of tuples of sequence element references.