code: def baseDomain(domain, includeScheme=True):
      
      result = ''
      url    = urlparse(domain)
      if includeScheme:
          result = '%s://' % url.scheme
      if len(url.netloc) == 0:
          result += url.path
      else:
          result += url.netloc
      return result
docs: Return only the network location portion of the given domain
      unless includeScheme is True