Clear the terminal screen and redraw all of the sub-windows
162716
def draw(self):
        
        n_rows, n_cols = self.term.stdscr.getmaxyx()
        if n_rows < self.term.MIN_HEIGHT or n_cols < self.term.MIN_WIDTH:
            # TODO: Will crash when you try to navigate if the terminal is too
            # small at startup because self._subwindows will never be populated
            return

        self._row = 0
        self._draw_header()
        self._draw_banner()
        self._draw_content()
        self._draw_footer()
        self.term.clear_screen()
        self.term.stdscr.refresh()
1034359
def cleanup():
    """"""
    if _output_dir and os.path.exists(_output_dir):
        log.msg_warn("Cleaning up output directory at '{output_dir}' ..."
                     .format(output_dir=_output_dir))
        if not _dry_run:
            shutil.rmtree(_output_dir)
540806
def clean_up(self):
        
        self.submenu.join()
        self.menu.clear_screen()
        self.menu.resume()
828705
def clear_canvas(self):
        """"""
        self.fig = None
        self.fmt = None
        self._qpix_buffer = []
        self.repaint()
1221333
def clean_all(self, args):
        """"""
        self.clean_dists(args)
        self.clean_builds(args)
        self.clean_download_cache(args)
1057419
def reset(self):
        
        surface = Surface(self.width, self.height)
        surface.fill(BLACK)
        self.matrix = surface.matrix
249496
def clear(self):
        
        layout = self._entryWidget.layout()
        for i in range(layout.count() - 1):
            widget = layout.itemAt(i).widget()
            widget.close()
93926
def clear():
    
    if not isatty(sys.stdout):
        return
    # If we're on Windows and we don't have colorama available, then we
    # clear the screen by shelling out.  Otherwise we can use an escape
    # sequence.
    if WIN:
        os.system('cls')
    else:
        sys.stdout.write('\033[2J\033[1;1H')
428410
def clear_screen():
    import os, platform
    
    if platform.system() == "Windows":
        tmp = os.system('cls') #for window
    else:
        tmp = os.system('clear') #for Linux
    return True
1028632
def clean(self):
        """"""
        if os.path.exists(self.buildroot):
            log.info('Clearing the build area.')
            log.debug('Deleting: %s', self.buildroot)
            shutil.rmtree(self.buildroot)
            os.makedirs(self.buildroot)
1037881
async def reset_all(self, full=True):
        
        conn = await self.redis()

        if full:
            await conn.execute('FLUSHDB')
        else:
            keys = await conn.execute('KEYS', 'fsm:*')
            await conn.execute('DEL', *keys)
1121623
def remove(self, *terminals):
        # type: (Iterable[Any]) -> None
        
        for term in set(terminals):
            if term not in self:
                raise KeyError('Terminal ' + str(term) + ' is not inside')
            self._grammar.rules.remove(*self._assign_map[term], _validate=False)
            del self._assign_map[term]
            super().remove(term)
456501
def clear(self):
        """"""
        for i in range(4):
            while len(self._panels[i]):
                key = sorted(list(self._panels[i].keys()))[0]
                panel = self.remove(key)
                panel.setParent(None)
                panel.deleteLater()
1006761
def clearScreen(cls):
        """"""
        if "win32" in sys.platform:
            os.system('cls')
        elif "linux" in sys.platform:
            os.system('clear')
        elif 'darwin' in sys.platform:
            os.system('clear')
        else:
            cit.err("No clearScreen for " + sys.platform)
179029
def _cleanup():
    '''
    
    '''
    for inst in _ACTIVE[:]:
        res = inst.isalive()
        if res is not True:
            try:
                _ACTIVE.remove(inst)
            except ValueError:
                # This can happen if two threads create a new Terminal instance
                # It's harmless that it was already removed, so ignore.
                pass
419722
def revert(self):
        
        os.environ.clear()
        os.environ.update(self.original)
393399
def close_all():
    """

    # Windows can be closed by releasing all references to them so they can be
    # garbage collected. May not be necessary to call close().
    global _qtg_windows
    for window in _qtg_windows:
        window.close()
    _qtg_windows = []

    global _qtg_widgets
    for widget in _qtg_widgets:
        widget.close()
    _qtg_widgets = []

    global _plt_figures
    for fig in _plt_figures:
        _, plt, _ = _import_plt()
        plt.close(fig)
    _plt_figures = []