code: def _ClearScreen(self):
      
      if self._have_ansi_support:
        # ANSI escape sequence to clear screen.
        self._output_writer.Write('\033[2J')
        # ANSI escape sequence to move cursor to top left.
        self._output_writer.Write('\033[H')
  
      elif win32console:
        # This version of Windows cmd.exe does not support ANSI escape codes, thus
        # instead we fill the console screen buffer with spaces. The downside of
        # this approach is an annoying flicker.
        top_left_coordinate = win32console.PyCOORDType(0, 0)
        screen_buffer = win32console.GetStdHandle(win32api.STD_OUTPUT_HANDLE)
        screen_buffer_information = screen_buffer.GetConsoleScreenBufferInfo()
  
        screen_buffer_attributes = screen_buffer_information['Attributes']
        screen_buffer_size = screen_buffer_information['Size']
        console_size = screen_buffer_size.X * screen_buffer_size.Y
  
        screen_buffer.FillConsoleOutputCharacter(
            ' ', console_size, top_left_coordinate)
        screen_buffer.FillConsoleOutputAttribute(
            screen_buffer_attributes, console_size, top_left_coordinate)
        screen_buffer.SetConsoleCursorPosition(top_left_coordinate)
docs: Clears the terminal/console screen.