code: def urlparse(url):
      
      value = 'http%s' % url[5:] if url[:5] == 'postgresql' else url
      parsed = _urlparse.urlparse(value)
      path, query = parsed.path, parsed.query
      hostname = parsed.hostname if parsed.hostname else ''
      return PARSED(parsed.scheme.replace('http', 'postgresql'),
                    parsed.netloc,
                    path,
                    parsed.params,
                    query,
                    parsed.fragment,
                    parsed.username,
                    parsed.password,
                    hostname.replace('%2f', '/'),
                    parsed.port)
docs: Parse the URL in a Python2/3 independent fashion.
  
      :param str url: The URL to parse
      :rtype: Parsed