code: def save_lyrics(self, filename=None, extension='json', verbose=True,
                      overwrite=None, binary_encoding=False):
          
          extension = extension.lstrip(".")
          assert (extension == 'json') or (extension == 'txt'), "format_ must be JSON or TXT"
  
          # Determine the filename
          if filename:
              for ext in ["txt", "TXT", "json", "JSON"]:
                  filename = filename.replace("." + ext, "")
              filename += "." + extension
          else:
              filename = "Lyrics_{}_{}.{}".format(self.artist.replace(" ", ""),
                                                  self.title.replace(" ", ""),
                                                  extension).lower()
              filename = self._sanitize_filename(filename)
  
          # Check if file already exists
          write_file = False
          if not os.path.isfile(filename):
              write_file = True
          elif overwrite:
              write_file = True
          else:
              if input("{} already exists. Overwrite?\n(y/n): ".format(filename)).lower() == 'y':
                  write_file = True
  
          # Format lyrics as either .txt or .json
          if extension == 'json':
              lyrics_to_write = {'songs': [], 'artist': self.artist}
              lyrics_to_write['songs'].append(self.to_dict())
          else:
              lyrics_to_write = self.lyrics
  
          if binary_encoding:
              lyrics_to_write = lyrics_to_write.encode('utf8')
  
          # Write the lyrics to either a .json or .txt file
          if write_file:
              with open(filename, 'wb' if binary_encoding else 'w') as lyrics_file:
                  if extension == 'json':
                      json.dump(lyrics_to_write, lyrics_file)
                  else:
                      lyrics_file.write(lyrics_to_write)
              if verbose:
                  print('Wrote {} to {}.'.format(self.title, filename))
          else:
              if verbose:
                  print('Skipping file save.\n')
          return lyrics_to_write
docs: Allows user to save song lyrics from Song object to a .json or .txt file.