def _on_keyboard_handler(self, instance, key, *args):
        if key == 32:
            self.effect_index = (self.effect_index + 1) % 2
            childrens = self.effect.children[:]
            self.effect.clear_widgets()
            self.root.remove_widget(self.effect)
            self.effect = self.effects[self.effect_index]
            self.root.add_widget(self.effect)
            for child in reversed(childrens):
                self.effect.add_widget(child)
            self.label.text = self.effect.__class__.__name__
            Window.title = self.label.text
dataset/ETHPy150Open kivy/kivy/examples/svg/main-smaa.py/SvgApp._on_keyboard_handler/original