def has_valid_checksum(self, number):
        letter_dict = {'A': 10, 'B': 11, 'C': 12, 'D': 13,
                       'E': 14, 'F': 15, 'G': 16, 'H': 17,
                       'I': 18, 'J': 19, 'K': 20, 'L': 21,
                       'M': 22, 'N': 23, 'O': 24, 'P': 25,
                       'Q': 26, 'R': 27, 'S': 28, 'T': 29,
                       'U': 30, 'V': 31, 'W': 32, 'X': 33,
                       'Y': 34, 'Z': 35}

        # convert letters to integer values
        int_table = [(not c.isdigit()) and letter_dict[c] or int(c)
                     for c in number]

        multiple_table = (7, 3, 1, -1, 7, 3, 1, 7, 3)
        result = 0
        for i in range(len(int_table)):
            result += int_table[i] * multiple_table[i]

        return result % 10 == 0
Calculates a checksum with the provided algorithm.
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/contrib/localflavor/pl/forms.py/PLNationalIDCardNumberField.has_valid_checksum