Default the passed in options using Pa11y's defaults.
@private
@param {Object} [options={}] - The options to apply defaults to.
@returns {Object} Returns the defaulted options.
480123
function defaultOptions(options) {
	options = extend({}, pa11y.defaults, options);
	options.ignore = options.ignore.map(ignored => ignored.toLowerCase());
	if (!options.includeNotices) {
		options.ignore.push('notice');
	}
	if (!options.includeWarnings) {
		options.ignore.push('warning');
	}
	return options;
}
382678
function getOption(opts, key, def) {
  var value = opts[key];
  return value === undefined ? def : value;
}
305213
def p_default_option(self, p):
        """"""
        if p[1]:
            if isinstance(p[2], AstTagRef):
                p[0] = p[2]
            else:
                p[0] = p[2]
1069118
def get_option(self, name, default=None):
        
        if self.options is None:
            return default
        return self.options.get(name, default)
1180105
function setDefaults ({ headers={}, overrideHeaders=false, ...rest }) {
  return {
    ...DEFAULTS,
    headers: overrideHeaders ? headers : { ...DEFAULT_HEADERS, ...headers },
    ...rest,
  }
}
419156
function defaultOptions(options) {
    const optionsDefault = {
        validateBeforeSave: true,
        explicitOnly: true,
        queries: {
            readAll: false,
            format: queries.formats.JSON,
        },
    };
    options = extend(true, {}, optionsDefault, options);
    if (options.joi) {
        const joiOptionsDefault = {
            options: {
                allowUnknown: options.explicitOnly !== true,
            },
        };
        if (is.object(options.joi)) {
            options.joi = extend(true, {}, joiOptionsDefault, options.joi);
        } else {
            options.joi = Object.assign({}, joiOptionsDefault);
        }
        if (!Object.prototype.hasOwnProperty.call(options.joi.options, 'stripUnknown')) {
            options.joi.options.stripUnknown = options.joi.options.allowUnknown !== true;
        }
    }
    return options;
}
247738
function addDefaultOptions(options, defaultOptions) {

    _.defaults(options, defaultOptions);
    options.currentRetries = 0;
    return options;

}
1028906
function defaultOptions() {
  return {
    logHl: true, // log this high level action
    logLl: false, // log lower level actions
    passHl: true, // is high level action increase pass counter
    passLl: false, // is low level actions increase pass counter
    passLlPrinting: true,
  };
}
306915
def defaults
      @values = Hash[self.class.options.select { |_, c| c.key?(:default) }.map { |n,c| [n, c[:default]] }].merge(@values)
    end
997819
def get(self, option, default=None):
        ''''''
        val = self[option]
        return (val is None and default) or val
877225
function applyDefaultValuesForOptionsArguments( options, def ) {
    Object.keys( options ).forEach( function ( cmdName ) {
        const
            cmdOpts = options[ cmdName ],
            defOpts = def[ cmdName ].opts;
        if ( defOpts ) {
            Object.keys( defOpts ).forEach( function ( defOptName ) {
                if ( cmdOpts[ defOptName ] ) return;
                const defOptValue = defOpts[ defOptName ];
                if ( countArgs( defOptValue ) > 0 ) {
                    cmdOpts[ defOptName ] = defOptValue.args;
                }
            } );
        }
    } );
}
706872
function initOptions(options, defaults) {
        options || (options = {});
        if (!defaults) {
            return options;
        }
        for (var i in defaults) {
            if (typeof options[i] === 'undefined') {
                options[i] = defaults[i];
            }
        }
        return options;
    }
382422
function withOptions(defaults) {

  // closure for a @use/it instance with provided `defaults`.
  // `plugin` is a string (path or package name), function, or an array of either.
  // `options` is an object.
  // `root` is the location (__dirname) of the script calling use()
  // allowing us to determine the correct path for require()'ing
  // a local plugin path.
  return function use(plugin, options, root) {

    // this holds the combined options/defaults.
    var opts

    // if we received an array then flatten it and call ourself on each.
    if (Array.isArray(plugin)) {

      plugin = flatten([plugin])

      for (var el of plugin) {
        this.use(el, options, root)
      }

      // return because we called this function on each array element.
      return
    }

    // if there are `options` then try to combine them with `defaults`
    // or create a copy of it.
    if (options) {
      if (defaults) {
        opts = Object.assign({}, defaults, options)
      }

      else {
        opts = Object.create(options)
      }
    }

    // otherwise, copy the defaults (which may be null).
    else {
      opts = Object.create(defaults)
    }

    // if the plugin is a package name or path to a file then we require() it.
    if (typeof(plugin) === 'string') {

      // if it starts with a dot and there's a `root` then join them
      if (plugin[0] === '.' && root) {
        plugin = join(root, plugin)
      }

      // now try to require the plugin function and call it with this @use/it
      // instance and the options (`opts`).
      try {
        // also, return the result which may contain an error result.
        return require(plugin).call(this, opts, this)
      } catch(error) {
        return {error: 'failed to require and call plugin', plugin: plugin, opts: opts}
      }
    }

    // otherwise, if it's a function then skip the require() and call it.
    else if (typeof(plugin) === 'function') {
      return plugin.call(this, opts, this)
    }

    // lastly, we didn't get a string or function so return an error.
    else {
      return { error: 'plugin must be string, function, or array', plugin: plugin }
    }
  }
}
250764
function (options) {
            if (!isObject(options)) {
                options = {};
            }

            this.options = extend({}, defaultOptions.base);

            var i,
                actions = ['drag', 'drop', 'resize', 'gesture'],
                methods = ['draggable', 'dropzone', 'resizable', 'gesturable'],
                perActions = extend(extend({}, defaultOptions.perAction), options[action] || {});

            for (i = 0; i < actions.length; i++) {
                var action = actions[i];

                this.options[action] = extend({}, defaultOptions[action]);

                this.setPerAction(action, perActions);

                this[methods[i]](options[action]);
            }

            var settings = [
                    'accept', 'actionChecker', 'allowFrom', 'deltaSource',
                    'dropChecker', 'ignoreFrom', 'origin', 'preventDefault',
                    'rectChecker', 'styleCursor'
                ];

            for (i = 0, len = settings.length; i < len; i++) {
                var setting = settings[i];

                this.options[setting] = defaultOptions.base[setting];

                if (setting in options) {
                    this[setting](options[setting]);
                }
            }

            return this;
        }
904987
def default_params(h = {})
      raise ArgumentError, 'Default params must be an object which responds to #to_hash' unless h.respond_to?(:to_hash)
      default_options[:default_params] ||= {}
      default_options[:default_params].merge!(h)
    end
129279
def with_default_options(options)
      config = RSpec.configuration

      {
        cookbook_root: config.cookbook_root || calling_cookbook_root(options, caller),
        cookbook_path: config.cookbook_path || calling_cookbook_path(options, caller),
        role_path:     config.role_path || default_role_path,
        environment_path: config.environment_path || default_environment_path,
        file_cache_path: config.file_cache_path,
        log_level:     config.log_level,
        path:          config.path,
        platform:      config.platform,
        version:       config.version,
      }.merge(options)
    end
1265503
def custom_options(options)
      return default_options if options.nil?

      return default_options.merge(options) unless options[:default_headers]

      opts = default_options.merge(options)
      opts[:default_headers] = default_options[:default_headers].merge(options[:default_headers])

      opts
    end