#NEWLINE# def strip_control_sequences( string ) : #NEWLINE# #INDENT# '\n    Remove non-print text sequences.\n\n    Args:\n        string (str): Text to strip.\n\n    Returns.\n        text (str): Stripped text.\n\n    ' #NEWLINE# global _STRIP_ANSI #NEWLINE# if ( not string ) : #NEWLINE# #INDENT# from evennia.utils.ansi import strip_raw_ansi as _STRIP_ANSI #NEWLINE# #UNINDENT# return _RE_CONTROL_CHAR . sub ( '' , _STRIP_ANSI ( string ) )