def get_switch_criteria(enduse, sector, crit_switch_happening, base_yr=
    False, curr_yr=False):
    """Test if switch is happending
    """
    if base_yr == curr_yr and (base_yr != False or curr_yr != False):
        crit_switch_service = False
    elif enduse in crit_switch_happening:
        if not crit_switch_happening[enduse] or not sector:
            crit_switch_service = True
        elif sector in crit_switch_happening[enduse]:
            crit_switch_service = True
        else:
            crit_switch_service = False
    else:
        crit_switch_service = False
    return crit_switch_service
