URL parameter parse
490103
private <E> Object parse( String s, Class fclz ) {
    if( fclz.equals(String.class) ) return s; // Strings already the right primitive type
    if( fclz.isArray() ) {      // An array?
      read(s,    0       ,'[',fclz);
      read(s,s.length()-1,']',fclz);
      String[] splits = s.substring(1,s.length()-1).split(",");
      Class<E> afclz = (Class<E>)fclz.getComponentType();
      E[] a= (E[])Array.newInstance(afclz,splits.length);
      for( int i=0; i<splits.length; i++ )
        a[i] = (E)parse(splits[i],afclz);
      return a;
    }
    if( fclz.equals(Key.class) ) return Key.make(s);

    throw new RuntimeException("Unimplemented schema fill from "+fclz.getSimpleName());
  }  
  private int read( String s, int x, char c, Class fclz ) {
    if( peek(s,x,c) ) return x+1;
    throw new IllegalArgumentException("Expected '"+c+"' while reading a "+fclz.getSimpleName()+", but found "+s);
  }
  private boolean peek( String s, int x, char c ) { return x < s.length() && s.charAt(x) == c; }
}
935383
def parse_parameters(self, parameters):
        """"""

        self.parameters = []
        for param_name, param_value in parameters.items():
            p = Parameter(param_name, param_value)
            if p:
                self.parameters.append(p)
827940
def _parse_url(self,url):
        ''''''
        (ip,port,target) = ('',DEFAULT_SERVER_PORT,'')
        m = re.match(r'[rtspRTSP:/]+(?P<ip>(\d{1,3}\.){3}\d{1,3})(:(?P<port>\d+))?(?P<target>.*)',url)
        if m is not None:
            ip      = m.group('ip')
            port    = int(m.group('port'))
            target  = m.group('target')
        #PRINT('ip: %s, port: %d, target: %s'%(ip,port,target), GREEN)
        return ip,port,target
519359
protected function _parseUrl()
    {
        $url_frgts = UrlHelper::parse($this->getUrl());
        $route = array('all'=>array());
        if (!empty($url_frgts['params'])) {
            $frgts = array();
            $url_args = $this->getArgumentsMap();
            foreach ($url_frgts['params'] as $_var=>$_val) {
                $_meth = 'fromUrl'.TextHelper::toCamelCase($_var);
                if (method_exists($this, $_meth)) {
                    $_val = call_user_func_array(array($this, $_meth), array($_val));
                }
                if (isset($url_args[$_var])) {
                    $route[$url_args[$_var]] = $_val;
                } else {
                    $route['all'][$_var] = $_val;
                }
            }
        }
        $this->setRouteParsed($route);
    }
657379
protected function parseUrlParams($url_params)
    {
        if ($url_params != '#' && (is_array($url_params) || (strpos($url_params, 'http') !== 0 && strpos($url_params, '/') !== 0))) {
            if (!is_array($url_params))
                $url_params = array($url_params);
            $url_to = Rails::application()->router()->urlFor($url_params, true);
        } else {
            $url_to = $url_params;
        }
        return $url_to;
    }
108902
function getQueryParameterValue(url, parameterName) {
        var parts;
        var query = (url || '').split('?');
        if (query && query.length > 0) {
            parts = query[1];
        }
        else {
            parts = '';
        }
        var vars = parts.split('&');
        for (var i = 0; i < vars.length; i++) {
            var pair = vars[i].split('=');
            if (decodeURIComponent(pair[0]) == parameterName) {
                return decodeURIComponent(pair[1]);
            }
        }
        // not found
        return null;
    }
1129638
function parseUri(str) {
    var parser = re.uri_parser;
    var parserKeys = ["source", "protocol", "authority", "userInfo", "user", "password", "host", "port", "isColonUri", "relative", "path", "directory", "file", "query", "anchor"];
    var m = parser.exec(str || '');
    var parts = {};

    parserKeys.forEach(function(key, i) {
      parts[key] = m[i] || '';
    });

    return parts;
  }
