Normalize all config entry to be a normalize class entry: array("class"=>XXX, "options"=>YYY)
964918
protected function normalize($config)
    {
        // Validate the config entry
        $this->validateRootElements($config);

        // For single value elements, normalize all class name and options, remove null entry
        foreach (array('vcs', 'version-generator', 'version-persister') as $configKey) {
            $value = $config[$configKey];
            if ($value == null) {
                unset($config[$configKey]);
                continue;
            }
            $config[$configKey] = $this->getClassAndOptions($value, $configKey);
        }

        // Same process but for list value elements
        foreach (array('prerequisites', 'pre-release-actions', 'post-release-actions') as $configKey) {
            foreach ($config[$configKey] as $key => $item) {

                // Accept the element to be define by key or by value
                if (!is_numeric($key)) {
                    if ($item == null) {
                        $item = array();
                    }
                    $item['name'] = $key;
                }

                $config[$configKey][$key] = $this->getClassAndOptions($item, $configKey.'_'.$key);
            }
        }

        return $config;
    }
120376
function normalizeConfig(config, pkg) {

  const rules = config.rules || {};

  const validatedRules = Object.keys(rules).reduce((normalizedRules, name) => {

    const value = rules[name];

    // prefix local rule definition
    if (name.indexOf('bpmnlint/') === 0) {
      name = name.substring('bpmnlint/'.length);
    }

    normalizedRules[name] = value;

    return normalizedRules;
  }, {});

  return {
    ...config,
    rules: validatedRules
  };
}
978152
def normalize_klass_for_type_name(klass)
      case klass
      when Symbol then klass
      when Array then ARRAY_KEY
      when Set then SET_KEY
      when String then underscore(klass)
      else
        underscore(klass.name)
      end
    end
383105
protected function normalizeFields()
    {
        $normalizedFields = [];
        foreach ($this->fields as $key => $field) {
            if ($this->isNumber($key)) {
                $direction = 1;
                if (substr($field, 0, 1) === '-') {
                    $direction = -1;
                }
                $normalizedFields[ltrim($field, '-+')] = $direction;
            } else {
                $normalizedFields[$key] = $field;
            }
        }
        $this->fields = $normalizedFields;
    }
1053420
function normalizeOptsKey(aval, basedir, pkg) {

    aval = aval || [];

    if (!u.isArray(aval)) {
      aval = [ aval ];
    }

    return u.map(u.compact(aval), function(val) {
      return normalize(val, basedir, pkg);
    });

  }
287365
protected static function _normalizeOptionsForRelate(&$options) {
        $options = ($options instanceof Garp_Util_Configuration) ? $options :
            new Garp_Util_Configuration($options);
        $options->obligate('modelA')
            ->obligate('modelB')
            ->obligate('keyA')
            ->obligate('keyB')
            ->setDefault('rule', null)
            ->setDefault('ruleA', null)
            ->setDefault('ruleB', null)
            ->setDefault('extraFields', array())
            ->setDefault('bindingModel', null)
            ->setDefault('bidirectional', true);
        // use models, not class names
        if (is_string($options['modelA'])) {
            $options['modelA'] = new $options['modelA']();
        }
        if (is_string($options['modelB'])) {
            $options['modelB'] = new $options['modelB']();
        }
        if (is_string($options['bindingModel'])) {
            $options['bindingModel'] = new $options['bindingModel']();
        }
        // Important to collect fresh data
        $options['modelA']->setCacheQueries(false);
        $options['modelB']->setCacheQueries(false);

        $options['keyA'] = (array)$options['keyA'];
        $options['keyB'] = (array)$options['keyB'];

        // allow 'rule' key to be set when 'ruleA' is meant
        if ($options['rule'] && !$options['ruleA']) {
            $options['ruleA'] = $options['rule'];
            // also allow it the other way around
        } else if ($options['ruleA'] && !$options['rule']) {
            $options['rule'] = $options['ruleA'];
        }
    }
1104504
function normalizeParams(params) {
        if (params && params.constructor !== Array && typeof params === 'object') {
            params = _.mapKeys(params, function (value, key) {
                return ':' + _.trimStart(key, ':');
            });
        }
        return params;
    }
