def clean_name(s):
 if (not isinstance(s, unicode)):
  u = unicode(s, 'ascii', 'replace')
 else:
  u = s
 u = _transliterate(u, _XLATE_GRAPHICAL_AND_DIACRITICAL)
 u = unicodedata.normalize('NFKC', u)
 u = _translate(u, _XLATE_SPECIAL)
 u = _CN_RE1.sub(u' ', u)
 u = _CN_RE2.sub(u' ', u)
 u = u.strip()
 return u

def clean_name ( s ) : if ( not isinstance ( s , unicode ) ) : u = unicode ( s , 'ascii' , 'replace' ) else : u = s u = _transliterate ( u , _XLATE_GRAPHICAL_AND_DIACRITICAL ) u = unicodedata . normalize ( 'NFKC' , u ) u = _translate ( u , _XLATE_SPECIAL ) u = _CN_RE1 . sub ( u' ' , u ) u = _CN_RE2 . sub ( u' ' , u ) u = u . strip ( ) return u
remove non-alphanumeric characters from the string .