      elif extension == ".fsa":
          retval = _CompressedSerializer()
      elif extension in (".yaml", ".yml") and yaml is not None:
          retval = _YAMLSerializer()
      elif extension in (".yaml", ".yml") and yaml is None:
          logger.warning("You must have PyYAML installed to use YAML as the serializer.\n"
                         "Switching to JSON as the serializer.")
          retval = _JSONSerializer()
      else:
          logger.warning("Unrecognized extension: '%s'. Returning json serializer", extension)
 
</s> remove     elif extension in (".yaml", ".yml") and yaml is not None:
 </s> add     elif extension in (".yaml", ".yml") and _HAS_YAML: </s> remove     elif serializer.lower() == "yaml" and yaml is None:
 </s> add     elif serializer.lower() == "yaml": </s> remove     elif serializer.lower() == "yaml" and yaml is not None:
 </s> add     elif serializer.lower() == "yaml" and _HAS_YAML: </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         retval = dict()
 </s> add         retval = {}
    elif extension in (".yaml", ".yml"):
      elif extension == ".fsa":
          retval = _CompressedSerializer()
      elif extension in (".yaml", ".yml") and yaml is not None:
          retval = _YAMLSerializer()
    elif extension in (".yaml", ".yml"):
          logger.warning("You must have PyYAML installed to use YAML as the serializer.\n"
                         "Switching to JSON as the serializer.")
          retval = _JSONSerializer()
      else:
          logger.warning("Unrecognized extension: '%s'. Returning json serializer", extension)
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