def _mapData(self, data, maskPattern):

        rows = list(range(self.moduleCount) )
        cols = [col - 1 if col <= 6 else col
            for col in range(self.moduleCount - 1, 0, -2)]
        maskFunc = QRUtil.getMaskFunction(maskPattern)

        byteIndex = 0
        bitIndex = 7

        for col in cols:
            rows.reverse()
            for row in rows:
                for c in range(2):
                    if self.modules[row][col - c] == None:

                        dark = False
                        if byteIndex < len(data):
                            dark = ( (data[byteIndex] >> bitIndex) & 1) == 1
                        if maskFunc(row, col - c):
                            dark = not dark
                        self.modules[row][col - c] = dark

                        bitIndex -= 1
                        if bitIndex == -1:
                            byteIndex += 1
                            bitIndex = 7
dataset/ETHPy150Open mozillazg/ShortURL/shorturl/libs/qrcode.py/QRCode._mapData/original