@mode.setter
    def mode(self, mode):
        if hasattr(self, '_pin_mode'):
            raise AttributeError("'mode' cannot be modified after Pin object is created")
        if mode not in PIN_MODES:
            raise ValueError("'mode' must be one of: {0}".format(', '.join(PIN_MODES)))
        self._pin_mode = mode
dataset/ETHPy150Open projectweekend/Pi-Pin-Manager/pi_pin_manager/pins.py/Pin.mode/original