/*
Set default choices if we need to
965140
function(choices) {
    if (_.isEmpty(choices.database)) {
      choices.database = conf.env;
    }
    if (_.isEmpty(choices.files)) {
      choices.files = conf.env;
    }
    return choices;
  }
666989
private function setDefaultOptions()
    {
        $this->setOptions([
            CURLOPT_SSL_VERIFYPEER => true,
            CURLOPT_HEADER => false,
            CURLOPT_RETURNTRANSFER => true, //=> return response instead of boolean
            CURLOPT_FAILONERROR => false //=> also return an error when there is a http error >= 400
        ]);
    }
1040675
protected function set_choices() {
		if ( ! is_array( $this->choices ) ) {
			$this->choices = [];
		}

		$this->choices = wp_parse_args(
			$this->choices,
			[
				'on'    => esc_html__( 'On', 'kirki' ),
				'off'   => esc_html__( 'Off', 'kirki' ),
				'round' => false,
			]
		);
	}
1120609
protected function setDefaults(array $defaultOptions = array())
    {
        $defaultOptions = array_merge(array(
            'depth' => null,
            'ancestorCurrencyDepth' => null,
            'currentClass' => 'active',
            'ancestorClass' => 'active',
            'firstClass' => null,
            'lastClass' => null
        ), $defaultOptions);

        parent::setDefaults($defaultOptions);
    }
395112
private static function setDefaultConfig() {
            if (!self::$defaults) {
                self::$defaults = [self::CFG_ERROR_LEVEL        => error_reporting(),
                                   self::CFG_LOG_ERROR_LOCATION => true];
            }
        }
811399
function setDefaults(scope, defaults) {
        if (!defaults) { return; }

        // store defaults for use in generateRemodel
        scope.defaults = defaults;

        for (var name in defaults) {
            if (defaults.hasOwnProperty(name) && scope[name] === undefined) {
                scope[name] = defaults[name];
            }
        }
    }
77208
public void setToDefault() {
		setToDefault(COLOR);
		setToDefault(CHARACTER);
		setToDefault(PARAGRAPH);
		setToDefault(SECTION);
		setToDefault(DOCUMENT);
	}
1264333
function defaultOptions(opts) {
    opts.bucketSize = opts.bucketSize || 20;
    opts.concurrency = opts.concurrency || 3;
    opts.expireTime = opts.expireTime || 60 * 60 * 24;
    opts.refreshTime = opts.refreshTime || 60 * 60;
    opts.replicateTime = opts.replicateTime || 60 * 60;
    opts.republishTime = opts.republishTime || 60 * 60 * 24;
}
921948
public void setDefaultSRE(ISREInstall sre) {
		if (sre == null) {
			setSelection(new StructuredSelection());
		} else {
			setSelection(new StructuredSelection(sre));
		}
	}
841276
private function setDefaultOptions()
    {
        // The default configuration settings.
        $this->di()->getConfig()->setOptions([
            'core.version'                      => $this->getVersion(),
            'core.language'                     => 'en',
            'core.encoding'                     => 'utf-8',
            'core.decode_utf8'                  => false,
            'core.prefix.function'              => 'jaxon_',
            'core.prefix.class'                 => 'Jaxon',
            // 'core.request.uri'               => '',
            'core.request.mode'                 => 'asynchronous',
            'core.request.method'               => 'POST',    // W3C: Method is case sensitive
            'core.response.merge.ap'            => true,
            'core.response.merge.js'            => true,
            'core.debug.on'                     => false,
            'core.debug.verbose'                => false,
            'core.process.exit'                 => true,
            'core.process.clean'                => false,
            'core.process.timeout'              => 6000,
            'core.error.handle'                 => false,
            'core.error.log_file'               => '',
            'core.jquery.no_conflict'           => false,
            'js.lib.output_id'                  => 0,
            'js.lib.queue_size'                 => 0,
            'js.lib.load_timeout'               => 2000,
            'js.lib.show_status'                => false,
            'js.lib.show_cursor'                => true,
            'js.app.dir'                        => '',
            'js.app.minify'                     => true,
            'js.app.options'                    => '',
        ]);
    }
1094038
protected function setupDefaultOptions()
    {
        $defaultOptions = [
            'overwriteInitial' => false,
            'initialPreviewAsData' => true,
            'browseLabel' => trans('admin.browse'),
            'showRemove' => false,
            'showUpload' => false,
//            'initialCaption'       => $this->initialCaption($this->value),
            'deleteExtraData' => [
                $this->formatName($this->column) => static::FILE_DELETE_FLAG,
                static::FILE_DELETE_FLAG => '',
                '_token' => csrf_token(),
                '_method' => 'PUT',
            ],
        ];

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

        $this->options($defaultOptions);
    }
1051674
function setDefault(name,val) {
	if (typeof(window[name])=="undefined" || window[name]==null) {
		window[name]=val;
	}
}
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'
}
1181829
private function setDefaults()
    {
        $this->options = [
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_FOLLOWLOCATION => true,
            CURLOPT_HEADER => true,
            CURLINFO_HEADER_OUT => true
        ];
    }
961250
function setOptions(cfg = {}) {
    console.log('setting handler options...', cfg);
    // override the default options
    _.defaultsDeep(handlers, cfg.handlers);
}
1287778
protected function setDefaultOptions()
    {
        $default = [
            'colors' => $this->getDefaultColors(),
            'disableCustomColors' => false
        ];

        if (function_exists('_x')) {
            $default['l10n'] = [
                'clear' => _x('Clear', 'field', Application::TEXTDOMAIN)
            ];
        }

        return array_merge($this->defaultOptions, $default);
    }
61767
protected function setDefaultParams()
    {
        foreach ($this->allowedParams as $param => $options) {
            $this->params[$param] = null;
            if (! empty($options['arguments'])) {
                $this->params[$param] = array();
                foreach ($options['arguments'] as $arg => $opts) {
                    if (! empty($opts['default'])) {
                        $cast = ! empty($opts['cast']) ? $opts['cast'] : 'string';
                        $this->params[$param][$arg] = $this->castValue($cast, $opts['default']);
                    }
                }
            } elseif (! empty($options['default'])) {
                $cast = ! empty($options['cast']) ? $options['cast'] : 'string';
                $this->params[$param] = $this->castValue($cast, $options['default']);
            }
        }
    }