Download data/software-slugify-4/solution.py from stoiclion/agent-workbench: direct link, hf CLI and curl.
- Browser
- Download file 213 Bytes
-
https://huggingface.co/datasets/stoiclion/agent-workbench/resolve/main/data/software-slugify-4/solution.py
- Command line
-
hf download hf://datasets/stoiclion/agent-workbench/data/software-slugify-4/solution.py
-
curl -L -o solution.py https://huggingface.co/datasets/stoiclion/agent-workbench/resolve/main/data/software-slugify-4/solution.py
213 Bytes
| def slugify(title): | |
| """Lowercase ASCII slug: words joined by single hyphens, no leading or trailing hyphen.""" | |
| import re | |
| slug = title.lower() | |
| slug = re.sub(r"[^a-z0-9]", "-", slug) | |
| return slug | |