Add missing settings with the default values.
346251
function setDefaultSettings(settings) {
  if (!settings)
    throw new Error('Settings must be an object.')

  // Default settings for each project type.
  switch (settings.projectType) {
    case 'cli':
    case 'node-app':
    case 'node-lib':
      settings.platforms ??= ['node']
      break

    case 'lib':
      settings.platforms ??= ['browser', 'node']
      break

    case 'react-spa':
      settings.platforms ??= ['browser']
      settings.jsx ??= true
      settings.react ??= true
      break

    case 'web-lib':
      settings.platforms ??= ['browser']
      break
  }

  // Default supported browsers inferred by the platform.
  if (settings.platforms.includes('browsers')) {
    settings.browsers ??= [
      '>= 0.5%',
      'not ie 11',
      'not op_mini all',
    ]
  }

  // Default supported NodeJS inferred by the platform.
  if (settings.platforms.includes('node'))
    settings.node ??= '8.9'
}
1021359
def setdefaults(dct, defaults):
    """"""
    for key in defaults:
        dct.setdefault(key, defaults[key])

    return dct
192218
private function applyDefaults(): void
    {
        $timezone = $this->config->get('timezone');
        if ($timezone != null) {
            date_default_timezone_set($timezone);
        }

        $encoding = $this->config->get('encoding');
        if ($encoding != null) {
            mb_internal_encoding($encoding);
            ini_set('default_charset', $encoding);
        }

        $locales = $this->config->get('locales');
        if ($locales != null) {
            foreach ((array) $locales as $category => $locale) {
                setlocale($category, $locale);
            }
        }
    }
241427
private static function setDefaultConfig() {
            if (!self::$defaults) {
                self::$defaults = [self::CFG_EXCEPTION_DEPTH        => 10,
                                   self::CFG_LOG_EXCEPTION_LOCATION => true];
            }
        }
716376
def add_defaults_to_kwargs(defaults, **kwargs):
    
    defaults = dict(defaults)
    defaults.update(kwargs)
    return defaults
602302
protected function setupDefaultOptions()
    {
        $defaults = [
            'overwriteInitial'     => false,
            'initialPreviewAsData' => true,
            'browseLabel'          => trans('admin.browse'),
            'cancelLabel'          => trans('admin.cancel'),
            'showRemove'           => false,
            'showUpload'           => false,
            'dropZoneEnabled'      => false,
            'deleteExtraData'      => [
                $this->formatName($this->column) => static::FILE_DELETE_FLAG,
                static::FILE_DELETE_FLAG         => '',
                '_token'                         => csrf_token(),
                '_method'                        => 'PUT',
            ],
        ];

        if ($this->form instanceof Form) {
            $defaults['deleteUrl'] = $this->form->resource().'/'.$this->form->model()->getKey();
        }

        $defaults = array_merge($defaults, ['fileActionSettings' => $this->fileActionSettings]);

        $this->options($defaults);
    }
1373408
def set_settings(self, settings):
        
        for k, v in settings.items():
            setattr(self, k, v)
1281831
def _merge_default_values(self):
        """"""
        values = self._get_default_values()
        for key, value in values.items():
            if not self.data.get(key):
                self.data[key] = value
5289
def set_settings(self, releases=None, default_release=None):
        """"""
        if (self._storage is None or
                getattr(self, 'releases', {}) != releases or
                getattr(self, 'default_release', '') != default_release):
            self._storage = {}
            self.releases = releases or {}
            self.default_release = default_release
751856
def set_defaults(self, default_config_params):
        
        map = StringValueMap.from_maps(default_config_params, self)
        return ConfigParams(map)
308521
def _set_defaults(self, defaults):
        """"""
        self.n_res = defaults.n_res
        self.n_sub = defaults.n_sub
        self.randomize = defaults.randomize
        self.return_median = defaults.return_median
        self.efficient = defaults.efficient
        self.return_only_bw = defaults.return_only_bw
        self.n_jobs = defaults.n_jobs
395112
private static function setDefaultConfig() {
            if (!self::$defaults) {
                self::$defaults = [self::CFG_ERROR_LEVEL        => error_reporting(),
                                   self::CFG_LOG_ERROR_LOCATION => true];
            }
        }
489328
def set_as_defaults(self):
        
        self.defaults = []
        for section in self.sections():
            secdict = {}
            for option, value in self.items(section, raw=self.raw):
                secdict[option] = value
            self.defaults.append( (section, secdict) )
55817
public function addMissingAttributes()
    {
        foreach ($this->getSchema() as $key => $settings) {
            if (!array_has($this->attributes, $key)) {
                array_set($this->attributes, $key, array_get($settings, 'default', null));
            }
        }
    }
26363
protected void addDefaults() {
    try {
      Parser.CNode.addIdentifier("inner", InnerJoinRecordReader.class);
      Parser.CNode.addIdentifier("outer", OuterJoinRecordReader.class);
      Parser.CNode.addIdentifier("override", OverrideRecordReader.class);
      Parser.WNode.addIdentifier("tbl", WrappedRecordReader.class);
    } catch (NoSuchMethodException e) {
      throw new RuntimeException("FATAL: Failed to init defaults", e);
    }
  }
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)
991359
protected function resetSettings()
    {
        $this->controlAccess('module_edit');
        $this->module->setSettings('frontend', array());
        $this->redirect('', $this->text('Settings have been reset to default values'), 'success');
    }