Spaces:
Running on Zero
Running on Zero
Download app/core/handles.py from cipher-attacks/Dbu-central-bot: direct link, hf CLI and curl.
- Browser
- Download file 424 Bytes
-
https://huggingface.co/spaces/cipher-attacks/Dbu-central-bot/resolve/main/app/core/handles.py
- Command line
-
hf download hf://spaces/cipher-attacks/Dbu-central-bot/app/core/handles.py
-
curl -L -o handles.py https://huggingface.co/spaces/cipher-attacks/Dbu-central-bot/resolve/main/app/core/handles.py
424 Bytes
| import re | |
| def parse_handles(raw: str) -> list[str]: | |
| """"DBUCentral, @DBUcentralforum" -> ["@DBUCentral", "@DBUcentralforum"] (no duplicates, case-insensitive).""" | |
| seen, out = set(), [] | |
| for part in re.split(r"[,\s]+", raw or ""): | |
| handle = part.strip().lstrip("@") | |
| if handle and handle.lower() not in seen: | |
| seen.add(handle.lower()) | |
| out.append("@" + handle) | |
| return out | |