<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def display(self, codes=[], fg=None, bg=None):
 """Displays the codes using ANSI escapes """

        codes, fg, bg = Magic.displayformat(codes, fg, bg)
        self.stream.write(Magic.display(codes, fg, bg))
        self.flush()