code: def parse_url(url):
      
      r = urlparse(url)
  
      assert r.scheme in ('', 'redis', 'rediss', 'unix'), (
          "Unsupported URI scheme", r.scheme)
      if r.scheme == '':
          return url, {}
      query = {}
      for p, v in parse_qsl(r.query, keep_blank_values=True):
          assert p not in query, ("Multiple parameters are not allowed", p, v)
          assert v, ("Empty parameters are not allowed", p, v)
          query[p] = v
  
      if r.scheme == 'unix':
          assert r.path, ("Empty path is not allowed", url)
          assert not r.netloc, (
              "Netlocation is not allowed for unix scheme", r.netloc)
          return r.path, _parse_uri_options(query, '', r.password)
  
      address = (r.hostname or 'localhost', int(r.port or 6379))
      path = r.path
      if path.startswith('/'):
          path = r.path[1:]
      options = _parse_uri_options(query, path, r.password)
      if r.scheme == 'rediss':
          options['ssl'] = True
      return address, options
docs: Parse Redis connection URI.
  
      Parse according to IANA specs:
      * https://www.iana.org/assignments/uri-schemes/prov/redis
      * https://www.iana.org/assignments/uri-schemes/prov/rediss
  
      Also more rules applied:
  
      * empty scheme is treated as unix socket path no further parsing is done.
  
      * 'unix://' scheme is treated as unix socket path and parsed.
  
      * Multiple query parameter values and blank values are considered error.
  
      * DB number specified as path and as query parameter is considered error.
  
      * Password specified in userinfo and as query parameter is
        considered error.