def _cleanup(self, dt):
        '''This method is scheduled from _complete_dispatcher to clean up the
        canvas and internal gesture list after a gesture is completed.'''
        m = UNDERSHOOT_MARGIN
        rg = self.canvas.remove_group
        gestures = self._gestures
        for idx, g in enumerate(gestures):
            if g._cleanup_time is None:
                continue
            if g._cleanup_time <= Clock.get_time() + m:
                rg(g.id)
                del gestures[idx]
                self.dispatch('on_gesture_cleanup', g)
dataset/ETHPy150Open kivy/kivy/kivy/uix/gesturesurface.py/GestureSurface._cleanup/original