<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def wait_for_bump(self, buttons, timeout_ms=None):
 """ Wait for the button to be pressed down and then released. Both actions must happen within timeout_ms. """

        start_time = time.time()

        if self.wait_for_pressed(buttons, timeout_ms):
            if timeout_ms is not None:
                timeout_ms -= int((time.time() - start_time) * 1000)
            return self.wait_for_released(buttons, timeout_ms)

        return False