================================================================
GMS alphabet coding as defined by the GSM standard 3GPP TS 03.40
================================================================

Unpacking septets
=================

Some pieces of information, such as the actual message text, are encoded by
septets which, in turn, are compressed into octets. That is, seven 8-bit bytes
contain eight 7-bit bytes which encode the actual data.

The ``unpack_septets`` function converts a sequence of octets (integers in the
range from 0 through 255) into a possibly longer sequence of septets (integers
in the range from 0 through 127). Any left-over bits in the octet sequence are
considered to be padding, and dropped.

>>> from phebe.gsmcoding import unpack_septets
>>> unpack_septets([])
[]
>>> unpack_septets([255])
[127]
>>> unpack_septets([255, 255])
[127, 127]
>>> unpack_septets([255, 255, 255, 255, 255, 255, 255])
[127, 127, 127, 127, 127, 127, 127, 127]

The highest bit of the first octet is used as the lowest bit for the second
septet, the two highest bits of the second octet appear in the third septet
and so on. After the seventh octet or eighth septet, this cycle begins again.

>>> unpack_septets([0])
[0]
>>> unpack_septets([1])
[1]
>>> unpack_septets([129, 0])
[1, 1]
>>> unpack_septets([129, 0, 0, 0, 0, 0, 0])
[1, 1, 0, 0, 0, 0, 0, 0]
>>> unpack_septets([129, 64, 32, 16, 8, 4, 2])
[1, 1, 1, 1, 1, 1, 1, 1]
>>> unpack_septets([129, 64, 32, 16, 8, 4, 2, 37])
[1, 1, 1, 1, 1, 1, 1, 1, 37]
>>> unpack_septets([129, 192, 32, 16, 40, 4, 3, 37])
[1, 1, 3, 1, 1, 5, 65, 1, 37]
