def norm(value: str) -> str:
    return (value or "").strip().lower()


def path_contains(target: str, keywords):
    target = norm(target)
    return any(k in target for k in keywords)


def text_contains(value: str, keywords):
    value = norm(value)
    return any(k in value for k in keywords)


def unique_preserve_order(values):
    seen = set()
    result = []
    for v in values:
        if v not in seen:
            seen.add(v)
            result.append(v)
    return result
