def normalize_percent_characters(s):
 matches = set(PERCENT_MATCHER.findall(s))
 for m in matches:
  if (not m.isupper()):
   s = s.replace(m, m.upper())
 return s

def normalize_percent_characters ( s ) : matches = set ( PERCENT_MATCHER . findall ( s ) ) for m in matches : if ( not m . isupper ( ) ) : s = s . replace ( m , m . upper ( ) ) return s
all percent characters should be upper-cased .