Parses the configuration and creates Parameter instances.
420858
def _create_and_add_parameters(params):
    '''
    
    '''
    global _current_parameter
    if _is_simple_type(params):
        _current_parameter = SimpleParameter(params)
        _current_option.add_parameter(_current_parameter)
    else:
        # must be a list
        for i in params:
            if _is_simple_type(i):
                _current_parameter = SimpleParameter(i)
            else:
                _current_parameter = TypedParameter()
                _parse_typed_parameter(i)
            _current_option.add_parameter(_current_parameter)
318064
def create(self):
        
        data = values.of({})

        payload = self._version.create(
            'POST',
            self._uri,
            data=data,
        )

        return ConfigurationInstance(self._version, payload, )
161379
@Override
    public void configure(String parameters) {
        if (parameters.isEmpty()) {
            return;
        }
        List<String> values = Op.split(parameters, " ", true);
        final int required = 2;
        if (values.size() < required) {
            throw new RuntimeException(MessageFormat.format(
                    "[configuration error] activation {0} requires {1} parameters",
                    this.getClass().getSimpleName(), required));
        }

        setComparison(Comparison.fromOperator(values.get(0)));
        setValue(Op.toDouble(values.get(1)));
    }
422614
def configure(self, config):
        
        parameters = config.get_section("parameters")
        if len(parameters) > 0:
            self._parameters = parameters
881424
private void loadConfigurationFiles() {

        // Parse the first annotation found (manage overriding)
        final Configuration conf = ClassUtility.getLastClassAnnotation(this.getClass(), Configuration.class);

        // Conf variable cannot be null because it was defined in this class
        // It's possible to discard default behaviour by setting an empty string to the value.

        // launch the configuration search engine
        ResourceBuilders.PARAMETER_BUILDER.searchConfigurationFiles(conf.value(), conf.extension());

    }
418611
def _build_parmlist(self, parameters):
        

        args = []
        for key, value in parameters.items():
            if not value is None:
                # We always use the explicit-length keyname format, to reduce the chance
                # of requests failing due to unusual characters in parameter values.

                try:
                    classinfo = unicode
                except NameError:
                    classinfo = str

                if isinstance(value, classinfo):
                    key = '%s[%d]' % (key.upper(), len(value.encode('utf-8')))
                else:
                    key = '%s[%d]' % (key.upper(), len(str(value)))
                args.append('%s=%s' % (key, value))
        args.sort()
        parmlist = '&'.join(args)        
        return parmlist
865029
@Override
    public void configure(String parameters) {
        if (parameters.isEmpty()) {
            return;
        }
        List<String> values = Op.split(parameters, " ");
        int required = 4;
        if (values.size() < required) {
            throw new RuntimeException(String.format(
                    "[configuration error] term <%s> requires <%d> parameters",
                    this.getClass().getSimpleName(), required));
        }
        Iterator<String> it = values.iterator();
        setBottomLeft(Op.toDouble(it.next()));
        setTopLeft(Op.toDouble(it.next()));
        setTopRight(Op.toDouble(it.next()));
        setBottomRight(Op.toDouble(it.next()));
        if (values.size() > required) {
            setHeight(Op.toDouble(it.next()));
        }
    }
849372
private void parseParameters(Map<String, String> parameters)
            throws ModuleInitializationException {
        logger.info("Parameters: " + parameters);

        String mode = parameters.get(PARAMETER_JOURNAL_MODE);
        if (mode == null) {
            inRecoveryMode = false;
        } else if (mode.equals(VALUE_JOURNAL_MODE_NORMAL)) {
            inRecoveryMode = false;
        } else if (mode.equals(VALUE_JOURNAL_MODE_RECOVER)) {
            inRecoveryMode = true;
        } else {
            throw new ModuleInitializationException("'"
                                                    + PARAMETER_JOURNAL_MODE + "' parameter must be '"
                                                    + VALUE_JOURNAL_MODE_NORMAL + "'(default) or '"
                                                    + VALUE_JOURNAL_MODE_RECOVER + "'", getRole());
        }
    }
