<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def keep_allowed_chars(text):
 """ Cleans the text for output """

    #     print ','.join(str(ord(c)) for c in text)
    return "".join(" " if c == "\n" else c for c in text.strip() if _allowed_char(c))