code: def commentless(data):
      
      it = iter(data)
      while True:
          line = next(it)
          while ":" in line or not line.lstrip().startswith(".."):
              yield line
              line = next(it)
          indent = indent_size(line)
          it = itertools.dropwhile(lambda el: indent_size(el) > indent
                                              or not el.strip(), it)
docs: Generator that removes from a list of strings the double dot
      reStructuredText comments and its contents based on indentation,
      removing trailing empty lines after each comment as well.