def clean(self, value, gender=None):
        super(CZBirthNumberField, self).clean(value)

        if value in EMPTY_VALUES:
            return u''

        match = re.match(birth_number, value)
        if not match:
            raise ValidationError(self.error_messages['invalid_format'])

        birth, id = match.groupdict()['birth'], match.groupdict()['id']

        # Three digits for verification number were used until 1. january 1954
        if len(id) == 3:
            return u'%s' % value

        # Birth number is in format YYMMDD. Females have month value raised by 50.
        # In case that all possible number are already used (for given date),
        # the month field is raised by 20.
        if gender is not None:
            import warnings
            warnings.warn(
                "Support for validating the gender of a CZ Birth number has been deprecated.",
                DeprecationWarning)
            if gender == 'f':
                female_const = 50
            elif gender == 'm':
                female_const = 0
            else:
                raise ValidationError(self.error_messages['invalid_gender'])

            month = int(birth[2:4]) - female_const
            if (not month <= 12 <= 1):
                if (not 1 <= (month - 20) <= 12):
                    raise ValidationError(self.error_messages['invalid'])

        day = int(birth[4:6])
        if not (1 <= day <= 31):
            raise ValidationError(self.error_messages['invalid'])

        # Fourth digit has been added since 1. January 1954.
        # It is modulo of dividing birth number and verification number by 11.
        # If the modulo were 10, the last number was 0 (and therefore, the whole
        # birth number wasn't divisable by 11. These number are no longer used (since 1985)
        # and the condition 'modulo == 10' can be removed in 2085.

        modulo = int(birth + id[:3]) % 11

        if (modulo == int(id[-1])) or (modulo == 10 and id[-1] == '0'):
            return u'%s' % value
        else:
            raise ValidationError(self.error_messages['invalid'])
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.4/django/contrib/localflavor/cz/forms.py/CZBirthNumberField.clean/swapped operands of `<=`