          if not self.have_alignments_file and (skip_existing or skip_faces):
              logger.warning("Skip Existing/Skip Faces selected, but no alignments file found!")
              return data
  
          try:
              with open(self.file, self.serializer.roptions) as align:
                  data = self.serializer.unmarshal(align.read())
          except IOError as err:
              logger.error("Error: '%s' not read: %s", self.file, err.strerror)
              exit(1)
  
          if skip_faces:
              # Remove items from algnments that have no faces so they will
              # be re-detected
              del_keys = [key for key, val in data.items() if not val]
 
</s> remove         try:
            logger.info("Reading alignments from: '%s'", self.file)
            with open(self.file, self.serializer.roptions) as align:
                data = self.serializer.unmarshal(align.read())
        except IOError as err:
            logger.error("'%s' not read: %s", self.file, err.strerror)
            exit(1)
 </s> add         logger.info("Reading alignments from: '%s'", self.file)
        data = self.serializer.load(self.file) </s> remove         try:
            logger.info("Writing alignments to: '%s'", self.file)
            with open(self.file, self.serializer.woptions) as align:
                align.write(self.serializer.marshal(self.data))
            logger.debug("Saved alignments")
        except IOError as err:
            logger.error("'%s' not written: %s", self.file, err.strerror)
 </s> add         logger.info("Writing alignments to: '%s'", self.file)
        self.serializer.save(self.file, self.data)
        logger.debug("Saved alignments") </s> remove         try:
            with open(self.filename, "rb") as inp:
                state = self.serializer.unmarshal(inp.read().decode("utf-8"))
                self.name = state.get("name", self.name)
                self.sessions = state.get("sessions", dict())
                self.lowest_avg_loss = state.get("lowest_avg_loss", dict())
                self.iterations = state.get("iterations", 0)
                self.training_size = state.get("training_size", 256)
                self.inputs = state.get("inputs", dict())
                self.config = state.get("config", dict())
                logger.debug("Loaded state: %s", state)
                self.replace_config(config_changeable_items)
        except IOError as err:
            logger.warning("No existing state file found. Generating.")
            logger.debug("IOError: %s", str(err))
        except JSONDecodeError as err:
            logger.debug("JSONDecodeError: %s:", str(err))
 </s> add         if not os.path.exists(self.filename):
            logger.info("No existing state file found. Generating.")
            return
        state = self.serializer.load(self.filename)
        self.name = state.get("name", self.name)
        self.sessions = state.get("sessions", dict())
        self.lowest_avg_loss = state.get("lowest_avg_loss", dict())
        self.iterations = state.get("iterations", 0)
        self.training_size = state.get("training_size", 256)
        self.inputs = state.get("inputs", dict())
        self.config = state.get("config", dict())
        logger.debug("Loaded state: %s", state)
        self.replace_config(config_changeable_items) </s> remove             with open(recent_filename, "rb") as inp:
                recent_files = self.serializer.unmarshal(inp.read().decode("utf-8"))
 </s> add             recent_files = self.serializer.load(recent_filename) </s> remove         except Exception as err:
 </s> add         except Exception as err:  # pylint:disable=broad-except
        data = self.serializer.load(self.file)
          if not self.have_alignments_file and (skip_existing or skip_faces):
              logger.warning("Skip Existing/Skip Faces selected, but no alignments file found!")
              return data
  
        data = self.serializer.load(self.file)
        data = self.serializer.load(self.file)
        data = self.serializer.load(self.file)
        data = self.serializer.load(self.file)
        data = self.serializer.load(self.file)
        data = self.serializer.load(self.file)
  
          if skip_faces:
              # Remove items from algnments that have no faces so they will
              # be re-detected
              del_keys = [key for key, val in data.items() if not val]
keep keep keep keep replace replace replace replace 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 
scripts/fsmedia.py