def aggregate_nuts(distribution, level):
    """
    Aggregates distributions to the desired NUTS level
    :param distribution: CostDistribution object
    :param level: Desired NUTS level, from 0 to 3
    :return: Aggregated CostDistribution
    """
    distribution.switch()
    distribution.match_this_nuts_regions(level)
    distribution = distribution.aggregate(True)
    distribution.match_this_nuts_regions(0)
    distribution.switch()
    return distribution