def _handle_utility_data(bs, utility_dict, business=None):
    for util_datum in utility_dict:
        if util_datum in UTILITY_NAMES:
            # Here we get or create a utility model.
            electric, gas = UTILITY_NAMES
            # Since America Saves only cares about these two types.
            if util_datum == electric:
                util_type = ELECTRICITY
            else:
                util_type = NATURAL_GAS
            util, _ = Utility.objects.get_or_create(
                name=utility_dict[util_datum],
                utility_type=util_type
            )
            if business:
                util.business.add(business)
            else:
                util.building_snapshot.add(bs)

    # Iterate through the list twice because we need to make sure the
    # Utilities are saved first before we can make the accounts
    for util_datum in utility_dict:
        if util_datum in UTILITY_ACCOUNTS:
            # get the utility based on type and building_snapshot
            util = None
            if util_datum == 'electric_provider_account_number':
                if business:
                    util = Utility.objects.get(
                        business=business, utility_type=ELECTRICITY
                    )
                else:
                    util = Utility.objects.get(
                        building_snapshot=bs, utility_type=ELECTRICITY
                    )
            elif util_datum == 'natural_gas_provider_account_number':
                if business:
                    util = Utility.objects.get(
                        business=business, utility_type=NATURAL_GAS
                    )
                else:
                    util = Utility.objects.get(
                        building_snapshot=bs, utility_type=NATURAL_GAS
                    )

            if not util:
                continue

            util_account, _ = UtilityAccount.objects.get_or_create(
                utility=util,
                account_number=utility_dict[util_datum],
                canonical_building=bs.canonical_building
            )
            # If there's no utility, there's no sense in saving the account.

    return bs
Test if it runs a2enconf for the given conf.
dataset/ETHPy150Open buildingenergy/buildingenergy-platform/seed/models.py/_handle_utility_data--crossover with--dataset/ETHPy150Open saltstack/salt/tests/unit/modules/deb_apache_test.py/DebApacheTestCase.test_a2enconf