<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def clear_last_lines(self, n):
 """Clear last N lines of terminal output. """

        self.term.stream.write(
            self.term.move_up * n + self.term.clear_eos)
        self.term.stream.flush()