def clean(self, value):
        super(NZBankAccountNumberField, self).clean(value)
        if value in EMPTY_VALUES:
            return ''
        value = re.sub('(\s+|-)', '', smart_str(value))
        match = BANK_ACCOUNT_NUMBER_RE.search(value)
        if match:
            # normalize the last part
            last = '0%s' % match.group(4) if len(match.group(4)) == 2 else match.group(4)
            return '%s-%s-%s-%s' % (match.group(1),
                match.group(2), match.group(3), last)
        raise ValidationError(self.error_messages['invalid'])
dataset/ETHPy150Open django/django-localflavor/localflavor/nz/forms.py/NZBankAccountNumberField.clean/original