<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def debug(self, on: bool = True) -> None: """ Switches debug mode of the engine on or off. This does not interrupt other ongoing operations. """

        if on:
            self.send_line("debug on")
        else:
            self.send_line("debug off")