595056
def parse_url(url):
    
    scheme, dest = url.split('://')
    host = None
    ssl_context = None
    if scheme == 'elk':
        host, port = dest.split(':') if ':' in dest else (dest, 2101)
    elif scheme == 'elks':
        host, port = dest.split(':') if ':' in dest else (dest, 2601)
        ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
        ssl_context.verify_mode = ssl.CERT_NONE
    elif scheme == 'serial':
        host, port = dest.split(':') if ':' in dest else (dest, 115200)
    else:
        raise ValueError("Invalid scheme '%s'" % scheme)
    return (scheme, host, int(port), ssl_context)
180745
def parse_url(url):
    
    if ":" not in url:
        raise ValueError("url is invalid")

    scheme, url = url.split(":", 1)

    parsed = urlparse(url, scheme="ws")
    if parsed.hostname:
        hostname = parsed.hostname
    else:
        raise ValueError("hostname is invalid")
    port = 0
    if parsed.port:
        port = parsed.port

    is_secure = False
    if scheme == "ws":
        if not port:
            port = 80
    elif scheme == "wss":
        is_secure = True
        if not port:
            port = 443
    else:
        raise ValueError("scheme %s is invalid" % scheme)

    if parsed.path:
        resource = parsed.path
    else:
        resource = "/"

    if parsed.query:
        resource += "?" + parsed.query

    return hostname, port, resource, is_secure
845530
function(url){

	var retlist = [];

	// Pull parameters.
	var tmp = url.split('?');
	var path = '';
	var parms = [];
	if( ! tmp[1] ){ // catch bad url--nothing before '?'
	    parms = tmp[0].split('&');
	}else{ // normal structure
	    path = tmp[0];
	    parms = tmp[1].split('&');
	}

	// Decompose parameters.
	each(parms, function(p){
	    var c = _first_split('=', p);
	    if( ! c[0] && ! c[1] ){
		retlist.push([p]);
	    }else{
		retlist.push(c);		  
	    }
	});
	
	return retlist;
    }
1067972
static function url_parse_into($url, &$request)
    {
        $url = str_replace(self::$url_add_end, '', $url);
        if (self::$url_key_join == self::$url_param_join)
        {
            $urls = explode(self::$url_param_join, $url);
            $c = intval(count($urls) / 2);
            for ($i = 0; $i < $c; $i++)
            {
                $request[$urls[$i * 2]] = $urls[$i * 2 + 1];
            }
        }
        else
        {
            $urls = explode(self::$url_param_join, $url);
            foreach ($urls as $u)
            {
                $us = explode(self::$url_key_join, $u);
                $request[$us[0]] = $us[1];
            }
        }
    }
1165844
private synchronized void parseParameters() {
        if (null != this.queryParams) {
            // already parsed
            return;
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "parseParameters for " + this);
        }

        String encoding = getCharset().name();
        // PQ99481... non-English environments are too complex at the moment due to
        // the fact that current clients are not enforcing the proper Content-Type
        // header usage therefore figuring out what encoding to use involves system
        // properties, WAS config files, etc. So query parameters will only be
        // pulled
        // from the URI and not POST formdata

        // now merge in any possible URL params
        String queryString = getQueryString();
        if (null != queryString) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Parsing URL query data");
            }
            this.queryParams = HttpChannelUtils.parseQueryString(queryString, encoding);
        } else {
            // if we didn't have any data then just create an empty table
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                // PQ99481 Tr.debug(tc, "No parameter data found in body or URL");
                Tr.debug(tc, "No query data found in URL");
            }
            this.queryParams = new Hashtable<String, String[]>();
        }
    }
1082665
function _parseParameters(rule, parameter) {
    if (rule.toLowerCase() == 'regex') return [parameter];
    if (is_string(parameter)) {
      return parameter.split(',');
    };

    return [];
  }
966050
def parse(url):
    """"""

    config = {}

    url = urlparse.urlparse(url)

    # Remove query strings.
    path = url.path[1:]
    path = path.split('?', 2)[0]

    # Update with environment configuration.
    config.update({
        "DB": int(path or 0),
        "PASSWORD": url.password or None,
        "HOST": url.hostname or "localhost",
        "PORT": int(url.port or 6379),
    })

    return config
