code: def get_base_url(url, include_path=False):
      
  
      if not url:
          return None
  
      parts = _urlsplit(url)
      base_url = _urlunsplit((
          parts.scheme, parts.netloc, (parts.path if include_path else ''), None, None
      ))
  
      return base_url if base_url.endswith('/') else base_url + '/'
docs: :return: the url without the query or fragment segments