def restore_text(text, character_map=mapped_chars):
 if (not text):
  return text
 for (key, value) in character_map.items():
  text = text.replace(value, key)
 return text

def restore_text ( text , character_map = mapped_chars ) : if ( not text ) : return text for ( key , value ) in character_map . items ( ) : text = text . replace ( value , key ) return text
restores sanitized text .