def clean(self, value):
        super(NZPhoneNumberField, self).clean(value)
        if value in EMPTY_VALUES:
            return ''
        value = re.sub('(\(|\)|\s+|_|-)', '', smart_str(value))
        value = re.sub('^(\+\+)', '00', smart_str(value))
        value = re.sub('^(\+)', '00', smart_str(value))
        phone_08_match = PHONE_08_RE.search(value)
        if phone_08_match:
            return '%s' % phone_08_match.group(0)
        phone_nz_match = PHONE_NZ_RE.search(value)
        if phone_nz_match:
            return '%s' % phone_nz_match.group(0)
        phone_in_match = PHONE_IN_RE.search(value)
        if phone_in_match:
            return '%s' % phone_in_match.group(0)
        raise ValidationError(self.error_messages['invalid'])
dataset/ETHPy150Open django/django-localflavor/localflavor/nz/forms.py/NZPhoneNumberField.clean/original