Normalizes options.

@param {Object|undefined} options - A options object to normalize.
@returns {Object} Normalized option object.
542260
function normalizeOptions(options = {}) {
    const hasGroups = options.groups && options.groups.length > 0;
    const groups = hasGroups ? options.groups : DEFAULT_GROUPS;
    const allowSamePrecedence = options.allowSamePrecedence !== false;

    return {
        groups,
        allowSamePrecedence
    };
}
620961
function normalizeModuleIdentifiers(ast, load, options) {
	visitRequireArgument(ast, function(argument) {
		var normalized = optionsNormalize(
			options,
			argument.value,
			load.name,
			load.address
		);

		argument.value = normalized;
		argument.raw = `"${normalized}"`;
	});
}
943865
function normalizeFields (options) {
  const fields = options.fields || options.outFields
  const idField = _.get(options, 'collection.metadata.idField')
  if (options.returnIdsOnly === true && idField) return [idField]
  else if (options.returnIdsOnly === true) return ['OBJECTID']
  if (fields === '*') return undefined
  if (typeof fields === 'string' || fields instanceof String) return fields.split(',')
  if (fields instanceof Array) return fields
  return undefined
}
357533
def normalize_option_value(value)
      case value
      when Array
        value.map { |option| normalize_option_value(option) }.join(",")
      else
        value.to_s
      end
    end
34636
def normalize_defaults
      new_options = {}
      options.each do |key,value|
        unless value.nil?
          new_options[key.to_s] = value
          new_options[key.to_sym] = value
        end
      end
      options.merge!(new_options)
    end
73013
function normalizeConfig(config, data) {
  const newConfig = Object.assign({}, data.callback.baseConfig, config)
  const { dest, src, watch } = newConfig
  const errors = []

  if (dest != null && typeof dest !== 'string' && typeof dest !== 'function') {
    errors.push(`- 'dest' must be a string or a function`)
  }

  if (src != null) {
    newConfig.src = toUniqueStrings(newConfig.src)
    if (newConfig.src.length === 0) {
      errors.push(`- 'src' must be a string or an array of strings`)
    }
  }

  if (watch === true) {
    if (Array.isArray(newConfig.src) && newConfig.src.length) {
      newConfig.watch = [].concat(newConfig.src)
    }
  } else if (watch) {
    newConfig.watch = toUniqueStrings(newConfig.watch)
    if (newConfig.watch.length === 0) {
      errors.push(`- 'watch' must be boolean, a string or an array of strings`)
    }
  }

  if (errors.length > 0) {
    const msg = [
      `Invalid config for '${data.name}'`,
      errors.join('\n'),
      JSON.stringify(config, null, 2)
    ].join('\n')
    handleError(new Error(msg), options.strict ? null : data.errors)
    return
  }

  return newConfig
}
637523
function( options ) {
			options || ( options = {} );
			if ( options.silent ) {
				options = _.extend( {}, options, { silentChange: true } );
				delete options.silent;
			}
			return options;
		}
264861
function normalizeEngine(fn, options) {
  if (utils.isEngine(options)) {
    return normalizeEngine(options, fn); //<= reverse args
  }

  if (!isObject(fn) && typeof fn !== 'function') {
    throw new TypeError('expected an object or function');
  }

  var engine = {};
  engine.render = fn.render || fn;
  engine.options = extend({}, options);

  if (typeof engine.render !== 'function') {
    throw new Error('expected engine to have a render method');
  }

  var keys = Object.keys(fn);
  var len = keys.length;
  var idx = -1;
  while (++idx < len) {
    var key = keys[idx];
    if (key === 'options') {
      engine.options = extend({}, engine.options, fn[key]);
      continue;
    }
    if (key === '__express' && !fn.hasOwnProperty('renderFile')) {
      engine.renderFile = fn[key];
    }
    engine[key] = fn[key];
  }
  return engine;
}
1148003
def normalize_options(options)
      options = options.dup

      options.tap do |opts|
        opts[:prefix] ||= "gridfs"
        opts[:prefix] = options[:prefix].gsub(/^\//, '')
        opts[:mapper] ||= lambda { |path| %r!^/#{options[:prefix]}/(.+)!.match(path)[1] }
      end
    end
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;
    }
1356987
function parseOptions(type, options) {
    const ret = {
        indentChar: " ",
        indentSize: 2,
        startIndent: 1,
        switchCase: 0,
    }

    if (Number.isSafeInteger(type)) {
        ret.indentSize = type
    } else if (type === "tab") {
        ret.indentChar = "\t"
        ret.indentSize = 1
    }
    if (Number.isSafeInteger(options.switchCase)) {
        ret.switchCase = options.switchCase
    }
    if (Number.isSafeInteger(options.startIndent)) {
        ret.startIndent = options.startIndent
    }

    return ret
}
568852
function defaults(options, defaultOptions) {
  options || (options = {});

  for (var opt in defaultOptions) {
    if (defaultOptions.hasOwnProperty(opt) && !options.hasOwnProperty(opt)) {
      options[opt] = defaultOptions[opt];
    }
  }

  return options;
}
814487
function parseOptions(options) {
    const defaults = {
        singleline: 1,
        multiline: 1,
        allowFirstLine: false,
    }

    if (options) {
        if (options.singleline) {
            if (typeof options.singleline === "number") {
                defaults.singleline = options.singleline
            } else if (options.singleline.max) {
                defaults.singleline = options.singleline.max
            }
        }

        if (options.multiline) {
            if (typeof options.multiline === "number") {
                defaults.multiline = options.multiline
            } else {
                if (options.multiline.max) {
                    defaults.multiline = options.multiline.max
                }

                if (options.multiline.allowFirstLine) {
                    defaults.allowFirstLine = options.multiline.allowFirstLine
                }
            }
        }
    }

    return defaults
}
1363574
function normalizeOptions(options, include) {
            _.forEach(options, function (v,k) {
                if(!_.contains(include, k))
                    delete options[k];
            });
            return options;
        }
426676
def _normalize_options(options)
        _normalize_text(options)

        if options[:html]
          options[:html] = ERB::Util.html_escape(options[:html])
        end

        if options[:status]
          options[:status] = Rack::Utils.status_code(options[:status])
        end

        super
      end
1027528
function parseOptions(options) {
    var defaultOptions = {
      verbose: false,
      prune: false,
      placeholder: false
    };
    options = options || {};

    // Delete sort option if not valid.
    if (options.sort && ['asc', 'desc'].indexOf(options.sort.toLowerCase()) === -1) {
      delete options.sort;
    }

    return _.extend(defaultOptions, options);
  }
1164879
function normalizeRunParams(context, options, callback) {
	'use strict';
	let typeErr = new TypeError('axe.run arguments are invalid');

	// Determine the context
	if (!isContext(context)) {
		if (callback !== undefined) {
			// Either context is invalid or there are too many params
			throw typeErr;
		}
		// Set default and shift one over
		callback = options;
		options = context;
		context = document;
	}

	// Determine the options
	if (typeof options !== 'object') {
		if (callback !== undefined) {
			// Either options is invalid or there are too many params
			throw typeErr;
		}
		// Set default and shift one over
		callback = options;
		options = {};
	}

	// Set the callback or noop;
	if (typeof callback !== 'function' && callback !== undefined) {
		throw typeErr;
	}

	return {
		context: context,
		options: options,
		callback: callback || noop
	};
}