We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Notes tutorial crashes when adding a new note
https://github.com/kivy/kivy/blob/master/examples/tutorials/notes/final/main.py
Related to https://github.com/kivy/kivy/pull/3469.

``` python
 Traceback (most recent call last):
   File "E:\dev\envs\py34_x86\kivy\examples\tutorials\notes\final\main.py", line 158, in <module>
     NoteApp().run()
   File "e:\dev\envs\py34_x86\kivy\kivy\app.py", line 828, in run
     runTouchApp()
   File "e:\dev\envs\py34_x86\kivy\kivy\base.py", line 487, in runTouchApp
     EventLoop.window.mainloop()
   File "e:\dev\envs\py34_x86\kivy\kivy\core\window\window_sdl2.py", line 606, in mainloop
     self._mainloop()
   File "e:\dev\envs\py34_x86\kivy\kivy\core\window\window_sdl2.py", line 361, in _mainloop
     EventLoop.idle()
   File "e:\dev\envs\py34_x86\kivy\kivy\base.py", line 336, in idle
     Clock.tick_draw()
   File "e:\dev\envs\py34_x86\kivy\kivy\clock.py", line 490, in tick_draw
     self._process_events_before_frame()
   File "e:\dev\envs\py34_x86\kivy\kivy\clock.py", line 640, in _process_events_before_frame
     event.tick(self._last_tick, remove)
   File "e:\dev\envs\py34_x86\kivy\kivy\clock.py", line 374, in tick
     ret = callback(self._dt)
   File "e:\dev\envs\py34_x86\kivy\kivy\uix\listview.py", line 950, in _spopulate
     self.populate()
   File "e:\dev\envs\py34_x86\kivy\kivy\uix\listview.py", line 998, in populate
     item_view = self.adapter.get_view(index)
   File "e:\dev\envs\py34_x86\kivy\kivy\adapters\listadapter.py", line 211, in get_view
     item_view = self.create_view(index)
   File "e:\dev\envs\py34_x86\kivy\kivy\adapters\listadapter.py", line 234, in create_view
     view_instance = cls(**item_args)
   File "e:\dev\envs\py34_x86\kivy\kivy\uix\boxlayout.py", line 102, in __init__
     super(BoxLayout, self).__init__(**kwargs)
   File "e:\dev\envs\py34_x86\kivy\kivy\uix\layout.py", line 72, in __init__
     super(Layout, self).__init__(**kwargs)
   File "e:\dev\envs\py34_x86\kivy\kivy\uix\widget.py", line 312, in __init__
     super(Widget, self).__init__(**kwargs)
   File "kivy\_event.pyx", line 253, in kivy._event.EventDispatcher.__init__ (kivy\_event.c:4863)
 TypeError: object.__init__() takes no parameters
```


