Canonicalize the query string.

@param sortedParameters Parameter name-value pairs in lexicographical order.
@return Canonical form of query string.
552451
private static String canonicalize(final SortedSet<QueryParameter> sortedParameters) {
		if (sortedParameters == null || sortedParameters.isEmpty()) {
			return "";
		}

		final StringBuilder sb = new StringBuilder(100);
		for (QueryParameter parameter : sortedParameters) {
			final String name = parameter.getName().toLowerCase();
			// Ignore irrelevant parameters
			if (IRRELEVANT_PARAMETERS.contains(name) || name.startsWith("utm_")) {
				continue;
			}
			if (sb.length() > 0) {
				sb.append('&');
			}
			sb.append(parameter.getName());
			if (!parameter.getValue().isEmpty()) {
				sb.append('=');
				sb.append(parameter.getValue());
			}
		}
		return sb.toString();
	}
1183020
public GitLabApiForm getQueryParams() {
        return (new GitLabApiForm()
            .withParam("archived", archived)
            .withParam("visibility", visibility)
            .withParam("order_by", orderBy)
            .withParam("sort", sort)
            .withParam("search", search)
            .withParam("simple", simple)
            .withParam("owned", owned)
            .withParam("starred", starred)
            .withParam("with_custom_attributes", withCustomAttributes)
            .withParam("with_issues_enabled", withIssuesEnabled)
            .withParam("with_merge_requests_enabled ", withMergeRequestsEnabled)
        );
    }
83024
public SortingParams nosort() {
    params.add(BY.raw);
    params.add(NOSORT.raw);
    return this;
  }
301271
public static void applyOrderBy(MultivaluedMap<String, String> queryParams, Query query) {
        List<String> orders = queryParams.get(SORT_PARAM_NAME);
        if (orders != null && orders.size() > 0) {
            OrderBy orderBy = query.orderBy();
            for (String order : orders) {
                EbeanUtils.appendOrder(orderBy, order);
            }
        }
    }
363075
private static String canonicalize(Map<String, String> paramsMap, Charset charset)
            throws UnsupportedEncodingException {
        if ((paramsMap == null) || paramsMap.isEmpty()) {
            return "";
        }

        final StringBuilder sb = new StringBuilder(100);
        for (Map.Entry<String, String> pair : paramsMap.entrySet()) {
            final String key = pair.getKey().toLowerCase();
            if ("jsessionid".equals(key) || "phpsessid".equals(key) || "aspsessionid".equals(key)) {
                continue;
            }
            if (sb.length() > 0) {
                sb.append('&');
            }
            sb.append(percentEncodeRfc3986(pair.getKey(), charset));
            if (!pair.getValue().isEmpty()) {
                sb.append('=');
                sb.append(percentEncodeRfc3986(pair.getValue(), charset));
            }
        }
        return sb.toString();
    }
465911
def _getParameters(self):
        """"""
        param = self.query._getParameters()        
        sortingNames = []
        for outputCol in self.__columns:
            sort_dictionary={"field" : outputCol, "direction" : "ASC"}
            sortingNames.append(sort_dictionary)            
        param.update({'sort' : {"ordersList" : sortingNames}})
        return param
294197
private static String canonicalize(String s) {

        int length = s.length();
        StringBuffer result = new StringBuffer(length);

        // The first character must be '/'.  Append it to the result, and then
        // skip the first character in the input string.
        result.append('/');

        for (int i = 1; i < length; i++) {
            char ch = s.charAt(i);

            if (ch != '.' || result.charAt(result.length() - 1) != '/') {
                // A character other than '.', or we're not at the beginning of
                // a path segment.
                result.append(ch);
            } else if (i + 1 == length || s.charAt(i + 1) == '/') {
                // We have a "." path segment.  Skip the following "/".
                i++;
            } else if (s.charAt(i + 1) == '.' && (i + 2 == length || s.charAt(i + 2) == '/')) {
                // We have a ".." path segment.  Skip the following "./".
                i += 2;

                int j = result.length();
                if (--j > 0) {
                    // Walk backwards until we find a '/'.
                    while (result.charAt(j - 1) != '/' && --j > 0);

                    result.setLength(j);
                }
            } else {
                // Found a path segment that starts with a '.' that is not "."
                // or "..".
                result.append('.');
            }
        }
        return result.toString();
    }
821509
public void setParameters(SortedMap<String, String> parameters) {

        m_parameters = new TreeMap<String, String>(parameters);
    }
