internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: zigpy/zha-device-handlers

Issue:
[Device Support Request] Zemismart Zigbee Roller Shade _TZE200_bv1jcqqu
Is your feature request related to a problem? Please describe.
Request cover support for Zigbee roller shades _TZE200_bv1jcqqu

Describe the solution you'd like
Add cover support for the _TZE200_bv1jcqqu roller shade. Specifically the Zemismart ZM25RZ01 tubular rechargeable zigbee motor.

<details><summary>Device Signature</summary>

```
{
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4098, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)",
  "endpoints": {
    "1": {
      "profile_id": 260,
      "device_type": "0x0051",
      "in_clusters": [
        "0x0000",
        "0x0004",
        "0x0005",
        "0xef00"
      ],
      "out_clusters": [
        "0x000a",
        "0x0019"
      ]
    }
  },
  "manufacturer": "_TZE200_7eue9vhc",
  "model": "TS0601",
  "class": "zigpy.device.Device"
}
``` 

</details> 


Discussion:

Resolving patch:
diff --git a/zhaquirks/tuya/ts0601_cover.py b/zhaquirks/tuya/ts0601_cover.py
--- a/zhaquirks/tuya/ts0601_cover.py
+++ b/zhaquirks/tuya/ts0601_cover.py
@@ -371,6 +371,7 @@ class TuyaMoesCover0601(TuyaWindowCover):
             ("_TZE200_nhyj64w2", "TS0601"),
             ("_TZE200_cf1sl3tj", "TS0601"),
             ("_TZE200_7eue9vhc", "TS0601"),
