def getLengthInBits(self, type):
        if 1 <= type and type < 10: # 1 - 9
            return {
                Mode.MODE_NUMBER:    10,
                Mode.MODE_ALPHA_NUM: 9,
                Mode.MODE_8BIT_BYTE: 8,
                Mode.MODE_KANJI:     8
                }[self.mode]

        elif type < 27: # 10 - 26
            return {
                Mode.MODE_NUMBER:    12,
                Mode.MODE_ALPHA_NUM: 11,
                Mode.MODE_8BIT_BYTE: 16,
                Mode.MODE_KANJI:     10
                }[self.mode]

        elif type < 41: # 27 - 40
            return {
                Mode.MODE_NUMBER:    14,
                Mode.MODE_ALPHA_NUM: 13,
                Mode.MODE_8BIT_BYTE: 16,
                Mode.MODE_KANJI:     12
                }[self.mode]

        else:
            raise Exception(type % 'type:%s')
dataset/ETHPy150Open mozillazg/ShortURL/shorturl/libs/qrcode.py/QR8BitByte.getLengthInBits/swapped operands of `%`