code: def save_gif(self, filename):
          
          self.timeline.index -= 1  # required for proper starting point for save
          self.animation.save(filename+'.gif', writer=PillowWriter(fps=self.timeline.fps))
docs: Saves the animation to a gif
  
          A convience function. Provided to let the user avoid dealing
          with writers.
  
          Parameters
          ----------
          filename : str
              the name of the file to be created without the file extension