code: def parse_netloc(scheme, netloc):
      
      auth, _netloc = netloc.split('@')
      sender, token = auth.split(':')
      if ':' in _netloc:
          domain, port = _netloc.split(':')
          port = int(port)
      else:
          domain = _netloc
          if scheme == 'https':
              port = 443
          else:
              port = 80
      return dict(sender=sender, token=token, domain=domain, port=port)
docs: Parse netloc string.