Returns the decoded key-value parameter pairs of the URI.
488453
public Map<String, List<String>> parameters() {
    if (params == null) {
      if (hasPath) {
        int pathLength = path().length();
        if (uri.length() == pathLength) {
          return Collections.emptyMap();
        }
        decodeParams(uri.substring(pathLength + 1));
      } else {
        if (uri.isEmpty()) {
          return Collections.emptyMap();
        }
        decodeParams(uri);
      }
    }
    return params;
  }
780468
private function decodeRequestUri()
    {
		foreach ($this->routes['general'] as $p => $callable)
		{
			if (preg_match('|^'.$p.'|', $_SERVER['REQUEST_URI'], $matches)) {
				list($url) = explode('?',$_SERVER['REQUEST_URI']);
				$this->_unparsedUrl = trim(str_replace($matches[0], '', $url),'/');
				$res = $callable($matches);
				if ($res) die();
			}
			/*
			if (substr($_SERVER['REQUEST_URI'],0,strlen($p)) == $p )
			{
				list($url) = explode('?',$_SERVER['REQUEST_URI']);
				$this->_unparsedUrl = trim(str_replace($p, '', $url),'/');
				$res = $callable();
				if ($res) die();
			}
			*/
		}		
		
		$this->_unparsedUrl = null;
		
        $this->_catalog = $this->getServer();
        $this->_urlPath[] = $this->_catalog;
        if (!$this->_catalog) return;
        list($url) = explode('?',$_SERVER['REQUEST_URI']);
        $url = trim($url, '/');
    	$dir = explode("/", $url);
    	
		/*
    	if (sizeof($dir) && $dir[0] == PREVIEW_PREFIX) {
            array_shift($dir);
            $this->_previewMode = true;
        }
		*/

    	  while ($alias = array_shift($dir)) {
    	    try {
                $c = $this->_catalog->prototype->getChildByAlias($alias);
                $this->_catalog = $c;
                $this->_urlPath[] = $this->_catalog;
                $this->debug(DEBUG_COMMON, 'Catalog: '.$alias.'('.$c->id.')');
            } catch (\Exception $e) {
                array_unshift($dir, $alias);
                break;
            }
        }
        
        $this->_unparsedUrl = implode('/', $dir);
    }
691471
private void parseURIIntoComponents() {
        List<String> pathNodeList = new ArrayList<String>();
        StringBuilder query = new StringBuilder();
        StringBuilder fragment = new StringBuilder();
        Utils.parseURI(getURI(), pathNodeList, query, fragment);
        for (String encodedNode : pathNodeList) {
            m_pathNodes.add(Utils.urlDecode(encodedNode));
        }
        m_query = Utils.urlDecode(query.toString());
    }
844556
@SuppressWarnings("PMD.PreserveStackTrace")
    private Map<String, String> findParameters(URI location) throws MalformedURLException {
        final Map<String, String> params;
        try {
            params = URISupport.parseParameters(location);
        } catch (final URISyntaxException e) {
            throw new MalformedURLException(e.getMessage());
        }
        return params;
    }
1270091
def unshorten(self, uri: str) -> str:
        
        res = self.get(uri)

        ysmm = re.findall(r'var ysmm =.*\;?', res.text)

        if len(ysmm) == 0:
            raise UnshortenFailed('No ysmm variable found.')

        # Decode the ysmm variable and extract the actual link
        ysmm = re.sub(r'var ysmm \= \'|\'\;', '', ysmm[0])

        left = ''
        right = ''

        for c in [ysmm[i:i+2] for i in range(0, len(ysmm), 2)]:
            left += c[0]
            right = c[1] + right

        # Additional digit arithmetic
        encoded_uri = list(left + right)
        numbers = ((i, n) for i, n in enumerate(encoded_uri) if str.isdigit(n))
        for first, second in zip(numbers, numbers):
            xor = int(first[1]) ^ int(second[1])
            if xor < 10:
                encoded_uri[first[0]] = str(xor)

        decoded_uri = b64decode("".join(encoded_uri).encode())[16:-16].decode()

        if re.search(r'go\.php\?u\=', decoded_uri):
            decoded_uri = b64decode(re.sub(r'(.*?)u=', '', decoded_uri)).decode()

        return decoded_uri
1241844
def get_params(self):
        
        return odict([(key,param.value) for key,param in self.params.items()])
155737
public Set<Entry<String, String>> getParameters() {
		Map<String,String> retval = new HashMap<String,String> ();
		for(Entry<String, String> nameValue : this.parameters.entrySet()) {
			retval.put(nameValue.getKey(), (RFC2396UrlDecoder.decode(nameValue.getValue())));
		}
		return retval.entrySet();
	}
1261606
def to_query_string_parameters(hash = {})
      properties = hash.map do |k, v|
        key   = URI.escape(k.to_s)
        value = URI.escape(v.to_s)

        "#{key}=#{value}"
      end

      if properties.empty?
        nil
      else
        properties.join("&")
      end
    end
1059470
def _EncodeParameters(self, parameters):
        

        if parameters is None:
            return None
        else:
            return urlencode(dict([(k, self._Encode(v)) for k, v in list(parameters.items()) if v is not None]))
