code: def save(self):
          
  
          # re-number cells
          self.cells = list(self.renumber())
  
          # add a newline to the last line if necessary
          if not self.cells[-1].endswith('\n'):
              self.cells[-1] += '\n'
  
          # save the rejoined the list of cells
          with open(self.filename, 'w') as file_open:
              file_open.write('\n\n'.join(self.cells))
docs: Format and save cells.