<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_state(self, state):
 """ Set the state of this device to on or off. """

        self.basicevent.SetBinaryState(BinaryState=int(state))
        self._state = int(state)