def METHOD_NAME(self, keyvals, delimiter):
    sanitized_keyvals = []
    for keyval in keyvals.split(delimiter):
        keyval = keyval.split("=")
        if len(keyval) == 2:
            sanitized_keyvals.append((keyval[0], self.sanitize(*keyval)))
        else:
            sanitized_keyvals.append(keyval)
    return delimiter.join("=".join(keyval) for keyval in sanitized_keyvals)