          selected check button options
      """
      def __init__(self, parent, value, variable, **kwargs):
          self._tk_var = tk.BooleanVar()
          self._tk_var.set(value == variable.get())
          super().__init__(parent, variable=self._tk_var, **kwargs)
          self._value = value
          self._master_variable = variable
          self._tk_var.trace("w", self._on_update)
          self._master_variable.trace("w", self._on_master_update)
 
</s> remove         """ Return a config item in it's correct format """
 </s> add         """ Return a config item in it's correct format.

        Parameters
        ----------
        section: str
            The configuration section currently being processed
        option: str
            The configuration option currently being processed

        Returns
        -------
        varies
            The selected configuration option in the correct data format
        """ </s> remove         f_cfgfile = open(self.configfile, "w")
        self.config.write(f_cfgfile)
        f_cfgfile.close()
 </s> add         with open(self.configfile, "w") as f_cfgfile:
            self.config.write(f_cfgfile) </s> remove                 opt_value = self.config.get(section, item)
                if opt_value.lower() == "none" and any(choice.lower() == "none"
                                                       for choice in opt["choices"]):
                    continue
                if opt_value not in opt["choices"]:
                    default = str(opt["default"])
                    logger.warning("'%s' is not a valid config choice for '%s': '%s'. Defaulting "
                                   "to: '%s'", opt_value, section, item, default)
                    self.config.set(section, item, default)
 </s> add                 if opt["type"] == list:  # Multi-select items
                    opt_value = self._parse_list(section, item)
                    if not opt_value:  # No option selected
                        continue
                    if not all(val in opt["choices"] for val in opt_value):
                        invalid = [val for val in opt_value if val not in opt["choices"]]
                        valid = ", ".join(val for val in opt_value if val in opt["choices"])
                        logger.warning("The option(s) %s are not valid selections for '%s': '%s'. "
                                       "setting to: '%s'", invalid, section, item, valid)
                        self.config.set(section, item, valid)
                else:  # Single-select items
                    opt_value = self.config.get(section, item)
                    if opt_value.lower() == "none" and any(choice.lower() == "none"
                                                           for choice in opt["choices"]):
                        continue
                    if opt_value not in opt["choices"]:
                        default = str(opt["default"])
                        logger.warning("'%s' is not a valid config choice for '%s': '%s'. "
                                       "Defaulting to: '%s'", opt_value, section, item, default)
                        self.config.set(section, item, default) </s> remove         helptext = '# {}'.format(helptext.replace("\n", "\n# "))
 </s> add         formatted = ""
        for hlp in helptext.split("\n"):
            subsequent_indent = "\t\t" if hlp.startswith("\t") else ""
            hlp = f"\t- {hlp[1:].strip()}" if hlp.startswith("\t") else hlp
            formatted += textwrap.fill(hlp,
                                       100,
                                       tabsize=4,
                                       subsequent_indent=subsequent_indent) + "\n"
        helptext = '# {}'.format(formatted[:-1].replace("\n", "\n# "))  # Strip last newline
        self._tk_var.set(value in variable.get().split())
          selected check button options
      """
      def __init__(self, parent, value, variable, **kwargs):
          self._tk_var = tk.BooleanVar()
        self._tk_var.set(value in variable.get().split())
          super().__init__(parent, variable=self._tk_var, **kwargs)
          self._value = value
          self._master_variable = variable
          self._tk_var.trace("w", self._on_update)
          self._master_variable.trace("w", self._on_master_update)
keep keep keep keep replace keep keep keep keep keep
 scripts.train - Add freeze weights option
lib.config:
  - Better formatting for .ini files
  - Support multi-select options
gui - Add support for multi-select config items 
lib/gui/custom_widgets.py