def tick(self, curtime, remove):
        # timeout happened ? (check also if we would miss from 5ms) this
        # 5ms increase the accuracy if the timing of animation for
        # example.
        if curtime - self._last_dt < self.timeout - 0.005:
            return True

        # calculate current timediff for this event
        self._dt = curtime - self._last_dt
        self._last_dt = curtime
        loop = self.loop

        # get the callback
        callback = self.get_callback()
        if callback is None:
            self._is_triggered = False
            try:
                remove(self)
            except ValueError:
                pass
            return False

        # if it's a trigger, allow to retrigger inside the callback
        # we have to remove event here, otherwise, if we remove later, the user
        # might have canceled in the callback and then re-triggered. That'd
        # result in the removal of the re-trigger
        if not loop:
            self._is_triggered = False
            try:
                remove(self)
            except ValueError:
                pass

        # call the callback
        ret = callback(self._dt)

        # if the user returns False explicitly, remove the event
        if loop and ret is False:
            self._is_triggered = False
            try:
                remove(self)
            except __HOLE__:
                pass
            return False
        return loop
dataset/ETHPy150Open kivy/kivy/kivy/clock.py/ClockEvent.tick