We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Adding new attribute fails in case new name is the last in the list
### Problem Statement

```bash
$ python scripts/add_attribute.py Permissions triage bool
Traceback (most recent call last):
  File "<...>\PyGithub\scripts\add_attribute.py", line 124, in <module>
    line = lines[i].rstrip()
IndexError: list index out of range
```
--> Adding a new attribute at the end of the existing list of attributes in class `Permissions` fails.
--> In this case the last attribute name was "push", so "triage" comes last.
https://github.com/PyGithub/PyGithub/blob/34d097ce473601624722b90fc5d0396011dd3acb/github/Permissions.py#L63-L72

### Solution Approach

In case the new attribute name will result in adding it at the end of the list of attributes, then the processing within the script at https://github.com/PyGithub/PyGithub/blob/master/scripts/add_attribute.py#L89 was already processing the next source code line which already contains the `_initAttributes` function.
Subsequently at https://github.com/PyGithub/PyGithub/blob/master/scripts/add_attribute.py#L122 `inInit` is set to `False`, but only checked again after reading already the next line. This means the following code block will never again notice the place of the `_initAttributes` and fails at the end of the file due to endless loop.

Problem can be fixed by conditionally remembering we already reached the `_initAttributes` function, so replace:
https://github.com/PyGithub/PyGithub/blob/34d097ce473601624722b90fc5d0396011dd3acb/scripts/add_attribute.py#L122

with

```python
inInit = True if line == "    def _initAttributes(self):" else False
```
Adding new attribute fails in case new name is the last in the list
### Problem Statement

```bash
$ python scripts/add_attribute.py Permissions triage bool
Traceback (most recent call last):
  File "<...>\PyGithub\scripts\add_attribute.py", line 124, in <module>
    line = lines[i].rstrip()
IndexError: list index out of range
```
--> Adding a new attribute at the end of the existing list of attributes in class `Permissions` fails.
--> In this case the last attribute name was "push", so "triage" comes last.
https://github.com/PyGithub/PyGithub/blob/34d097ce473601624722b90fc5d0396011dd3acb/github/Permissions.py#L63-L72

### Solution Approach

In case the new attribute name will result in adding it at the end of the list of attributes, then the processing within the script at https://github.com/PyGithub/PyGithub/blob/master/scripts/add_attribute.py#L89 was already processing the next source code line which already contains the `_initAttributes` function.
Subsequently at https://github.com/PyGithub/PyGithub/blob/master/scripts/add_attribute.py#L122 `inInit` is set to `False`, but only checked again after reading already the next line. This means the following code block will never again notice the place of the `_initAttributes` and fails at the end of the file due to endless loop.

Problem can be fixed by conditionally remembering we already reached the `_initAttributes` function, so replace:
https://github.com/PyGithub/PyGithub/blob/34d097ce473601624722b90fc5d0396011dd3acb/scripts/add_attribute.py#L122

with

