import re


def normalize(s):
    """Set to ALL CAPS, replace common GPL patterns, and strip"""
    s = s.upper()
    s = re.sub('GENERAL PUBLIC LICENSE', 'GPL', s)
    s = re.sub('LESSER *', 'L', s)
    s = re.sub('AFFERO *', 'A', s)
    return s.strip()