def event(self, button):
<EOL>if self.timer:<EOL><INDENT>self.timer.cancel()<EOL><DEDENT>if self.last_button != button:<EOL><INDENT>if self.last_button:<EOL><INDENT>self.trigger()<EOL><DEDENT>self.clicks = <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>self.clicks += <NUM_LIT:1><EOL><DEDENT>button_index = min(button, len(self.callbacks)) - <NUM_LIT:1><EOL>if not self.callbacks[button_index][<NUM_LIT:1>]:<EOL><INDENT>self.clicks = <NUM_LIT:1><EOL>self.last_button = button<EOL>self.trigger()<EOL><DEDENT>else:<EOL><INDENT>self.last_button = button<EOL>self.timer = Timer(self.click_time, self.trigger)<EOL>self.timer.start()<EOL><DEDENT>
button has been clicked