The default parser for an URI
 === arguments
 * +request+ -    A Rack::Request with our monkey patch to access :uri
503010
def parse_uri(request)
			@uri_parser ||= self.uri_parser
			ast = @uri_parser.parse(request.path)
			values = request.params
			ast.children_names.each { |name|
				case name
				when'language', 'flavor', 'event', 'zone'
# 					values.add(name, ast.send(name).value)
				when 'variables'
					ast.variables.each { |pair|
						key = pair.key.value
						val = if(pair.children_names.include?('value'))
							CGI.unescape(pair.value.value.to_s)
						else
							''
						end
						request.update_param(key, val)
					}
				end
			}
		end
479013
function parseUri(uri) {
  if (uri instanceof Array) {
    uri = eut(uri[0], uri[1]);
  }

  return baseUrl + uri;
}
1253228
def to_uri(rss)
      return rss if rss.is_a?(::URI::Generic)

      begin
        ::URI.parse(rss)
      rescue ::URI::Error
        rss
      end
    end
275878
def parseUri(stream, uri=None):
    """"""
    return etree.parse(stream, parser=_get_xmlparser(), base_url=uri)
1075515
def translate_uri(request)
			@@empty_check ||= Regexp.new('^/?$')
			@@lang_check ||= Regexp.new('^/[a-z]{2}(/|$)')
      uri = request.path
      request.uri ||= uri
      config = config(request)
      handle_shortcut(request, config)
      case uri
      when @@empty_check
        request.uri = config['redirect']['/'] ||= @handler_uri
      when @@lang_check
        begin
          self.parse_uri(request)
        rescue LoadError # this happens often
          res = simple_parse_uri(request)
        end
        request.uri = @handler_uri
      end
      Apache::DECLINED
		end
308075
def get_request(url,args)
      uri = URI.parse url

      # ck is the current unix timestamp
      args[:ck] = Time.now.to_i unless args[:ck]

      req = Net::HTTP::Get.new("#{uri.path}?#{argument_string(args)}")
      request(uri,req)
    end
801829
def _urlnorm(cls, uri):
        """"""
        (scheme, authority, path, query, fragment) = parse_uri(uri)
        if not scheme or not authority:
            raise Exception("Only absolute URIs are allowed. uri = %s" % uri)

        scheme = scheme.lower()
        authority = authority.lower()

        if not path:
            path = "/"

        # Could do syntax based normalization of the URI before
        # computing the digest. See Section 6.2.2 of Std 66.
        request_uri = query and "?".join([path, query]) or path
        defrag_uri = scheme + "://" + authority + request_uri

        return defrag_uri
583880
def build_request(verb, uri, opts = {}) # rubocop:disable Style/OptionHash
      opts    = @default_options.merge(opts)
      uri     = make_request_uri(uri, opts)
      headers = make_request_headers(opts)
      body    = make_request_body(opts, headers)

      req = HTTP::Request.new(
        :verb           => verb,
        :uri            => uri,
        :uri_normalizer => opts.feature(:normalize_uri)&.normalizer,
        :proxy          => opts.proxy,
        :headers        => headers,
        :body           => body
      )

      opts.features.inject(req) do |request, (_name, feature)|
        feature.wrap_request(request)
      end
    end
703445
def to_uri(url)
      uri = URI.parse(url)
      uri.host.nil? ? false : uri
    rescue URI::BadURIError
      false
    rescue URI::InvalidURIError
      false
    end
1025496
def parse_uri(self, uri=None):

		'''
		
		'''

		# no uri provided, assume root
		if not uri:
			return rdflib.term.URIRef(self.root)

		# string uri provided
		elif type(uri) == str:

			# assume "short" uri, expand with repo root
			if type(uri) == str and not uri.startswith('http'):
				return rdflib.term.URIRef("%s%s" % (self.root, uri))

			# else, assume full uri
			else:
				return rdflib.term.URIRef(uri)

		# already rdflib.term.URIRef
		elif type(uri) == rdflib.term.URIRef:
			return uri

		# unknown input
		else:
			raise TypeError('invalid URI input')
1124764
def call(env)
      # calling env.dup here prevents bad things from happening
      request = Rack::Request.new(env.dup)

      # calling request.params is sufficient to trigger the error see
      # https://github.com/rack/rack/issues/337#issuecomment-46453404
      request.params
      @app.call(env)

    # Rescue from that specific ArgumentError
    rescue ArgumentError => e
      raise unless e.message =~ /invalid %-encoding/

      @logger.info "Bad request. Returning 400 due to #{e.message} from " + \
                   "request with env #{request.inspect}"
      error_response
    end
1103250
def parse(h={:collect => {}, :ignore_without => {}})
      self.rebuild_collect_hash(h)

      parser = Parser.new(self.argument.url, h[:user_agent] || DEFAULT_USER_AGENT)
      if h[:any_looks_like_image]
        parser.get_content_raw
        parser.get_images_raw(self.argument.path, h[:collect])
      elsif h[:regexp]
        parser.get_content_raw
        parser.get_images_regexp(self.argument.path, h[:regexp])
      else
        parser.get_content
        parser.get_images(self.argument.path, h[:collect])
      end

      parser.ignore_file_without(h[:ignore_without])

      self.images = parser.images
    end
1241479
def split_file_uri(uri)
      scheme, _, host, _, _, path, _, query, _ = URI.split(uri)

      path = URI::Generic::DEFAULT_PARSER.unescape(path)
      path.force_encoding(Encoding::UTF_8)

      # Hack for parsing Windows "/C:/Users/IEUser" paths
      if File::ALT_SEPARATOR && path[2] == ':'
        path = path[1..-1]
      end

      [scheme, host, path, query]
    end
1226605
def get_symbolized_path(request)
      request_path = (request.env['REQUEST_URI'] || request.path).dup
      request_params =
        request.env['action_dispatch.request.parameters'] ||
        request.env['rack.request.form_hash'] ||
        request.env['rack.request.query_hash']

      if request_params
        request_params
          .except(*EXCLUDE_PARAMS)
          .select { |_, value| value.is_a?(String) }
          .each { |key, value| request_path.sub!("/#{value}", "/:#{key}") if value.to_s != '' }
      end

      request_path.freeze
    end
642853
def parse_params(params)
      args = params.split(/\s+/).map(&:strip)
      invalid_args!(args) unless args.any?

      if args[0].to_s == OEMBED_ARG # TODO: remove after deprecation cycle
        arguments_deprecation_warning(args)
        args.shift
      end

      url, *api_args = args
      ApiRequest.new(url, parse_args(api_args))
    end
361138
def parseURIRaw(str, raw):
    
    ret = libxml2mod.xmlParseURIRaw(str, raw)
    if ret is None:raise uriError('xmlParseURIRaw() failed')
    return URI(_obj=ret)
429967
def _view_url(preference)
      uri = URI(request.url)
      query = Rack::Utils.parse_nested_query(uri.query)
      query["prefer"] = preference
      uri.query = query.to_param
      uri.to_s
    end