<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_events(self):
 """Return a set of events. Which have been occured since the last call of this method. This method should be called regulary to get all occuring Events. There are three different Event types/classes which can be returned: - DeviceStateChangedEvent, if any device changed it's state due to an applied action or just because of other reasons - CommandExecutionStateChangedEvent, a executed command goes through several phases which can be followed - ExecutionStateChangedEvent, ******** todo :return: an array of Events or empty array :rtype: list raises ValueError in case of protocol issues :Seealso: - apply_actions - launch_action_group - get_history """

        header = BASE_HEADERS.copy()
        header['Cookie'] = self.__cookie

        request = requests.post(BASE_URL + 'getEvents',
                                headers=header,
                                timeout=10)

        if request.status_code != 200:
            self.__logged_in = False
            self.login()
            self.get_events()
            return

        try:
            result = request.json()
        except ValueError as error:
            raise Exception(
                "Not a valid result for getEvent," +
                " protocol error: " + error)

        return self._get_events(result)