def METHOD_NAME(url):
    # This function extracts the domain name part of an URL.
    # It works indiscriminately on URLs or plain domains.
    res = tld_extract(url)
    if not res.subdomain or res.subdomain == "":
        return res.registered_domain
    else:
        return ".".join([res.subdomain, res.registered_domain])