Repository: PyGithub/PyGithub

Issue:
Repository.get_issues() only loads state = open issues
Hi,
I am loading repositories with `github.get_repo(repo_name, lazy=False)`. Then I load the issues of that repository with `get_issues()`. I did that many times and only get issues with the state of "open".

When I use `get_issues(state="closed")` I only get closed issues.

From my point of view this is a bug because `get_issues()` without parameter should also get closed issues, not just open. Maybe this is the default of the Github API but then you should not default init the parameter to `NotSet` but to 'open' or at least give a hint in the API doc.

Can you guys check this please? Many thanks. :-)

And by the way: Thank you for this wonderful python lib.


Discussion:
Yes - I just saw that state = "open" is default in the Github API. See here:
https://developer.github.com/v3/issues/#list-issues-for-a-repository

I suggest to set this here too via `state='open'`:
https://github.com/PyGithub/PyGithub/blob/master/github/Repository.py#L1788
`def get_issues(self, milestone=github.GithubObject.NotSet, state='open', assignee=github.GithubObject.NotSet, mentioned=github.GithubObject.NotSet, labels=github.GithubObject.NotSet, sort=github.GithubObject.NotSet, direction=github.GithubObject.NotSet, since=github.GithubObject.NotSet, creator=github.GithubObject.NotSet):`

This way it is more clear for the user of the function about what is happening here.
IMO, the default behavior is what Github returns when you don't provide anything, say the `state` parameter. We don't want to hard-code it in the method definition. For example, if Github changes this default behavior to return `all` issues, then this function will break. What do you think?
Well. You are right. When Github would change the default behavior you would have to change your default too. But you only would have to do that when you want to do the same as Github.
From my point of view it would be logical to load "all" issues by default. So you could just provide "all" as default and give a hint about this in the api documentation. Noone forces you to do exactly the same as Github.

When you want to avoid this you should at least write into the API documentation that at the moment (you can provide a date) the default only loads open issues.

What do you think?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@sfdye What do you think of my comment above? Should the behavior of the API be changed?
Thanks, Philip
Hi Philip, honestly if I do that, it would be a breaking API change which will affect a lot of users who are expecting the current behavior. I don't mind updating this library whenever Github changes their default behavior. 
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Well ok - from my point of view you should at least write into the API documentation that at the moment (you can provide a date) the default only loads open issues. So there is no doubt fpr the API user.
Okay PR welcome

Resolving patch:
diff --git a/github/Repository.py b/github/Repository.py
--- a/github/Repository.py
+++ b/github/Repository.py
@@ -1883,7 +1883,7 @@ def get_issues(self, milestone=github.GithubObject.NotSet, state=github.GithubOb
         """
         :calls: `GET /repos/:owner/:repo/issues <http://developer.github.com/v3/issues>`_
         :param milestone: :class:`github.Milestone.Milestone` or "none" or "*"
-        :param state: string
+        :param state: string. `open`, `closed`, or `all`. If this is not set the GitHub API default behavior will be used. At the moment this is to return only open issues. This might change anytime on GitHub API side and it could be clever to explicitly specify the state value.
         :param assignee: string or :class:`github.NamedUser.NamedUser` or "none" or "*"
         :param mentioned: :class:`github.NamedUser.NamedUser`
         :param labels: list of :class:`github.Label.Label`


Test patch: