def is_subdomain(subdomain, base):
 return ((subdomain == base) or ((subdomain is not None) and subdomain.endswith(('.' + base))))

def is_subdomain ( subdomain , base ) : return ( ( subdomain == base ) or ( ( subdomain is not None ) and subdomain . endswith ( ( '.' + base ) ) ) )
check if a domain is equal to or a subdomain of a base domain .