  
          choices = list() if not choices else choices
  
          if None in (section, title, default, info):
              raise ValueError("Default config items must have a section, "
                               "title, defult and  "
                               "information text")
          if not self.defaults.get(section, None):
              raise ValueError("Section does not exist: {}".format(section))
          if datatype not in (str, bool, float, int):
              raise ValueError("'datatype' must be one of str, bool, float or "
 
</s> remove         if datatype not in (str, bool, float, int):
 </s> add         if datatype not in (str, bool, float, int, list): </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         """ Handle the config """
        logger.debug("Handling config")
 </s> add         """ Handle the config.

        Checks whether a config file exists for this section. If not then a default is created.

        Configuration choices are then loaded and validated
        """
        logger.debug("Handling config: (section: %s, configfile: '%s')",
                     self.section, self.configfile)
            raise ValueError("Default config items must have a section, title, defult and "
  
          choices = list() if not choices else choices
  
          if None in (section, title, default, info):
            raise ValueError("Default config items must have a section, title, defult and "
            raise ValueError("Default config items must have a section, title, defult and "
                               "information text")
          if not self.defaults.get(section, None):
              raise ValueError("Section does not exist: {}".format(section))
          if datatype not in (str, bool, float, int):
              raise ValueError("'datatype' must be one of str, bool, float or "
keep keep keep keep replace 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