              location = os.path.join(str(folder), filename)
          else:
              location = os.path.join(str(folder),
                                      "{}.{}".format(filename,
                                                     self.serializer.ext))
              logger.debug("File extension set from serializer: '%s'", self.serializer.ext)
          logger.verbose("Alignments filepath: '%s'", location)
          return location
  
      # << I/O >> #
  
 
</s> remove             logger.debug("Serializer set from file extension: '%s'", extension)
            retval = Serializer.get_serializer_from_ext(extension)
 </s> add             logger.debug("Serializer set from filename extension: '%s'", extension)
            retval = get_serializer_from_filename(filename) </s> remove         self.file = "{}.{}".format(filename, self.serializer.ext)
 </s> add         self.file = "{}.{}".format(filename, self.serializer.file_extension) </s> remove             retval = Serializer.get_serializer(serializer)
        logger.verbose("Using '%s' serializer for alignments", retval.ext)
 </s> add             retval = get_serializer(serializer)
        logger.verbose("Using '%s' serializer for alignments", retval.file_extension) </s> remove         self.serializer = Serializer.get_serializer("json")
        filename = "{}_state.{}".format(model_name, self.serializer.ext)
 </s> add         self.serializer = get_serializer("json")
        filename = "{}_state.{}".format(model_name, self.serializer.file_extension) </s> remove             serializer_ext = os.path.splitext(
                self.args.log_file_path)[-1]
            self.serializer = Serializer.get_serializer_from_ext(
                serializer_ext)
 </s> add             self.serializer = get_serializer_from_filename(self.args.log_file_path)
                                                   self.serializer.file_extension))
            logger.debug("File extension set from serializer: '%s'",
                         self.serializer.file_extension)
              location = os.path.join(str(folder), filename)
          else:
              location = os.path.join(str(folder),
                                      "{}.{}".format(filename,
                                                   self.serializer.file_extension))
            logger.debug("File extension set from serializer: '%s'",
                         self.serializer.file_extension)
                                                   self.serializer.file_extension))
            logger.debug("File extension set from serializer: '%s'",
                         self.serializer.file_extension)
          logger.verbose("Alignments filepath: '%s'", location)
          return location
  
      # << I/O >> #
  
keep keep keep keep replace replace keep keep keep keep keep
 Standardize serialization (#903)

* Standardize serialization

- Linting
- Standardize serializer use throughout code
- Extend serializer to load and save files
- Always load and save in utf-8
- Create documentation 
lib/alignments.py