prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  [examples] installation of latest kivy-examples package fails
  Looks like there is a simple syntax problem in an example...
  Beleave it is not py3 compatible :/
  
  Package: kivy-examples (1.8.1-daily0+201405040547-2023-testing42~ubuntu14.04.1)
  
  ```
    File "/usr/share/kivy-examples/widgets/compound_selection.py", line 17
      print [x.text for x in self.selected_nodes]
                      ^
  SyntaxError: invalid syntax
  ```
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `examples/widgets/compound_selection.py`
  Content:
  ```
  1 from kivy.uix.gridlayout import GridLayout
  2 from kivy.uix.button import Button
  3 from kivy.uix.behaviors import CompoundSelectionBehavior
  4 from kivy.app import runTouchApp
  5 from kivy.core.window import Window
  6 
  7 
  8 class SelectableGrid(CompoundSelectionBehavior, GridLayout):
  9 
  10     def __init__(self, **kwargs):
  11         super(SelectableGrid, self).__init__(**kwargs)
  12         keyboard = Window.request_keyboard(None, self)
  13         keyboard.bind(on_key_down=self.select_with_key_down,
  14                       on_key_up=self.select_with_key_up)
  15 
  16         def print_selection(*l):
  17             print(x.text for x in self.selected_nodes)
  18         self.bind(selected_nodes=print_selection)
  19 
  20     def goto_node(self, key, last_node, last_node_idx):
  21         ''' This function is used to go to the node by typing the number
  22         of the text of the button.
  23         '''
  24         node, idx = super(SelectableGrid, self).goto_node(key, last_node,
  25                                                           last_node_idx)
  26         if node == last_node:
  27             children = self.children
  28             for i in range(len(children)):
  29                 if children[i].text == key:
  30                     return children[i], i
  31         return node, idx
  32 
  33     def select_node(self, node):
  34         node.background_color = (1, 0, 0, 1)
  35         return super(SelectableGrid, self).select_node(node)
  36 
  37     def deselect_node(self, node):
  38         node.background_color = (1, 1, 1, 1)
  39         super(SelectableGrid, self).deselect_node(node)
  40 
  41     def do_touch(self, instance, touch):
  42         if ('button' in touch.profile and touch.button in
  43             ('scrollup', 'scrolldown', 'scrollleft', 'scrollright')) or\
  44             instance.collide_point(*touch.pos):
  45             self.select_with_touch(instance, touch)
  46         else:
  47             return False
  48         return True
  49 
  50 
  51 root = SelectableGrid(cols=5, up_count=5, multiselect=True, scroll_count=1)
  52 for i in range(40):
  53     c = Button(text=str(i))
  54     c.bind(on_touch_down=root.do_touch)
  55     root.add_widget(c)
  56 
  57 runTouchApp(root)
  58
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/examples/widgets/compound_selection.py b/examples/widgets/compound_selection.py
  --- a/examples/widgets/compound_selection.py
  +++ b/examples/widgets/compound_selection.py
  @@ -14,7 +14,7 @@
                         on_key_up=self.select_with_key_up)
   
           def print_selection(*l):
  -            print(x.text for x in self.selected_nodes)
  +            print([x.text for x in self.selected_nodes])
           self.bind(selected_nodes=print_selection)
   
       def goto_node(self, key, last_node, last_node_idx):
  
verification_info: {"golden_diff": "diff --git a/examples/widgets/compound_selection.py b/examples/widgets/compound_selection.py\n--- a/examples/widgets/compound_selection.py\n+++ b/examples/widgets/compound_selection.py\n@@ -14,7 +14,7 @@\n                       on_key_up=self.select_with_key_up)\n \n         def print_selection(*l):\n-            print(x.text for x in self.selected_nodes)\n+            print([x.text for x in self.selected_nodes])\n         self.bind(selected_nodes=print_selection)\n \n     def goto_node(self, key, last_node, last_node_idx):\n", "issue": "[examples] installation of latest kivy-examples package fails\nLooks like there is a simple syntax problem in an example...\nBeleave it is not py3 compatible :/\n\nPackage: kivy-examples (1.8.1-daily0+201405040547-2023-testing42~ubuntu14.04.1)\n\n```\n  File \"/usr/share/kivy-examples/widgets/compound_selection.py\", line 17\n    print [x.text for x in self.selected_nodes]\n                    ^\nSyntaxError: invalid syntax\n```\n\n", "before_files": [{"content": "from kivy.uix.gridlayout import GridLayout\nfrom kivy.uix.button import Button\nfrom kivy.uix.behaviors import CompoundSelectionBehavior\nfrom kivy.app import runTouchApp\nfrom kivy.core.window import Window\n\n\nclass SelectableGrid(CompoundSelectionBehavior, GridLayout):\n\n    def __init__(self, **kwargs):\n        super(SelectableGrid, self).__init__(**kwargs)\n        keyboard = Window.request_keyboard(None, self)\n        keyboard.bind(on_key_down=self.select_with_key_down,\n                      on_key_up=self.select_with_key_up)\n\n        def print_selection(*l):\n            print(x.text for x in self.selected_nodes)\n        self.bind(selected_nodes=print_selection)\n\n    def goto_node(self, key, last_node, last_node_idx):\n        ''' This function is used to go to the node by typing the number\n        of the text of the button.\n        '''\n        node, idx = super(SelectableGrid, self).goto_node(key, last_node,\n                                                          last_node_idx)\n        if node == last_node:\n            children = self.children\n            for i in range(len(children)):\n                if children[i].text == key:\n                    return children[i], i\n        return node, idx\n\n    def select_node(self, node):\n        node.background_color = (1, 0, 0, 1)\n        return super(SelectableGrid, self).select_node(node)\n\n    def deselect_node(self, node):\n        node.background_color = (1, 1, 1, 1)\n        super(SelectableGrid, self).deselect_node(node)\n\n    def do_touch(self, instance, touch):\n        if ('button' in touch.profile and touch.button in\n            ('scrollup', 'scrolldown', 'scrollleft', 'scrollright')) or\\\n            instance.collide_point(*touch.pos):\n            self.select_with_touch(instance, touch)\n        else:\n            return False\n        return True\n\n\nroot = SelectableGrid(cols=5, up_count=5, multiselect=True, scroll_count=1)\nfor i in range(40):\n    c = Button(text=str(i))\n    c.bind(on_touch_down=root.do_touch)\n    root.add_widget(c)\n\nrunTouchApp(root)\n", "path": "examples/widgets/compound_selection.py"}], "after_files": [{"content": "from kivy.uix.gridlayout import GridLayout\nfrom kivy.uix.button import Button\nfrom kivy.uix.behaviors import CompoundSelectionBehavior\nfrom kivy.app import runTouchApp\nfrom kivy.core.window import Window\n\n\nclass SelectableGrid(CompoundSelectionBehavior, GridLayout):\n\n    def __init__(self, **kwargs):\n        super(SelectableGrid, self).__init__(**kwargs)\n        keyboard = Window.request_keyboard(None, self)\n        keyboard.bind(on_key_down=self.select_with_key_down,\n                      on_key_up=self.select_with_key_up)\n\n        def print_selection(*l):\n            print([x.text for x in self.selected_nodes])\n        self.bind(selected_nodes=print_selection)\n\n    def goto_node(self, key, last_node, last_node_idx):\n        ''' This function is used to go to the node by typing the number\n        of the text of the button.\n        '''\n        node, idx = super(SelectableGrid, self).goto_node(key, last_node,\n                                                          last_node_idx)\n        if node == last_node:\n            children = self.children\n            for i in range(len(children)):\n                if children[i].text == key:\n                    return children[i], i\n        return node, idx\n\n    def select_node(self, node):\n        node.background_color = (1, 0, 0, 1)\n        return super(SelectableGrid, self).select_node(node)\n\n    def deselect_node(self, node):\n        node.background_color = (1, 1, 1, 1)\n        super(SelectableGrid, self).deselect_node(node)\n\n    def do_touch(self, instance, touch):\n        if ('button' in touch.profile and touch.button in\n            ('scrollup', 'scrolldown', 'scrollleft', 'scrollright')) or\\\n            instance.collide_point(*touch.pos):\n            self.select_with_touch(instance, touch)\n        else:\n            return False\n        return True\n\n\nroot = SelectableGrid(cols=5, up_count=5, multiselect=True, scroll_count=1)\nfor i in range(40):\n    c = Button(text=str(i))\n    c.bind(on_touch_down=root.do_touch)\n    root.add_widget(c)\n\nrunTouchApp(root)\n", "path": "examples/widgets/compound_selection.py"}]}