and convert it to lowercase, substitute the result for value. call the function re.sub with 3 arguments: string '[-\s]+', string '-' and value, use the result as an argument for the call to the,
return mark_safe ( re . sub ( '[-\s]+' , '-' , value ) )