<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_escape(self, idx, char):
 """ Translates and adds the escape sequence. :param idx: Provides the ending index of the escape sequence. :param char: The actual character that was escaped. """


        self.fmt.append_text(self.fmt._unescape.get(
            self.format[self.str_begin:idx], char))