1205986
function magnetURIDecode (uri) {
  const result = {}

  // Support 'magnet:' and 'stream-magnet:' uris
  const data = uri.split('magnet:?')[1]

  const params = (data && data.length >= 0)
    ? data.split('&')
    : []

  params.forEach(param => {
    const keyval = param.split('=')

    // This keyval is invalid, skip it
    if (keyval.length !== 2) return

    const key = keyval[0]
    let val = keyval[1]

    // Clean up torrent name
    if (key === 'dn') val = decodeURIComponent(val).replace(/\+/g, ' ')

    // Address tracker (tr), exact source (xs), and acceptable source (as) are encoded
    // URIs, so decode them
    if (key === 'tr' || key === 'xs' || key === 'as' || key === 'ws') {
      val = decodeURIComponent(val)
    }

    // Return keywords as an array
    if (key === 'kt') val = decodeURIComponent(val).split('+')

    // Cast file index (ix) to a number
    if (key === 'ix') val = Number(val)

    // If there are repeated parameters, return an array of values
    if (result[key]) {
      if (Array.isArray(result[key])) {
        result[key].push(val)
      } else {
        const old = result[key]
        result[key] = [old, val]
      }
    } else {
      result[key] = val
    }
  })

  // Convenience properties for parity with `parse-torrent-file` module
  let m
  if (result.xt) {
    const xts = Array.isArray(result.xt) ? result.xt : [ result.xt ]
    xts.forEach(xt => {
      if ((m = xt.match(/^urn:btih:(.{40})/))) {
        result.infoHash = m[1].toLowerCase()
      } else if ((m = xt.match(/^urn:btih:(.{32})/))) {
        const decodedStr = base32.decode(m[1])
        result.infoHash = Buffer.from(decodedStr, 'binary').toString('hex')
      }
    })
  }
  if (result.infoHash) result.infoHashBuffer = Buffer.from(result.infoHash, 'hex')

  if (result.dn) result.name = result.dn
  if (result.kt) result.keywords = result.kt

  if (typeof result.tr === 'string') result.announce = [ result.tr ]
  else if (Array.isArray(result.tr)) result.announce = result.tr
  else result.announce = []

  result.urlList = []
  if (typeof result.as === 'string' || Array.isArray(result.as)) {
    result.urlList = result.urlList.concat(result.as)
  }
  if (typeof result.ws === 'string' || Array.isArray(result.ws)) {
    result.urlList = result.urlList.concat(result.ws)
  }

  uniq(result.announce)
  uniq(result.urlList)

  return result
}
1150497
def _get_parameters(link, encoding):
    
    parameters = []
    properties = {}
    required = []

    for field in link.fields:
        parser = OpenApiFieldParser(link, field)
        if parser.location == 'form':
            if encoding in ('multipart/form-data', 'application/x-www-form-urlencoded'):
                # 'formData' in swagger MUST be one of these media types.
                parameters.append(parser.as_parameter())
            else:
                # Expand coreapi fields with location='form' into a single swagger
                # parameter, with a schema containing multiple properties.
                properties[field.name] = parser.as_schema_property()
                if field.required:
                    required.append(field.name)
        elif parser.location == 'body':
            parameters.append(parser.as_body_parameter(encoding))
        else:
            parameters.append(parser.as_parameter())

    if properties:
        parameter = {
            'name': 'data',
            'in': 'body',
            'schema': {
                'type': 'object',
                'properties': properties
            }
        }
        if required:
            parameter['schema']['required'] = required
        parameters.append(parameter)

    return parameters
807346
def pull_url_pairs(params)
      url.keys.map {|k| [k, params.delete(k) || params.delete(k.to_sym)] }
    end
718358
protected static RequestParams getParams(Uri uri) {
        RequestParams params = new RequestParams();
        Set<String> keys = getQueryParameterNames(uri);
        for (String key : keys) {
            String value = uri.getQueryParameter(key);
            if (TextUtils.isEmpty(value)) {
                value = null;
            }
            params.put(key, value);
        }
        return params;
    }
386627
def iri2uri(uri):
	""""""

	assert uri != None, 'iri2uri must be passed a non-none string!'

	original = uri
	if isinstance(uri ,str):
		(scheme, authority, path, query, fragment) = urllib.parse.urlsplit(uri)
		authority = authority.encode('idna').decode('utf-8')
		# For each character in 'ucschar' or 'iprivate'
		#  1. encode as utf-8
		#  2. then %-encode each octet of that utf-8
		# path = urllib.parse.quote(path)
		uri = urllib.parse.urlunsplit((scheme, authority, path, query, fragment))
		uri = "".join([encode(c) for c in uri])

	# urllib.parse.urlunsplit(urllib.parse.urlsplit({something})
	# strips any trailing "?" chars. While this may be legal according to the
	# spec, it breaks some services. Therefore, we patch
	# the "?" back in if it has been removed.
	if original.endswith("?") and not uri.endswith("?"):
		uri = uri+"?"
	return uri
961549
private static String decodeURL(String url) {
    	try {
			return URLDecoder.decode(url, UTF_8);
		} catch (UnsupportedEncodingException e) {
		}
		return null;
    }
1235631
public static Map<String, String> parseQuery(String uri) {
        Map<String, String> map = new LinkedHashMap<>();
        String query = URI.create(uri).getQuery();
        if (query == null || query.equals("")) {
            return Collections.unmodifiableMap(map);
        }
        String[] params = query.split("&");
        for (String param : params) {
            try {
                String[] pair = param.split("=", 2);
                String name = URLDecoder.decode(pair[0], "UTF-8");
                if (name.equals("")) {
                    continue;
                }
                map.put(name, pair.length > 1 ? URLDecoder.decode(pair[1], "UTF-8") : "");
            } catch (UnsupportedEncodingException e) {
                throw new RuntimeException(e);
            }
        }
        return Collections.unmodifiableMap(map);
    }
975672
def get_canonical_query_params(self):
        """"""
        result = []
        for key, value in self.sorted_params():
            result.append("%s=%s" % (self.encode(key), self.encode(value)))
        return "&".join(result)