Fills the struct with the default parameter values as defined in provided
parameter definition collection.
1328
private function fillDefault(ParameterDefinitionCollectionInterface $definitionCollection): void
    {
        foreach ($definitionCollection->getParameterDefinitions() as $name => $definition) {
            $this->setParameterValue($name, $definition->getDefaultValue());

            if ($definition instanceof CompoundParameterDefinition) {
                $this->fillDefault($definition);
            }
        }
    }
429565
def parameter_struct_dict(self):
        """"""
        if self._parameter_struct_dict is None:
            self._parameter_struct_dict = self._make_ff_params_dict()
        elif self.auto_update_f_params:
            new_hash = hash(
                tuple([tuple(item)
                       for sublist in self.values()
                       for item in sublist.values()]))
            if self._old_hash != new_hash:
                self._parameter_struct_dict = self._make_ff_params_dict()
                self._old_hash = new_hash
        return self._parameter_struct_dict
372289
private static void setCollectionParam(String name, List<?> values) throws ConfigurationException {
        try {
            Field field = config.getClass().getDeclaredField(name);
            Class<?> fieldClass = field.getType();
            if (Map.class.isAssignableFrom(fieldClass)) {
                setMapParam(field, values);
            } else if (List.class.isAssignableFrom(fieldClass)) {
                setListParam(field, values);
            } else {
                throw new ConfigurationException("Invalid value type for parameter: " + name);
            }
        } catch (SecurityException | NoSuchFieldException e) {
            throw new ConfigurationException("Unknown configuration parameter: " + name);
        }
    }
1337807
def _init_params_default(self):
        
        # if there are some nan -> mean impute
        Yimp = self.Y.copy()
        Inan = sp.isnan(Yimp)
        Yimp[Inan] = Yimp[~Inan].mean()
        if self.P==1:   C = sp.array([[Yimp.var()]])
        else:           C = sp.cov(Yimp.T)
        C /= float(self.n_randEffs)
        for ti in range(self.n_randEffs):
            self.getTraitCovarFun(ti).setCovariance(C)
573027
def _insert_defaults(self):
        
        merged = merge_defaults(self.structure, self)
        self.update(merged)
279458
private static void initializeSchemaIds() {

		final Map<String, Class> interfaces = StructrApp.getConfiguration().getInterfaces();

		// add Structr interfaces here
		for (final Class type : interfaces.values()) {

			// only register node types
			if (type.isInterface() && NodeInterface.class.isAssignableFrom(type) && !type.getName().startsWith("org.structr.dynamic.")) {

				registerType(type);
			}
		}
	}
60515
def set_defaults(self):
        """"""

        for const_name, c in file_classes.items():
            if c.multiplicity == '1':
                f = self.file(const_name)
                if not f.record.unpacked_contents:
                    f.setcontent(f.default)
588106
def populate(self, **values):
        """"""
        values = values.copy()
        fields = list(self.iterate_with_name())
        for _, structure_name, field in fields:
            if structure_name in values:
                field.__set__(self, values.pop(structure_name))
        for name, _, field in fields:
            if name in values:
                field.__set__(self, values.pop(name))
1260612
def setup_parameters(self):
        """"""
        t = self.template
        parameters = self.get_parameter_definitions()

        if not parameters:
            logger.debug("No parameters defined.")
            return

        for name, attrs in parameters.items():
            p = build_parameter(name, attrs)
            t.add_parameter(p)
1222404
public Chunks withDefault(int defaultValue) {
        this.defaultValue = defaultValue;
        if (defaultValue != 0) {
            for (int[] chunk : chunks) {
                Arrays.fill(chunk, defaultValue);
            }
        }
        return this;
    }
1144841
private void injectStructFields(MethodDefinition read, LocalVariableDefinition instance, Map<Short, LocalVariableDefinition> structData)
    {
        for (ThriftFieldMetadata field : metadata.getFields(THRIFT_FIELD)) {
            injectField(read, field, instance, structData.get(field.getId()));
        }
    }
