code: def urlsplit(url):
      
      proto, rest = url.split(':', 1)
      host = ''
      if rest[:2] == '//':
          host, rest = rest[2:].split('/', 1)
          rest = '/' + rest
      return proto, host, rest
docs: Split an arbitrary url into protocol, host, rest
  
      The standard urlsplit does not want to provide 'netloc' for arbitrary
      protocols, this works around that.
  
      :param url: The url to split into component parts