code: 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
docs: Replace all lines matching `old_line` with `new_line`.
  
          If ``once`` is set to True, remove only the first instance.