(cls, packed, height, items_per_byte)
return cls._create_from_rows([
            unpack_bytes(packed[_offs : _offs+width], items_per_byte)
            for _offs in xrange(0, len(packed), width)
        ])
Unpack from packed-bits representation.
Unpack from packed-bits representation.
Unpack from packed - bits representation .
def frompacked(cls, packed, height, items_per_byte):
        """Unpack from packed-bits representation."""
        packed = bytes(packed)
        if not packed or not height:
            return cls(0, 0)
        width = len(packed) // height
        if not width:
            return cls(0, 0)
        return cls._create_from_rows([
            unpack_bytes(packed[_offs : _offs+width], items_per_byte)
            for _offs in xrange(0, len(packed), width)
        ])
def frompacked ( cls , packed , height , items_per_byte ) : packed = bytes ( packed ) if not packed or not height : return cls ( 0 , 0 ) width = len ( packed ) // height if not width : return cls ( 0 , 0 ) return cls . _create_from_rows ( [ unpack_bytes ( packed [ _offs : _offs + width ] , items_per_byte ) for _offs in xrange ( 0 , len ( packed ) , width ) ] )