Partitions a sequence into all groupings of pairs and singles of elements.
s (sequence) – the sequence to partition
include_singles (bool) – if False, only partitions into pairs is returned.
returns a nested tuple, containing all partitions of the sequence.
- Return type