def getNibbles(byte):
    """
    Returns hi and lo bits in a byte as a tuple

    .. doctest::

        >>> getNibbles(142)
        (8, 14)

        Asserts byte value in byte range
        >>> getNibbles(256)
        Traceback (most recent call last):
        ...
        ValueError: Byte value out of range 0-255: 256
    """
    if not 0 <= byte <= 255:
        raise ValueError('Byte value out of range 0-255: %s' % byte)
    return byte >> 4 & 15, byte & 15
