<commit_before>
VCC = 19

PIN_BY_ZONE = {}
PIN_BY_ZONE[1] = 6
PIN_BY_ZONE[2] = 13
PIN_BY_ZONE[3] = 12
PIN_BY_ZONE[4] = 16

ALL_PINS = [VCC] + PIN_BY_ZONE.values()

class ZoneService(object):

    def __init__(self, gpio):
        self._gpio = gpio
        self._gpio.setmode(gpio.BCM)
        self._gpio.setup(ALL_PINS, self._gpio.OUT)
        self._gpio.output(VCC, self._gpio.HIGH)

    def set_zone(self, zone_id):
        off_pins = [value for key, value in PIN_BY_ZONE.items() if key != zone_id]
        self._gpio.output(off_pins, self._gpio.HIGH)
        if zone_id in PIN_BY_ZONE:
            self._gpio.output(PIN_BY_ZONE[zone_id], self._gpio.LOW)

    def stop(self):
        self._gpio.output(VCC, self._gpio.LOW)<commit_msg>fix pin logic<commit_after>
VCC = 19

PIN_BY_ZONE = {}
PIN_BY_ZONE[1] = 6
PIN_BY_ZONE[2] = 13
PIN_BY_ZONE[3] = 12
PIN_BY_ZONE[4] = 16

ALL_PINS = [VCC] + PIN_BY_ZONE.values()

class ZoneService(object):

    def __init__(self, gpio):
        self._gpio = gpio
        self._gpio.setmode(gpio.BCM)
        self._gpio.setup(ALL_PINS, self._gpio.OUT)
        self._gpio.output(VCC, self._gpio.LOW)
        self._gpio.output(PIN_BY_ZONE.values(), self._gpio.HIGH)
        self._gpio.output(VCC, self._gpio.HIGH)

    def set_zone(self, zone_id):
        off_pins = [value for key, value in PIN_BY_ZONE.items() if key != zone_id]
        self._gpio.output(off_pins, self._gpio.HIGH)
        if zone_id in PIN_BY_ZONE:
            self._gpio.output(PIN_BY_ZONE[zone_id], self._gpio.LOW)

    def stop(self):
        self._gpio.output(VCC, self._gpio.LOW)
{'fraction_non_alphanumeric': 0.1294191919191919, 'fraction_numerical': 0.016414141414141416, 'mean_word_length': 2.9824120603015074, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5683061', 'n_tokens_mistral': 661, 'n_tokens_neox': 630, 'n_words': 109}