748557
function normaliseParams(params) {
			if (typeof params === 'string') {
				params = params.split(' ');
			}
			else if (!$.isArray(params)) {
				var opts = [];
				for (var name in params) {
					opts[0] = name;
					opts[1] = params[name];
				}
				params = opts;
			}
			return params;
		}
1076334
public static function normalize($options)
    {
        //normalize not indexed fields
        foreach ($options as $key => $value) {
            if (\is_int($key)) {
                if (!isset($options[$value])) {
                    $options[$value] = true;
                }
                unset($options[$key]);
            }
        }

        //normalize comma separated names
        foreach ($options as $fieldsNames => $option) {
            if (strpos($fieldsNames, ',') !== false) {
                $fieldNamesArray = explode(',', $fieldsNames);
                foreach ($fieldNamesArray as $name) {
                    $name = trim($name);
                    if (!isset($options[$name])) {
                        $options[$name] = $option;
                        unset($options[$fieldsNames]);
                    }
                }
            }
        }

        return $options;
    }
1058054
function normalizeOptions(options) {

    var opts = {};

    if (typeof options === 'string') {
        opts = {
            url: options
        };
    } else if (_.isPlainObject(options)) {
        opts = _.clone(options);
    }

    return opts;
}
743527
function normalizeList (val, name) {
  var list = [].concat(val || [])

  for (var i = 0; i < list.length; i++) {
    if (typeof list[i] !== 'string') {
      throw new TypeError(name + ' must be array of strings or false')
    }
  }

  return list
}
492407
protected static function normalizeInputOptions($options)
    {
        self::addSpanClass($options);
        self::addTextAlignClass($options);
        $size = TbArray::popValue('size', $options);
        if (TbArray::popValue('block', $options, false)) {
            self::addCssClass('input-block-level', $options);
        } else {
            if (!empty($size)) {
                self::addCssClass('input-' . $size, $options);
            }
        }
        return $options;
    }
683661
def invalidate_config_var_entry(self, index):
        """"""

        if index == 0 or index > len(self.config_database.entries):
            return [Error.INVALID_ARRAY_KEY, b'']

        entry = self.config_database.entries[index - 1]
        if not entry.valid:
            return [ConfigDatabaseError.OBSOLETE_ENTRY, b'']

        entry.valid = False
        return [Error.NO_ERROR]
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
418294
function normalizeObjects(types) {
  var ret = types[0].type ? types[0].type : types[0];
  var args = types[1].map(function(item) { return item.type ? item.type : item; });
  return [ret, args];
 }
989686
function normalize(obj) {
  if (obj === null || typeof obj !== 'object') {
    return JSON.stringify(obj);
  }
  if (obj instanceof Array) {
    return '[' + obj.map(normalize).join(', ') + ']';
  }
  var answer = '{';
  for (var key of Object.keys(obj).sort()) {
    answer += key + ': ';
    answer += normalize(obj[key]);
    answer += ', ';
  }
  answer += '}';
  return answer;
}
554130
function normalizeEventsConfig(events) {
  let newEvents = {}

  Object.keys(events).forEach((eventName) => {
    let event = Object.assign({}, events[eventName])
    newEvents[eventName] = event

    let tags = Object.assign({}, event.tags)
    event.tags = tags

    Object.keys(tags).forEach((tagName) => {
      let tag = Object.assign({}, tags[tagName])
      tags[tagName] = tag

      if (tag.impliedBy) {
        throw new Error('"impliedBy" must not be set explicitly')
      }

      if (tag.goesAfter) {
        tag.goesAfter.forEach((goesAfterTagName) => {
          tags[goesAfterTagName] = tags[goesAfterTagName] || {}
        })
      }

      if (tag.goesBefore) {
        tag.goesBefore.forEach((goesBeforeTagName) => {
          tags[goesBeforeTagName] = tags[goesBeforeTagName] || {}
        })
      }

      if (tag.implies) {
        tag.implies.forEach((impliedTagName) => {
          tags[impliedTagName] = tags[impliedTagName] || {}
          tags[impliedTagName].impliedBy = tags[impliedTagName].impliedBy || []
          tags[impliedTagName].impliedBy.push(tagName)
        })
      }
    })
  })

  return newEvents
}