71798
public function initializeInnerParameters()
    {
        $paramName = $this->config('name');
        $this->_dependentParameters[$paramName] = new HiddenParameter($this->_registry, [
            'name' => $paramName
        ]);
    }
603327
def from_config(config):
        
        result = Parameters()
        
        if config == None or len(config) == 0:
            return result
        
        for (key, value) in config.items():
            result.put(key, value)
        
        return result
812370
protected Map<String,String> initializeAdditionalParameters()
    {
        //get configuration
        Map<String,String> configuration=this.getConfiguration();

        //get property part
        String propertyPart=this.getPropertyPart();
        
        //get prefix
        String prefix=FaxJob2HTTPRequestConverterConfigurationConstants.ADDITIONAL_PARAMETER_PROPERTY_KEY_PREFIX.toString();
        prefix=MessageFormat.format(prefix,propertyPart);

        //init output
        Map<String,String> additionalParametersMap=new HashMap<String,String>();
        
        Iterator<Entry<String,String>> iterator=configuration.entrySet().iterator();
        Entry<String,String> entry=null;
        String key=null;
        String value=null;
        while(iterator.hasNext())
        {
            //get next entry
            entry=iterator.next();
            
            //get next key
            key=entry.getKey();
            
            if(key!=null)
            {
                //format key
                key=MessageFormat.format(key,propertyPart);
                key=key.trim();
                
                if(key.length()>0)
                {
                    //check if additional parameter key
                    if(key.startsWith(prefix))
                    {
                        //get value
                        value=entry.getValue();
                        
                        if(value!=null)
                        {
                            value=value.trim();
                            if(value.length()>0)
                            {
                                //get updated key without prefix
                                key=key.substring(prefix.length());
                                
                                //put in map
                                additionalParametersMap.put(key,value);
                            }
                        }
                    }
                }
            }
        }
        
        return additionalParametersMap;
    }
1061750
@Override
  protected void initParser() throws MtasConfigException {
    super.initParser();
    if (config != null) {
      for (int i = 0; i < config.children.size(); i++) {
        MtasConfiguration current = config.children.get(i);
        if (current.name.equals(PENNTREEBANK_IGNORE)) {
          for (int j = 0; j < current.children.size(); j++) {
            if (current.children.get(j).name.equals(PENNTREEBANK_NODE)) {
              String nameVariable = current.children.get(j).attributes
                  .get(PENNTREEBANK_NODE_NAME);
              if (!nameVariable.isEmpty()) {
                ignoreNodes.add(nameVariable);
              }
            }
          }
        }
      }
    }
  }
346356
public T withParameter(ConfigurationParameters parameter, Object value) {
        configMap.put(parameter, value);
        return getThis();
    }
313359
public static Parameters fromConfig(ConfigParams config) {
		Parameters result = new Parameters();

		if (config == null || config.size() == 0)
			return result;

		for (Map.Entry<String, String> entry : config.entrySet()) {
			result.put(entry.getKey(), entry.getValue());
		}

		return result;
	}
1211874
def instantiate_from_config(cfg):
    """"""
    for h in cfg:
        if h.get("type") in data_types:
            raise KeyError("Data type '%s' already exists" % h)
        data_types[h.get("type")] = DataType(h)
659368
def init_dataset_prepare_args(self, parser):
        ''' '''
        parser.add_argument('-f', '--configuration', dest='config', default=DEFAULT_USER_CONFIG_PATH,
                            help='the path to the configuration file to use -- ./config.yaml by default')
        parser.add_argument('-c', '--corpus-name', help='the name of the corpus to process')
        parser.add_argument('-n', '--dataset-name', help='the name to assign the newly processed dataset')
1199979
def parameters(self, params):
        
        array = JavaArray(jobject=JavaArray.new_instance("weka.core.setupgenerator.AbstractParameter", len(params)))
        for idx, obj in enumerate(params):
            array[idx] = obj.jobject
        javabridge.call(self.jobject, "setParameters", "([Lweka/core/setupgenerator/AbstractParameter;)V", array.jobject)