The params out of match_path will have integers in the params that came from bindings
 in the url.  This replaces those with the values from the url.
438323
def setup_bindings_in_params(original_parts, params)
      # Create a copy of the params we can modify and return
      params = params.dup

      params.each_pair do |key, value|
        if value.is_a?(Fixnum)
          # Lookup the param's value in the original url parts
          params[key] = original_parts[value]
        elsif value.is_a?(Range)
          # When doing multiple section bindings, we lookup the parts as a range
          # then join them with /
          params[key] = original_parts[value].join('/')
        end
      end

      params
    end
1330434
def process_url_params url, headers
      url_params = {}
      headers.delete_if do |key, value|
        if 'params' == key.to_s.downcase && value.is_a?(Hash)
          url_params.merge! value
          true
        else
          false
        end
      end
      unless url_params.empty?
        query_string = url_params.collect { |k, v| "#{k.to_s}=#{CGI::escape(v.to_s)}" }.join('&')
        url + "?#{query_string}"
      else
        url
      end
    end
1359122
def url_params(request, except_params=None, as_is=False):
    
    if not request.GET:
        return ''
    params = []
    for key, value in request.GET.items():
        if except_params and key not in except_params:
            for v in request.GET.getlist(key):
                params.append('%s=%s' % (key, urlquote(v)))

    if as_is:
        str_params = '?' + '&'.join(params)
    else:
        str_params = '?' + '&'.join(params)
        str_params = urlquote(str_params)
    return mark_safe(str_params)
182366
function addMatch (route) {
  let routePath = route.path
  let paramNames = []
  let matched
  // find any paths prefixed with `:` or `%`, and treat them as capture groups
  while ((matched = routePath.match(paramPattern)) !== null) {
    routePath = routePath.replace(paramPattern, '([^?/]+)')
    paramNames.push(matched[1])
  }
  // if a route ends with `index`, allow matching that route without matching the `index` part
  if (path.basename(routePath) === 'index') {
    route.isIndex = true
    routePath = routePath.replace(/\/index$/, '/?([:%]?index)?')
  }
  // create a regex with our path
  let pattern = new RegExp(`^${routePath}(\\?(.*)|$)`, 'i')
  route.pattern = pattern
  route.match = url => {
    let m = url.match(pattern)
    if (m) {
      let params = paramNames.reduce((o, p, idx) => {
        o[p] = m[idx + 1]
        return o
      }, {})
      let query = qs.parse(m[m.length - 1])
      return { params, query }
    }
  }
  return route
}
458658
def encode_uri_query_params(params)
      query = []

      params.each do |key, value|
        case value
        when Integer
          query << "#{key}=#{value}"
        when String, Symbol
          query << "#{key}=#{URI::Generic::DEFAULT_PARSER.escape(value.to_s)}"
        when TrueClass
          query << "#{key}"
        when FalseClass, NilClass
        else
          raise TypeError, "unexpected type: #{value.class}"
        end
      end

      "#{query.join('&'.freeze)}" if query.any?
    end
504276
function(url, param, args) {
        var index;
        var name;
        var urlArgs = '?';

        var i;
        var oldCount;
        var arrayUrl = url.split('/');

        var res = {
            url : '',
            count : 0
        };

        // For each arguments.
        for (index in args) {
            // Create the name, :argument or name from param in routing.
            name = (typeof(param[index]) != 'undefined') ? param[index] : ':'+index;
            i = 0;
            // Saving count each iteration.
            oldCount = res.count;
            for (; i < arrayUrl.length; ++i) {
                // If an argument match.
                if (arrayUrl[i] == name) {
                    // Replace data with the argument value.
                    arrayUrl[i] = args[index];
                    ++res.count
                }
            }
            // If equal, the argument was not a param url, add in get request.
            if (oldCount == res.count) {
                urlArgs = urlArgs + index + '=' + args[index] + '&'
            }
        }
        // Remove the last character '?' if empty or '&' if filled.
        urlArgs = urlArgs.slice(0, -1);
        // Create the new url.
        res.url = arrayUrl.join('/');
        // Add get arguments.
        res.url = res.url+urlArgs;

        // Return result.
        return res
    }
