          for section, items in self.defaults.items():
              logger.debug("Adding section: '%s')", section)
              self.insert_config_section(section, items["helptext"])
              for item, opt in items.items():
                  logger.debug("Adding option: (item: '%s', opt: '%s'", item, opt)
                  if item == "helptext":
                      continue
                  self.insert_config_item(section,
                                          item,
                                          opt["default"],
 
</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         """ 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
        """
                logger.debug("Adding option: (item: '%s', opt: '%s')", item, opt)
          for section, items in self.defaults.items():
              logger.debug("Adding section: '%s')", section)
              self.insert_config_section(section, items["helptext"])
              for item, opt in items.items():
                logger.debug("Adding option: (item: '%s', opt: '%s')", item, opt)
                  if item == "helptext":
                      continue
                  self.insert_config_item(section,
                                          item,
                                          opt["default"],
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/config.py