Normalize Parameters
https://tools.ietf.org/html/rfc5849#section-3.4.1.3.2
437671
function normalizeParameters (data) {
  var encoded = []
  var normalized = ''

  // Convert object into nested arrays
  // and encode the keys and values.
  Object.keys(data).forEach(function (key) {
    encoded[encoded.length] = [
      encodeOAuthData(key),
      encodeOAuthData(data[key])
    ]
  })

  // Sort by keys and values
  encoded.sort(function (a, b) {
    return (a[0] === b[0])
      ? (a[1] < b[1])
        ? -1
        : 1
      : (a[0] < b[0])
        ? -1
        : 1
  })

  // Encode parameters similar to
  // query string.
  encoded.forEach(function (pair, i) {
    normalized += pair[0]
    normalized += '='
    normalized += pair[1]
    if (i < encoded.length - 1) {
      normalized += '&'
    }
  })

  // bada boom
  return normalized
}
731706
def normalize(url, strip=False):
    ""
    if strip:
        p = _urltools.parse(url)
        url = p.scheme + '://' + p.subdomain + p.domain + p.path
    return _urltools.normalize(url)
1148803
function normalize (format) {
	if (!format) format = {}

	//bring default format values, if not present
	formatProperties.forEach(function (key) {
		if (format[key] == null) {
			format[key] = defaultFormat[key]
		}
	})

	//ensure float values
	if (format.float) {
		if (format.bitDepth != 64) format.bitDepth = 32
		format.signed = true
	}

	//for words byte length does not matter
	else if (format.bitDepth <= 8) format.byteOrder = ''

	//max/min values
	if (format.float) {
		format.min = -1
		format.max = 1
	}
	else {
		format.max = Math.pow(2, format.bitDepth) - 1
		format.min = 0
		if (format.signed) {
			format.min -= Math.ceil(format.max * 0.5)
			format.max -= Math.ceil(format.max * 0.5)
		}
	}

	//calc id
	format.id = stringify(format)

	return format
}
1267984
function normalizeArgs(id){
  var keys = id.keys;
  var pairs = {};

  Object.keys(id.keys).forEach(function forEachCSID(csid){
    var pair = pairs[csid] = {};
    // flexible buffer or base32 input
    pair.key = Buffer.isBuffer(id.keys[csid]) ? id.keys[csid]
             : base32.decode(id.keys[csid]);

    pair.secret = Buffer.isBuffer(id.secrets[csid]) ? id.secrets[csid]
                : base32.decode(id.secrets[csid]);
  });
  return {pairs: pairs, debug: log.debug};
}
1060436
def _normalize(self, key, value):
        

        # None value should not be converted by normalizer
        if value is None:
            return None

        normalize_func = getattr(self, 'normalize_{0}'.format(key),
                                 lambda x: x)

        return normalize_func(value)
38634
function normalizeNetAddress (array) {
  return array.map(function (options) {
    if (typeof options === 'string') return wrapIPv6Address(options)
    if (typeof options === 'number') return wrapIPv6Address(defaultHost, options)
    options.host = options.host || defaultHost
    options.port = options.port || defaultPort
    return wrapIPv6Address(options.host, options.port)
  })
}
362627
def normalize(pw):
    
    pw_lower = pw.lower()
    return ''.join(helper.L33T.get(c, c) for c in pw_lower)
561758
protected function _normalize()
    {
        /* Clients conforming to RFC 4314 MUST ignore the virtual ACL_CREATE
         * and ACL_DELETE rights. See RFC 4314 [2.1]. However, we still need
         * to handle these rights when dealing with RFC 2086 servers since
         * we are abstracting out use of ACL_CREATE/ACL_DELETE to their
         * component RFC 4314 rights. */
        foreach ($this->_virtual as $key => $val) {
            foreach ($val as $right) {
                if ($this[$right]) {
                    foreach (array_keys($this->_virtual) as $virtual) {
                        unset($this[$virtual]);
                    }
                    return;
                }
            }
        }
        foreach ($this->_virtual as $key => $val) {
            if ($this[$key]) {
                unset($this[$key]);
                $this->_rights = array_unique(array_merge($this->_rights, $val));
            }
        }
    }
254983
def normalize(path, extra=nil, params={})
      if extra.is_a?(Hash) and params.empty?
        params = extra
        extra = nil
      end

      path = "#{path}/#{extra}" if extra
      path = "/#{path}" unless path[0] == '/'

      query = default_query.merge params

      params[:query] = query unless query.empty?
      params = default_params.merge params

      [path, extra, params]
    end
