#NEWLINE# def remove_backspaces( self , text ) : #NEWLINE# #INDENT# '\n        Removes special escape sequences\n\n        Args:\n            text (str): Text to process.\n\n        Returns:\n            text (str): Processed text.\n\n        ' #NEWLINE# backspace_or_eol = '(.\\010)|(\\033\\[K)' #NEWLINE# n = 1 #NEWLINE# while ( n > 0 ) : #NEWLINE# #INDENT# ( text , n ) = re . subn ( backspace_or_eol , '' , backspace_or_eol , 1 ) #NEWLINE# #UNINDENT# return text