1313202
function removeParameters(url) {
	var baseURL = url;

	// Iterate over all parameters
	for (var int = 0; int < params.length; int++) {

		// Remove parameter
		baseURL = baseURL.replace(new RegExp(params[int] + '=[^&]*&', 'ig'), '');
	}

	return baseURL;
}
751867
def cleanup_parameter_values
        abandoned_parameter_values = Discerner::ParameterValue.order(:id).to_a - updated_parameter_values - blank_parameter_values

        if self.options[:prune_dictionaries].blank?
          notification_message "if option --prune_dictionaries is not specified, parameter values for dictionaries that are not in parsed definition file should be deleted manually. Use `rake discerner:delete_dictionary' NAME='My dictionary name'"
          abandoned_parameter_values = abandoned_parameter_values.reject{|v| abandoned_dictionaries.include?(v.parameter.parameter_category.dictionary)}
        end

        used_parameter_values      = abandoned_parameter_values.select{|p| p.used_in_search?}
        not_used_parameter_values  = abandoned_parameter_values - used_parameter_values

        used_parameter_values.each do |r|
          notification_message("marking parameter value #{r.name} as deleted");
          r.deleted_at = Time.now
          error_message "parameter value could not be marked as deleted: #{r.errors.full_messages}", r.name unless r.save
        end

        unless not_used_parameter_values.blank?
          notification_message("permanently deleting parameter values #{not_used_parameter_values.map{|r| r.name}.join(', ')}");
          not_used_parameter_values.each{|r| r.destroy}
        end
      end
431814
private static String cleanODataPath(String path, HandleParametersOption handleParameters) {
		String cleanedPath = path;
		
		if (HandleParametersOption.USE_ALL.equals(handleParameters) ) {
			cleanedPath = path;
		} else {

			// check for single ID (unnamed)
			Matcher matcher = patternResourceIdentifierUnquoted.matcher(path);
			if (matcher.find()) {
				String resourceName =  matcher.group(1); 
				String resourceID   =  matcher.group(2);
			
				String subString = resourceName + "(" + resourceID + ")";
				int begin = path.indexOf(subString);
				int end   = begin + subString.length();
				
				String beforeSubstring = path.substring(0,begin);
				String afterSubstring  = path.substring(end);
				
	
				if (HandleParametersOption.IGNORE_COMPLETELY.equals(handleParameters) ||
				    HandleParametersOption.IGNORE_VALUE.equals(handleParameters)	     ) {
					
					StringBuilder sb = new StringBuilder(beforeSubstring);
					sb.append(resourceName).append("()").append(afterSubstring);
					cleanedPath = sb.toString();
				} 
							
			} else {
				
				matcher = patternResourceMultipleIdentifier.matcher(path);
				if (matcher.find()) {
					// We've found a composite identifier. i.e: /Resource(field1=a,field2=3)
					
					String multipleIdentifierSection =   matcher.group(1); 
					
					int begin = path.indexOf(multipleIdentifierSection);
					int end   = begin + multipleIdentifierSection.length();
	
					String beforeSubstring = path.substring(0,begin);
					String afterSubstring  = path.substring(end);

					if (HandleParametersOption.IGNORE_COMPLETELY.equals(handleParameters) ) {
							cleanedPath = beforeSubstring + afterSubstring;
					} else {
						StringBuilder sb = new StringBuilder(beforeSubstring);
						
						matcher = patternResourceMultipleIdentifierDetail.matcher(multipleIdentifierSection);
						int i = 1;
						while (matcher.find()) {
							
							if (i >  1) {
								sb.append(',');
							}
							String paramName       = matcher.group(1);
							sb.append(paramName);
							i++;
						}
					
						sb.append(afterSubstring);
						cleanedPath = sb.toString();
					}
							
				} 
			}		
		}
		
		return cleanedPath;
	}
54130
def show_page_path_params(page, optional_params = {})
      raise ArgumentError, 'Page is nil' if page.nil?
      url_params = {urlname: page.urlname}.update(optional_params)
      prefix_locale? ? url_params.update(locale: page.language_code) : url_params
    end
771018
def path_to_pattern(api_path, parameters):
    
    parts = re.split(PARAMETER_REGEX, api_path)
    pattern = ''.join((process_path_part(part, parameters) for part in parts))

    if not pattern.startswith('^'):
        pattern = "^{0}".format(pattern)
    if not pattern.endswith('$'):
        pattern = "{0}$".format(pattern)

    return pattern