443848
def parameters(self):
        
        if self._parameters is None:
            self.__init()
        for param in self._parameters:
            if not isinstance(param['defaultValue'], BaseGPObject):
                if param['dataType'] == "GPFeatureRecordSetLayer":
                    param['defaultValue'] = GPFeatureRecordSetLayer.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPString":
                    param['defaultValue'] = GPString.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPLong":
                    param['defaultValue'] = GPLong.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPDouble":
                    param['defaultValue'] = GPDouble.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPDate":
                    param['defaultValue'] = GPDate.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPBoolean":
                    param['defaultValue'] = GPBoolean.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPDataFile":
                    param['defaultValue'] = GPDataFile.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPLinearUnit":
                    param['defaultValue'] = GPLinearUnit.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPMultiValue":
                    param['defaultValue'] = GPMultiValue.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPRasterData":
                    param['defaultValue'] = GPRasterData.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPRasterDataLayer":
                    param['defaultValue'] = GPRasterDataLayer.fromJSON(json.dumps(param))
                elif param['dataType'] == "GPRecordSet":
                    param['defaultValue'] = GPRecordSet.fromJSON(json.dumps(param))
        return self._parameters
809806
public void addParameter(String paramName, String paramValue) {
        this.parameters.add(new StructureParameter(paramName, paramValue));
    }
66918
protected Parameter[] createDefaultParameters(Class[] parameters) {
		Parameter[] componentParameters = new Parameter[parameters.length];
		for (int i = 0; i < parameters.length; i++) {
			componentParameters[i] = ComponentParameter.DEFAULT;
		}
		return componentParameters;
	}
998098
def restore_default_values_page(self):
        """"""
        # Clear parameters so it doesn't add parameters when
        # restore from changes.
        if self.default_value_parameters:
            self.default_value_parameters = []
        if self.default_value_parameter_containers:
            self.default_value_parameter_containers = []

        for i in reversed(list(range(self.container_layout.count()))):
            widget = self.container_layout.itemAt(i).widget()
            if widget is not None:
                widget.setParent(None)

        default_fields = all_default_fields()

        for field_group in all_field_groups:
            settable_fields = []
            for field in field_group['fields']:
                if field not in default_fields:
                    continue
                else:
                    settable_fields.append(field)
                    default_fields.remove(field)

            if not settable_fields:
                continue
            # Create group box for each field group
            group_box = QGroupBox(self)
            group_box.setTitle(field_group['name'])
            self.container_layout.addWidget(group_box)
            parameters = []
            for settable_field in settable_fields:
                parameter = self.default_field_to_parameter(settable_field)
                if parameter:
                    parameters.append(parameter)
            parameter_container = ParameterContainer(
                parameters,
                description_text=field_group['description'],
                extra_parameters=extra_parameter
            )
            parameter_container.setup_ui(must_scroll=False)
            group_box_inner_layout = QVBoxLayout()
            group_box_inner_layout.addWidget(parameter_container)
            group_box.setLayout(group_box_inner_layout)

            # Add to attribute
            self.default_value_parameter_containers.append(parameter_container)

        # Only show non-groups default fields if there is one
        if len(default_fields) > 0:
            for default_field in default_fields:
                parameter = self.default_field_to_parameter(default_field)
                if parameter:
                    self.default_value_parameters.append(parameter)

            description_text = tr(
                'In this options you can change the global default values for '
                'these variables.')
            parameter_container = ParameterContainer(
                self.default_value_parameters,
                description_text=description_text,
                extra_parameters=extra_parameter
            )
            parameter_container.setup_ui(must_scroll=False)
            self.other_group_box = QGroupBox(tr('Non-group fields'))
            other_group_inner_layout = QVBoxLayout()
            other_group_inner_layout.addWidget(parameter_container)
            self.other_group_box.setLayout(other_group_inner_layout)
            self.container_layout.addWidget(self.other_group_box)

            # Add to attribute
            self.default_value_parameter_containers.append(parameter_container)
269972
public static void initDefaultParameterValues(QueryParameter param,
                                                  List<Serializable> defValues, Map<String, Object> parameterValues) throws QueryException {

        if (param.getSelection().equals(QueryParameter.SINGLE_SELECTION)) {
            parameterValues.put(param.getName(), defValues.get(0));
        } else {
            Object[] val = new Object[defValues.size()];
            for (int k = 0, size = defValues.size(); k < size; k++) {
                val[k] = defValues.get(k);
            }
            parameterValues.put(param.getName(), val);
        }
    }
1221350
def add_defaults(self, ctype: ContentType = None) -> "InstanceNode":
        
        val = self.value
        if not (isinstance(val, StructuredValue) and self.is_internal()):
            return self
        res = self
        if isinstance(val, ObjectValue):
            if val:
                for mn in self._member_names():
                    m = res._member(mn) if res is self else res.sibling(mn)
                    res = m.add_defaults(ctype)
                res = res.up()
            return self.schema_node._add_defaults(res, ctype)
        if not val:
            return res
        en = res[0]
        while True:
            res = en.add_defaults(ctype)
            try:
                en = res.next()
            except NonexistentInstance:
                break
        return res.up()