INNER CODE UNIT · Python

_dedupe_preserve_order

OpenOSINT/OpenOSINT · actors/username-recon/src/main.py:76

def _dedupe_preserve_order(items: list[str]) -> list[str]:
    seen: set[str] = set()
    out: list[str] = []
    for item in items:
        key = item.strip()
        if not key or key in seen:
            continue
        seen.add(key)
        out.append(key)
    return out


def validate_usernames(raw: list) -> tuple[list[str], list[str]]:
    """Dedupe and split raw input into (valid, rejected) usernames."""
    deduped = _dedupe_preserve_order([str(u) for u in raw])
    valid, rejected = [], []
    for username in deduped:
        if _USERNAME_RE.match(username):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…