Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.

        :param options: the options to fix
        :type options: dict
        :return: the (potentially) fixed options
        :rtype: dict
761727
def fix_config(self, options):
        
        options = super(ForLoop, self).fix_config(options)

        opt = "min"
        if opt not in options:
            options[opt] = 1
        if opt not in self.help:
            self.help[opt] = "The minimum for the loop (included, int)."

        opt = "max"
        if opt not in options:
            options[opt] = 10
        if opt not in self.help:
            self.help[opt] = "The maximum for the loop (included, int)."

        opt = "step"
        if opt not in options:
            options[opt] = 1
        if opt not in self.help:
            self.help[opt] = "The step size (int)."

        return options
1328359
def fix(self, item):
        
        if not self.is_python_2:
            return item
        if isinstance(item, str):
            return item.decode("utf-8")
        if isinstance(item, unicode):  # noqa <-- python3 has no unicode
            return item
        if isinstance(item, Mapping):
            return dict(map(self.fix, item.items()))
        elif isinstance(item, Iterable):
            return type(item)(map(self.fix, item))

        return item
848721
def add_option(self, option):
        
        assert isinstance(option, Option)
        repeatable = defines.OptionRegistry.LIST[option.number].repeatable
        if not repeatable:
            ret = self._already_in(option)
            if ret:
                raise TypeError("Option : %s is not repeatable", option.name)
            else:
                self._options.append(option)
        else:
            self._options.append(option)
1254777
def fix_config(self, options):
        
        options = super(Evaluate, self).fix_config(options)

        opt = "storage_name"
        if opt not in options:
            options[opt] = "unknown"
        if opt not in self.help:
            self.help[opt] = "The name of the classifier model in storage (string)."

        opt = "discard_predictions"
        if opt not in options:
            options[opt] = False
        if opt not in self.help:
            self.help[opt] = "Discard classifier predictions to save memory (bool)."

        opt = "output"
        if opt not in options:
            options[opt] = None
        if opt not in self.help:
            self.help[opt] = "For capturing the classifier's prediction output (PredictionOutput)."

        return options
490163
def fix_config(self, options):
        
        options = super(ROC, self).fix_config(options)

        opt = "class_index"
        if opt not in options:
            options[opt] = [0]
        if opt not in self.help:
            self.help[opt] = "The list of 0-based class-label indices to display (list)."

        opt = "key_loc"
        if opt not in options:
            options[opt] = "lower right"
        if opt not in self.help:
            self.help[opt] = "The location of the key in the plot (str)."

        opt = "title"
        if opt not in options:
            options[opt] = None
        if opt not in self.help:
            self.help[opt] = "The title for the plot (str)."

        opt = "outfile"
        if opt not in options:
            options[opt] = None
        if opt not in self.help:
            self.help[opt] = "The file to store the plot in (str)."

        opt = "wait"
        if opt not in options:
            options[opt] = True
        if opt not in self.help:
            self.help[opt] = "Whether to wait for user to close the plot window (bool)."

        return options
346407
def fix_config(self, options):
        
        options = super(Console, self).fix_config(options)

        opt = "prefix"
        if opt not in options:
            options[opt] = ""
        if opt not in self.help:
            self.help[opt] = "The prefix for the output (string)."

        return options
659336
def resolve(self):
        
        if self.source and self.target:
            for key in self.source.keys():
                if (key not in self.dont_carry_over_options
                        and not self.target.has(key)):
                    self.target.set(key, self.source.get(key))
537748
def fix_config(self, options):
        
        opt = "setup"
        if opt not in options:
            options[opt] = datagen.DataGenerator(classname="weka.datagenerators.classifiers.classification.Agrawal")
        if opt not in self.help:
            self.help[opt] = "The data generator to use (DataGenerator)."

        opt = "incremental"
        if opt not in options:
            options[opt] = False
        if opt not in self.help:
            self.help[opt] = "Whether to output the data incrementally, in case the generator supports that (bool)."

        return super(DataGenerator, self).fix_config(options)
