Repository: PyGithub/PyGithub

Issue:
Repo stats API out-dated
Hi, I'm encountering a small issue wherein the `.contributions` attribute of a `NamedUser` instance returns `None`. Here's the code:

``` python
user = gh.get_user('example_user')
print user.contributions
```

The output is always `None`. Here `gh` is the `MainClass.Github` authorized instance. Am I doing something wrong here? Thanks a lot for the help!
P.S. My `pygithub` is in sync with upstream.



Discussion:
I think github api just doesn't provide function to get contributions for certain user, I don't know why authors of this library place such field to User class. You can look up here : https://developer.github.com/v3/repos/statistics/#get-the-number-of-additions-and-deletions-per-week

Looking at the latest API:
https://developer.github.com/v3/repos/statistics/#get-contributors-list-with-additions-deletions-and-commit-counts

I believe the `contributions` is an out-dated attribute from the old API:
`/repos/:owner/:repo/contributors`

This attribute should be removed and this API needs to be updated as well.

The statistics API was implemented years ago -- first added in a4910ac922c12cd1e3ce58766ebda8780391aae4 and completed in c6671c64668d67018cc89b364887dd056a498277.

(The relevant methods are Repository.get_stats_*)

Resolving patch:
diff --git a/github/NamedUser.py b/github/NamedUser.py
--- a/github/NamedUser.py
+++ b/github/NamedUser.py
@@ -101,14 +101,6 @@ def company(self):
         self._completeIfNotSet(self._company)
         return self._company.value
 
-    @property
-    def contributions(self):
-        """
-        :type: integer
-        """
-        self._completeIfNotSet(self._contributions)
-        return self._contributions.value
-
     @property
     def created_at(self):
         """
@@ -571,7 +563,6 @@ def _initAttributes(self):
         self._blog = github.GithubObject.NotSet
         self._collaborators = github.GithubObject.NotSet
         self._company = github.GithubObject.NotSet
-        self._contributions = github.GithubObject.NotSet
         self._created_at = github.GithubObject.NotSet
         self._disk_usage = github.GithubObject.NotSet
         self._email = github.GithubObject.NotSet
@@ -616,8 +607,6 @@ def _useAttributes(self, attributes):
             self._collaborators = self._makeIntAttribute(attributes["collaborators"])
         if "company" in attributes:  # pragma no branch
             self._company = self._makeStringAttribute(attributes["company"])
-        if "contributions" in attributes:  # pragma no branch
-            self._contributions = self._makeIntAttribute(attributes["contributions"])
         if "created_at" in attributes:  # pragma no branch
             self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
         if "disk_usage" in attributes:  # pragma no branch


Test patch:
diff --git a/github/tests/Repository.py b/github/tests/Repository.py
--- a/github/tests/Repository.py
+++ b/github/tests/Repository.py
@@ -198,7 +198,7 @@ def testDelete(self):
         repo.delete()
 
     def testGetContributors(self):
-        self.assertListKeyEqual(self.repo.get_contributors(), lambda c: (c.login, c.contributions), [("jacquev6", 355)])
+        self.assertListKeyEqual(self.repo.get_contributors(), lambda c: c.login, ["jacquev6"])
 
     def testCreateMilestone(self):
         milestone = self.repo.create_milestone("Milestone created by PyGithub", state="open", description="Description created by PyGithub", due_on=datetime.date(2012, 6, 15))