def append_at(self, index, text):
        logging.debug("Appending at index %s text %s",
                      index,
                      text)
        if index == -1:
            self.top_matter = _compose(self.top_matter,
                                       _echo(text))
        elif index >= 0:
            self.composed_lines[index] = _compose(self.composed_lines[index],
                                                  _echo(text))
        else:
            raise Exception("Index must be >= -1.")
dataset/ETHPy150Open hut8labs/diffscuss/diffscuss/github_import.py/DiffscussComposer.append_at/original