We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
List pull requests based on commit
There's a functionality on the Github API that is apparently not supported on PyGithub -- https://developer.github.com/v3/repos/commits/#list-pull-requests-associated-with-commit

## Motivation

I'm doing an auto-versioning type of thing on my repo, and I need to walk through all the pull requests searching for labels. I can get all the commits since the last release using `<repo>.get_commits(since=date_from_last_release)`. It would be incredibly useful if those commits came with their associated pull requests - that way I could simply check for each label on those.

I couldn't find this functionality on the documentation or reading the code, and I couldn't find another decent way to do this on the current PyGithub implementation.

## Caveats

This feature seems to be in preview period and the API might change, so it's probably not worth doing this right now (if ever).

--- 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/Commit.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 # Copyright 2014 Andy Casey <acasey@mso.anu.edu.au>                            #
11 # Copyright 2014 Vincent Jacques <vincent@vincent-jacques.net>                 #
12 # Copyright 2016 Jannis Gebauer <ja.geb@me.com>                                #
13 # Copyright 2016 John Eskew <jeskew@edx.org>                                   #
14 # Copyright 2016 Peter Buckley <dx-pbuckley@users.noreply.github.com>          #
15 # Copyright 2018 sfdye <tsfdye@gmail.com>                                      #
16 #                                                                              #
17 # This file is part of PyGithub.                                               #
18 # http://pygithub.readthedocs.io/                                              #
19 #                                                                              #
20 # PyGithub is free software: you can redistribute it and/or modify it under    #
21 # the terms of the GNU Lesser General Public License as published by the Free  #
22 # Software Foundation, either version 3 of the License, or (at your option)    #
23 # any later version.                                                           #
24 #                                                                              #
25 # PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY  #
26 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS    #
27 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
28 # details.                                                                     #
29 #                                                                              #
30 # You should have received a copy of the GNU Lesser General Public License     #
31 # along with PyGithub. If not, see <http://www.gnu.org/licenses/>.             #
32 #                                                                              #
33 ################################################################################
34 
35 import github.CommitCombinedStatus
36 import github.CommitComment
37 import github.CommitStats
38 import github.CommitStatus
39 import github.File
40 import github.GitCommit
41 import github.GithubObject
42 import github.NamedUser
43 import github.PaginatedList
44 
45 
46 class Commit(github.GithubObject.CompletableGithubObject):
47     """
48     This class represents Commits. The reference can be found here http://developer.github.com/v3/git/commits/
49     """
50 
51     def __repr__(self):
52         return self.get__repr__({"sha": self._sha.value})
53 
54     @property
55     def author(self):
56         """
57         :type: :class:`github.NamedUser.NamedUser`
58         """
59         self._completeIfNotSet(self._author)
60         return self._author.value
61 
62     @property
63     def comments_url(self):
64         """
65         :type: string
66         """
67         self._completeIfNotSet(self._comments_url)
68         return self._comments_url.value
69 
70     @property
71     def commit(self):
72         """
73         :type: :class:`github.GitCommit.GitCommit`
74         """
75         self._completeIfNotSet(self._commit)
76         return self._commit.value
77 
78     @property
79     def committer(self):
80         """
81         :type: :class:`github.NamedUser.NamedUser`
82         """
83         self._completeIfNotSet(self._committer)
84         return self._committer.value
85 
86     @property
87     def files(self):
88         """
89         :type: list of :class:`github.File.File`
90         """
91         self._completeIfNotSet(self._files)
92         return self._files.value
93 
94     @property
95     def html_url(self):
96         """
97         :type: string
98         """
99         self._completeIfNotSet(self._html_url)
100         return self._html_url.value
101 
102     @property
103     def parents(self):
104         """
105         :type: list of :class:`github.Commit.Commit`
106         """
107         self._completeIfNotSet(self._parents)
108         return self._parents.value
109 
110     @property
111     def sha(self):
112         """
113         :type: string
114         """
115         self._completeIfNotSet(self._sha)
116         return self._sha.value
117 
118     @property
119     def stats(self):
120         """
121         :type: :class:`github.CommitStats.CommitStats`
122         """
123         self._completeIfNotSet(self._stats)
124         return self._stats.value
125 
126     @property
127     def url(self):
128         """
129         :type: string
130         """
131         self._completeIfNotSet(self._url)
132         return self._url.value
133 
134     def create_comment(
135         self,
136         body,
137         line=github.GithubObject.NotSet,
138         path=github.GithubObject.NotSet,
139         position=github.GithubObject.NotSet,
140     ):
141         """
142         :calls: `POST /repos/:owner/:repo/commits/:sha/comments <http://developer.github.com/v3/repos/comments>`_
143         :param body: string
144         :param line: integer
145         :param path: string
146         :param position: integer
147         :rtype: :class:`github.CommitComment.CommitComment`
148         """
149         assert isinstance(body, str), body
150         assert line is github.GithubObject.NotSet or isinstance(line, int), line
151         assert path is github.GithubObject.NotSet or isinstance(path, str), path
152         assert position is github.GithubObject.NotSet or isinstance(
153             position, int
154         ), position
155         post_parameters = {
156             "body": body,
157         }
158         if line is not github.GithubObject.NotSet:
159             post_parameters["line"] = line
160         if path is not github.GithubObject.NotSet:
161             post_parameters["path"] = path
162         if position is not github.GithubObject.NotSet:
163             post_parameters["position"] = position
164         headers, data = self._requester.requestJsonAndCheck(
165             "POST", self.url + "/comments", input=post_parameters
166         )
167         return github.CommitComment.CommitComment(
168             self._requester, headers, data, completed=True
169         )
170 
171     def create_status(
172         self,
173         state,
174         target_url=github.GithubObject.NotSet,
175         description=github.GithubObject.NotSet,
176         context=github.GithubObject.NotSet,
177     ):
178         """
179         :calls: `POST /repos/:owner/:repo/statuses/:sha <http://developer.github.com/v3/repos/statuses>`_
180         :param state: string
181         :param target_url: string
182         :param description: string
183         :param context: string
184         :rtype: :class:`github.CommitStatus.CommitStatus`
185         """
186         assert isinstance(state, str), state
187         assert target_url is github.GithubObject.NotSet or isinstance(
188             target_url, str
189         ), target_url
190         assert description is github.GithubObject.NotSet or isinstance(
191             description, str
192         ), description
193         assert context is github.GithubObject.NotSet or isinstance(
194             context, str
195         ), context
196         post_parameters = {
197             "state": state,
198         }
199         if target_url is not github.GithubObject.NotSet:
200             post_parameters["target_url"] = target_url
201         if description is not github.GithubObject.NotSet:
202             post_parameters["description"] = description
203         if context is not github.GithubObject.NotSet:
204             post_parameters["context"] = context
205         headers, data = self._requester.requestJsonAndCheck(
206             "POST",
207             self._parentUrl(self._parentUrl(self.url)) + "/statuses/" + self.sha,
208             input=post_parameters,
209         )
210         return github.CommitStatus.CommitStatus(
211             self._requester, headers, data, completed=True
212         )
213 
214     def get_comments(self):
215         """
216         :calls: `GET /repos/:owner/:repo/commits/:sha/comments <http://developer.github.com/v3/repos/comments>`_
217         :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.CommitComment.CommitComment`
218         """
219         return github.PaginatedList.PaginatedList(
220             github.CommitComment.CommitComment,
221             self._requester,
222             self.url + "/comments",
223             None,
224         )
225 
226     def get_statuses(self):
227         """
228         :calls: `GET /repos/:owner/:repo/statuses/:ref <http://developer.github.com/v3/repos/statuses>`_
229         :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.CommitStatus.CommitStatus`
230         """
231         return github.PaginatedList.PaginatedList(
232             github.CommitStatus.CommitStatus,
233             self._requester,
234             self._parentUrl(self._parentUrl(self.url)) + "/statuses/" + self.sha,
235             None,
236         )
237 
238     def get_combined_status(self):
239         """
240         :calls: `GET /repos/:owner/:repo/commits/:ref/status/ <http://developer.github.com/v3/repos/statuses>`_
241         :rtype: :class:`github.CommitCombinedStatus.CommitCombinedStatus`
242         """
243         headers, data = self._requester.requestJsonAndCheck("GET", self.url + "/status")
244         return github.CommitCombinedStatus.CommitCombinedStatus(
245             self._requester, headers, data, completed=True
246         )
247 
248     @property
249     def _identity(self):
250         return self.sha
251 
252     def _initAttributes(self):
253         self._author = github.GithubObject.NotSet
254         self._comments_url = github.GithubObject.NotSet
255         self._commit = github.GithubObject.NotSet
256         self._committer = github.GithubObject.NotSet
257         self._files = github.GithubObject.NotSet
258         self._html_url = github.GithubObject.NotSet
259         self._parents = github.GithubObject.NotSet
260         self._sha = github.GithubObject.NotSet
261         self._stats = github.GithubObject.NotSet
262         self._url = github.GithubObject.NotSet
263 
264     def _useAttributes(self, attributes):
265         if "author" in attributes:  # pragma no branch
266             self._author = self._makeClassAttribute(
267                 github.NamedUser.NamedUser, attributes["author"]
268             )
269         if "comments_url" in attributes:  # pragma no branch
270             self._comments_url = self._makeStringAttribute(attributes["comments_url"])
271         if "commit" in attributes:  # pragma no branch
272             self._commit = self._makeClassAttribute(
273                 github.GitCommit.GitCommit, attributes["commit"]
274             )
275         if "committer" in attributes:  # pragma no branch
276             self._committer = self._makeClassAttribute(
277                 github.NamedUser.NamedUser, attributes["committer"]
278             )
279         if "files" in attributes:  # pragma no branch
280             self._files = self._makeListOfClassesAttribute(
281                 github.File.File, attributes["files"]
282             )
283         if "html_url" in attributes:  # pragma no branch
284             self._html_url = self._makeStringAttribute(attributes["html_url"])
285         if "parents" in attributes:  # pragma no branch
286             self._parents = self._makeListOfClassesAttribute(
287                 Commit, attributes["parents"]
288             )
289         if "sha" in attributes:  # pragma no branch
290             self._sha = self._makeStringAttribute(attributes["sha"])
291         if "stats" in attributes:  # pragma no branch
292             self._stats = self._makeClassAttribute(
293                 github.CommitStats.CommitStats, attributes["stats"]
294             )
295         if "url" in attributes:  # pragma no branch
296             self._url = self._makeStringAttribute(attributes["url"])
297
```
--- 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/Commit.py b/github/Commit.py
--- a/github/Commit.py
+++ b/github/Commit.py
@@ -245,6 +245,19 @@
             self._requester, headers, data, completed=True
         )
 
+    def get_pulls(self):
+        """
+        :calls: `GET /repos/:owner/:repo/commits/:sha/pulls <https://developer.github.com/v3/repos/commits/#list-pull-requests-associated-with-commit>`_
+        :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.PullRequest.PullRequest`
+        """
+        return github.PaginatedList.PaginatedList(
+            github.PullRequest.PullRequest,
+            self._requester,
+            self.url + "/pulls",
+            None,
+            headers={"Accept": "application/vnd.github.groot-preview+json"},
+        )
+
     @property
     def _identity(self):
         return self.sha

{"golden_diff": "diff --git a/github/Commit.py b/github/Commit.py\n--- a/github/Commit.py\n+++ b/github/Commit.py\n@@ -245,6 +245,19 @@\n             self._requester, headers, data, completed=True\n         )\n \n+    def get_pulls(self):\n+        \"\"\"\n+        :calls: `GET /repos/:owner/:repo/commits/:sha/pulls <https://developer.github.com/v3/repos/commits/#list-pull-requests-associated-with-commit>`_\n+        :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.PullRequest.PullRequest`\n+        \"\"\"\n+        return github.PaginatedList.PaginatedList(\n+            github.PullRequest.PullRequest,\n+            self._requester,\n+            self.url + \"/pulls\",\n+            None,\n+            headers={\"Accept\": \"application/vnd.github.groot-preview+json\"},\n+        )\n+\n     @property\n     def _identity(self):\n         return self.sha\n", "issue": "List pull requests based on commit\nThere's a functionality on the Github API that is apparently not supported on PyGithub -- https://developer.github.com/v3/repos/commits/#list-pull-requests-associated-with-commit\r\n\r\n## Motivation\r\n\r\nI'm doing an auto-versioning type of thing on my repo, and I need to walk through all the pull requests searching for labels. I can get all the commits since the last release using `<repo>.get_commits(since=date_from_last_release)`. It would be incredibly useful if those commits came with their associated pull requests - that way I could simply check for each label on those.\r\n\r\nI couldn't find this functionality on the documentation or reading the code, and I couldn't find another decent way to do this on the current PyGithub implementation.\r\n\r\n## Caveats\r\n\r\nThis feature seems to be in preview period and the API might change, so it's probably not worth doing this right now (if ever).\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# Copyright 2014 Andy Casey <acasey@mso.anu.edu.au>                            #\n# Copyright 2014 Vincent Jacques <vincent@vincent-jacques.net>                 #\n# Copyright 2016 Jannis Gebauer <ja.geb@me.com>                                #\n# Copyright 2016 John Eskew <jeskew@edx.org>                                   #\n# Copyright 2016 Peter Buckley <dx-pbuckley@users.noreply.github.com>          #\n# Copyright 2018 sfdye <tsfdye@gmail.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 github.CommitCombinedStatus\nimport github.CommitComment\nimport github.CommitStats\nimport github.CommitStatus\nimport github.File\nimport github.GitCommit\nimport github.GithubObject\nimport github.NamedUser\nimport github.PaginatedList\n\n\nclass Commit(github.GithubObject.CompletableGithubObject):\n    \"\"\"\n    This class represents Commits. The reference can be found here http://developer.github.com/v3/git/commits/\n    \"\"\"\n\n    def __repr__(self):\n        return self.get__repr__({\"sha\": self._sha.value})\n\n    @property\n    def author(self):\n        \"\"\"\n        :type: :class:`github.NamedUser.NamedUser`\n        \"\"\"\n        self._completeIfNotSet(self._author)\n        return self._author.value\n\n    @property\n    def comments_url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._comments_url)\n        return self._comments_url.value\n\n    @property\n    def commit(self):\n        \"\"\"\n        :type: :class:`github.GitCommit.GitCommit`\n        \"\"\"\n        self._completeIfNotSet(self._commit)\n        return self._commit.value\n\n    @property\n    def committer(self):\n        \"\"\"\n        :type: :class:`github.NamedUser.NamedUser`\n        \"\"\"\n        self._completeIfNotSet(self._committer)\n        return self._committer.value\n\n    @property\n    def files(self):\n        \"\"\"\n        :type: list of :class:`github.File.File`\n        \"\"\"\n        self._completeIfNotSet(self._files)\n        return self._files.value\n\n    @property\n    def html_url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._html_url)\n        return self._html_url.value\n\n    @property\n    def parents(self):\n        \"\"\"\n        :type: list of :class:`github.Commit.Commit`\n        \"\"\"\n        self._completeIfNotSet(self._parents)\n        return self._parents.value\n\n    @property\n    def sha(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._sha)\n        return self._sha.value\n\n    @property\n    def stats(self):\n        \"\"\"\n        :type: :class:`github.CommitStats.CommitStats`\n        \"\"\"\n        self._completeIfNotSet(self._stats)\n        return self._stats.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 create_comment(\n        self,\n        body,\n        line=github.GithubObject.NotSet,\n        path=github.GithubObject.NotSet,\n        position=github.GithubObject.NotSet,\n    ):\n        \"\"\"\n        :calls: `POST /repos/:owner/:repo/commits/:sha/comments <http://developer.github.com/v3/repos/comments>`_\n        :param body: string\n        :param line: integer\n        :param path: string\n        :param position: integer\n        :rtype: :class:`github.CommitComment.CommitComment`\n        \"\"\"\n        assert isinstance(body, str), body\n        assert line is github.GithubObject.NotSet or isinstance(line, int), line\n        assert path is github.GithubObject.NotSet or isinstance(path, str), path\n        assert position is github.GithubObject.NotSet or isinstance(\n            position, int\n        ), position\n        post_parameters = {\n            \"body\": body,\n        }\n        if line is not github.GithubObject.NotSet:\n            post_parameters[\"line\"] = line\n        if path is not github.GithubObject.NotSet:\n            post_parameters[\"path\"] = path\n        if position is not github.GithubObject.NotSet:\n            post_parameters[\"position\"] = position\n        headers, data = self._requester.requestJsonAndCheck(\n            \"POST\", self.url + \"/comments\", input=post_parameters\n        )\n        return github.CommitComment.CommitComment(\n            self._requester, headers, data, completed=True\n        )\n\n    def create_status(\n        self,\n        state,\n        target_url=github.GithubObject.NotSet,\n        description=github.GithubObject.NotSet,\n        context=github.GithubObject.NotSet,\n    ):\n        \"\"\"\n        :calls: `POST /repos/:owner/:repo/statuses/:sha <http://developer.github.com/v3/repos/statuses>`_\n        :param state: string\n        :param target_url: string\n        :param description: string\n        :param context: string\n        :rtype: :class:`github.CommitStatus.CommitStatus`\n        \"\"\"\n        assert isinstance(state, str), state\n        assert target_url is github.GithubObject.NotSet or isinstance(\n            target_url, str\n        ), target_url\n        assert description is github.GithubObject.NotSet or isinstance(\n            description, str\n        ), description\n        assert context is github.GithubObject.NotSet or isinstance(\n            context, str\n        ), context\n        post_parameters = {\n            \"state\": state,\n        }\n        if target_url is not github.GithubObject.NotSet:\n            post_parameters[\"target_url\"] = target_url\n        if description is not github.GithubObject.NotSet:\n            post_parameters[\"description\"] = description\n        if context is not github.GithubObject.NotSet:\n            post_parameters[\"context\"] = context\n        headers, data = self._requester.requestJsonAndCheck(\n            \"POST\",\n            self._parentUrl(self._parentUrl(self.url)) + \"/statuses/\" + self.sha,\n            input=post_parameters,\n        )\n        return github.CommitStatus.CommitStatus(\n            self._requester, headers, data, completed=True\n        )\n\n    def get_comments(self):\n        \"\"\"\n        :calls: `GET /repos/:owner/:repo/commits/:sha/comments <http://developer.github.com/v3/repos/comments>`_\n        :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.CommitComment.CommitComment`\n        \"\"\"\n        return github.PaginatedList.PaginatedList(\n            github.CommitComment.CommitComment,\n            self._requester,\n            self.url + \"/comments\",\n            None,\n        )\n\n    def get_statuses(self):\n        \"\"\"\n        :calls: `GET /repos/:owner/:repo/statuses/:ref <http://developer.github.com/v3/repos/statuses>`_\n        :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.CommitStatus.CommitStatus`\n        \"\"\"\n        return github.PaginatedList.PaginatedList(\n            github.CommitStatus.CommitStatus,\n            self._requester,\n            self._parentUrl(self._parentUrl(self.url)) + \"/statuses/\" + self.sha,\n            None,\n        )\n\n    def get_combined_status(self):\n        \"\"\"\n        :calls: `GET /repos/:owner/:repo/commits/:ref/status/ <http://developer.github.com/v3/repos/statuses>`_\n        :rtype: :class:`github.CommitCombinedStatus.CommitCombinedStatus`\n        \"\"\"\n        headers, data = self._requester.requestJsonAndCheck(\"GET\", self.url + \"/status\")\n        return github.CommitCombinedStatus.CommitCombinedStatus(\n            self._requester, headers, data, completed=True\n        )\n\n    @property\n    def _identity(self):\n        return self.sha\n\n    def _initAttributes(self):\n        self._author = github.GithubObject.NotSet\n        self._comments_url = github.GithubObject.NotSet\n        self._commit = github.GithubObject.NotSet\n        self._committer = github.GithubObject.NotSet\n        self._files = github.GithubObject.NotSet\n        self._html_url = github.GithubObject.NotSet\n        self._parents = github.GithubObject.NotSet\n        self._sha = github.GithubObject.NotSet\n        self._stats = github.GithubObject.NotSet\n        self._url = github.GithubObject.NotSet\n\n    def _useAttributes(self, attributes):\n        if \"author\" in attributes:  # pragma no branch\n            self._author = self._makeClassAttribute(\n                github.NamedUser.NamedUser, attributes[\"author\"]\n            )\n        if \"comments_url\" in attributes:  # pragma no branch\n            self._comments_url = self._makeStringAttribute(attributes[\"comments_url\"])\n        if \"commit\" in attributes:  # pragma no branch\n            self._commit = self._makeClassAttribute(\n                github.GitCommit.GitCommit, attributes[\"commit\"]\n            )\n        if \"committer\" in attributes:  # pragma no branch\n            self._committer = self._makeClassAttribute(\n                github.NamedUser.NamedUser, attributes[\"committer\"]\n            )\n        if \"files\" in attributes:  # pragma no branch\n            self._files = self._makeListOfClassesAttribute(\n                github.File.File, attributes[\"files\"]\n            )\n        if \"html_url\" in attributes:  # pragma no branch\n            self._html_url = self._makeStringAttribute(attributes[\"html_url\"])\n        if \"parents\" in attributes:  # pragma no branch\n            self._parents = self._makeListOfClassesAttribute(\n                Commit, attributes[\"parents\"]\n            )\n        if \"sha\" in attributes:  # pragma no branch\n            self._sha = self._makeStringAttribute(attributes[\"sha\"])\n        if \"stats\" in attributes:  # pragma no branch\n            self._stats = self._makeClassAttribute(\n                github.CommitStats.CommitStats, attributes[\"stats\"]\n            )\n        if \"url\" in attributes:  # pragma no branch\n            self._url = self._makeStringAttribute(attributes[\"url\"])\n", "path": "github/Commit.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# Copyright 2014 Andy Casey <acasey@mso.anu.edu.au>                            #\n# Copyright 2014 Vincent Jacques <vincent@vincent-jacques.net>                 #\n# Copyright 2016 Jannis Gebauer <ja.geb@me.com>                                #\n# Copyright 2016 John Eskew <jeskew@edx.org>                                   #\n# Copyright 2016 Peter Buckley <dx-pbuckley@users.noreply.github.com>          #\n# Copyright 2018 sfdye <tsfdye@gmail.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 github.CommitCombinedStatus\nimport github.CommitComment\nimport github.CommitStats\nimport github.CommitStatus\nimport github.File\nimport github.GitCommit\nimport github.GithubObject\nimport github.NamedUser\nimport github.PaginatedList\n\n\nclass Commit(github.GithubObject.CompletableGithubObject):\n    \"\"\"\n    This class represents Commits. The reference can be found here http://developer.github.com/v3/git/commits/\n    \"\"\"\n\n    def __repr__(self):\n        return self.get__repr__({\"sha\": self._sha.value})\n\n    @property\n    def author(self):\n        \"\"\"\n        :type: :class:`github.NamedUser.NamedUser`\n        \"\"\"\n        self._completeIfNotSet(self._author)\n        return self._author.value\n\n    @property\n    def comments_url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._comments_url)\n        return self._comments_url.value\n\n    @property\n    def commit(self):\n        \"\"\"\n        :type: :class:`github.GitCommit.GitCommit`\n        \"\"\"\n        self._completeIfNotSet(self._commit)\n        return self._commit.value\n\n    @property\n    def committer(self):\n        \"\"\"\n        :type: :class:`github.NamedUser.NamedUser`\n        \"\"\"\n        self._completeIfNotSet(self._committer)\n        return self._committer.value\n\n    @property\n    def files(self):\n        \"\"\"\n        :type: list of :class:`github.File.File`\n        \"\"\"\n        self._completeIfNotSet(self._files)\n        return self._files.value\n\n    @property\n    def html_url(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._html_url)\n        return self._html_url.value\n\n    @property\n    def parents(self):\n        \"\"\"\n        :type: list of :class:`github.Commit.Commit`\n        \"\"\"\n        self._completeIfNotSet(self._parents)\n        return self._parents.value\n\n    @property\n    def sha(self):\n        \"\"\"\n        :type: string\n        \"\"\"\n        self._completeIfNotSet(self._sha)\n        return self._sha.value\n\n    @property\n    def stats(self):\n        \"\"\"\n        :type: :class:`github.CommitStats.CommitStats`\n        \"\"\"\n        self._completeIfNotSet(self._stats)\n        return self._stats.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 create_comment(\n        self,\n        body,\n        line=github.GithubObject.NotSet,\n        path=github.GithubObject.NotSet,\n        position=github.GithubObject.NotSet,\n    ):\n        \"\"\"\n        :calls: `POST /repos/:owner/:repo/commits/:sha/comments <http://developer.github.com/v3/repos/comments>`_\n        :param body: string\n        :param line: integer\n        :param path: string\n        :param position: integer\n        :rtype: :class:`github.CommitComment.CommitComment`\n        \"\"\"\n        assert isinstance(body, str), body\n        assert line is github.GithubObject.NotSet or isinstance(line, int), line\n        assert path is github.GithubObject.NotSet or isinstance(path, str), path\n        assert position is github.GithubObject.NotSet or isinstance(\n            position, int\n        ), position\n        post_parameters = {\n            \"body\": body,\n        }\n        if line is not github.GithubObject.NotSet:\n            post_parameters[\"line\"] = line\n        if path is not github.GithubObject.NotSet:\n            post_parameters[\"path\"] = path\n        if position is not github.GithubObject.NotSet:\n            post_parameters[\"position\"] = position\n        headers, data = self._requester.requestJsonAndCheck(\n            \"POST\", self.url + \"/comments\", input=post_parameters\n        )\n        return github.CommitComment.CommitComment(\n            self._requester, headers, data, completed=True\n        )\n\n    def create_status(\n        self,\n        state,\n        target_url=github.GithubObject.NotSet,\n        description=github.GithubObject.NotSet,\n        context=github.GithubObject.NotSet,\n    ):\n        \"\"\"\n        :calls: `POST /repos/:owner/:repo/statuses/:sha <http://developer.github.com/v3/repos/statuses>`_\n        :param state: string\n        :param target_url: string\n        :param description: string\n        :param context: string\n        :rtype: :class:`github.CommitStatus.CommitStatus`\n        \"\"\"\n        assert isinstance(state, str), state\n        assert target_url is github.GithubObject.NotSet or isinstance(\n            target_url, str\n        ), target_url\n        assert description is github.GithubObject.NotSet or isinstance(\n            description, str\n        ), description\n        assert context is github.GithubObject.NotSet or isinstance(\n            context, str\n        ), context\n        post_parameters = {\n            \"state\": state,\n        }\n        if target_url is not github.GithubObject.NotSet:\n            post_parameters[\"target_url\"] = target_url\n        if description is not github.GithubObject.NotSet:\n            post_parameters[\"description\"] = description\n        if context is not github.GithubObject.NotSet:\n            post_parameters[\"context\"] = context\n        headers, data = self._requester.requestJsonAndCheck(\n            \"POST\",\n            self._parentUrl(self._parentUrl(self.url)) + \"/statuses/\" + self.sha,\n            input=post_parameters,\n        )\n        return github.CommitStatus.CommitStatus(\n            self._requester, headers, data, completed=True\n        )\n\n    def get_comments(self):\n        \"\"\"\n        :calls: `GET /repos/:owner/:repo/commits/:sha/comments <http://developer.github.com/v3/repos/comments>`_\n        :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.CommitComment.CommitComment`\n        \"\"\"\n        return github.PaginatedList.PaginatedList(\n            github.CommitComment.CommitComment,\n            self._requester,\n            self.url + \"/comments\",\n            None,\n        )\n\n    def get_statuses(self):\n        \"\"\"\n        :calls: `GET /repos/:owner/:repo/statuses/:ref <http://developer.github.com/v3/repos/statuses>`_\n        :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.CommitStatus.CommitStatus`\n        \"\"\"\n        return github.PaginatedList.PaginatedList(\n            github.CommitStatus.CommitStatus,\n            self._requester,\n            self._parentUrl(self._parentUrl(self.url)) + \"/statuses/\" + self.sha,\n            None,\n        )\n\n    def get_combined_status(self):\n        \"\"\"\n        :calls: `GET /repos/:owner/:repo/commits/:ref/status/ <http://developer.github.com/v3/repos/statuses>`_\n        :rtype: :class:`github.CommitCombinedStatus.CommitCombinedStatus`\n        \"\"\"\n        headers, data = self._requester.requestJsonAndCheck(\"GET\", self.url + \"/status\")\n        return github.CommitCombinedStatus.CommitCombinedStatus(\n            self._requester, headers, data, completed=True\n        )\n\n    def get_pulls(self):\n        \"\"\"\n        :calls: `GET /repos/:owner/:repo/commits/:sha/pulls <https://developer.github.com/v3/repos/commits/#list-pull-requests-associated-with-commit>`_\n        :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.PullRequest.PullRequest`\n        \"\"\"\n        return github.PaginatedList.PaginatedList(\n            github.PullRequest.PullRequest,\n            self._requester,\n            self.url + \"/pulls\",\n            None,\n            headers={\"Accept\": \"application/vnd.github.groot-preview+json\"},\n        )\n\n    @property\n    def _identity(self):\n        return self.sha\n\n    def _initAttributes(self):\n        self._author = github.GithubObject.NotSet\n        self._comments_url = github.GithubObject.NotSet\n        self._commit = github.GithubObject.NotSet\n        self._committer = github.GithubObject.NotSet\n        self._files = github.GithubObject.NotSet\n        self._html_url = github.GithubObject.NotSet\n        self._parents = github.GithubObject.NotSet\n        self._sha = github.GithubObject.NotSet\n        self._stats = github.GithubObject.NotSet\n        self._url = github.GithubObject.NotSet\n\n    def _useAttributes(self, attributes):\n        if \"author\" in attributes:  # pragma no branch\n            self._author = self._makeClassAttribute(\n                github.NamedUser.NamedUser, attributes[\"author\"]\n            )\n        if \"comments_url\" in attributes:  # pragma no branch\n            self._comments_url = self._makeStringAttribute(attributes[\"comments_url\"])\n        if \"commit\" in attributes:  # pragma no branch\n            self._commit = self._makeClassAttribute(\n                github.GitCommit.GitCommit, attributes[\"commit\"]\n            )\n        if \"committer\" in attributes:  # pragma no branch\n            self._committer = self._makeClassAttribute(\n                github.NamedUser.NamedUser, attributes[\"committer\"]\n            )\n        if \"files\" in attributes:  # pragma no branch\n            self._files = self._makeListOfClassesAttribute(\n                github.File.File, attributes[\"files\"]\n            )\n        if \"html_url\" in attributes:  # pragma no branch\n            self._html_url = self._makeStringAttribute(attributes[\"html_url\"])\n        if \"parents\" in attributes:  # pragma no branch\n            self._parents = self._makeListOfClassesAttribute(\n                Commit, attributes[\"parents\"]\n            )\n        if \"sha\" in attributes:  # pragma no branch\n            self._sha = self._makeStringAttribute(attributes[\"sha\"])\n        if \"stats\" in attributes:  # pragma no branch\n            self._stats = self._makeClassAttribute(\n                github.CommitStats.CommitStats, attributes[\"stats\"]\n            )\n        if \"url\" in attributes:  # pragma no branch\n            self._url = self._makeStringAttribute(attributes[\"url\"])\n", "path": "github/Commit.py"}]}