--- 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/tutorials/notes/final/main.py`
Content:
```
1 '''
2 Notes
3 =====
4 
5 Simple application for reading/writing notes.
6 
7 '''
8 
9 __version__ = '1.0'
10 
11 import json
12 from os.path import join, exists
13 from kivy.app import App
14 from kivy.uix.screenmanager import ScreenManager, Screen, SlideTransition
15 from kivy.properties import ListProperty, StringProperty, \
16         NumericProperty, BooleanProperty
17 from kivy.uix.boxlayout import BoxLayout
18 from kivy.uix.floatlayout import FloatLayout
19 from kivy.clock import Clock
20 
21 
22 class MutableTextInput(FloatLayout):
23 
24     text = StringProperty()
25     multiline = BooleanProperty(True)
26 
27     def __init__(self, **kwargs):
28         super(MutableTextInput, self).__init__(**kwargs)
29         Clock.schedule_once(self.prepare, 0)
30 
31     def prepare(self, *args):
32         self.w_textinput = self.ids.w_textinput.__self__
33         self.w_label = self.ids.w_label.__self__
34         self.view()
35 
36     def on_touch_down(self, touch):
37         if self.collide_point(*touch.pos) and touch.is_double_tap:
38             self.edit()
39             return True
40         return super(MutableTextInput, self).on_touch_down(touch)
41 
42     def edit(self):
43         self.clear_widgets()
44         self.add_widget(self.w_textinput)
45         self.w_textinput.focus = True
46 
47     def view(self):
48         self.clear_widgets()
49         self.add_widget(self.w_label)
50 
51     def check_focus_and_view(self, textinput):
52         if not textinput.focus:
53             self.text = textinput.text
54             self.view()
55 
56 
57 class NoteView(Screen):
58 
59     note_index = NumericProperty()
60     note_title = StringProperty()
61     note_content = StringProperty()
62 
63 
64 class NoteListItem(BoxLayout):
65 
66     note_title = StringProperty()
67     note_index = NumericProperty()
68 
69 
70 class Notes(Screen):
71 
72     data = ListProperty()
73 
74     def args_converter(self, row_index, item):
75         return {
76             'note_index': row_index,
77             'note_content': item['content'],
78             'note_title': item['title']}
79 
80 
81 class NoteApp(App):
82 
83     def build(self):
84         self.notes = Notes(name='notes')
85         self.load_notes()
86 
87         self.transition = SlideTransition(duration=.35)
88         root = ScreenManager(transition=self.transition)
89         root.add_widget(self.notes)
90         return root
91 
92     def load_notes(self):
93         if not exists(self.notes_fn):
94             return
95         with open(self.notes_fn, 'rb') as fd:
96             data = json.load(fd)
97         self.notes.data = data
98 
99     def save_notes(self):
100         with open(self.notes_fn, 'wb') as fd:
101             json.dump(self.notes.data, fd)
102 
103     def del_note(self, note_index):
104         del self.notes.data[note_index]
105         self.save_notes()
106         self.refresh_notes()
107         self.go_notes()
108 
109     def edit_note(self, note_index):
110         note = self.notes.data[note_index]
111         name = 'note{}'.format(note_index)
112 
113         if self.root.has_screen(name):
114             self.root.remove_widget(self.root.get_screen(name))
115 
116         view = NoteView(
117             name=name,
118             note_index=note_index,
119             note_title=note.get('title'),
120             note_content=note.get('content'))
121 
122         self.root.add_widget(view)
123         self.transition.direction = 'left'
124         self.root.current = view.name
125 
126     def add_note(self):
127         self.notes.data.append({'title': 'New note', 'content': ''})
128         note_index = len(self.notes.data) - 1
129         self.edit_note(note_index)
130 
131     def set_note_content(self, note_index, note_content):
132         self.notes.data[note_index]['content'] = note_content
133         data = self.notes.data
134         self.notes.data = []
135         self.notes.data = data
136         self.save_notes()
137         self.refresh_notes()
138 
139     def set_note_title(self, note_index, note_title):
140         self.notes.data[note_index]['title'] = note_title
141         self.save_notes()
142         self.refresh_notes()
143 
144     def refresh_notes(self):
145         data = self.notes.data
146         self.notes.data = []
147         self.notes.data = data
148 
149     def go_notes(self):
150         self.transition.direction = 'right'
151         self.root.current = 'notes'
152 
153     @property
154     def notes_fn(self):
155         return join(self.user_data_dir, 'notes.json')
156 
157 if __name__ == '__main__':
158     NoteApp().run()
159
```
--- 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()

```

diff --git a/examples/tutorials/notes/final/main.py b/examples/tutorials/notes/final/main.py
--- a/examples/tutorials/notes/final/main.py
+++ b/examples/tutorials/notes/final/main.py
@@ -36,7 +36,6 @@
     def on_touch_down(self, touch):
         if self.collide_point(*touch.pos) and touch.is_double_tap:
             self.edit()
-            return True
         return super(MutableTextInput, self).on_touch_down(touch)
 
     def edit(self):
@@ -63,6 +62,11 @@
 
 class NoteListItem(BoxLayout):
 
+    def __init__(self, **kwargs):
+        print(kwargs)
+        del kwargs['index']
+        super(NoteListItem, self).__init__(**kwargs)
+    note_content = StringProperty()
     note_title = StringProperty()
     note_index = NumericProperty()
 
@@ -92,12 +96,12 @@
     def load_notes(self):
         if not exists(self.notes_fn):
             return
-        with open(self.notes_fn, 'rb') as fd:
+        with open(self.notes_fn) as fd:
             data = json.load(fd)
         self.notes.data = data
 
     def save_notes(self):
-        with open(self.notes_fn, 'wb') as fd:
+        with open(self.notes_fn, 'w') as fd:
             json.dump(self.notes.data, fd)
 
     def del_note(self, note_index):