+            ("_TZE200_bv1jcqqu", "TS0601"),
         ],
         ENDPOINTS: {
             1: {


Test patch:
Repository: PyGithub/PyGithub

Issue:
Another assertion error (reverse of #80)
We have a customer using an instance of GitHub Enterprise with a SSL-terminating proxy in front of it. This means that URLs to the server need to be HTTPS, but URLs received from the API responses are HTTP. I contacted GitHub and they do not support GHE behind an SSL-terminating proxy, but were considering supporting.

Thus we hit this assertion:

``` python
File "/endpoints/trigger.py", line 222, in list_build_sources
  for repo in org.get_repos(type='member'):
File "/venv/local/lib/python2.7/site-packages/github/PaginatedList.py", line 48, in __iter__
  newElements = self._grow()
File "/venv/local/lib/python2.7/site-packages/github/PaginatedList.py", line 60, in _grow
  newElements = self._fetchNextPage()
File "/venv/local/lib/python2.7/site-packages/github/PaginatedList.py", line 158, in _fetchNextPage
  parameters=self.__nextParams
File "/venv/local/lib/python2.7/site-packages/github/Requester.py", line 169, in requestJsonAndCheck
  return self.__check(*self.requestJson(verb, url, parameters, headers, input, cnx))
File "/venv/local/lib/python2.7/site-packages/github/Requester.py", line 210, in requestJson
  return self.__requestEncode(cnx, verb, url, parameters, headers, input, encode)
File "/venv/local/lib/python2.7/site-packages/github/Requester.py", line 238, in __requestEncode
  url = self.__makeAbsoluteUrl(url)
File "/venv/local/lib/python2.7/site-packages/github/Requester.py", line 299, in __makeAbsoluteUrl
  assert o.scheme == self.__scheme or o.scheme == "https" and self.__scheme == "http"  # Issue #80
AssertionError
```

My initial response is simply to delete this assertion. Correct me if I am wrong, but I believe that you are appending path+queryparams to the base URL, and thus the scheme shouldn't really matter anyway.



Discussion:

Resolving patch:
diff --git a/github/Requester.py b/github/Requester.py
--- a/github/Requester.py
+++ b/github/Requester.py
@@ -296,7 +296,6 @@ def __makeAbsoluteUrl(self, url):
             url = self.__prefix + url
         else:
             o = urlparse.urlparse(url)
-            assert o.scheme == self.__scheme or o.scheme == "https" and self.__scheme == "http"  # Issue #80
             assert o.hostname == self.__hostname
             assert o.path.startswith(self.__prefix)
             assert o.port == self.__port


Test patch:
Repository: PyGithub/PyGithub

Issue:
GistFile.content is None If Gist haven't complete
If gist object haven't complete, files in this gist has no content.
I create an pull request using Just4test account.


Discussion:

Resolving patch:
diff --git a/github/Gist.py b/github/Gist.py
--- a/github/Gist.py
+++ b/github/Gist.py
@@ -88,7 +88,7 @@ def files(self):
         """
         :type: dict of string to :class:`github.GistFile.GistFile`
         """
-        self._completeIfNotSet(self._files)
+        self._completeIfNeeded()
         return self._files.value
 
     @property


Test patch:
Repository: PyGithub/PyGithub

Issue:
GitHub Integration raises "NotImplementedError Algorithm not supported"
We have working github integration code using PyGithub v1.32 that does essentially:

```python
integration = github.GithubIntegration(settings.GITHUB_INTEGRATION_ID, settings.GITHUB_INTEGRATION_PRIVATE_PEM)
inst_token = integration.get_access_token(installation_id).token
```
After upgrading to v1.34 this code raises "NotImplementedError Algorithm not supported"

I suspect it has to do with the [switch to pyjwt from python-jose](https://github.com/PyGithub/PyGithub/commit/d447eb13b9f4688a4c981ca03b1b3111fb299142)


Discussion:
Could you post a stacktrace? 
Yeah, my bad.  Here is the relevant info:
```
inst_token = integration.get_access_token(installation_id).token
File "github/MainClass.py", line 657, in get_access_token
                  "Authorization": "Bearer {}".format(self.create_jwt()),
File "github/MainClass.py", line 638, in create_jwt
              algorithm="RS256"
File "jwt/api_jwt.py", line 56, in encode
              json_payload, key, algorithm, headers, json_encoder
File "jwt/api_jws.py", line 102, in encode
              raise NotImplementedError('Algorithm not supported')
NotImplementedErrorAlgorithm not supported
```
Ah, I see. `RS256` requires cryptography to be installed:

```
pip install cryptography
```

We should make that an extra that can be installed via `pygithub[integrations]` and document it.
Great, thanks for looking into it so quickly.  It's very much appreciated.  Thank you for the project as well, it's a great tool.

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -96,5 +96,8 @@
         use_2to3=True,
         install_requires=[
             "pyjwt"
-        ]
+        ],
+        extras_require = {
+            "integrations": ["cryptography"]
+        }
     )


Test patch:
Repository: PyGithub/PyGithub

Issue:
Comments do not include reply info
assert github.Github().get_user().get_repo("PyGithub").get_pull(664).get_comment(166456140).in_reply_to_id == "166453895"

Currently, in_reply_to_id is undefined.  This makes it impossible to understand the comment threading.


Discussion:

Resolving patch:
diff --git a/github/PullRequestComment.py b/github/PullRequestComment.py
--- a/github/PullRequestComment.py
+++ b/github/PullRequestComment.py
@@ -80,6 +80,14 @@ def id(self):
         self._completeIfNotSet(self._id)
         return self._id.value
 
+    @property
+    def in_reply_to_id(self):
+        """
+        :type: integer
+        """
+        self._completeIfNotSet(self._in_reply_to_id)
+        return self._in_reply_to_id.value
+
     @property
     def original_commit_id(self):
         """
@@ -221,6 +229,7 @@ def _initAttributes(self):
         self._created_at = github.GithubObject.NotSet
         self._diff_hunk = github.GithubObject.NotSet
         self._id = github.GithubObject.NotSet
+        self._in_reply_to_id = github.GithubObject.NotSet
         self._original_commit_id = github.GithubObject.NotSet
         self._original_position = github.GithubObject.NotSet
         self._path = github.GithubObject.NotSet
@@ -242,6 +251,8 @@ def _useAttributes(self, attributes):
             self._diff_hunk = self._makeStringAttribute(attributes["diff_hunk"])
         if "id" in attributes:  # pragma no branch
             self._id = self._makeIntAttribute(attributes["id"])
+        if "in_reply_to_id" in attributes:  # pragma no branch
+            self._in_reply_to_id = self._makeIntAttribute(attributes["in_reply_to_id"])
         if "original_commit_id" in attributes:  # pragma no branch
             self._original_commit_id = self._makeStringAttribute(attributes["original_commit_id"])
         if "original_position" in attributes:  # pragma no branch


Test patch:
Repository: PyGithub/PyGithub

Issue:
get_comments does not return the comments created with create_issue_comments
I notice that calling `get_comments` on a PR object does not return the comments created with `create_issue_comment`, it only returns the user-based comments made with the web interface. Similarly, `get_issue_comments` does not return the API-created comments.

This is quite counter-intuitive.

Is that on purpose?



Discussion:
Hi @monperrus Thanks for reporting.

Can you provide an example?
Steps to reproduce:

1. post comment x with create_issue_comment
1. get comment list with get_comments
1. check that x in in list (this fails, x is not the list)
@monperrus To answer your original question. Yes that's on purpose.

From https://developer.github.com/v3/pulls/comments/:
> Pull Request review comments are comments on a portion of the unified diff. These are separate from Commit Comments (which are applied directly to a commit, outside of the Pull Request view), and Issue Comments (which do not reference a portion of the unified diff).

So to summarize, PR review comment is different from issue comment. However, if you look at the source code, the `get_comments` method on PullRequest is actually an alias of `get_review_comments`. (probably a history problem, I don't know) 

`get_issue_comments` is what you want and I believe you should get what you created with `create_issue_comment` unless there is a caching or timing issue?

Resolving patch:
diff --git a/github/PullRequest.py b/github/PullRequest.py
--- a/github/PullRequest.py
+++ b/github/PullRequest.py
@@ -480,6 +480,7 @@ def get_review_comment(self, id):
 
     def get_comments(self):
         """
+        Warning: this only returns review comments. For normal conversation comments, use get_issue_comments.
         :calls: `GET /repos/:owner/:repo/pulls/:number/comments <http://developer.github.com/v3/pulls/comments>`_
         :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.PullRequestComment.PullRequestComment`
         """


Test patch:
Repository: PyGithub/PyGithub

Issue:
Add description to teams
As mentioned at https://developer.github.com/v3/orgs/teams/ , a team also has a description. This is currently not part of the Teams https://github.com/PyGithub/PyGithub/blob/master/github/Team.py

Would be great if this can be added



Discussion:

Resolving patch:
diff --git a/github/Team.py b/github/Team.py
--- a/github/Team.py
+++ b/github/Team.py
@@ -83,6 +83,14 @@ def name(self):
         self._completeIfNotSet(self._name)
         return self._name.value
 
+    @property
+    def description(self):
+        """
+        :type: string
+        """
+        self._completeIfNotSet(self._description)
+        return self.description.value
+
     @property
     def permission(self):
         """
@@ -317,6 +325,7 @@ def _initAttributes(self):
         self._members_count = github.GithubObject.NotSet
         self._members_url = github.GithubObject.NotSet
         self._name = github.GithubObject.NotSet
+        self._description = github.GithubObject.NotSet
         self._permission = github.GithubObject.NotSet
         self._repos_count = github.GithubObject.NotSet
         self._repositories_url = github.GithubObject.NotSet
@@ -333,6 +342,8 @@ def _useAttributes(self, attributes):
             self._members_url = self._makeStringAttribute(attributes["members_url"])
         if "name" in attributes:  # pragma no branch
             self._name = self._makeStringAttribute(attributes["name"])
+        if "description" in attributes:  # pragma no branch
+            self._description = self._makeStringAttribute(attributes["description"])
         if "permission" in attributes:  # pragma no branch
             self._permission = self._makeStringAttribute(attributes["permission"])
         if "repos_count" in attributes:  # pragma no branch


Test patch:
Repository: PyGithub/PyGithub

Issue:
Repository.get_tree_tree(sha, False) buggy
Passing `False` as the value for the `recursive` parameter in `Repository.get_git_tree()` causes the resulting URL to contain `?recursive=False`, which GitHub API treats as True. The only way to get a non-recursive tree is to not pass `recursive` at all. For that matter, passing `True` causes the resulting URL to contain `?recursive=True`, which under a strict interpretation of the API docs is also a bug (should be `?recursive=1`).

From the console debugging logs (much omitted...):

```
GET https://git.MY_CORP.com/api/v3/repos/MY_USER/MY_REPO/git/trees/MY_SHA?recursive=False {'Authorization': 'token (oauth token removed)', 'User-Agent': 'PyGithub/Python'} null ==> 200 {'statu...
```


Discussion:

Resolving patch:
diff --git a/github/Repository.py b/github/Repository.py
--- a/github/Repository.py
+++ b/github/Repository.py
@@ -1727,8 +1727,9 @@ def get_git_tree(self, sha, recursive=github.GithubObject.NotSet):
         assert isinstance(sha, (str, unicode)), sha
         assert recursive is github.GithubObject.NotSet or isinstance(recursive, bool), recursive
         url_parameters = dict()
-        if recursive is not github.GithubObject.NotSet:
-            url_parameters["recursive"] = recursive
+        if recursive is not github.GithubObject.NotSet and recursive:
+            # GitHub API requires the recursive parameter be set to 1.
+            url_parameters["recursive"] = 1
         headers, data = self._requester.requestJsonAndCheck(
             "GET",
             self.url + "/git/trees/" + sha,


Test patch:
diff --git a/github/tests/ReplayData/Repository.testGetGitTreeWithRecursive.txt b/github/tests/ReplayData/Repository.testGetGitTreeWithRecursive.txt
--- a/github/tests/ReplayData/Repository.testGetGitTreeWithRecursive.txt
+++ b/github/tests/ReplayData/Repository.testGetGitTreeWithRecursive.txt
@@ -2,7 +2,7 @@ https
 GET
 api.github.com
 None
-/repos/jacquev6/PyGithub/git/trees/f492784d8ca837779650d1fb406a1a3587a764ad?recursive=True
+/repos/jacquev6/PyGithub/git/trees/f492784d8ca837779650d1fb406a1a3587a764ad?recursive=1
 {'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
 None
 200
diff --git a/github/tests/Repository.py b/github/tests/Repository.py
--- a/github/tests/Repository.py
+++ b/github/tests/Repository.py
@@ -267,7 +267,7 @@ def testCreateGitTree(self):
         self.assertEqual(tree.sha, "41cf8c178c636a018d537cb20daae09391efd70b")
 
     def testCreateGitTreeWithBaseTree(self):
-        base_tree = self.repo.get_git_tree("41cf8c178c636a018d537cb20daae09391efd70b")
+        base_tree = self.repo.get_git_tree("41cf8c178c636a018d537cb20daae09391efd70b", recursive=False)
         tree = self.repo.create_git_tree(
             [github.InputGitTreeElement(
                 "Barbaz.txt",
Repository: PyGithub/PyGithub

Issue:
stack overflow for Team.description 

Missing `_` means stack overflow as property accessor calls itself indefinitely.

Should be `self._description.value` I suspect. 

Due to client open source policy I cannot submit a PR.

Team.py
```python
    @property
    def description(self):
        """
        :type: string
        """
        self._completeIfNotSet(self._description)
        return self.description.value
```


Discussion:

Resolving patch:
diff --git a/github/Team.py b/github/Team.py
--- a/github/Team.py
+++ b/github/Team.py
@@ -89,7 +89,7 @@ def description(self):
         :type: string
         """
         self._completeIfNotSet(self._description)
-        return self.description.value
+        return self._description.value
 
     @property
     def permission(self):


Test patch:
Repository: PyGithub/PyGithub

Issue:
Allow updating tag_name and target_commitish of GitRelease
GitHub API [allows updating](https://developer.github.com/v3/repos/releases/#edit-a-release) `tag_name` and `target_commitish` of a release, among `name`, `body`, `draft` and `prerelease`, but PyGithub API wrapper allows updating all of them but  `tag_name` and `target_commitish`:

https://github.com/PyGithub/PyGithub/blob/e389396405146bb1b0c4587de1f6f757a9514a43/github/GitRelease.py#L178-L199

Could we add `tag_name` and `target_commitish` parameters to that function?


Discussion:

Resolving patch:
diff --git a/github/GitRelease.py b/github/GitRelease.py
--- a/github/GitRelease.py
+++ b/github/GitRelease.py
@@ -175,22 +175,36 @@ def delete_release(self):
             self.url
         )
 
-    def update_release(self, name, message, draft=False, prerelease=False):
+    def update_release(self, name, message, draft=False, prerelease=False,
+                       tag_name=github.GithubObject.NotSet,
+                       target_commitish=github.GithubObject.NotSet):
         """
         :calls: `PATCH /repos/:owner/:repo/releases/:release_id <https://developer.github.com/v3/repos/releases/#edit-a-release>`_
         :rtype: :class:`github.GitRelease.GitRelease`
         """
+        assert tag_name is github.GithubObject.NotSet              \
+            or isinstance(tag_name, (str, unicode)),               \
+            'tag_name must be a str/unicode object'
+        assert target_commitish is github.GithubObject.NotSet      \
+            or isinstance(target_commitish, (str, unicode)),       \
+            'target_commitish must be a str/unicode object'
         assert isinstance(name, (str, unicode)), name
         assert isinstance(message, (str, unicode)), message
         assert isinstance(draft, bool), draft
         assert isinstance(prerelease, bool), prerelease
+        if tag_name is github.GithubObject.NotSet:
+            tag_name = self.tag_name
         post_parameters = {
-            "tag_name": self.tag_name,
+            "tag_name": tag_name,
             "name": name,
             "body": message,
             "draft": draft,
             "prerelease": prerelease,
         }
+        # Do not set target_commitish to self.target_commitish when ommited, just don't send it
+        # alltogether in that case, in order to match the Github API behaviour. Only send it when set.
+        if target_commitish is not github.GithubObject.NotSet:
+            post_parameters['target_commitish'] = target_commitish
         headers, data = self._requester.requestJsonAndCheck(
             "PATCH",
             self.url,


Test patch:
Repository: PyGithub/PyGithub

Issue:
Add 'visibility' parameter to get_repos
I'm working with Github Enterprise API and I cannot get a full list of private repositories without this parameter being allowed.  Only 'since' works here


Discussion:

Resolving patch:
diff --git a/github/MainClass.py b/github/MainClass.py
--- a/github/MainClass.py
+++ b/github/MainClass.py
@@ -297,16 +297,20 @@ def get_repo(self, full_name_or_id, lazy=False):
         )
         return Repository.Repository(self.__requester, headers, data, completed=True)
 
-    def get_repos(self, since=github.GithubObject.NotSet):
+    def get_repos(self, since=github.GithubObject.NotSet, visibility=github.GithubObject.NotSet):
         """
         :calls: `GET /repositories <http://developer.github.com/v3/repos/#list-all-public-repositories>`_
         :param since: integer
+        :param visibility: string ('all','public')
         :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository`
         """
         assert since is github.GithubObject.NotSet or isinstance(since, (int, long)), since
         url_parameters = dict()
         if since is not github.GithubObject.NotSet:
             url_parameters["since"] = since
+        if visibility is not github.GithubObject.NotSet:
+            assert visibility in ('public', 'all'), visibility
+            url_parameters["visibility"] = visibility
         return github.PaginatedList.PaginatedList(
             github.Repository.Repository,
             self.__requester,


Test patch:
Repository: PyGithub/PyGithub

Issue:
Organization needs get_team_by_slug()
https://developer.github.com/v3/teams/#get-team-by-name

This API call is missing. 


Discussion:
Hi I am new to the community and I would like to work on this issue.
Could anyone please explain this issue to me.

What exactly do i need to do ?

Resolving patch:
diff --git a/github/Organization.py b/github/Organization.py
--- a/github/Organization.py
+++ b/github/Organization.py
@@ -790,6 +790,19 @@ def get_team(self, id):
         )
         return github.Team.Team(self._requester, headers, data, completed=True)
 
+    def get_team_by_slug(self, slug):
+        """
+        :calls: `GET /orgs/:org/teams/:team_slug <https://developer.github.com/v3/teams>`_
+        :param slug: string
+        :rtype: :class:`github.Team.Team`
+        """
+        assert isinstance(slug, (str, unicode)), slug
+        headers, data = self._requester.requestJsonAndCheck(
+            "GET",
+            self.url + "/teams/" + slug
+        )
+        return github.Team.Team(self._requester, headers, data, completed=True)
+
     def get_teams(self):
         """
         :calls: `GET /orgs/:org/teams <http://developer.github.com/v3/orgs/teams>`_


Test patch:
diff --git a/tests/Organization.py b/tests/Organization.py
--- a/tests/Organization.py
+++ b/tests/Organization.py
@@ -188,6 +188,10 @@ def testGetEvents(self):
     def testGetTeams(self):
         self.assertListKeyEqual(self.org.get_teams(), lambda t: t.name, ["Members", "Owners"])
 
+    def testGetTeamBySlug(self):
+        team = self.org.get_team_by_slug("Members")
+        self.assertEqual(team.id, 141496)
+
     def testCreateHookWithMinimalParameters(self):
         hook = self.org.create_hook("web", {"url": "http://foobar.com"})
         self.assertEqual(hook.id, 257967)
@@ -255,4 +259,4 @@ def testCreateMigration(self):
 
     def testGetMigrations(self):
         self.org = self.g.get_organization("sample-test-organisation")
-        self.assertEqual(self.org.get_migrations().totalCount, 2)
\ No newline at end of file
+        self.assertEqual(self.org.get_migrations().totalCount, 2)
diff --git a/tests/ReplayData/Organization.testGetTeamBySlug.txt b/tests/ReplayData/Organization.testGetTeamBySlug.txt
new file mode 100644
--- /dev/null
+++ b/tests/ReplayData/Organization.testGetTeamBySlug.txt
@@ -0,0 +1,11 @@
+https
+GET
+api.github.com
+None
+/orgs/BeaverSoftware/teams/Members
+{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
+None
+200
+[('status', '200 OK'), ('x-ratelimit-remaining', '4994'), ('x-ratelimit-limit', '5000'), ('content-length', '128'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('etag', '"f93241eaf43847bcf38b352f25595e28"'), ('date', 'Tue, 18 Jun 2019 10:32:13 GMT'), ('content-type', 'application/json; charset=utf-8')]
+{"repos_count":1,"permission":"push","url":"https://api.github.com/teams/141496","name":"Members","id":141496,"members_count":1}
+