def validate(tax_number):
 try:
  verify_vat(tax_number)
  return u'vat'
 except VatCannotIdentifyValidationError:
  pass
 return u'unknown'

def validate ( tax_number ) : try : verify_vat ( tax_number ) return u'vat' except VatCannotIdentifyValidationError : pass return u'unknown'
use w3c validator service: URL .