def normalize(vat_id):

    if not vat_id:
        return None

    if not isinstance(vat_id, str_cls):
        raise ValueError('VAT ID is not a string')

    if len(vat_id) < 3:
        raise ValueError('VAT ID must be at least three character long')

    # Normalize the ID for simpler regexes
    vat_id = re.sub('\\s+', '', vat_id)
    vat_id = vat_id.replace('-', '')
    vat_id = vat_id.replace('.', '')
    vat_id = vat_id.upper()

    country_prefix = vat_id[0:2]

    # Fix people using GR prefix for Greece
    if country_prefix == 'GR':
        vat_id = 'EL' + vat_id[2:]
        country_prefix = 'EL'

    if country_prefix not in ID_PATTERNS:
        return None

    return vat_id
Accepts a VAT ID and normaizes it, getting rid of spaces, periods, dashes
dataset/ETHPy150Open wbond/vat_moss-python/vat_moss/id.py/normalize