def get_domain(url):
    domain = '{url.netloc}'.format(url=urlparse(url))
    if '.' in domain:
        return domain.split('.')[-2]
    return domain
Called to create a Canonicalbuilding from a single snapshot.
dataset/ETHPy150Open huntrar/scrape/scrape/utils.py/get_domain--crossover with--dataset/ETHPy150Open buildingenergy/buildingenergy-platform/seed/models.py/initialize_canonical_building