108910
function canonicalizeResource (resource) {
  var url = parse(resource, true)
    , path = url.pathname
    , buf = []
    ;

  Object.keys(url.query).forEach(function(key){
    if (!~keys.indexOf(key)) return
    var val = '' == url.query[key] ? '' : '=' + encodeURIComponent(url.query[key])
    buf.push(key + val)
  })

  return path + (buf.length ? '?' + buf.sort().join('&') : '')
}
388268
public static <T extends List<U>, U extends Comparable<U>> Comparator<T> canonicalComparator() {
        return CmpUtil::canonicalCompare;
    }
209065
public static <T> SortedMap<Long, HBaseColumn<T>> asSortedMap(T value) {
        return asSortedMap(value, DESC_HBASE_VERSION_COMPARATOR);
    }
776852
protected static final QueryMap parseApiRequestQueryParams(String queryString) {
        QueryMap rval = new QueryMap();

        if (queryString != null) {
            try {
                String[] pairSplit = queryString.split("&"); //$NON-NLS-1$
                for (String paramPair : pairSplit) {
                    int idx = paramPair.indexOf("="); //$NON-NLS-1$
                    String key, value;
                    if (idx != -1) {
                        key =  URLDecoder.decode(paramPair.substring(0, idx), "UTF-8"); //$NON-NLS-1$
                        value = URLDecoder.decode(paramPair.substring(idx + 1), "UTF-8"); //$NON-NLS-1$
                    } else {
                        key = URLDecoder.decode(paramPair, "UTF-8"); //$NON-NLS-1$
                        value = null;
                    }
                    rval.add(key,  value);
                }
            } catch (UnsupportedEncodingException e) {
                throw new RuntimeException(e);
            }

        }

        return rval;
    }
198083
@Override
	public String toCanonicalString() {
		String result;
		if(hasNoStringCache() || (result = stringCache.canonicalString) == null) {
			stringCache.canonicalString = result = toNormalizedString(IPv6StringCache.canonicalParams);
		}
		return result;
	}
622087
public static JinxConstants.SortOrder stringToSortOrder(String sortOrderString) {
        if (JinxUtils.isNullOrEmpty(sortOrderString)) {
            return null;
        }
        JinxConstants.SortOrder retVal = null;
        String s = sortOrderString.toLowerCase().trim().replaceAll("-", "_");
        for (JinxConstants.SortOrder sortOrder : JinxConstants.SortOrder.values()) {
            if (sortOrder.toString().equals(s)) {
                retVal = sortOrder;
                break;
            }
        }
        return retVal;
    }
849467
private Map<String, Object> parseRequestParameters(String requestParameters) {

        Map<String, Object> parameterMap;
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(requestParameters)) {
            parameterMap = new HashMap<String, Object>();
            String[] params = requestParameters.split("&");
            for (int i = 0; i < params.length; i++) {
                int position = params[i].indexOf("=");
                if (position >= 0) {
                    String key = params[i].substring(0, position);
                    String value = params[i].substring(position + 1);
                    if (value.contains(",")) {
                        parameterMap.put(key, value.split(","));
                    } else {
                        parameterMap.put(key, value);
                    }
                }
            }
        } else {
            parameterMap = Collections.<String, Object> emptyMap();
        }
        return parameterMap;
    }
899059
def get_normalized_parameters(self):
        """"""
        items = []
        for key, value in self.items():
            if key == 'oauth_signature':
                continue
            # 1.0a/9.1.1 states that kvp must be sorted by key, then by value,
            # so we unpack sequence values into multiple items for sorting.
            if isinstance(value, STRING_TYPES):
                items.append((to_utf8_if_string(key), to_utf8(value)))
            else:
                try:
                    value = list(value)
                except TypeError as e:
                    assert 'is not iterable' in str(e)
                    items.append((to_utf8_if_string(key), to_utf8_if_string(value)))
                else:
                    items.extend((to_utf8_if_string(key), to_utf8_if_string(item)) for item in value)

        # Include any query string parameters from the provided URL
        query = urlparse(self.url)[4]

        url_items = self._split_url_string(query).items()
        url_items = [(to_utf8(k), to_utf8_optional_iterator(v)) for k, v in url_items if k != 'oauth_signature' ]
        items.extend(url_items)

        items.sort()
        encoded_str = urlencode(items, True)
        # Encode signature parameters per Oauth Core 1.0 protocol
        # spec draft 7, section 3.6
        # (http://tools.ietf.org/html/draft-hammer-oauth-07#section-3.6)
        # Spaces must be encoded with "%20" instead of "+"
        return encoded_str.replace('+', '%20').replace('%7E', '~')
1372606
String canonicalize(String rawMathML) {
        try {
            return MathMLCanUtil.canonicalize(rawMathML);
        } catch (Exception e) {
            logger.warn("mathml canonicalization failed", e);
            return rawMathML;
        }
    }