def METHOD_NAME(redirect, **kw):
    for part in parts:
        attr = getattr(redirect, part)
        if attr != "":
            v = kw[part] if kw[part] else ""
            if attr.lower() != v.lower():
                return False
    return True