def _flatten_to_ascii(txt):
 if isinstance(txt, str):
  txt = txt.decode('utf-8')
  return unicodedata.normalize('NFKD', txt).encode('ASCII', 'ignore')
 else:
  return unicode(unicodedata.normalize('NFKD', txt).encode('ASCII', 'ignore'))

def _flatten_to_ascii ( txt ) : if isinstance ( txt , str ) : txt = txt . decode ( 'utf-8' ) return unicodedata . normalize ( 'NFKD' , txt ) . encode ( 'ASCII' , 'ignore' ) else : return unicode ( unicodedata . normalize ( 'NFKD' , txt ) . encode ( 'ASCII' , 'ignore' ) )
flattens possibly unicode txt to ascii .