Remove all instances of a line.

        Returns:
            int: the number of lines removed
484450
def remove_line(self, section, line):
        
        try:
            s = self._get_section(section, create=False)
        except KeyError:
            # No such section, skip.
            return 0

        return s.remove(line)
963652
def remove_blank_lines(self):
        """"""
        to_remove = []
        for i, line in enumerate(self):
            ln = line.strip()
            if ln == '':
                to_remove.append(i)
        self.delete_lines(to_remove)
1354377
def erase_lines(n=1):
    
    for _ in range(n):
        print(codes.cursor["up"], end="")
        print(codes.cursor["eol"], end="")
639356
def __str_cleanup(line):
        
        if '#' in line:
            line = line.replace("#", "")
            line = line.strip()
        if '-----------' in line:
            line = ''
        return line
483887
def removeblanklines(astr):
    """"""
    lines = astr.splitlines()
    lines = [line for line in lines if line.strip() != ""]
    return "\n".join(lines)
396648
def num_lines(self):
        
        if self.from_stdin:
            return None
        if not self._num_lines:
            self._iterate_lines()
        return self._num_lines
866261
def remove_lines(lines, remove=('[[back to top]', '<a class="mk-toclify"')):
    """"""

    if not remove:
        return lines[:]

    out = []
    for l in lines:
        if l.startswith(remove):
            continue
        out.append(l)
    return out
683089
def clear(self):
        
        if not self._enabled:
            return self

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

        return self
656878
def update(self, old_line, new_line, once=False):
        
        nb = 0
        for i, line in enumerate(self.lines):
            if line.match(old_line):
                self.lines[i] = new_line
                nb += 1
                if once:
                    return nb
        return nb
503902
public boolean removeLeadingEmptyLines()
    {
        boolean wasEmpty = false;
        Line line = this.lines;
        while (line != null && line.isEmpty)
        {
            this.removeLine(line);
            line = this.lines;
            wasEmpty = true;
        }
        return wasEmpty;
    }
267279
def remove_examples_all():
    
    d = examples_all_dir()
    if d.exists():
        log.debug('remove %s', d)
        d.rmtree()
    else:
        log.debug('nothing to remove: %s', d)
255718
def remove_blank_lines(source):
    
    io_obj = io.StringIO(source)
    source = [a for a in io_obj.readlines() if a.strip()]
    return "".join(source)
620646
def trim(self, text):
        
        lines = text.splitlines()
        firstline = lines[0] or lines[1]
        indent = len(firstline) - len(firstline.lstrip())
        return '\n'.join(x[indent:] for x in lines if x.strip())
317002
def remove_all_lvs(self):
        
        lvs = self.lvscan()
        for lv in lvs:
            self.remove_lv(lv)
134834
def trim_lines(lines)
      new_lines = lines.dup
      while new_lines[-1] && new_lines[-1].strip.empty?
        new_lines.pop
      end
      new_lines
    end
1354689
def remove(self, *args):
        
        for x in args:
            self.children.remove(x)
        return self.children
474731
def line_count(fn):
    

    with open(fn) as f:
        for i, l in enumerate(f):
            pass
    return i + 1