{"golden_diff": "diff --git a/examples/tutorials/notes/final/main.py b/examples/tutorials/notes/final/main.py\n--- a/examples/tutorials/notes/final/main.py\n+++ b/examples/tutorials/notes/final/main.py\n@@ -36,7 +36,6 @@\n     def on_touch_down(self, touch):\n         if self.collide_point(*touch.pos) and touch.is_double_tap:\n             self.edit()\n-            return True\n         return super(MutableTextInput, self).on_touch_down(touch)\n \n     def edit(self):\n@@ -63,6 +62,11 @@\n \n class NoteListItem(BoxLayout):\n \n+    def __init__(self, **kwargs):\n+        print(kwargs)\n+        del kwargs['index']\n+        super(NoteListItem, self).__init__(**kwargs)\n+    note_content = StringProperty()\n     note_title = StringProperty()\n     note_index = NumericProperty()\n \n@@ -92,12 +96,12 @@\n     def load_notes(self):\n         if not exists(self.notes_fn):\n             return\n-        with open(self.notes_fn, 'rb') as fd:\n+        with open(self.notes_fn) as fd:\n             data = json.load(fd)\n         self.notes.data = data\n \n     def save_notes(self):\n-        with open(self.notes_fn, 'wb') as fd:\n+        with open(self.notes_fn, 'w') as fd:\n             json.dump(self.notes.data, fd)\n \n     def del_note(self, note_index):\n", "issue": "Notes tutorial crashes when adding a new note\nhttps://github.com/kivy/kivy/blob/master/examples/tutorials/notes/final/main.py\nRelated to https://github.com/kivy/kivy/pull/3469.\n\n``` python\n Traceback (most recent call last):\n   File \"E:\\dev\\envs\\py34_x86\\kivy\\examples\\tutorials\\notes\\final\\main.py\", line 158, in <module>\n     NoteApp().run()\n   File \"e:\\dev\\envs\\py34_x86\\kivy\\kivy\\app.py\", line 828, in run\n     runTouchApp()\n   File \"e:\\dev\\envs\\py34_x86\\kivy\\kivy\\base.py\", line 487, in runTouchApp\n     EventLoop.window.mainloop()\n   File \"e:\\dev\\envs\\py34_x86\\kivy\\kivy\\core\\window\\window_sdl2.py\", line 606, in mainloop\n     self._mainloop()\n   File \"e:\\dev\\envs\\py34_x86\\kivy\\kivy\\core\\window\\window_sdl2.py\", line 361, in _mainloop\n     EventLoop.idle()\n   File \"e:\\dev\\envs\\py34_x86\\kivy\\kivy\\base.py\", line 336, in idle\n     Clock.tick_draw()\n   File \"e:\\dev\\envs\\py34_x86\\kivy\\kivy\\clock.py\", line 490, in tick_draw\n     self._process_events_before_frame()\n   File \"e:\\dev\\envs\\py34_x86\\kivy\\kivy\\clock.py\", line 640, in _process_events_before_frame\n     event.tick(self._last_tick, remove)\n   File \"e:\\dev\\envs\\py34_x86\\kivy\\kivy\\clock.py\", line 374, in tick\n     ret = callback(self._dt)\n   File \"e:\\dev\\envs\\py34_x86\\kivy\\kivy\\uix\\listview.py\", line 950, in _spopulate\n     self.populate()\n   File \"e:\\dev\\envs\\py34_x86\\kivy\\kivy\\uix\\listview.py\", line 998, in populate\n     item_view = self.adapter.get_view(index)\n   File \"e:\\dev\\envs\\py34_x86\\kivy\\kivy\\adapters\\listadapter.py\", line 211, in get_view\n     item_view = self.create_view(index)\n   File \"e:\\dev\\envs\\py34_x86\\kivy\\kivy\\adapters\\listadapter.py\", line 234, in create_view\n     view_instance = cls(**item_args)\n   File \"e:\\dev\\envs\\py34_x86\\kivy\\kivy\\uix\\boxlayout.py\", line 102, in __init__\n     super(BoxLayout, self).__init__(**kwargs)\n   File \"e:\\dev\\envs\\py34_x86\\kivy\\kivy\\uix\\layout.py\", line 72, in __init__\n     super(Layout, self).__init__(**kwargs)\n   File \"e:\\dev\\envs\\py34_x86\\kivy\\kivy\\uix\\widget.py\", line 312, in __init__\n     super(Widget, self).__init__(**kwargs)\n   File \"kivy\\_event.pyx\", line 253, in kivy._event.EventDispatcher.__init__ (kivy\\_event.c:4863)\n TypeError: object.__init__() takes no parameters\n```\n\n", "before_files": [{"content": "'''\nNotes\n=====\n\nSimple application for reading/writing notes.\n\n'''\n\n__version__ = '1.0'\n\nimport json\nfrom os.path import join, exists\nfrom kivy.app import App\nfrom kivy.uix.screenmanager import ScreenManager, Screen, SlideTransition\nfrom kivy.properties import ListProperty, StringProperty, \\\n        NumericProperty, BooleanProperty\nfrom kivy.uix.boxlayout import BoxLayout\nfrom kivy.uix.floatlayout import FloatLayout\nfrom kivy.clock import Clock\n\n\nclass MutableTextInput(FloatLayout):\n\n    text = StringProperty()\n    multiline = BooleanProperty(True)\n\n    def __init__(self, **kwargs):\n        super(MutableTextInput, self).__init__(**kwargs)\n        Clock.schedule_once(self.prepare, 0)\n\n    def prepare(self, *args):\n        self.w_textinput = self.ids.w_textinput.__self__\n        self.w_label = self.ids.w_label.__self__\n        self.view()\n\n    def on_touch_down(self, touch):\n        if self.collide_point(*touch.pos) and touch.is_double_tap:\n            self.edit()\n            return True\n        return super(MutableTextInput, self).on_touch_down(touch)\n\n    def edit(self):\n        self.clear_widgets()\n        self.add_widget(self.w_textinput)\n        self.w_textinput.focus = True\n\n    def view(self):\n        self.clear_widgets()\n        self.add_widget(self.w_label)\n\n    def check_focus_and_view(self, textinput):\n        if not textinput.focus:\n            self.text = textinput.text\n            self.view()\n\n\nclass NoteView(Screen):\n\n    note_index = NumericProperty()\n    note_title = StringProperty()\n    note_content = StringProperty()\n\n\nclass NoteListItem(BoxLayout):\n\n    note_title = StringProperty()\n    note_index = NumericProperty()\n\n\nclass Notes(Screen):\n\n    data = ListProperty()\n\n    def args_converter(self, row_index, item):\n        return {\n            'note_index': row_index,\n            'note_content': item['content'],\n            'note_title': item['title']}\n\n\nclass NoteApp(App):\n\n    def build(self):\n        self.notes = Notes(name='notes')\n        self.load_notes()\n\n        self.transition = SlideTransition(duration=.35)\n        root = ScreenManager(transition=self.transition)\n        root.add_widget(self.notes)\n        return root\n\n    def load_notes(self):\n        if not exists(self.notes_fn):\n            return\n        with open(self.notes_fn, 'rb') as fd:\n            data = json.load(fd)\n        self.notes.data = data\n\n    def save_notes(self):\n        with open(self.notes_fn, 'wb') as fd:\n            json.dump(self.notes.data, fd)\n\n    def del_note(self, note_index):\n        del self.notes.data[note_index]\n        self.save_notes()\n        self.refresh_notes()\n        self.go_notes()\n\n    def edit_note(self, note_index):\n        note = self.notes.data[note_index]\n        name = 'note{}'.format(note_index)\n\n        if self.root.has_screen(name):\n            self.root.remove_widget(self.root.get_screen(name))\n\n        view = NoteView(\n            name=name,\n            note_index=note_index,\n            note_title=note.get('title'),\n            note_content=note.get('content'))\n\n        self.root.add_widget(view)\n        self.transition.direction = 'left'\n        self.root.current = view.name\n\n    def add_note(self):\n        self.notes.data.append({'title': 'New note', 'content': ''})\n        note_index = len(self.notes.data) - 1\n        self.edit_note(note_index)\n\n    def set_note_content(self, note_index, note_content):\n        self.notes.data[note_index]['content'] = note_content\n        data = self.notes.data\n        self.notes.data = []\n        self.notes.data = data\n        self.save_notes()\n        self.refresh_notes()\n\n    def set_note_title(self, note_index, note_title):\n        self.notes.data[note_index]['title'] = note_title\n        self.save_notes()\n        self.refresh_notes()\n\n    def refresh_notes(self):\n        data = self.notes.data\n        self.notes.data = []\n        self.notes.data = data\n\n    def go_notes(self):\n        self.transition.direction = 'right'\n        self.root.current = 'notes'\n\n    @property\n    def notes_fn(self):\n        return join(self.user_data_dir, 'notes.json')\n\nif __name__ == '__main__':\n    NoteApp().run()\n", "path": "examples/tutorials/notes/final/main.py"}], "after_files": [{"content": "'''\nNotes\n=====\n\nSimple application for reading/writing notes.\n\n'''\n\n__version__ = '1.0'\n\nimport json\nfrom os.path import join, exists\nfrom kivy.app import App\nfrom kivy.uix.screenmanager import ScreenManager, Screen, SlideTransition\nfrom kivy.properties import ListProperty, StringProperty, \\\n        NumericProperty, BooleanProperty\nfrom kivy.uix.boxlayout import BoxLayout\nfrom kivy.uix.floatlayout import FloatLayout\nfrom kivy.clock import Clock\n\n\nclass MutableTextInput(FloatLayout):\n\n    text = StringProperty()\n    multiline = BooleanProperty(True)\n\n    def __init__(self, **kwargs):\n        super(MutableTextInput, self).__init__(**kwargs)\n        Clock.schedule_once(self.prepare, 0)\n\n    def prepare(self, *args):\n        self.w_textinput = self.ids.w_textinput.__self__\n        self.w_label = self.ids.w_label.__self__\n        self.view()\n\n    def on_touch_down(self, touch):\n        if self.collide_point(*touch.pos) and touch.is_double_tap:\n            self.edit()\n        return super(MutableTextInput, self).on_touch_down(touch)\n\n    def edit(self):\n        self.clear_widgets()\n        self.add_widget(self.w_textinput)\n        self.w_textinput.focus = True\n\n    def view(self):\n        self.clear_widgets()\n        self.add_widget(self.w_label)\n\n    def check_focus_and_view(self, textinput):\n        if not textinput.focus:\n            self.text = textinput.text\n            self.view()\n\n\nclass NoteView(Screen):\n\n    note_index = NumericProperty()\n    note_title = StringProperty()\n    note_content = StringProperty()\n\n\nclass NoteListItem(BoxLayout):\n\n    def __init__(self, **kwargs):\n        print(kwargs)\n        del kwargs['index']\n        super(NoteListItem, self).__init__(**kwargs)\n    note_content = StringProperty()\n    note_title = StringProperty()\n    note_index = NumericProperty()\n\n\nclass Notes(Screen):\n\n    data = ListProperty()\n\n    def args_converter(self, row_index, item):\n        return {\n            'note_index': row_index,\n            'note_content': item['content'],\n            'note_title': item['title']}\n\n\nclass NoteApp(App):\n\n    def build(self):\n        self.notes = Notes(name='notes')\n        self.load_notes()\n\n        self.transition = SlideTransition(duration=.35)\n        root = ScreenManager(transition=self.transition)\n        root.add_widget(self.notes)\n        return root\n\n    def load_notes(self):\n        if not exists(self.notes_fn):\n            return\n        with open(self.notes_fn) as fd:\n            data = json.load(fd)\n        self.notes.data = data\n\n    def save_notes(self):\n        with open(self.notes_fn, 'w') as fd:\n            json.dump(self.notes.data, fd)\n\n    def del_note(self, note_index):\n        del self.notes.data[note_index]\n        self.save_notes()\n        self.refresh_notes()\n        self.go_notes()\n\n    def edit_note(self, note_index):\n        note = self.notes.data[note_index]\n        name = 'note{}'.format(note_index)\n\n        if self.root.has_screen(name):\n            self.root.remove_widget(self.root.get_screen(name))\n\n        view = NoteView(\n            name=name,\n            note_index=note_index,\n            note_title=note.get('title'),\n            note_content=note.get('content'))\n\n        self.root.add_widget(view)\n        self.transition.direction = 'left'\n        self.root.current = view.name\n\n    def add_note(self):\n        self.notes.data.append({'title': 'New note', 'content': ''})\n        note_index = len(self.notes.data) - 1\n        self.edit_note(note_index)\n\n    def set_note_content(self, note_index, note_content):\n        self.notes.data[note_index]['content'] = note_content\n        data = self.notes.data\n        self.notes.data = []\n        self.notes.data = data\n        self.save_notes()\n        self.refresh_notes()\n\n    def set_note_title(self, note_index, note_title):\n        self.notes.data[note_index]['title'] = note_title\n        self.save_notes()\n        self.refresh_notes()\n\n    def refresh_notes(self):\n        data = self.notes.data\n        self.notes.data = []\n        self.notes.data = data\n\n    def go_notes(self):\n        self.transition.direction = 'right'\n        self.root.current = 'notes'\n\n    @property\n    def notes_fn(self):\n        return join(self.user_data_dir, 'notes.json')\n\nif __name__ == '__main__':\n    NoteApp().run()\n", "path": "examples/tutorials/notes/final/main.py"}]}