We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Team add_membership should take parameter for role
The github api allows the use of this call to specify the role of the new member, https://developer.github.com/v3/orgs/teams/#add-or-update-team-membership. 

Team.add_membership should allow the same.
Team add_membership method needs a test

Team add_membership should take parameter for role
The github api allows the use of this call to specify the role of the new member, https://developer.github.com/v3/orgs/teams/#add-or-update-team-membership. 

Team.add_membership should allow the same.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `github/Team.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 
3 # ########################## Copyrights and license ############################
4 #                                                                              #
5 # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net>                 #
6 # Copyright 2012 Zearin <zearin@gonk.net>                                      #
7 # Copyright 2013 AKFish <akfish@gmail.com>                                     #
8 # Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net>                 #
9 # Copyright 2013 martinqt <m.ki2@laposte.net>                                  #
10 #                                                                              #
11 # This file is part of PyGithub.                                               #
12 # http://pygithub.github.io/PyGithub/v1/index.html                             #
13 #                                                                              #
14 # PyGithub is free software: you can redistribute it and/or modify it under    #
15 # the terms of the GNU Lesser General Public License as published by the Free  #
16 # Software Foundation, either version 3 of the License, or (at your option)    #
17 # any later version.                                                           #
18 #                                                                              #
19 # PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY  #
20 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS    #
21 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
22 # details.                                                                     #
23 #                                                                              #
24 # You should have received a copy of the GNU Lesser General Public License     #
25 # along with PyGithub. If not, see <http://www.gnu.org/licenses/>.             #
26 #                                                                              #
27 # ##############################################################################
28 
29 import github.GithubObject
30 import github.PaginatedList
31 
32 import github.Repository
33 import github.NamedUser
34 
35 
36 class Team(github.GithubObject.CompletableGithubObject):
37     """
38     This class represents Teams. The reference can be found here http://developer.github.com/v3/orgs/teams/
39     """
40 
41     def __repr__(self):
42         return self.get__repr__({"id": self._id.value, "name": self._name.value})
43 
44     @property
45     def id(self):
46         """
47         :type: integer
48         """
49         self._completeIfNotSet(self._id)
50         return self._id.value
51 
52     @property
53     def members_count(self):
54         """
55         :type: integer
56         """
57         self._completeIfNotSet(self._members_count)
58         return self._members_count.value
59 
60     @property
61     def members_url(self):
62         """
63         :type: string
64         """
65         self._completeIfNotSet(self._members_url)
66         return self._members_url.value
67 
68     @property
69     def name(self):
70         """
71         :type: string
72         """
73         self._completeIfNotSet(self._name)
74         return self._name.value
75 
76     @property
77     def permission(self):
78         """
79         :type: string
80         """
81         self._completeIfNotSet(self._permission)
82         return self._permission.value
83 
84     @property
85     def repos_count(self):
86         """
87         :type: integer
88         """
89         self._completeIfNotSet(self._repos_count)
90         return self._repos_count.value
91 
92     @property
93     def repositories_url(self):
94         """
95         :type: string
96         """
97         self._completeIfNotSet(self._repositories_url)
98         return self._repositories_url.value
99 
100     @property
101     def slug(self):
102         """
103         :type: string
104         """
105         self._completeIfNotSet(self._slug)
106         return self._slug.value
107 
108     @property
109     def url(self):
110         """
111         :type: string
112         """
113         self._completeIfNotSet(self._url)
114         return self._url.value
115 
116     def add_to_members(self, member):
117         """
118         :calls: `PUT /teams/:id/members/:user <http://developer.github.com/v3/orgs/teams>`_
119         :param member: :class:`github.NamedUser.NamedUser`
120         :rtype: None
121         """
122         assert isinstance(member, github.NamedUser.NamedUser), member
123         headers, data = self._requester.requestJsonAndCheck(
124             "PUT",
125             self.url + "/members/" + member._identity
126         )
127 
128     def add_membership(self, member):
129         """
130         :calls: `PUT /teams/:id/memberships/:user <http://developer.github.com/v3/orgs/teams>`_
131         :param member: :class:`github.Nameduser.NamedUser`
132         :rtype: None
133         """
134         assert isinstance(member, github.NamedUser.NamedUser), member
135         headers, data = self._requester.requestJsonAndCheck(
136             "PUT",
137             self.url + "/memberships/" + member._identity
138         )
139 
140     def add_to_repos(self, repo):
141         """
142         :calls: `PUT /teams/:id/repos/:org/:repo <http://developer.github.com/v3/orgs/teams>`_
143         :param repo: :class:`github.Repository.Repository`
144         :rtype: None
145         """
146         assert isinstance(repo, github.Repository.Repository), repo
147         headers, data = self._requester.requestJsonAndCheck(
148             "PUT",
149             self.url + "/repos/" + repo._identity
150         )
151 
152     def set_repo_permission(self, repo, permission):
153         """
154         :calls: `PUT /teams/:id/repos/:org/:repo <http://developer.github.com/v3/orgs/teams>`_
155         :param repo: :class:`github.Repository.Repository`
156         :param permission: string
157         :rtype: None
158         """
159         assert isinstance(repo, github.Repository.Repository), repo
160         put_parameters = {
161             "permission": permission,
162         }
163         headers, data = self._requester.requestJsonAndCheck(
164             "PUT",
165             self.url + "/repos/" + repo._identity,
166             input=put_parameters
167         )
168 
169     def delete(self):
170         """
171         :calls: `DELETE /teams/:id <http://developer.github.com/v3/orgs/teams>`_
172         :rtype: None
173         """
174         headers, data = self._requester.requestJsonAndCheck(
175             "DELETE",
176             self.url
177         )
178 
179     def edit(self, name, permission=github.GithubObject.NotSet):
180         """
181         :calls: `PATCH /teams/:id <http://developer.github.com/v3/orgs/teams>`_
182         :param name: string
183         :param permission: string
184         :rtype: None
185         """
186         assert isinstance(name, (str, unicode)), name
187         assert permission is github.GithubObject.NotSet or isinstance(permission, (str, unicode)), permission
188         post_parameters = {
189             "name": name,
190         }
191         if permission is not github.GithubObject.NotSet:
192             post_parameters["permission"] = permission
193         headers, data = self._requester.requestJsonAndCheck(
194             "PATCH",
195             self.url,
196             input=post_parameters
197         )
198         self._useAttributes(data)
199 
200     def get_members(self):
201         """
202         :calls: `GET /teams/:id/members <http://developer.github.com/v3/orgs/teams>`_
203         :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser`
204         """
205         return github.PaginatedList.PaginatedList(
206             github.NamedUser.NamedUser,
207             self._requester,
208             self.url + "/members",
209             None
210         )
211 
212     def get_repos(self):
213         """
214         :calls: `GET /teams/:id/repos <http://developer.github.com/v3/orgs/teams>`_
215         :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository`
216         """
217         return github.PaginatedList.PaginatedList(
218             github.Repository.Repository,
219             self._requester,
220             self.url + "/repos",
221             None
222         )
223 
224     def has_in_members(self, member):
225         """
226         :calls: `GET /teams/:id/members/:user <http://developer.github.com/v3/orgs/teams>`_
227         :param member: :class:`github.NamedUser.NamedUser`
228         :rtype: bool
229         """
230         assert isinstance(member, github.NamedUser.NamedUser), member
231         status, headers, data = self._requester.requestJson(
232             "GET",
233             self.url + "/members/" + member._identity
234         )
235         return status == 204
236 
237     def has_in_repos(self, repo):
238         """
239         :calls: `GET /teams/:id/repos/:owner/:repo <http://developer.github.com/v3/orgs/teams>`_
240         :param repo: :class:`github.Repository.Repository`
241         :rtype: bool
242         """
243         assert isinstance(repo, github.Repository.Repository), repo
244         status, headers, data = self._requester.requestJson(
245             "GET",
246             self.url + "/repos/" + repo._identity
247         )
248         return status == 204
249 
250     def remove_from_members(self, member):
251         """
252         :calls: `DELETE /teams/:id/members/:user <http://developer.github.com/v3/orgs/teams>`_
253         :param member: :class:`github.NamedUser.NamedUser`
254         :rtype: None
255         """
256         assert isinstance(member, github.NamedUser.NamedUser), member
257         headers, data = self._requester.requestJsonAndCheck(
258             "DELETE",
259             self.url + "/members/" + member._identity
260         )
261 
262     def remove_from_repos(self, repo):
263         """
264         :calls: `DELETE /teams/:id/repos/:owner/:repo <http://developer.github.com/v3/orgs/teams>`_
265         :param repo: :class:`github.Repository.Repository`
266         :rtype: None
267         """
268         assert isinstance(repo, github.Repository.Repository), repo
269         headers, data = self._requester.requestJsonAndCheck(
270             "DELETE",
271             self.url + "/repos/" + repo._identity
272         )
273 
274     @property
275     def _identity(self):
276         return self.id
277 
278     def _initAttributes(self):
279         self._id = github.GithubObject.NotSet
280         self._members_count = github.GithubObject.NotSet
281         self._members_url = github.GithubObject.NotSet
282         self._name = github.GithubObject.NotSet
283         self._permission = github.GithubObject.NotSet
284         self._repos_count = github.GithubObject.NotSet
285         self._repositories_url = github.GithubObject.NotSet
286         self._slug = github.GithubObject.NotSet
287         self._url = github.GithubObject.NotSet
288 
289     def _useAttributes(self, attributes):
290         if "id" in attributes:  # pragma no branch
291             self._id = self._makeIntAttribute(attributes["id"])
292         if "members_count" in attributes:  # pragma no branch
293             self._members_count = self._makeIntAttribute(attributes["members_count"])
294         if "members_url" in attributes:  # pragma no branch
295             self._members_url = self._makeStringAttribute(attributes["members_url"])
296         if "name" in attributes:  # pragma no branch
297             self._name = self._makeStringAttribute(attributes["name"])
298         if "permission" in attributes:  # pragma no branch
299             self._permission = self._makeStringAttribute(attributes["permission"])
300         if "repos_count" in attributes:  # pragma no branch
301             self._repos_count = self._makeIntAttribute(attributes["repos_count"])
302         if "repositories_url" in attributes:  # pragma no branch
303             self._repositories_url = self._makeStringAttribute(attributes["repositories_url"])
304         if "slug" in attributes:  # pragma no branch
305             self._slug = self._makeStringAttribute(attributes["slug"])
306         if "url" in attributes:  # pragma no branch
307             self._url = self._makeStringAttribute(attributes["url"])
308
```
--- 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/github/Team.py b/github/Team.py
--- a/github/Team.py
+++ b/github/Team.py
@@ -125,16 +125,29 @@
             self.url + "/members/" + member._identity
         )
 
-    def add_membership(self, member):
+    def add_membership(self, member, role=github.GithubObject.NotSet):
         """
         :calls: `PUT /teams/:id/memberships/:user <http://developer.github.com/v3/orgs/teams>`_
         :param member: :class:`github.Nameduser.NamedUser`