291708
def query_params_from_hash(value, prefix = nil)
      case value
      when Array
        value.map { |v| query_params_from_hash(v, "#{prefix}%5B%5D") }.join("&")
      when Hash
        value.map { |k, v|
          query_params_from_hash(v, prefix ? "#{prefix}%5B#{Rack::Utils.escape_path(k)}%5D" : Rack::Utils.escape_path(k))
        }.join("&")
      when NilClass
        prefix
      else
        raise ArgumentError, "value must be a Hash" if prefix.nil?
        "#{prefix}=#{Rack::Utils.escape_path(value)}"
      end
    end
118910
def validate_path_parameters(target_path, api_path, path_parameters, context):
    
    base_path = context.get('basePath', '')
    full_api_path = re.sub(NORMALIZE_SLASH_REGEX, '/', base_path + api_path)
    parameter_values = get_path_parameter_values(
        target_path, full_api_path, path_parameters, context,
    )
    validate_parameters(parameter_values, path_parameters, context=context)
707331
function parsePathParams (req, res, next) {
    if (util.isSwaggerRequest(req)) {
      req.pathParams = {};

      if (req.swagger.pathName.indexOf("{") >= 0) {
        // Convert the Swagger path to a RegExp
        let paramNames = [];
        let pathPattern = req.swagger.pathName.replace(util.swaggerParamRegExp, (match, paramName) => {
          paramNames.push(paramName);
          return "([^\/]+)";
        });

        // Exec the RegExp to get the path param values from the URL
        let values = new RegExp(pathPattern + "\/?$", "i").exec(req.path);

        // Parse each path param
        for (let i = 1; i < values.length; i++) {
          let paramName = paramNames[i - 1];
          let paramValue = decodeURIComponent(values[i]);
          let param = _.find(req.swagger.params, { in: "path", name: paramName });

          util.debug('    Parsing the "%s" path parameter', paramName);
          req.pathParams[paramName] = paramParser.parseParameter(param, paramValue, param);
        }
      }
    }

    next();
  }
892536
function replace_params(params) {
	return function replace_params_(match, key) {
		if(params && params.hasOwnProperty(key)) {
			var value = params[key];
			delete params[key];
			return value;
		}
		return ':' + key;
	};
}
879693
function URLSearchParams(/* init */) {
  anInstance(this, URLSearchParamsConstructor, URL_SEARCH_PARAMS);
  var init = arguments.length > 0 ? arguments[0] : undefined;
  var that = this;
  var entries = [];
  var iteratorMethod, iterator, step, entryIterator, first, second, key;

  setInternalState(that, {
    type: URL_SEARCH_PARAMS,
    entries: entries,
    updateURL: null,
    updateSearchParams: updateSearchParams
  });

  if (init !== undefined) {
    if (isObject(init)) {
      iteratorMethod = getIteratorMethod(init);
      if (typeof iteratorMethod === 'function') {
        iterator = iteratorMethod.call(init);
        while (!(step = iterator.next()).done) {
          entryIterator = getIterator(anObject(step.value));
          if (
            (first = entryIterator.next()).done ||
            (second = entryIterator.next()).done ||
            !entryIterator.next().done
          ) throw TypeError('Expected sequence with length 2');
          entries.push({ key: first.value + '', value: second.value + '' });
        }
      } else for (key in init) if (hasOwn(init, key)) entries.push({ key: key, value: init[key] + '' });
    } else {
      parseSearchParams(entries, typeof init === 'string' ? init.charAt(0) === '?' ? init.slice(1) : init : init + '');
    }
  }
}
1002613
function addURIParams(uri, params) {
  uri = uri || "";
  params = params || {};

  params = _.clone(params);

  var keys = _.keys(params);

  var separatedPath = uri.split("/");

  separatedPath = _.compact(separatedPath);

  //Replacing Any Path Elements
  separatedPath = _.map(separatedPath, function(pathEntry) {
    if (pathEntry.indexOf(":") !== 0) {
      return pathEntry;
    }

    var key = _.find(keys, function(key) {
      return (":" + key) === pathEntry;
    });

    if (key) {
      return params[key];
    } else {
      return {
        key: pathEntry.substring(1, pathEntry.length),
        error: constants.PROPERTY_NOT_SET
      };
    }
  });

  //If the path contains an invalid parameter, return the error object
  var invalidParameter = _.findWhere(separatedPath, {error: constants.PROPERTY_NOT_SET});

  if (invalidParameter) {
    return invalidParameter;
  }

  var fullPath = "";

  _.each(separatedPath, function(pathElem) {
    return fullPath += "/" + pathElem;
  });

  return fullPath;
}