code: def parse_url(url, default_scheme='http', is_connect=False):
      
      # If this is not in origin-form, authority-form or asterisk-form and no
      # scheme is present, assume it's in absolute-form with a missing scheme.
      # See RFC7230 section 5.3.
      if url[:1] not in '*/' and not is_connect and '://' not in url:
          url = '{}://{}'.format(default_scheme, url)
      burl = s2b(url)
      parser = ffi.new('struct http_parser_url *')
      lib.http_parser_url_init(parser)
      res = lib.http_parser_parse_url(ffi.from_buffer(burl), len(burl), is_connect, parser)
      if res != 0:
          raise ValueError('invalid URL')
      parsed = ParsedUrl.from_parser(parser, url)
      return parsed
docs: Parse an URL and return its components.
  
      The *default_scheme* argument specifies the scheme in case URL is
      an otherwise valid absolute URL but with a missing scheme.
  
      The *is_connect* argument must be set to ``True`` if the URL was requested
      with the HTTP CONNECT method. These URLs have a different form and need to
      be parsed differently.
  
      The result is a :class:`ParsedUrl` containing the URL components.