                  logger.debug("stored data type: %s", type(data))
                  retval = self.unmarshal(data)
  
          except IOError as err:
              msg = "Error reading from '{}': {}".format(filename, err.strerror)
              raise FaceswapError(msg) from err
          logger.debug("data type: %s", type(retval))
          return retval
  
      def marshal(self, data):
 
</s> remove             msg = "Error serializing data for type {}: {}".format(type(data), str(err))
 </s> add             msg = f"Error serializing data for type {type(data)}: {str(err)}" </s> remove             msg = "Error unserializing data for type {}: {}".format(type(serialized_data),
                                                                    str(err))
 </s> add             msg = f"Error unserializing data for type {type(serialized_data)}: {str(err)}" </s> remove             msg = "Error writing to '{}': {}".format(filename, err.strerror)
 </s> add             msg = f"Error writing to '{filename}': {err.strerror}" </s> remove         retval = filename if extension else "{}.{}".format(filename, self.file_extension)
 </s> add         retval = filename if extension else f"{filename}.{self.file_extension}" </s> remove     elif serializer.lower() == "yaml" and yaml is not None:
 </s> add     elif serializer.lower() == "yaml" and _HAS_YAML:
            msg = f"Error reading from '{filename}': {err.strerror}"
                  logger.debug("stored data type: %s", type(data))
                  retval = self.unmarshal(data)
  
          except IOError as err:
            msg = f"Error reading from '{filename}': {err.strerror}"
              raise FaceswapError(msg) from err
          logger.debug("data type: %s", type(retval))
          return retval
  
      def marshal(self, data):
keep keep keep keep replace keep keep keep keep keep
 Core updates
   - Change loss loading mechanism
   - Autosize tooltips based on content size
   - Random linting + code modernisation 
lib/serializer.py