code: def clear_screen(mode=2):
      ''' Clear the terminal/console screen. (Also aliased to clear.)
  
          Arguments:
  
              mode:  | 0 | 'forward'   - Clear cursor to end of screen, cursor stays.
                     | 1 | 'backward'  - Clear cursor to beginning of screen, ""
                     | 2 | 'full'      - Clear entire visible screen, cursor to 1,1.
                     | 3 | 'history'   - Clear entire visible screen and scrollback
                                         buffer (xterm).
      '''
      text = sc.erase(_mode_map.get(mode, mode))
      _write(text)
      return texf clear_screen(mode=2):
      ''' Clear the terminal/console screen. (Also aliased to clear.)
  
          Arguments:
  
              mode:  | 0 | 'forward'   - Clear cursor to end of screen, cursor stays.
                     | 1 | 'backward'  - Clear cursor to beginning of screen, ""
                     | 2 | 'full'      - Clear entire visible screen, cursor to 1,1.
                     | 3 | 'history'   - Clear entire visible screen and scrollback
                                         buffer (xterm).
      '''
      text = sc.erase(_mode_map.get(mode, mode))
      _write(text)
      return text
docs: Clear the terminal/console screen. (Also aliased to clear.)
  
          Arguments:
  
              mode:  | 0 | 'forward'   - Clear cursor to end of screen, cursor stays.
                     | 1 | 'backward'  - Clear cursor to beginning of screen, ""
                     | 2 | 'full'      - Clear entire visible screen, cursor to 1,1.
                     | 3 | 'history'   - Clear entire visible screen and scrollback
                                         buffer (xterm).