and string 'ignore', call the method decode on the result with an argument string 'ascii', substitute the result for value. call the method re.sub with 3 arguments: string '[^\w\s-]', empty string and value, strip the result of whitespaces from both ends,
value = re . sub ( '[^\w\s-]' , '' , value ) . strip ( ) . lower ( )