          self.cli_opts = cli_opts
          self.scaling_factor = scaling_factor
          self.pathcache = pathcache
          self.statusbar = statusbar
          self.serializer = JSONSerializer
          self.tk_vars = self.set_tk_vars()
          self.user_config = UserConfig(None)
          self.user_config_dict = self.user_config.config_dict
          self.command_notebook = None  # set in command.py
          self.session = session
 
</s> remove         self.serializer = JSONSerializer
 </s> add         self.serializer = get_serializer("json") </s> remove         self.serializer = Serializer.get_serializer("json")
 </s> add         self.serializer = get_serializer("json") </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) </s> remove                                   "{}_state.{}".format(self.model_name, serializer.ext))
        with open(state_file, "rb") as inp:
            state = serializer.unmarshal(inp.read().decode("utf-8"))
            session_names = ["session_{}".format(key)
                             for key in state["sessions"].keys()]
 </s> add                                   "{}_state.{}".format(self.model_name, serializer.file_extension))
        state = serializer.load(state_file)
        session_names = ["session_{}".format(key)
                         for key in state["sessions"].keys()] </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)
        self.serializer = get_serializer("json")
          self.cli_opts = cli_opts
          self.scaling_factor = scaling_factor
          self.pathcache = pathcache
          self.statusbar = statusbar
        self.serializer = get_serializer("json")
          self.tk_vars = self.set_tk_vars()
          self.user_config = UserConfig(None)
          self.user_config_dict = self.user_config.config_dict
          self.command_notebook = None  # set in command.py
          self.session = session
keep keep keep keep 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/gui/utils.py