def slugify(value):
import re<EOL>import unicodedata<EOL>from six import text_type<EOL>value = text_type(value)<EOL>value = unicodedata.normalize('<STR_LIT>', value).encode('<STR_LIT:ascii>', '<STR_LIT:ignore>').decode('<STR_LIT:utf8>')<EOL>value = re.sub(r'<STR_LIT>', '<STR_LIT>', value).strip().lower()<EOL>value = re.sub(r'<STR_LIT>', '<STR_LIT:_>', value)<EOL>return value<EOL>
Normalizes string, converts to lowercase, removes non-alpha characters,
and converts spaces to hyphens.type(