<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check_presses(self):
 """ Return the set of Buttons which have been pressed since this call was last made, clearing it as we do. :return: A ButtonPresses instance which contains buttons which were pressed since this call was last made. """

        pressed = []
        for button, state in self.buttons.items():
            if state.was_pressed_since_last_check:
                pressed.append(button)
                state.was_pressed_since_last_check = False
        self.__presses = ButtonPresses(pressed)
        return self.__presses