999804
def fix_config(self, options):
        
        opt = "db_url"
        if opt not in options:
            options[opt] = "jdbc:mysql://somehost:3306/somedatabase"
        if opt not in self.help:
            self.help[opt] = "The JDBC database URL to connect to (str)."

        opt = "user"
        if opt not in options:
            options[opt] = "user"
        if opt not in self.help:
            self.help[opt] = "The database user to use for connecting (str)."

        opt = "password"
        if opt not in options:
            options[opt] = "secret"
        if opt not in self.help:
            self.help[opt] = "The password for the database user (str)."

        opt = "query"
        if opt not in options:
            options[opt] = "SELECT * FROM table"
        if opt not in self.help:
            self.help[opt] = "The SQL query for generating the dataset (str)."

        opt = "sparse"
        if opt not in options:
            options[opt] = False
        if opt not in self.help:
            self.help[opt] = "Whether to return the data in sparse format (bool)."

        opt = "custom_props"
        if opt not in options:
            options[opt] = ""
        if opt not in self.help:
            self.help[opt] = "Custom properties filename (str)."

        return super(LoadDatabase, self).fix_config(options)
921965
def set(self, option, value):
        
        if self.config is None:
            self.config = {}
        self.config[option] = value
487884
def addOption(classobj, name, default, dtype=str, doc=None):
        
        # make a config object
        if not hasattr(classobj, '_config'):
            classobj._config = Kittens.config.SectionParser(ConfigFile, "render-" + classobj.renderer_id)
        # make a class-specific copy of the current option set
        if classobj._options_owner is not classobj:
            classobj.options = dict(DefaultRenderer.options)
            classobj._options_owner = classobj
        # overrid default value from config file
        if dtype is bool:
            value = classobj._config.getbool(name, default)
        else:
            value = dtype(classobj._config.get(name, default))
        # insert into dict
        classobj.options[name] = (value, default, dtype, doc)
197587
private function fixOptions()
    {
        $options = (is_array($this->file))
            ? $this->file
            : [[$this->file]];
        return $options;
    }
1315060
def add(options = {})
      self.options = options

      raise(ArgumentError, 'Mandatory param :name missing') unless options[:name]

      if options[:feature]
        features << options
        SafetyCone::ViewHelpers.add_method(options[:feature])
      else
        paths[make_key] = options
      end
    end
328908
def set_options(self, **kwargs):
        
        options = self.options
        options.update(kwargs)
        self.update(options=options)
10854
def addopt ( opt )
      raise TypeError, 'Incorrectly types for option object.' unless
	opt.instance_of? Cmdlib::Option

      @options[opt.longname.to_sym] = opt
    end
263834
def fix_config(self, options):
        
        options = super(CrossValidate, self).fix_config(options)

        opt = "setup"
        if opt not in options:
            options[opt] = Classifier(classname="weka.classifiers.rules.ZeroR")
        if opt not in self.help:
            self.help[opt] = "The classifier/clusterer to train (Classifier/Clusterer)."

        opt = "folds"
        if opt not in options:
            options[opt] = 10
        if opt not in self.help:
            self.help[opt] = "The number of folds for CV (int)."

        opt = "seed"
        if opt not in options:
            options[opt] = 1
        if opt not in self.help:
            self.help[opt] = "The seed value for randomizing the data (int)."

        opt = "discard_predictions"
        if opt not in options:
            options[opt] = False
        if opt not in self.help:
            self.help[opt] = "Discard classifier predictions to save memory (bool)."

        opt = "output"
        if opt not in options:
            options[opt] = None
        if opt not in self.help:
            self.help[opt] = "For capturing the classifier's prediction output (PredictionOutput)."

        return options
815711
def fix_config(self, options):
        
        options = super(ListFiles, self).fix_config(options)

        opt = "dir"
        if opt not in options:
            options[opt] = "."
        if opt not in self.help:
            self.help[opt] = "The directory to search (string)."

        opt = "recursive"
        if opt not in options:
            options[opt] = False
        if opt not in self.help:
            self.help[opt] = "Whether to search recursively (bool)."

        opt = "list_files"
        if opt not in options:
            options[opt] = True
        if opt not in self.help:
            self.help[opt] = "Whether to include files (bool)."

        opt = "list_dirs"
        if opt not in options:
            options[opt] = False
        if opt not in self.help:
            self.help[opt] = "Whether to include directories (bool)."

        opt = "regexp"
        if opt not in options:
            options[opt] = ".*"
        if opt not in self.help:
            self.help[opt] = "The regular expression that files/dirs must match (string)."

        return options