951976
def normalize_path(url)
      url = URI(url)
      (url.path.start_with?('/') ? url.path : '/' + url.path) +
        (url.query ? "?#{sort_query_params(url.query)}" : '')
    end
225642
def normalize(input, case_mapping=protocol.DEFAULT_CASE_MAPPING):
    
    if case_mapping not in protocol.CASE_MAPPINGS:
        raise pydle.protocol.ProtocolViolation('Unknown case mapping ({})'.format(case_mapping))

    input = input.lower()

    if case_mapping in ('rfc1459', 'rfc1459-strict'):
        input = input.replace('{', '[').replace('}', ']').replace('|', '\\')
    if case_mapping == 'rfc1459':
        input = input.replace('~', '^')

    return input
931498
def _normalize_number_values(self, parameters):
        """"""
        for key, value in parameters.items():
            if isinstance(value, (int, float)):
                parameters[key] = str(Decimal(value).normalize(self._context))
1073711
function normalize(opts) {
	if (typeof opts === 'string') {
		opts = {path: opts};
	}
	opts.path = path.resolve(opts.path);
	return opts;
}
452243
function Parameter(match) {
  let param;
  const matchValue = match.substr(2, match.length - 4).trim();
  const i = matchValue.indexOf(':');

  if (i !== -1) {
    param = {
      key: matchValue.substr(0, i),
      defaultValue: matchValue.substr(i + 1)
    };
  } else {
    param = { key: matchValue };
  }

  return param;
}
1024871
private function normalizeParameters($parameters, $parentKey = '')
    {
        if (empty($parameters)) {
            return '';
        }

        $normalized = array();
        foreach ($parameters as $key => $value) {
            if (empty($value)) {
                continue;
            }

            if ($parentKey !== '') {
                // Multidimensional array; using foo=bar&foo=baz rather than foo[bar]=baz&foo[baz]=bar
                $key = $parentKey;
            }

            if (is_array($value)) {
                $normalized[] = $this->normalizeParameters($value, $key);
            } else {
                $normalized[] = $this->encode($key) . '=' . $this->encode($value);
            }
        }

        $normalized = array_filter($normalized);
        sort($normalized, SORT_STRING);

        return implode('&', $normalized);
    }
1083194
private String normalizeParameters(MultiValueMap<String, String> collectedParameters) {
		// Normalizes the collected parameters for baseString calculation, per https://tools.ietf.org/html/rfc5849#section-3.4.1.3.2
		MultiValueMap<String, String> sortedEncodedParameters = new TreeMultiValueMap<String, String>();
		for (Iterator<Entry<String, List<String>>> entryIt = collectedParameters.entrySet().iterator(); entryIt.hasNext();) {
			Entry<String, List<String>> entry = entryIt.next();
			String collectedName = entry.getKey();
			List<String> collectedValues = entry.getValue();	
			List<String> encodedValues = new ArrayList<String>(collectedValues.size());
			sortedEncodedParameters.put(oauthEncode(collectedName), encodedValues);
			for (Iterator<String> valueIt = collectedValues.iterator(); valueIt.hasNext();) {
				String value = valueIt.next();
				encodedValues.add(value != null ? oauthEncode(value) : "");
			}
			Collections.sort(encodedValues);
		}
		StringBuilder paramsBuilder = new StringBuilder();
		for (Iterator<Entry<String, List<String>>> entryIt = sortedEncodedParameters.entrySet().iterator(); entryIt.hasNext();) {
			Entry<String, List<String>> entry = entryIt.next();
			String name = entry.getKey();
			List<String> values = entry.getValue();
			for (Iterator<String> valueIt = values.iterator(); valueIt.hasNext();) {
				String value = valueIt.next();
				paramsBuilder.append(name).append('=').append(value);
				if (valueIt.hasNext()) {
					paramsBuilder.append("&");
				}
			}
			if (entryIt.hasNext()) {
				paramsBuilder.append("&");
			}
		}
		return paramsBuilder.toString();
	}
521819
def format_parameters(self, params):
        # type: (Dict[str, str]) -> None
        
        query = urlparse(self.url).query
        if query:
            self.url = self.url.partition('?')[0]
            existing_params = {
                p[0]: p[-1]
                for p in [p.partition('=') for p in query.split('&')]
            }
            params.update(existing_params)
        query_params = ["{}={}".format(k, v) for k, v in params.items()]
        query = '?' + '&'.join(query_params)
        self.url = self.url + query