+        :param role: string
         :rtype: None
         """
         assert isinstance(member, github.NamedUser.NamedUser), member
+        assert role is github.GithubObject.NotSet or isinstance(
+            role, (str, unicode)), role
+        if role is not github.GithubObject.NotSet:
+            assert role in ['member', 'maintainer']
+            put_parameters = {
+                "role": role,
+            }
+        else:
+            put_parameters = {
+                "role": "member",
+            }
         headers, data = self._requester.requestJsonAndCheck(
             "PUT",
-            self.url + "/memberships/" + member._identity
+            self.url + "/memberships/" + member._identity,
+            input=put_parameters
         )
 
     def add_to_repos(self, repo):

{"golden_diff": "diff --git a/github/Team.py b/github/Team.py\n--- a/github/Team.py\n+++ b/github/Team.py\n@@ -125,16 +125,29 @@\n             self.url + \"/members/\" + member._identity\n         )\n \n-    def add_membership(self, member):\n+    def add_membership(self, member, role=github.GithubObject.NotSet):\n         \"\"\"\n         :calls: `PUT /teams/:id/memberships/:user <http://developer.github.com/v3/orgs/teams>`_\n         :param member: :class:`github.Nameduser.NamedUser`\n+        :param role: string\n         :rtype: None\n         \"\"\"\n         assert isinstance(member, github.NamedUser.NamedUser), member\n+        assert role is github.GithubObject.NotSet or isinstance(\n+            role, (str, unicode)), role\n+        if role is not github.GithubObject.NotSet:\n+            assert role in ['member', 'maintainer']\n+            put_parameters = {\n+                \"role\": role,\n+            }\n+        else:\n+            put_parameters = {\n+                \"role\": \"member\",\n+            }\n         headers, data = self._requester.requestJsonAndCheck(\n             \"PUT\",\n-            self.url + \"/memberships/\" + member._identity\n+            self.url + \"/memberships/\" + member._identity,\n+            input=put_parameters\n         )\n \n     def add_to_repos(self, repo):\n", "issue": "Team add_membership should take parameter for role\nThe github api allows the use of this call to specify the role of the new member, https://developer.github.com/v3/orgs/teams/#add-or-update-team-membership. \r\n\r\nTeam.add_membership should allow the same.\nTeam add_membership method needs a test\n\nTeam add_membership should take parameter for role\nThe github api allows the use of this call to specify the role of the new member, https://developer.github.com/v3/orgs/teams/#add-or-update-team-membership. \r\n\r\nTeam.add_membership should allow the same.\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\n# ########################## Copyrights and license ############################\n#                                                                              #\n# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net>                 #\n# Copyright 2012 Zearin <zearin@gonk.net>                                      #\n# Copyright 2013 AKFish <akfish@gmail.com>                                     #\n# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net>                 #\n# Copyright 2013 martinqt <m.ki2@laposte.net>                                  #\n#                                                                              #\n# This file is part of PyGithub.                                               #\n# http://pygithub.github.io/PyGithub/v1/index.html                             #\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 github.GithubObject\nimport github.PaginatedList\n\nimport github.Repository\nimport github.NamedUser\n\n\nclass Team(github.GithubObject.CompletableGithubObject):\n    \"\"\"\n    This class represents Teams. The reference can be found here http://developer.github.com/v3/orgs/teams/\n    \"\"\"\n\n    def __repr__(self):\n        return self.get__repr__({\"id\": self._id.value, \"name\": self._name.value})\n\n    @property\n    def id(self):\n        \"\"\"\n        :type: integer\n        \"\"\"\n        self._completeIfNotSet(self._id)\n        return self._id.value\n\n    @property\n    def members_count(self):\n        \"\"\"\n        :type: integer\n        \"\"\"\n        self._completeIfNotSet(self._members_count)\n        return self._members_count.value\n\n    @property\n    def members_url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._members_url)\n        return self._members_url.value\n\n    @property\n    def name(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._name)\n        return self._name.value\n\n    @property\n    def permission(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._permission)\n        return self._permission.value\n\n    @property\n    def repos_count(self):\n        \"\"\"\n        :type: integer\n        \"\"\"\n        self._completeIfNotSet(self._repos_count)\n        return self._repos_count.value\n\n    @property\n    def repositories_url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._repositories_url)\n        return self._repositories_url.value\n\n    @property\n    def slug(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._slug)\n        return self._slug.value\n\n    @property\n    def url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._url)\n        return self._url.value\n\n    def add_to_members(self, member):\n        \"\"\"\n        :calls: `PUT /teams/:id/members/:user <http://developer.github.com/v3/orgs/teams>`_\n        :param member: :class:`github.NamedUser.NamedUser`\n        :rtype: None\n        \"\"\"\n        assert isinstance(member, github.NamedUser.NamedUser), member\n        headers, data = self._requester.requestJsonAndCheck(\n            \"PUT\",\n            self.url + \"/members/\" + member._identity\n        )\n\n    def add_membership(self, member):\n        \"\"\"\n        :calls: `PUT /teams/:id/memberships/:user <http://developer.github.com/v3/orgs/teams>`_\n        :param member: :class:`github.Nameduser.NamedUser`\n        :rtype: None\n        \"\"\"\n        assert isinstance(member, github.NamedUser.NamedUser), member\n        headers, data = self._requester.requestJsonAndCheck(\n            \"PUT\",\n            self.url + \"/memberships/\" + member._identity\n        )\n\n    def add_to_repos(self, repo):\n        \"\"\"\n        :calls: `PUT /teams/:id/repos/:org/:repo <http://developer.github.com/v3/orgs/teams>`_\n        :param repo: :class:`github.Repository.Repository`\n        :rtype: None\n        \"\"\"\n        assert isinstance(repo, github.Repository.Repository), repo\n        headers, data = self._requester.requestJsonAndCheck(\n            \"PUT\",\n            self.url + \"/repos/\" + repo._identity\n        )\n\n    def set_repo_permission(self, repo, permission):\n        \"\"\"\n        :calls: `PUT /teams/:id/repos/:org/:repo <http://developer.github.com/v3/orgs/teams>`_\n        :param repo: :class:`github.Repository.Repository`\n        :param permission: string\n        :rtype: None\n        \"\"\"\n        assert isinstance(repo, github.Repository.Repository), repo\n        put_parameters = {\n            \"permission\": permission,\n        }\n        headers, data = self._requester.requestJsonAndCheck(\n            \"PUT\",\n            self.url + \"/repos/\" + repo._identity,\n            input=put_parameters\n        )\n\n    def delete(self):\n        \"\"\"\n        :calls: `DELETE /teams/:id <http://developer.github.com/v3/orgs/teams>`_\n        :rtype: None\n        \"\"\"\n        headers, data = self._requester.requestJsonAndCheck(\n            \"DELETE\",\n            self.url\n        )\n\n    def edit(self, name, permission=github.GithubObject.NotSet):\n        \"\"\"\n        :calls: `PATCH /teams/:id <http://developer.github.com/v3/orgs/teams>`_\n        :param name: string\n        :param permission: string\n        :rtype: None\n        \"\"\"\n        assert isinstance(name, (str, unicode)), name\n        assert permission is github.GithubObject.NotSet or isinstance(permission, (str, unicode)), permission\n        post_parameters = {\n            \"name\": name,\n        }\n        if permission is not github.GithubObject.NotSet:\n            post_parameters[\"permission\"] = permission\n        headers, data = self._requester.requestJsonAndCheck(\n            \"PATCH\",\n            self.url,\n            input=post_parameters\n        )\n        self._useAttributes(data)\n\n    def get_members(self):\n        \"\"\"\n        :calls: `GET /teams/:id/members <http://developer.github.com/v3/orgs/teams>`_\n        :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser`\n        \"\"\"\n        return github.PaginatedList.PaginatedList(\n            github.NamedUser.NamedUser,\n            self._requester,\n            self.url + \"/members\",\n            None\n        )\n\n    def get_repos(self):\n        \"\"\"\n        :calls: `GET /teams/:id/repos <http://developer.github.com/v3/orgs/teams>`_\n        :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository`\n        \"\"\"\n        return github.PaginatedList.PaginatedList(\n            github.Repository.Repository,\n            self._requester,\n            self.url + \"/repos\",\n            None\n        )\n\n    def has_in_members(self, member):\n        \"\"\"\n        :calls: `GET /teams/:id/members/:user <http://developer.github.com/v3/orgs/teams>`_\n        :param member: :class:`github.NamedUser.NamedUser`\n        :rtype: bool\n        \"\"\"\n        assert isinstance(member, github.NamedUser.NamedUser), member\n        status, headers, data = self._requester.requestJson(\n            \"GET\",\n            self.url + \"/members/\" + member._identity\n        )\n        return status == 204\n\n    def has_in_repos(self, repo):\n        \"\"\"\n        :calls: `GET /teams/:id/repos/:owner/:repo <http://developer.github.com/v3/orgs/teams>`_\n        :param repo: :class:`github.Repository.Repository`\n        :rtype: bool\n        \"\"\"\n        assert isinstance(repo, github.Repository.Repository), repo\n        status, headers, data = self._requester.requestJson(\n            \"GET\",\n            self.url + \"/repos/\" + repo._identity\n        )\n        return status == 204\n\n    def remove_from_members(self, member):\n        \"\"\"\n        :calls: `DELETE /teams/:id/members/:user <http://developer.github.com/v3/orgs/teams>`_\n        :param member: :class:`github.NamedUser.NamedUser`\n        :rtype: None\n        \"\"\"\n        assert isinstance(member, github.NamedUser.NamedUser), member\n        headers, data = self._requester.requestJsonAndCheck(\n            \"DELETE\",\n            self.url + \"/members/\" + member._identity\n        )\n\n    def remove_from_repos(self, repo):\n        \"\"\"\n        :calls: `DELETE /teams/:id/repos/:owner/:repo <http://developer.github.com/v3/orgs/teams>`_\n        :param repo: :class:`github.Repository.Repository`\n        :rtype: None\n        \"\"\"\n        assert isinstance(repo, github.Repository.Repository), repo\n        headers, data = self._requester.requestJsonAndCheck(\n            \"DELETE\",\n            self.url + \"/repos/\" + repo._identity\n        )\n\n    @property\n    def _identity(self):\n        return self.id\n\n    def _initAttributes(self):\n        self._id = github.GithubObject.NotSet\n        self._members_count = github.GithubObject.NotSet\n        self._members_url = github.GithubObject.NotSet\n        self._name = github.GithubObject.NotSet\n        self._permission = github.GithubObject.NotSet\n        self._repos_count = github.GithubObject.NotSet\n        self._repositories_url = github.GithubObject.NotSet\n        self._slug = github.GithubObject.NotSet\n        self._url = github.GithubObject.NotSet\n\n    def _useAttributes(self, attributes):\n        if \"id\" in attributes:  # pragma no branch\n            self._id = self._makeIntAttribute(attributes[\"id\"])\n        if \"members_count\" in attributes:  # pragma no branch\n            self._members_count = self._makeIntAttribute(attributes[\"members_count\"])\n        if \"members_url\" in attributes:  # pragma no branch\n            self._members_url = self._makeStringAttribute(attributes[\"members_url\"])\n        if \"name\" in attributes:  # pragma no branch\n            self._name = self._makeStringAttribute(attributes[\"name\"])\n        if \"permission\" in attributes:  # pragma no branch\n            self._permission = self._makeStringAttribute(attributes[\"permission\"])\n        if \"repos_count\" in attributes:  # pragma no branch\n            self._repos_count = self._makeIntAttribute(attributes[\"repos_count\"])\n        if \"repositories_url\" in attributes:  # pragma no branch\n            self._repositories_url = self._makeStringAttribute(attributes[\"repositories_url\"])\n        if \"slug\" in attributes:  # pragma no branch\n            self._slug = self._makeStringAttribute(attributes[\"slug\"])\n        if \"url\" in attributes:  # pragma no branch\n            self._url = self._makeStringAttribute(attributes[\"url\"])\n", "path": "github/Team.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n\n# ########################## Copyrights and license ############################\n#                                                                              #\n# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net>                 #\n# Copyright 2012 Zearin <zearin@gonk.net>                                      #\n# Copyright 2013 AKFish <akfish@gmail.com>                                     #\n# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net>                 #\n# Copyright 2013 martinqt <m.ki2@laposte.net>                                  #\n#                                                                              #\n# This file is part of PyGithub.                                               #\n# http://pygithub.github.io/PyGithub/v1/index.html                             #\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 github.GithubObject\nimport github.PaginatedList\n\nimport github.Repository\nimport github.NamedUser\n\n\nclass Team(github.GithubObject.CompletableGithubObject):\n    \"\"\"\n    This class represents Teams. The reference can be found here http://developer.github.com/v3/orgs/teams/\n    \"\"\"\n\n    def __repr__(self):\n        return self.get__repr__({\"id\": self._id.value, \"name\": self._name.value})\n\n    @property\n    def id(self):\n        \"\"\"\n        :type: integer\n        \"\"\"\n        self._completeIfNotSet(self._id)\n        return self._id.value\n\n    @property\n    def members_count(self):\n        \"\"\"\n        :type: integer\n        \"\"\"\n        self._completeIfNotSet(self._members_count)\n        return self._members_count.value\n\n    @property\n    def members_url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._members_url)\n        return self._members_url.value\n\n    @property\n    def name(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._name)\n        return self._name.value\n\n    @property\n    def permission(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._permission)\n        return self._permission.value\n\n    @property\n    def repos_count(self):\n        \"\"\"\n        :type: integer\n        \"\"\"\n        self._completeIfNotSet(self._repos_count)\n        return self._repos_count.value\n\n    @property\n    def repositories_url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._repositories_url)\n        return self._repositories_url.value\n\n    @property\n    def slug(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._slug)\n        return self._slug.value\n\n    @property\n    def url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._url)\n        return self._url.value\n\n    def add_to_members(self, member):\n        \"\"\"\n        :calls: `PUT /teams/:id/members/:user <http://developer.github.com/v3/orgs/teams>`_\n        :param member: :class:`github.NamedUser.NamedUser`\n        :rtype: None\n        \"\"\"\n        assert isinstance(member, github.NamedUser.NamedUser), member\n        headers, data = self._requester.requestJsonAndCheck(\n            \"PUT\",\n            self.url + \"/members/\" + member._identity\n        )\n\n    def add_membership(self, member, role=github.GithubObject.NotSet):\n        \"\"\"\n        :calls: `PUT /teams/:id/memberships/:user <http://developer.github.com/v3/orgs/teams>`_\n        :param member: :class:`github.Nameduser.NamedUser`\n        :param role: string\n        :rtype: None\n        \"\"\"\n        assert isinstance(member, github.NamedUser.NamedUser), member\n        assert role is github.GithubObject.NotSet or isinstance(\n            role, (str, unicode)), role\n        if role is not github.GithubObject.NotSet:\n            assert role in ['member', 'maintainer']\n            put_parameters = {\n                \"role\": role,\n            }\n        else:\n            put_parameters = {\n                \"role\": \"member\",\n            }\n        headers, data = self._requester.requestJsonAndCheck(\n            \"PUT\",\n            self.url + \"/memberships/\" + member._identity,\n            input=put_parameters\n        )\n\n    def add_to_repos(self, repo):\n        \"\"\"\n        :calls: `PUT /teams/:id/repos/:org/:repo <http://developer.github.com/v3/orgs/teams>`_\n        :param repo: :class:`github.Repository.Repository`\n        :rtype: None\n        \"\"\"\n        assert isinstance(repo, github.Repository.Repository), repo\n        headers, data = self._requester.requestJsonAndCheck(\n            \"PUT\",\n            self.url + \"/repos/\" + repo._identity\n        )\n\n    def set_repo_permission(self, repo, permission):\n        \"\"\"\n        :calls: `PUT /teams/:id/repos/:org/:repo <http://developer.github.com/v3/orgs/teams>`_\n        :param repo: :class:`github.Repository.Repository`\n        :param permission: string\n        :rtype: None\n        \"\"\"\n        assert isinstance(repo, github.Repository.Repository), repo\n        put_parameters = {\n            \"permission\": permission,\n        }\n        headers, data = self._requester.requestJsonAndCheck(\n            \"PUT\",\n            self.url + \"/repos/\" + repo._identity,\n            input=put_parameters\n        )\n\n    def delete(self):\n        \"\"\"\n        :calls: `DELETE /teams/:id <http://developer.github.com/v3/orgs/teams>`_\n        :rtype: None\n        \"\"\"\n        headers, data = self._requester.requestJsonAndCheck(\n            \"DELETE\",\n            self.url\n        )\n\n    def edit(self, name, permission=github.GithubObject.NotSet):\n        \"\"\"\n        :calls: `PATCH /teams/:id <http://developer.github.com/v3/orgs/teams>`_\n        :param name: string\n        :param permission: string\n        :rtype: None\n        \"\"\"\n        assert isinstance(name, (str, unicode)), name\n        assert permission is github.GithubObject.NotSet or isinstance(permission, (str, unicode)), permission\n        post_parameters = {\n            \"name\": name,\n        }\n        if permission is not github.GithubObject.NotSet:\n            post_parameters[\"permission\"] = permission\n        headers, data = self._requester.requestJsonAndCheck(\n            \"PATCH\",\n            self.url,\n            input=post_parameters\n        )\n        self._useAttributes(data)\n\n    def get_members(self):\n        \"\"\"\n        :calls: `GET /teams/:id/members <http://developer.github.com/v3/orgs/teams>`_\n        :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser`\n        \"\"\"\n        return github.PaginatedList.PaginatedList(\n            github.NamedUser.NamedUser,\n            self._requester,\n            self.url + \"/members\",\n            None\n        )\n\n    def get_repos(self):\n        \"\"\"\n        :calls: `GET /teams/:id/repos <http://developer.github.com/v3/orgs/teams>`_\n        :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository`\n        \"\"\"\n        return github.PaginatedList.PaginatedList(\n            github.Repository.Repository,\n            self._requester,\n            self.url + \"/repos\",\n            None\n        )\n\n    def has_in_members(self, member):\n        \"\"\"\n        :calls: `GET /teams/:id/members/:user <http://developer.github.com/v3/orgs/teams>`_\n        :param member: :class:`github.NamedUser.NamedUser`\n        :rtype: bool\n        \"\"\"\n        assert isinstance(member, github.NamedUser.NamedUser), member\n        status, headers, data = self._requester.requestJson(\n            \"GET\",\n            self.url + \"/members/\" + member._identity\n        )\n        return status == 204\n\n    def has_in_repos(self, repo):\n        \"\"\"\n        :calls: `GET /teams/:id/repos/:owner/:repo <http://developer.github.com/v3/orgs/teams>`_\n        :param repo: :class:`github.Repository.Repository`\n        :rtype: bool\n        \"\"\"\n        assert isinstance(repo, github.Repository.Repository), repo\n        status, headers, data = self._requester.requestJson(\n            \"GET\",\n            self.url + \"/repos/\" + repo._identity\n        )\n        return status == 204\n\n    def remove_from_members(self, member):\n        \"\"\"\n        :calls: `DELETE /teams/:id/members/:user <http://developer.github.com/v3/orgs/teams>`_\n        :param member: :class:`github.NamedUser.NamedUser`\n        :rtype: None\n        \"\"\"\n        assert isinstance(member, github.NamedUser.NamedUser), member\n        headers, data = self._requester.requestJsonAndCheck(\n            \"DELETE\",\n            self.url + \"/members/\" + member._identity\n        )\n\n    def remove_from_repos(self, repo):\n        \"\"\"\n        :calls: `DELETE /teams/:id/repos/:owner/:repo <http://developer.github.com/v3/orgs/teams>`_\n        :param repo: :class:`github.Repository.Repository`\n        :rtype: None\n        \"\"\"\n        assert isinstance(repo, github.Repository.Repository), repo\n        headers, data = self._requester.requestJsonAndCheck(\n            \"DELETE\",\n            self.url + \"/repos/\" + repo._identity\n        )\n\n    @property\n    def _identity(self):\n        return self.id\n\n    def _initAttributes(self):\n        self._id = github.GithubObject.NotSet\n        self._members_count = github.GithubObject.NotSet\n        self._members_url = github.GithubObject.NotSet\n        self._name = github.GithubObject.NotSet\n        self._permission = github.GithubObject.NotSet\n        self._repos_count = github.GithubObject.NotSet\n        self._repositories_url = github.GithubObject.NotSet\n        self._slug = github.GithubObject.NotSet\n        self._url = github.GithubObject.NotSet\n\n    def _useAttributes(self, attributes):\n        if \"id\" in attributes:  # pragma no branch\n            self._id = self._makeIntAttribute(attributes[\"id\"])\n        if \"members_count\" in attributes:  # pragma no branch\n            self._members_count = self._makeIntAttribute(attributes[\"members_count\"])\n        if \"members_url\" in attributes:  # pragma no branch\n            self._members_url = self._makeStringAttribute(attributes[\"members_url\"])\n        if \"name\" in attributes:  # pragma no branch\n            self._name = self._makeStringAttribute(attributes[\"name\"])\n        if \"permission\" in attributes:  # pragma no branch\n            self._permission = self._makeStringAttribute(attributes[\"permission\"])\n        if \"repos_count\" in attributes:  # pragma no branch\n            self._repos_count = self._makeIntAttribute(attributes[\"repos_count\"])\n        if \"repositories_url\" in attributes:  # pragma no branch\n            self._repositories_url = self._makeStringAttribute(attributes[\"repositories_url\"])\n        if \"slug\" in attributes:  # pragma no branch\n            self._slug = self._makeStringAttribute(attributes[\"slug\"])\n        if \"url\" in attributes:  # pragma no branch\n            self._url = self._makeStringAttribute(attributes[\"url\"])\n", "path": "github/Team.py"}]}