Initialize default values and validate that config is correct.
350543
public void postConstruct() {
        Assert.isTrue(this.spacing == null || this.spacing.length == 2,
                      GridLayer.class.getSimpleName() +
                              ".spacing has the wrong number of elements.  Expected 2 (x,y) but was: " +
                              Arrays.toString(this.spacing));
        Assert.isTrue(this.numberOfLines == null || this.numberOfLines.length == 2,
                      GridLayer.class.getSimpleName() +
                              ".numberOfLines has the wrong number of elements.  Expected 2 (x,y) but was: " +
                              Arrays.toString(this.numberOfLines));
        Assert.isTrue(this.pointsInLine > 2,
                      "There must be at least 2 points in a line.  There were: " + this.pointsInLine);
        Assert.isTrue(this.indent >= 0, "The indent is not permitted to be negative: " + this.indent);
        Assert.isTrue(this.labelColor != null, "labelColor should not be null");
        Assert.isTrue(this.haloColor != null, "haloColor should not be null");
        Assert.isTrue(this.font != null, "font should not be null");

        try {
            if (this.labelProjection != null) {
                if (this.longitudeFirst != null) {
                    this.labelCRS = CRS.decode(this.labelProjection, this.longitudeFirst);
                } else {
                    this.labelCRS = CRS.decode(this.labelProjection);
                }
            }
        } catch (FactoryException e) {
            throw new IllegalArgumentException("The projection code: " + this.labelProjection +
                                                       " is not valid. Error message when parsing code: " +
                                                       e.getMessage());
        }
        if (this.labelFormat != null || this.valueFormat != null || this.unitFormat != null) {
            GridLabelFormat format = GridLabelFormat.fromConfig(this);
            if (format == null) {
                throw new IllegalArgumentException("`labelFormat` or `valueFormat` must be set");
            }
            try {
                format.format(2.0, "m");
            } catch (IllegalFormatException e) {
                throw new IllegalArgumentException("Invalid label format");
            }
            this.gridLabelFormat = format;
        }
    }
229714
def __init_defaults(self, config):
        """"""

        provider = self.__provider

        if provider == 'sqlite':
            config.setdefault('dbname', ':memory:')
            config.setdefault('create_db',  True)
        elif provider == 'mysql':
            config.setdefault('port', 3306)
            config.setdefault('charset', 'utf8')
        elif provider == 'postgres':
            config.setdefault('port', 5432)
        elif provider == 'oracle':
            config.setdefault('port', 1521)
        else:
            raise ValueError('Unsupported provider "{}"'.format(provider))

        if provider != 'sqlite':
            config.setdefault('host', 'localhost')
            config.setdefault('user', None)
            config.setdefault('password', None)
            config.setdefault('dbname', None)
1065617
def init_defaults(self):
        
        super(SimpleTable, self).init_defaults()
        self.name = self.table
643899
def init(self, *args):
        '''
        '''
        cfg = {}
        for k, v in self.options.items():
            if k.lower() in self.cfg.settings and v is not None:
                cfg[k.lower()] = v
        return cfg
605526
def initialize(self, init_value, context=None, force=False):
        

        if not force and self._instance is not None:
            raise ConfigurationAlreadyInitializedError(
                'Configuration manager object is already initialized.'
            )

        self.__class__._instance = Root(init_value, context=context)
949405
def validate(self):
        """"""
        missing = []
        for k, v in self._map.items():
            attr = getattr(self, k, False)
            if not attr or attr == CONFIG_PLACEHOLDER:
                missing.append(v)
        if missing:
            return "Missing or invalid config values: {}".format(
                ", ".join(sorted(missing))
            )
592697
def set_default_preferences(self):
        

        LOGGER.debug("> Initializing default settings!")

        for key in self.__default_settings.allKeys():
            self.__settings.setValue(key, self.__default_settings.value(key))

        self.set_default_layouts()
        return True
1183632
private synchronized static void initConfigs() {
        for (int i = 0; i < moduleIDs.length; i++) {
            // add module configs one by one
            //addModuleInfo(moduleIDs[i] + modulePrefix);
            // don't do validation since in pre-defined module
            getConfigFromXMLFile(getXmlFileName(modulePrefix + moduleIDs[i]), true, false);
        }
    }
644201
public function initDefaultProperties()
    {
        if (!empty($this->schema->properties)) {
            foreach ($this->schema->properties as $property_name => $property) {
                if ($this->setPropertyDefaultValue($property)) {
                    $this->property_values->$property_name = $this->getFactory()->create($property, $this->schema_path);
                }
            }
        }
    }
73608
private void validateConfigurationProperties() {
        if (isStringValueUndefined(config.userName()) && !isStringValueUndefined(config.userPassword())) {
            Tr.error(tc, "QUICK_START_SECURITY_MISSING_ATTIRBUTES", CFG_KEY_USER);
        }
        if (!isStringValueUndefined(config.userName()) && isStringValueUndefined(config.userPassword())) {
            Tr.error(tc, "QUICK_START_SECURITY_MISSING_ATTIRBUTES", CFG_KEY_PASSWORD);
        }
        errorOnAnotherRegistry();
        errorOnAnotherManagementRole();
    }
234025
private function setDefaultConfig()
    {
        $defaults = $this->configRepo->get('laravelPnotify');

        foreach($defaults as $key => $value){
            $this->config[$key] = $value;
        }
    }
792955
def init_config(self, app):
        
        config_apps = ['REST_', 'CORS_', ]
        for k in dir(config):
            if any([k.startswith(prefix) for prefix in config_apps]):
                app.config.setdefault(k, getattr(config, k))
492082
def init(**config):
    
    global _implementation
    global _validate_implementations

    if config.get('crypto_backend') == 'gpg':
        _implementation = gpg
    else:
        _implementation = x509

    _validate_implementations = []
    for mod in config.get('crypto_validate_backends', []):
        if mod == 'gpg':
            _validate_implementations.append(gpg)
        elif mod == 'x509':
            _validate_implementations.append(x509)
        else:
            raise ValueError("%r is not a valid crypto backend" % mod)

    if not _validate_implementations:
        _validate_implementations.append(_implementation)
241427
private static function setDefaultConfig() {
            if (!self::$defaults) {
                self::$defaults = [self::CFG_EXCEPTION_DEPTH        => 10,
                                   self::CFG_LOG_EXCEPTION_LOCATION => true];
            }
        }
1024567
private static function initializeConfigurations()
    {
        if (!is_readable(self::CONFIGURATION_PATH)) {
            throw new \RuntimeException("Cannot parse configurations file (config.ini)");
        }
        self::$configurationFile = new ConfigurationFile(self::CONFIGURATION_PATH);
    }
1363826
private function _initialize()
    {
        $params = $this->getParameters();
        if ($params) {
            foreach ($params as $param) {
                if ($param->getType() == "config") {
                    $this->configParameters[] = $param;
                } else {
                    if ($param->getName() == "encoding") {
                        $this->setEncoding($param->getValue());
                    }
                }
            }
        }
    }
972381
protected function registerLegacyConfigValues()
    {
        $config = $this->getConfig();
        $name = $this->getSiteService()->getSite()->getSiteName();

        $config->set('concrete.site', $name);
    }