clear readline then log
18577
function rlog()
    {
      process.stdout.clearLine();
      process.stdout.cursorTo(0);
      console.log.apply(console, arguments);
      rl.prompt();
    }
1240400
def erase(self):
        """"""
        with self._at_last_line():
            self.stream.write(self._term.clear_eol)
        self.stream.flush()
117244
void skipLine() {
        int ch;
        do {
            try {
                ch = reader.read();
            } catch( IOException ex ) {
                throw new LessException( ex );
            }
            incLineColumn( ch );
        } while( ch != '\n' && ch != -1 );
    }
664242
def do_eof(self, line):
        """"""
        d1_cli.impl.util.print_info("")
        self.do_exit(line)
1241597
public function clearLog()
    {
        $this->listLog();
        foreach($this->dumparray as $df){
            /** @var $df DumpFile */
            $df->delete();
        }
        $this->setAccessMode(File::FILE_MODE_RW_TRUNCATE_FILE_TO_ZERO_LENGTH);
        $this->write("");
        $this->setAccessMode(File::FILE_MODE_RW_POINTER_AT_END);

    }
288748
def log_and_clear_command_output(command, stream)
      output = command.public_send(stream)
      log_command_data(command, stream, output)
      command.public_send("#{stream}=", "")
    end
1035756
def cleanup_log_files(outputfile):
    """"""
    d = os.path.dirname(os.path.abspath(outputfile))
    logfiles = [f for f in os.listdir(d) if f.endswith('ogg.log')]
    for f in logfiles:
        os.remove(f)
9550
def reset_line(text = "")
      # Initialise ANSI escape string
      escape = ""

      # Get terminal window width
      cols = console_columns

      # The number of lines the previous message spanned
      lines = @@prev / cols

      # If cols == 80 and @@prev == 80, @@prev / cols == 1 but we don't want to
      # go up an extra line since it fits exactly
      lines -= 1 if @@prev % cols == 0

      # Clear and go up a line
      lines.times { escape += "#{ESC_R_AND_CLR}#{ESC_UP_A_LINE}" }

      # Clear the line that is to be printed on
      escape += "#{ESC_R_AND_CLR}"

      # Console is clear, we can print!
      $console.print "#{escape}#{text}"

      # Store the current message so we know how many lines it spans
      @@prev = text.to_s.length
    end
683089
def clear(self):
        
        if not self._enabled:
            return self

        self._stream.write('\r')
        self._stream.write(self.CLEAR_LINE)

        return self
275027
protected void clearLine() {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < terminal.getWidth(); i++) {
            sb.append(" ");
        }
        console.out().print(sb.toString());
    }
187398
def restore_logging(lines, min_level_value, max_level_value):
    """"""
    output = ''
    while lines:
        line = lines[0]
        if line.lstrip() != PASS_LINE_CONTENTS:
            # not our pass statement here, so just leave the line as-is and keep going
            output += line
            lines = lines[1:]
        else:
            # a logging call will start on the next line: find all the lines it includes and those it does not
            logging_lines, remaining_lines = split_call(lines[1:])
            lines = remaining_lines
            logging_stmt = ''.join(logging_lines)
            original_lines = line + logging_stmt

            # replace the logging statement if its level falls b/w min and max
            if not check_level(logging_stmt, True, min_level_value, max_level_value):
                output += logging_stmt
            else:
                # uncomment_lines of this logging statement and remove the pass line
                uncommented_logging_lines = uncomment_lines(logging_lines)
                logging.info('replacing:\n%s\nwith this:\n%s' % (original_lines.rstrip(), uncommented_logging_lines.rstrip()))
                output += uncommented_logging_lines
    return output
544439
def stop_readout(self, timeout=10.0):
        ''' 
        '''
        if self._scan_threads and self.current_module_handle not in [t.name for t in self._scan_threads]:
            raise RuntimeError('Thread name "%s" is not valid.')
        if self._scan_threads and self.current_module_handle not in self._curr_readout_threads:
            raise RuntimeError('Thread "%s" is not reading FIFO.')
        with self._readout_lock:
            self._curr_readout_threads.remove(self.current_module_handle)
        self._stopping_readout_event.clear()
        while not self._stopping_readout_event.wait(0.01):
            with self._readout_lock:
                if len(set(self._curr_readout_threads) & set([t.name for t in self._scan_threads if t.is_alive()])) == 0 or not self._scan_threads or self.abort_run.is_set():
                    if self.fifo_readout.is_running:
                        self.fifo_readout.stop(timeout=timeout)
                    self._stopping_readout_event.set()
878682
function _resetReadLine(state) {
    if (state.rl) {
        state.rl.close();
    }

    state.rl = readline.createInterface({
        'input': state.input,
        'output': state.output,
        'completer': function(line, callback) {
            if (!_.isFunction(state.autocomplete)) {
                // No autocomplete was provided, do nothing
                return callback(null, [[], line]);
            }

            CommandAutocomplete.getAutocompleteArguments(state.currentCommand, line, function(abort, args) {
                if (abort) {
                    return callback(null, [[], line]);
                }

                state.autocomplete(args, function(err, replacements) {
                    if (err) {
                        return callback(err);
                    }

                    CommandAutocomplete.getAutocompleteReplacements(state.currentCommand, line, replacements, function(replacements, toReplace) {
                        // Convert the arguments into what node-readline expects
                        return callback(null, [replacements, toReplace]);
                    });
                });
            });
        }
    });

    /*!
     * Monkey-patch the setPrompt method to properly calculate the string length when colors are
     * used. :(
     *
     * http://stackoverflow.com/questions/12075396/adding-colors-to-terminal-prompt-results-in-large-white-space
     */
    var rl = state.rl;
    rl._setPrompt = rl.setPrompt;
    rl.setPrompt = function(prompt, length) {
        var strippedLength = null;
        if (length) {
            strippedLength = length;
        } else {
            var stripped = prompt.split(/[\r\n]/).pop().stripColors;
            if (stripped) {
                strippedLength = stripped.length;
            }
        }

        rl._setPrompt(prompt, strippedLength);
    };

    _bindSigint(state);
}
260991
async def clear(self):
        """"""
        with (await self._cond):
            while self._free:
                conn = self._free.popleft()
                await conn.close()
            self._cond.notify()
6632
async def pop_log(self):
        """"""
        self._check_receive_loop()
        res = self.log_queue.get()
        self._check_error(res)
        return res
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')
1102800
def clear(prompt=True, cache=None):
    """"""
    cache = cache or config.cache()
    if prompt:
        answer = input(
            'Clear library cache files in %s/? (yN) ' % cache)
        if not answer.startswith('y'):
            return False
    shutil.rmtree(cache, ignore_errors=True)
    return True