Internal: Parse query string into hash of params

 query - String query string

 Return Hash of params.
330165
def parse_uri_query_params(query)
      query.to_s.split('&'.freeze).reduce({}) do |h, p|
        k, v = p.split('='.freeze, 2)
        v = URI::Generic::DEFAULT_PARSER.unescape(v) if v
        h[k.to_sym] = v || true
        h
      end
    end
810740
function parseQuery(str, opts = {}) {
  let _querys = {};
  decodeURIComponent(str || '').replace(/\+/g, ' ')
  // (optional no-capturing & )(key)=(value)
  .replace(/(?:^|&)([^&=]*)=?([^&]*)/g, function ($0, _name, _value) {
    if (_name) {
      let _path, _acc, _tmp, _ref;
      (_path = []).unshift(_name = _name.replace(/\[([^\]]*)]/g, function ($0, _k) {
        _path.push(_k);
        return '';
      }));
      _ref = _querys;
      for (let j = 0; j < _path.length - 1; j++) {
        _acc = _path[j];
        _tmp = _path[j + 1];
        if (!_ref[_acc]) {
          _ref[_acc] = _tmp === '' || /^[0-9]+$/.test(_tmp) ? [] : {};
        }
        _ref = _ref[_acc];
      }
      if (opts.boolval) {
        // first
        if (_value === 'true') {
          _value = true;
        } else if (_value === 'false') {
          _value = false;
        }
      } else if (opts.intval) {
        // skip "true" & "false"
        if (_tmp = parseInt(_value) === _value) {
          _value = _tmp;
        }
      }
      if ((_acc = _path[_path.length - 1]) === '') {
        _ref.push(_value);
      } else {
        _ref[_acc] = _value;
      }
    }
  });
  return _querys;
}
202898
function parseQueryMap(query) {
  var map = {};
  parseQueryString(query, function(key, value) {
    map[key] = value;
  });
  return map;
}
187731
def hash_to_rets_query_string(hash)
      [].tap do |str|
        hash.each_pair do |k,v|
          val = value_map(v)
          str << "(#{k.to_s.camelize}=#{val})"
        end
      end.join(',')
    end
150984
def parse_filter_params(query_params, filterable):
    
    if query_params is not None:
        filter_params = {}
        for fq in query_params.mixed():
            if fq in filterable:
                filter_params[fq] = query_params.mixed().get(fq)
        return filter_params
    else:
        return {}
1212795
function parseQueryString(query) {
  const result = {};

  _.each(query.replace(/\+/g, ' ').split('&'), (key) => {
    const index = key.indexOf('=');
    let val = '';

    if (index >= 0) {
      val = decodeURIComponent(key.slice(index + 1));
      key = key.slice(0, index);
    }
    if (!key) return;

    key = decodeURIComponent(key);

    // brackets notation for array value
    if (key.slice(-2) === '[]') {
      key = key.slice(0, -2);
      val = [val];
    }

    // if there are multiple values per key, concatenate
    result[key] = _.has(result, key) ? [].concat(result[key], val) : val;
  });

  return result;
}
313092
def _make_canonical_query_string(parsed):
    
    query_params = urlparse.parse_qs(parsed.query, keep_blank_values=True)
    sorted_query_params = sorted((k, v)
                                 for k, vs in query_params.items()
                                 for v in vs)
    return urllib.urlencode(sorted_query_params)
317945
def parse_querystring(self, req, name, field):
        """"""
        return core.get_value(req.query, name, field)
1059165
def query_url_params(query)
      if query.reverse_geocode?
        {
          :token => configuration.api_key,
          :lat => query.coordinates[0],
          :lon => query.coordinates[1]
        }.merge(super)
      else
        {
          :token => configuration.api_key,
          :address => query.sanitized_text
        }.merge(super)
      end
    end
44992
def parse_query_filter():
    """"""
    query_string = request.args.get("queryFilter")
    if query_string is None:
        return {"type": "and", "filters": []}
    query = json.loads(query_string)
    assert type(query) == dict
    assert type(query.get("type")) == str
    return query
35432
def to_query(params)
      unless params.is_a?(Hash)
        raise "Expected Hash but got #{params.class.name}"
      end
      Addressable::URI.form_encode(params)
    end
246035
def parse_querystring(self, req: Request, name: str, field: Field) -> typing.Any:
        """"""
        return core.get_value(req.query, name, field)
1282001
def from_raw_query(cls, query_string):
        
        try:
            node_tree = grammar.parse(query_string)
        except IncompleteParseError:
            query_string = cls.fix_quotes(query_string)
            node_tree = grammar.parse(query_string)

        structured_query = DictFormater().visit(node_tree)

        return cls([t for t in structured_query
                    if t[1].lower() not in STOPWORDS])
509148
def _get_hashed_params(self, page_text):
        """"""
        soup = BeautifulSoup(page_text, 'html.parser')
        return [tag['name'] for tag in soup.find_all('input', class_='sl')]
797721
def get_parameters_as_dictionary(self, query_string):
        
        pairs = (x.split('=', 1) for x in query_string.split('&'))
        return dict((k, unquote(v)) for k, v in pairs)
77327
def parse_querystring(self, req, name, field):
        """"""
        return core.get_value(req.params, name, field)
1031585
def parse_query(query, delim='/'):
        
        key = ''
        prefix = ''
        postfix = ''

        parsed = urlparse(query)
        query = parsed.path.lstrip(delim)
        bucket = parsed.netloc

        if not parsed.scheme.lower() in ('', "gs", "s3", "s3n"):
            raise ValueError("Query scheme must be one of '', 'gs', 's3', or 's3n'; "
                             "got: '%s'" % parsed.scheme)
        storage = parsed.scheme.lower()

        if not bucket.strip() and query:
            toks = query.split(delim, 1)
            bucket = toks[0]
            if len(toks) == 2:
                key = toks[1]
            else:
                key = ''

        if not bucket.strip():
            raise ValueError("Could not parse bucket name from query string '%s'" % query)

        tokens = query.split("*")
        n = len(tokens)
        if n == 0:
            pass
        elif n == 1:
            key = tokens[0]
        elif n == 2:
            index = tokens[0].rfind(delim)
            if index >= 0:
                key = tokens[0][:(index + 1)]
                prefix = tokens[0][(index + 1):] if len(tokens[0]) > (index + 1) else ''
            else:
                prefix = tokens[0]
            postfix = tokens[1]
        else:
            raise ValueError("Only one wildcard ('*') allowed in query string, got: '%s'" % query)

        return storage, bucket, key, prefix, postfix