504479
def parse_url(url):
    
    try:
        url = unicode(url)
    except UnicodeDecodeError:
        pass

    if py3k:
        make_utf8 = lambda x: x
    else:
        make_utf8 = lambda x: isinstance(x, unicode) and x.encode('utf-8') or x

    if '://' in url:
        scheme, url = url.split('://', 1)
    else:
        scheme = 'http'
    url = 'http://' + url
    parsed = urlparse.urlsplit(url)
    r = ObjectDict()
    r['scheme'] = make_utf8(scheme)
    r['netloc'] = make_utf8(parsed.netloc)
    r['path'] = make_utf8(parsed.path)
    r['query'] = make_utf8(parsed.query)
    r['fragment'] = make_utf8(parsed.fragment)
    r['uri'] = make_utf8(parsed.path)
    if parsed.query:
        r['uri'] += '?' + make_utf8(parsed.query)
    r['username'] = make_utf8(parsed.username)
    r['password'] = make_utf8(parsed.password)
    host = make_utf8(parsed.hostname.encode('idna').decode('utf-8'))
    r['host'] = r['hostname'] = host
    try:
        r['port'] = parsed.port
    except ValueError:
        r['port'] = None
    if r['port']:
        r['http_host'] = '%s:%d' % (r['host'], r['port'])
    else:
        r['http_host'] = r['host']

    return r
1205999
function (url) {
        !url && (url = E);
        var parsedUrl = _.isString(url) ? Url.parse(url) : url,
            auth = parsedUrl.auth,
            protocol = parsedUrl.protocol,
            port = parsedUrl.port,
            path = parsedUrl.path,
            hash = parsedUrl.hash,
            host = parsedUrl.host,
            query = parsedUrl.query,
            variable = parsedUrl.variable;

        // convert object based query string to array
        // @todo: create a key value parser
        if (query) {
            if (_.isString(query)) {
                query = QueryParam.parse(query);
            }

            if (!_.isArray(query) && _.keys(query).length) {
                query = _.map(_.keys(query), function (key) {
                    return {
                        key: key,
                        value: query[key]
                    };
                });
            }
        }

        // backward compatibility with path variables being storing thins with `id`
        if (_.isArray(variable)) {
            variable = _.map(variable, function (v) {
                _.isObject(v) && (v.key = v.key || v.id); // @todo Remove once path variables are deprecated
                return v;
            });
        }

        // expand string path name
        if (_.isString(path)) {
            path && (path = path.replace(regexes.trimPath, MATCH_1)); // remove leading slash for valid path
            // if path is blank string, we set it to undefined, if '/' then single blank string array
            path = path ? (path === PATH_SEPARATOR ? [E] : path.split(PATH_SEPARATOR)) : undefined;
        }

        // expand host string
        _.isString(host) && (host = host.split(regexes.splitDomain));

        _.assign(this, /** @lends Url.prototype */ {
            /**
             * @type {String}
             */
            auth: auth,

            /**
             * @type {String}
             */
            protocol: protocol,

            /**
             * @type {String}
             */
            port: port || undefined,

            /**
             * @type {Array<String>}
             */
            path: path,

            /**
             * @type {String}
             */
            hash: hash || undefined,

            /**
             * @type {Array<String>}
             */
            host: host,

            /**
             * @type {PropertyList<QueryParam>}
             */
            query: new PropertyList(QueryParam, this, query || []),

            /**
             * @type {VariableList}
             */
            variables: new VariableList(this, variable || [])
        });
    }
485415
def parse_link(value):
    

    links = []

    replace_chars = ' \'"'

    value = value.strip(replace_chars)
    if not value:
        return links

    for val in re.split(', *<', value):
        try:
            url, params = val.split(';', 1)
        except ValueError:
            url, params = val, ''

        link = {'url': url.strip('<> \'"')}

        for param in params.split(';'):
            try:
                key, value = param.split('=')
            except ValueError:
                break

            link[key.strip(replace_chars)] = value.strip(replace_chars)

        links.append(link)

    return links