def clean(self, value):
        value = super(ITSocialSecurityNumberField, self).clean(value)
        if value in EMPTY_VALUES:
            return ''
        value = re.sub('\s', '', value).upper()
        # Entities SSN are numeric-only
        if value.isdigit():
            try:
                return vat_number_validation(value)
            except ValueError:
                raise ValidationError(self.error_messages['invalid'])
        # Person SSN
        else:
            try:
                return ssn_validation(value)
            except (__HOLE__, IndexError):
                raise ValidationError(self.error_messages['invalid'])
dataset/ETHPy150Open django/django-localflavor/localflavor/it/forms.py/ITSocialSecurityNumberField.clean