code: def save(self, output_file, overwrite=False):
  
          
  
          if os.path.exists(output_file) and overwrite is False:
  
              raise ModelFileExists("The file %s exists already. If you want to overwrite it, use the 'overwrite=True' "
                                    "options as 'model.save(\"%s\", overwrite=True)'. " % (output_file, output_file))
  
          else:
  
              data = self.to_dict_with_types()
  
              # Write it to disk
  
              try:
  
                  # Get the YAML representation of the data
  
                  representation = my_yaml.dump(data, default_flow_style=False)
  
                  with open(output_file, "w+") as f:
  
                      # Add a new line at the end of each voice (just for clarity)
  
                      f.write(representation.replace("\n", "\n\n"))
  
              except IOError:
  
                  raise CannotWriteModel(os.path.dirname(os.path.abspath(output_file)),
                                         "Could not write model file %s. Check your permissions to write or the "
                                         "report on the free space which follows: " % output_file)
docs: Save the model to disk