```python
inInit = True if line == "    def _initAttributes(self):" else False
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `scripts/add_attribute.py`
Content:
```
1 #!/usr/bin/env python
2 
3 ############################ Copyrights and license ############################
4 #                                                                              #
5 # Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net>                 #
6 # Copyright 2014 Thialfihar <thi@thialfihar.org>                               #
7 # Copyright 2014 Vincent Jacques <vincent@vincent-jacques.net>                 #
8 # Copyright 2016 Peter Buckley <dx-pbuckley@users.noreply.github.com>          #
9 # Copyright 2018 sfdye <tsfdye@gmail.com>                                      #
10 # Copyright 2018 bbi-yggy <yossarian@blackbirdinteractive.com>                 #
11 #                                                                              #
12 # This file is part of PyGithub.                                               #
13 # http://pygithub.readthedocs.io/                                              #
14 #                                                                              #
15 # PyGithub is free software: you can redistribute it and/or modify it under    #
16 # the terms of the GNU Lesser General Public License as published by the Free  #
17 # Software Foundation, either version 3 of the License, or (at your option)    #
18 # any later version.                                                           #
19 #                                                                              #
20 # PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY  #
21 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS    #
22 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
23 # details.                                                                     #
24 #                                                                              #
25 # You should have received a copy of the GNU Lesser General Public License     #
26 # along with PyGithub. If not, see <http://www.gnu.org/licenses/>.             #
27 #                                                                              #
28 ################################################################################
29 
30 import os.path
31 import sys
32 
33 className, attributeName, attributeType = sys.argv[1:4]
34 if len(sys.argv) > 4:
35     attributeClassType = sys.argv[4]
36 else:
37     attributeClassType = ""
38 
39 
40 types = {
41     "string": (
42         "string",
43         None,
44         'self._makeStringAttribute(attributes["' + attributeName + '"])',
45     ),
46     "int": (
47         "integer",
48         None,
49         'self._makeIntAttribute(attributes["' + attributeName + '"])',
50     ),
51     "bool": (
52         "bool",
53         None,
54         'self._makeBoolAttribute(attributes["' + attributeName + '"])',
55     ),
56     "datetime": (
57         "datetime.datetime",
58         "(str, unicode)",
59         'self._makeDatetimeAttribute(attributes["' + attributeName + '"])',
60     ),
61     "class": (
62         ":class:`" + attributeClassType + "`",
63         None,
64         "self._makeClassAttribute("
65         + attributeClassType
66         + ', attributes["'
67         + attributeName
68         + '"])',
69     ),
70 }
71 
72 attributeDocType, attributeAssertType, attributeValue = types[attributeType]
73 
74 
75 fileName = os.path.join("github", className + ".py")
76 
77 with open(fileName) as f:
78     lines = list(f)
79 
80 newLines = []
81 
82 i = 0
83 
84 added = False
85 
86 isCompletable = True
87 isProperty = False
88 while not added:
89     line = lines[i].rstrip()
90     i += 1
91     if line.startswith("class "):
92         if "NonCompletableGithubObject" in line:
93             isCompletable = False
94     elif line == "    @property":
95         isProperty = True
96     elif line.startswith("    def "):
97         attrName = line[8:-7]
98         # Properties will be inserted after __repr__, but before any other function.
99         if attrName != "__repr__" and (
100             attrName == "_identity" or attrName > attributeName or not isProperty
101         ):
102             if not isProperty:
103                 newLines.append("    @property")
104             newLines.append("    def " + attributeName + "(self):")
105             newLines.append('        """')
106             newLines.append("        :type: " + attributeDocType)
107             newLines.append('        """')
108             if isCompletable:
109                 newLines.append(
110                     "        self._completeIfNotSet(self._" + attributeName + ")"
111                 )
112             newLines.append("        return self._" + attributeName + ".value")
113             newLines.append("")
114             if isProperty:
115                 newLines.append("    @property")
116             added = True
117         isProperty = False
118     newLines.append(line)
119 
120 added = False
121 
122 inInit = False
123 while not added:
124     line = lines[i].rstrip()
125     i += 1
126     if line == "    def _initAttributes(self):":
127         inInit = True
128     if inInit:
129         if not line or line.endswith(" = github.GithubObject.NotSet"):
130             if line:
131                 attrName = line[14:-29]
132             if not line or attrName > attributeName:
133                 newLines.append(
134                     "        self._" + attributeName + " = github.GithubObject.NotSet"
135                 )
136                 added = True
137     newLines.append(line)
138 
139 added = False
140 
141 inUse = False
142 while not added:
143     try:
144         line = lines[i].rstrip()
145     except IndexError:
146         line = ""
147     i += 1
148     if line == "    def _useAttributes(self, attributes):":
149         inUse = True
150     if inUse:
151         if not line or line.endswith(" in attributes:  # pragma no branch"):
152             if line:
153                 attrName = line[12:-36]
154             if not line or attrName > attributeName:
155                 newLines.append(
156                     '        if "'
157                     + attributeName
158                     + '" in attributes:  # pragma no branch'
159                 )
160                 if attributeAssertType:
161                     newLines.append(
162                         '            assert attributes["'
163                         + attributeName
164                         + '"] is None or isinstance(attributes["'
165                         + attributeName
166                         + '"], '
167                         + attributeAssertType
168                         + '), attributes["'
169                         + attributeName
170                         + '"]'
171                     )
172                 newLines.append(
173                     "            self._" + attributeName + " = " + attributeValue
174                 )
175                 added = True
176     newLines.append(line)
177 
178 
179 while i < len(lines):
180     line = lines[i].rstrip()
181     i += 1
182     newLines.append(line)
183 
184 with open(fileName, "w") as f:
185     for line in newLines:
186         f.write(line + "\n")
187
```
--- 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/scripts/add_attribute.py b/scripts/add_attribute.py
--- a/scripts/add_attribute.py
+++ b/scripts/add_attribute.py
@@ -119,7 +119,7 @@
 
 added = False
 
-inInit = False
+inInit = line.endswith("def _initAttributes(self):")
 while not added:
     line = lines[i].rstrip()
     i += 1

{"golden_diff": "diff --git a/scripts/add_attribute.py b/scripts/add_attribute.py\n--- a/scripts/add_attribute.py\n+++ b/scripts/add_attribute.py\n@@ -119,7 +119,7 @@\n \n added = False\n \n-inInit = False\n+inInit = line.endswith(\"def _initAttributes(self):\")\n while not added:\n     line = lines[i].rstrip()\n     i += 1\n", "issue": "Adding new attribute fails in case new name is the last in the list\n### Problem Statement\r\n\r\n```bash\r\n$ python scripts/add_attribute.py Permissions triage bool\r\nTraceback (most recent call last):\r\n  File \"<...>\\PyGithub\\scripts\\add_attribute.py\", line 124, in <module>\r\n    line = lines[i].rstrip()\r\nIndexError: list index out of range\r\n```\r\n--> Adding a new attribute at the end of the existing list of attributes in class `Permissions` fails.\r\n--> In this case the last attribute name was \"push\", so \"triage\" comes last.\r\nhttps://github.com/PyGithub/PyGithub/blob/34d097ce473601624722b90fc5d0396011dd3acb/github/Permissions.py#L63-L72\r\n\r\n### Solution Approach\r\n\r\nIn case the new attribute name will result in adding it at the end of the list of attributes, then the processing within the script at https://github.com/PyGithub/PyGithub/blob/master/scripts/add_attribute.py#L89 was already processing the next source code line which already contains the `_initAttributes` function.\r\nSubsequently at https://github.com/PyGithub/PyGithub/blob/master/scripts/add_attribute.py#L122 `inInit` is set to `False`, but only checked again after reading already the next line. This means the following code block will never again notice the place of the `_initAttributes` and fails at the end of the file due to endless loop.\r\n\r\nProblem can be fixed by conditionally remembering we already reached the `_initAttributes` function, so replace:\r\nhttps://github.com/PyGithub/PyGithub/blob/34d097ce473601624722b90fc5d0396011dd3acb/scripts/add_attribute.py#L122\r\n\r\nwith\r\n\r\n```python\r\ninInit = True if line == \"    def _initAttributes(self):\" else False\r\n```\nAdding new attribute fails in case new name is the last in the list\n### Problem Statement\r\n\r\n```bash\r\n$ python scripts/add_attribute.py Permissions triage bool\r\nTraceback (most recent call last):\r\n  File \"<...>\\PyGithub\\scripts\\add_attribute.py\", line 124, in <module>\r\n    line = lines[i].rstrip()\r\nIndexError: list index out of range\r\n```\r\n--> Adding a new attribute at the end of the existing list of attributes in class `Permissions` fails.\r\n--> In this case the last attribute name was \"push\", so \"triage\" comes last.\r\nhttps://github.com/PyGithub/PyGithub/blob/34d097ce473601624722b90fc5d0396011dd3acb/github/Permissions.py#L63-L72\r\n\r\n### Solution Approach\r\n\r\nIn case the new attribute name will result in adding it at the end of the list of attributes, then the processing within the script at https://github.com/PyGithub/PyGithub/blob/master/scripts/add_attribute.py#L89 was already processing the next source code line which already contains the `_initAttributes` function.\r\nSubsequently at https://github.com/PyGithub/PyGithub/blob/master/scripts/add_attribute.py#L122 `inInit` is set to `False`, but only checked again after reading already the next line. This means the following code block will never again notice the place of the `_initAttributes` and fails at the end of the file due to endless loop.\r\n\r\nProblem can be fixed by conditionally remembering we already reached the `_initAttributes` function, so replace:\r\nhttps://github.com/PyGithub/PyGithub/blob/34d097ce473601624722b90fc5d0396011dd3acb/scripts/add_attribute.py#L122\r\n\r\nwith\r\n\r\n```python\r\ninInit = True if line == \"    def _initAttributes(self):\" else False\r\n```\n", "before_files": [{"content": "#!/usr/bin/env python\n\n############################ Copyrights and license ############################\n#                                                                              #\n# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net>                 #\n# Copyright 2014 Thialfihar <thi@thialfihar.org>                               #\n# Copyright 2014 Vincent Jacques <vincent@vincent-jacques.net>                 #\n# Copyright 2016 Peter Buckley <dx-pbuckley@users.noreply.github.com>          #\n# Copyright 2018 sfdye <tsfdye@gmail.com>                                      #\n# Copyright 2018 bbi-yggy <yossarian@blackbirdinteractive.com>                 #\n#                                                                              #\n# This file is part of PyGithub.                                               #\n# http://pygithub.readthedocs.io/                                              #\n#                                                                              #\n# PyGithub is free software: you can redistribute it and/or modify it under    #\n# the terms of the GNU Lesser General Public License as published by the Free  #\n# Software Foundation, either version 3 of the License, or (at your option)    #\n# any later version.                                                           #\n#                                                                              #\n# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY  #\n# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS    #\n# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #\n# details.                                                                     #\n#                                                                              #\n# You should have received a copy of the GNU Lesser General Public License     #\n# along with PyGithub. If not, see <http://www.gnu.org/licenses/>.             #\n#                                                                              #\n################################################################################\n\nimport os.path\nimport sys\n\nclassName, attributeName, attributeType = sys.argv[1:4]\nif len(sys.argv) > 4:\n    attributeClassType = sys.argv[4]\nelse:\n    attributeClassType = \"\"\n\n\ntypes = {\n    \"string\": (\n        \"string\",\n        None,\n        'self._makeStringAttribute(attributes[\"' + attributeName + '\"])',\n    ),\n    \"int\": (\n        \"integer\",\n        None,\n        'self._makeIntAttribute(attributes[\"' + attributeName + '\"])',\n    ),\n    \"bool\": (\n        \"bool\",\n        None,\n        'self._makeBoolAttribute(attributes[\"' + attributeName + '\"])',\n    ),\n    \"datetime\": (\n        \"datetime.datetime\",\n        \"(str, unicode)\",\n        'self._makeDatetimeAttribute(attributes[\"' + attributeName + '\"])',\n    ),\n    \"class\": (\n        \":class:`\" + attributeClassType + \"`\",\n        None,\n        \"self._makeClassAttribute(\"\n        + attributeClassType\n        + ', attributes[\"'\n        + attributeName\n        + '\"])',\n    ),\n}\n\nattributeDocType, attributeAssertType, attributeValue = types[attributeType]\n\n\nfileName = os.path.join(\"github\", className + \".py\")\n\nwith open(fileName) as f:\n    lines = list(f)\n\nnewLines = []\n\ni = 0\n\nadded = False\n\nisCompletable = True\nisProperty = False\nwhile not added:\n    line = lines[i].rstrip()\n    i += 1\n    if line.startswith(\"class \"):\n        if \"NonCompletableGithubObject\" in line:\n            isCompletable = False\n    elif line == \"    @property\":\n        isProperty = True\n    elif line.startswith(\"    def \"):\n        attrName = line[8:-7]\n        # Properties will be inserted after __repr__, but before any other function.\n        if attrName != \"__repr__\" and (\n            attrName == \"_identity\" or attrName > attributeName or not isProperty\n        ):\n            if not isProperty:\n                newLines.append(\"    @property\")\n            newLines.append(\"    def \" + attributeName + \"(self):\")\n            newLines.append('        \"\"\"')\n            newLines.append(\"        :type: \" + attributeDocType)\n            newLines.append('        \"\"\"')\n            if isCompletable:\n                newLines.append(\n                    \"        self._completeIfNotSet(self._\" + attributeName + \")\"\n                )\n            newLines.append(\"        return self._\" + attributeName + \".value\")\n            newLines.append(\"\")\n            if isProperty:\n                newLines.append(\"    @property\")\n            added = True\n        isProperty = False\n    newLines.append(line)\n\nadded = False\n\ninInit = False\nwhile not added:\n    line = lines[i].rstrip()\n    i += 1\n    if line == \"    def _initAttributes(self):\":\n        inInit = True\n    if inInit:\n        if not line or line.endswith(\" = github.GithubObject.NotSet\"):\n            if line:\n                attrName = line[14:-29]\n            if not line or attrName > attributeName:\n                newLines.append(\n                    \"        self._\" + attributeName + \" = github.GithubObject.NotSet\"\n                )\n                added = True\n    newLines.append(line)\n\nadded = False\n\ninUse = False\nwhile not added:\n    try:\n        line = lines[i].rstrip()\n    except IndexError:\n        line = \"\"\n    i += 1\n    if line == \"    def _useAttributes(self, attributes):\":\n        inUse = True\n    if inUse:\n        if not line or line.endswith(\" in attributes:  # pragma no branch\"):\n            if line:\n                attrName = line[12:-36]\n            if not line or attrName > attributeName:\n                newLines.append(\n                    '        if \"'\n                    + attributeName\n                    + '\" in attributes:  # pragma no branch'\n                )\n                if attributeAssertType:\n                    newLines.append(\n                        '            assert attributes[\"'\n                        + attributeName\n                        + '\"] is None or isinstance(attributes[\"'\n                        + attributeName\n                        + '\"], '\n                        + attributeAssertType\n                        + '), attributes[\"'\n                        + attributeName\n                        + '\"]'\n                    )\n                newLines.append(\n                    \"            self._\" + attributeName + \" = \" + attributeValue\n                )\n                added = True\n    newLines.append(line)\n\n\nwhile i < len(lines):\n    line = lines[i].rstrip()\n    i += 1\n    newLines.append(line)\n\nwith open(fileName, \"w\") as f:\n    for line in newLines:\n        f.write(line + \"\\n\")\n", "path": "scripts/add_attribute.py"}], "after_files": [{"content": "#!/usr/bin/env python\n\n############################ Copyrights and license ############################\n#                                                                              #\n# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net>                 #\n# Copyright 2014 Thialfihar <thi@thialfihar.org>                               #\n# Copyright 2014 Vincent Jacques <vincent@vincent-jacques.net>                 #\n# Copyright 2016 Peter Buckley <dx-pbuckley@users.noreply.github.com>          #\n# Copyright 2018 sfdye <tsfdye@gmail.com>                                      #\n# Copyright 2018 bbi-yggy <yossarian@blackbirdinteractive.com>                 #\n#                                                                              #\n# This file is part of PyGithub.                                               #\n# http://pygithub.readthedocs.io/                                              #\n#                                                                              #\n# PyGithub is free software: you can redistribute it and/or modify it under    #\n# the terms of the GNU Lesser General Public License as published by the Free  #\n# Software Foundation, either version 3 of the License, or (at your option)    #\n# any later version.                                                           #\n#                                                                              #\n# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY  #\n# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS    #\n# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #\n# details.                                                                     #\n#                                                                              #\n# You should have received a copy of the GNU Lesser General Public License     #\n# along with PyGithub. If not, see <http://www.gnu.org/licenses/>.             #\n#                                                                              #\n################################################################################\n\nimport os.path\nimport sys\n\nclassName, attributeName, attributeType = sys.argv[1:4]\nif len(sys.argv) > 4:\n    attributeClassType = sys.argv[4]\nelse:\n    attributeClassType = \"\"\n\n\ntypes = {\n    \"string\": (\n        \"string\",\n        None,\n        'self._makeStringAttribute(attributes[\"' + attributeName + '\"])',\n    ),\n    \"int\": (\n        \"integer\",\n        None,\n        'self._makeIntAttribute(attributes[\"' + attributeName + '\"])',\n    ),\n    \"bool\": (\n        \"bool\",\n        None,\n        'self._makeBoolAttribute(attributes[\"' + attributeName + '\"])',\n    ),\n    \"datetime\": (\n        \"datetime.datetime\",\n        \"(str, unicode)\",\n        'self._makeDatetimeAttribute(attributes[\"' + attributeName + '\"])',\n    ),\n    \"class\": (\n        \":class:`\" + attributeClassType + \"`\",\n        None,\n        \"self._makeClassAttribute(\"\n        + attributeClassType\n        + ', attributes[\"'\n        + attributeName\n        + '\"])',\n    ),\n}\n\nattributeDocType, attributeAssertType, attributeValue = types[attributeType]\n\n\nfileName = os.path.join(\"github\", className + \".py\")\n\nwith open(fileName) as f:\n    lines = list(f)\n\nnewLines = []\n\ni = 0\n\nadded = False\n\nisCompletable = True\nisProperty = False\nwhile not added:\n    line = lines[i].rstrip()\n    i += 1\n    if line.startswith(\"class \"):\n        if \"NonCompletableGithubObject\" in line:\n            isCompletable = False\n    elif line == \"    @property\":\n        isProperty = True\n    elif line.startswith(\"    def \"):\n        attrName = line[8:-7]\n        # Properties will be inserted after __repr__, but before any other function.\n        if attrName != \"__repr__\" and (\n            attrName == \"_identity\" or attrName > attributeName or not isProperty\n        ):\n            if not isProperty:\n                newLines.append(\"    @property\")\n            newLines.append(\"    def \" + attributeName + \"(self):\")\n            newLines.append('        \"\"\"')\n            newLines.append(\"        :type: \" + attributeDocType)\n            newLines.append('        \"\"\"')\n            if isCompletable:\n                newLines.append(\n                    \"        self._completeIfNotSet(self._\" + attributeName + \")\"\n                )\n            newLines.append(\"        return self._\" + attributeName + \".value\")\n            newLines.append(\"\")\n            if isProperty:\n                newLines.append(\"    @property\")\n            added = True\n        isProperty = False\n    newLines.append(line)\n\nadded = False\n\ninInit = line.endswith(\"def _initAttributes(self):\")\nwhile not added:\n    line = lines[i].rstrip()\n    i += 1\n    if line == \"    def _initAttributes(self):\":\n        inInit = True\n    if inInit:\n        if not line or line.endswith(\" = github.GithubObject.NotSet\"):\n            if line:\n                attrName = line[14:-29]\n            if not line or attrName > attributeName:\n                newLines.append(\n                    \"        self._\" + attributeName + \" = github.GithubObject.NotSet\"\n                )\n                added = True\n    newLines.append(line)\n\nadded = False\n\ninUse = False\nwhile not added:\n    try:\n        line = lines[i].rstrip()\n    except IndexError:\n        line = \"\"\n    i += 1\n    if line == \"    def _useAttributes(self, attributes):\":\n        inUse = True\n    if inUse:\n        if not line or line.endswith(\" in attributes:  # pragma no branch\"):\n            if line:\n                attrName = line[12:-36]\n            if not line or attrName > attributeName:\n                newLines.append(\n                    '        if \"'\n                    + attributeName\n                    + '\" in attributes:  # pragma no branch'\n                )\n                if attributeAssertType:\n                    newLines.append(\n                        '            assert attributes[\"'\n                        + attributeName\n                        + '\"] is None or isinstance(attributes[\"'\n                        + attributeName\n                        + '\"], '\n                        + attributeAssertType\n                        + '), attributes[\"'\n                        + attributeName\n                        + '\"]'\n                    )\n                newLines.append(\n                    \"            self._\" + attributeName + \" = \" + attributeValue\n                )\n                added = True\n    newLines.append(line)\n\n\nwhile i < len(lines):\n    line = lines[i].rstrip()\n    i += 1\n    newLines.append(line)\n\nwith open(fileName, \"w\") as f:\n    for line in newLines:\n        f.write(line + \"\\n\")\n", "path": "scripts/add_attribute.py"}]}