Function to covert params into url encoded query string
        :param dict params: Json string sent  by Authy.
        :param string topkey: params key
        :return string: url encoded Query.
15443
def __make_http_query(self, params, topkey=''):
        
        if len(params) == 0:
            return ""
        result = ""
        # is a dictionary?
        if type(params) is dict:
            for key in params.keys():
                newkey = quote(key)
                if topkey != '':
                    newkey = topkey + quote('[' + key + ']')
                if type(params[key]) is dict:
                    result += self.__make_http_query(params[key], newkey)
                elif type(params[key]) is list:
                    i = 0
                    for val in params[key]:
                        if type(val) is dict:
                            result += self.__make_http_query(
                                val, newkey + quote('['+str(i)+']'))
                        else:
                            result += newkey + \
                                quote('['+str(i)+']') + "=" + \
                                quote(str(val)) + "&"
                        i = i + 1
                # boolean should have special treatment as well
                elif type(params[key]) is bool:
                    result += newkey + "=" + \
                        quote(str(params[key]).lower()) + "&"
                # assume string (integers and floats work well)
                else:
                    result += newkey + "=" + quote(str(params[key])) + "&"
        # remove the last '&'
        if (result) and (topkey == '') and (result[-1] == '&'):
            result = result[:-1]
        return result
32862
function request_params(params) {
  'use strict';
  var base_params, merged_params, key;

  // Omit defaults, to make smaller requests
  // output: 'JSON',
  // version: '2',
  // validation: 'HMACSHA1'  
  base_params = { apikey: global.monitis.apikey };
  merged_params = {};

  for (key in base_params) {
    merged_params[key] = base_params[key];
  }
  for (key in params) {
    merged_params[key] = params[key];
  }
  return merged_params;
}
992100
def get_from_params(request, key):
    
    data = getattr(request, 'json', None) or request.values
    value = data.get(key)
    return to_native(value)
1281091
def urlencoded(body, charset='ascii', **kwargs):
    """"""
    return parse_query_string(text(body, charset=charset), False)
40402
def urlencode(query, params):
    
    return query + '?' + "&".join(key+'='+quote_plus(str(value)) 
                                  for key, value in params)
452624
def url(path, params = nil)
      if path.respond_to? :query
        if (query = path.query)
          path = path.dup
          path.query = nil
        end
      else
        anchor_index = path.index('#')
        path = path.slice(0, anchor_index) unless anchor_index.nil?
        path, query = path.split('?', 2)
      end
      self.path = path
      self.params.merge_query query, options.params_encoder
      self.params.update(params) if params
    end
314839
def to_query(self):
        
        return {
            self.name: {
                'lang': self.lang,
                'script': self.script,
                'params': self.script_params
            }
        }
350181
def _get_query_params(query):
    
    query_params = OrderedDict(sorted(query['query'].items()))
    return ' '.join(['{}={}'.format(k, v) for k, v in query_params.items()])
558834
def query_string(context, **kwargs):
    """"""
    params = context["request"].GET.copy()

    for key, value in list(kwargs.items()):
        params[key] = value

    return "?" + params.urlencode()
1227577
def append_query_param(self, key, value):
        
        values = self.query_param(key, as_list=True, default=[])
        values.append(value)
        return self.query_param(key, values)
816506
def url_for params
      p = params.dup
      query = p.map{|key, value| value.to_query(key) } * '&'
      "#{h.url_for({})}?#{query}"
    end
144481
def url_param2value(param):
    
    if param == None:
        return Null
    if param == None:
        return Null

    def _decode(v):
        output = []
        i = 0
        while i < len(v):
            c = v[i]
            if c == "%":
                d = hex2chr(v[i + 1:i + 3])
                output.append(d)
                i += 3
            else:
                output.append(c)
                i += 1

        output = text_type("".join(output))
        try:
            return json2value(output)
        except Exception:
            pass
        return output

    query = Data()
    for p in param.split('&'):
        if not p:
            continue
        if p.find("=") == -1:
            k = p
            v = True
        else:
            k, v = p.split("=")
            v = _decode(v)

        u = query.get(k)
        if u is None:
            query[k] = v
        elif is_list(u):
            u += [v]
        else:
            query[k] = [u, v]

    return query
1108323
def encode_params(params, **kwargs):
    """"""
    cleaned = clean_params(params, **kwargs)
    return json.dumps(cleaned)
1237574
def remove_query_param(self, key, value=None):
        
        parse_result = self.query_params()
        if value is not None:
            index = parse_result[key].index(value)
            del parse_result[key][index]
        else:
            del parse_result[key]
        return URL._mutate(self, query=unicode_urlencode(parse_result, doseq=True))
359792
def to_url(self, url=None, replace=False, **kwargs):
        ''''''
        params = copy.deepcopy(self.filter_values)
        if self._query:
            params['q'] = self._query
        if self.page_size != DEFAULT_PAGE_SIZE:
            params['page_size'] = self.page_size
        if kwargs:
            for key, value in kwargs.items():
                if not replace and key in params:
                    if not isinstance(params[key], (list, tuple)):
                        params[key] = [params[key], value]
                    else:
                        params[key].append(value)
                else:
                    params[key] = value
        else:
            params['page'] = self.page
        href = Href(url or request.base_url)
        return href(params)
65600
def query_params(self, params, key, def_value, short_hand=None):
    
    if key not in params and short_hand:
        # value is associated with shorthand, move to key
        params[key] = params.get(short_hand, def_value)
        del params[short_hand]
    elif key not in params and not short_hand:
        params[key] = def_value
    elif key in params:
        # key is there, also possibly shorthand
        # assume def value at this point is not needed
        if short_hand in params:
            del params[short_hand]
    return params
24110
function toQueryParams(object){
	return Object.keys(object)
		.filter(key => !!object[key])
		.map(key => key + "=" + encodeURIComponent(object[key]))
		.join("&")
}