code: def write(self, delete_if_empty=False):
          
          with open(self.path, 'w') as f:
              if not self.todos:
                  f.flush()
              else:
                  for todo in _todo_to_file(self.todos):
                      f.write(todo)
docs: flush todos to file
          :param delete_if_empty: delete if todo is empty