def to_slug(value, incoming=None, errors='strict'):
 value = safe_decode(value, incoming, errors)
 value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore').decode('ascii')
 value = SLUGIFY_STRIP_RE.sub('', value).strip().lower()
 return SLUGIFY_HYPHENATE_RE.sub('-', value)

def to_slug ( value , incoming = None , errors = 'strict' ) : value = safe_decode ( value , incoming , errors ) value = unicodedata . normalize ( 'NFKD' , value ) . encode ( 'ascii' , 'ignore' ) . decode ( 'ascii' ) value = SLUGIFY_STRIP_RE . sub ( '' , value ) . strip ( ) . lower ( ) return SLUGIFY_HYPHENATE_RE . sub ( '-' , value )
normalize string .