(packed, items_per_byte)
return bytearray(
        (_byte >> _shift) & mask
        for _byte in iterbytes(packed)
        for _shift in shifts
    )
Unpack from packed-bits representation.
Unpack from packed-bits representation.
Unpack from packed - bits representation .
def unpack_bytes(packed, items_per_byte):
    """Unpack from packed-bits representation."""
    bpp = 8 // items_per_byte
    mask = (1 << bpp) - 1
    shifts = [8 - bpp - _sh for _sh in range(0, 8, bpp)]
    return bytearray(
        (_byte >> _shift) & mask
        for _byte in iterbytes(packed)
        for _shift in shifts
    )
def unpack_bytes ( packed , items_per_byte ) : bpp = 8 // items_per_byte mask = ( 1 << bpp ) - 1 shifts = [ 8 - bpp - _sh for _sh in range ( 0 , 8 , bpp ) ] return bytearray ( ( _byte >> _shift ) & mask for _byte in iterbytes ( packed ) for _shift in shifts )