{"action":"created","comment":{"url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments/180754062","pull_request_review_id":111228210,"id":180754062,"diff_hunk":"@@ -0,0 +1,333 @@\n+#   Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+#     http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+\"\"\"DocstringChecker is used to check python doc string's style.\"\"\"\n+\n+import six\n+import astroid\n+\n+from pylint.checkers import BaseChecker, utils\n+from pylint.interfaces import IAstroidChecker\n+\n+\n+def register(linter):\n+    \"\"\"Register checkers.\"\"\"\n+    linter.register_checker(DocstringChecker(linter))\n+\n+\n+class Docstring(object):\n+    \"\"\"Docstring class holds the parsed doc string elements.\n+    \"\"\"\n+\n+    def __init__(self):\n+        from collections import defaultdict\n+        self.d = defaultdict(list)  #name->[]\n+        self.clear()\n+\n+    def clear(self):\n+        self.d['Args'] = []\n+        self.d['Examples'] = []\n+        self.d['Returns'] = []\n+        self.d['Raises'] = []\n+        self.args = {}  #arg_name->arg_type\n+\n+    def get_level(self, string, indent='    '):\n+        level = 0\n+        unit_size = len(indent)\n+        while string[:unit_size] == indent:\n+            string = string[unit_size:]\n+            level += 1\n+\n+        return level\n+\n+    def parse(self, doc):\n+        \"\"\"parse gets sections from doc\n+        Such as Args, Returns, Raises, Examples s\n+        Args:\n+            doc (string): is the astroid node doc string.\n+        Returns:\n+            True if doc is parsed successfully.\n+        \"\"\"\n+        self.clear()\n+\n+        lines = doc.splitlines()\n+        state = (\"others\", -1)\n+        for l in lines:\n+            c = l.strip()\n+            if len(c) <= 0:\n+                continue\n+\n+            level = self.get_level(l)\n+            if c.startswith(\"Args:\"):\n+                state = (\"Args\", level)","path":"tools/codestyle/docstring_checker.py","position":72,"original_position":72,"commit_id":"cdb489da99e708fc8e269cc53fff7df7cf3d5261","original_commit_id":"cdb489da99e708fc8e269cc53fff7df7cf3d5261","user":{"login":"panyx0718","id":2887803,"avatar_url":"https://avatars0.githubusercontent.com/u/2887803?v=4","gravatar_id":"","url":"https://api.github.com/users/panyx0718","html_url":"https://github.com/panyx0718","followers_url":"https://api.github.com/users/panyx0718/followers","following_url":"https://api.github.com/users/panyx0718/following{/other_user}","gists_url":"https://api.github.com/users/panyx0718/gists{/gist_id}","starred_url":"https://api.github.com/users/panyx0718/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/panyx0718/subscriptions","organizations_url":"https://api.github.com/users/panyx0718/orgs","repos_url":"https://api.github.com/users/panyx0718/repos","events_url":"https://api.github.com/users/panyx0718/events{/privacy}","received_events_url":"https://api.github.com/users/panyx0718/received_events","type":"User","site_admin":false},"body":"I think we need to check with our auto-doc generator and see it can parse the new style","created_at":"2018-04-11T13:31:11Z","updated_at":"2018-04-11T13:36:09Z","html_url":"https://github.com/PaddlePaddle/Paddle/pull/9848#discussion_r180754062","pull_request_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/9848","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments/180754062"},"html":{"href":"https://github.com/PaddlePaddle/Paddle/pull/9848#discussion_r180754062"},"pull_request":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/9848"}}},"pull_request":{"url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/9848","id":180868766,"html_url":"https://github.com/PaddlePaddle/Paddle/pull/9848","diff_url":"https://github.com/PaddlePaddle/Paddle/pull/9848.diff","patch_url":"https://github.com/PaddlePaddle/Paddle/pull/9848.patch","issue_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/9848","number":9848,"state":"open","locked":false,"title":"Add docstring checker.","user":{"login":"gongweibao","id":10721757,"avatar_url":"https://avatars3.githubusercontent.com/u/10721757?v=4","gravatar_id":"","url":"https://api.github.com/users/gongweibao","html_url":"https://github.com/gongweibao","followers_url":"https://api.github.com/users/gongweibao/followers","following_url":"https://api.github.com/users/gongweibao/following{/other_user}","gists_url":"https://api.github.com/users/gongweibao/gists{/gist_id}","starred_url":"https://api.github.com/users/gongweibao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gongweibao/subscriptions","organizations_url":"https://api.github.com/users/gongweibao/orgs","repos_url":"https://api.github.com/users/gongweibao/repos","events_url":"https://api.github.com/users/gongweibao/events{/privacy}","received_events_url":"https://api.github.com/users/gongweibao/received_events","type":"User","site_admin":false},"body":"Fix https://github.com/PaddlePaddle/Paddle/issues/9778#issuecomment-379842049","created_at":"2018-04-11T11:13:40Z","updated_at":"2018-04-11T13:36:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"60613109f11413e9e97461e97c5f883f84965580","assignee":null,"assignees":[],"requested_reviewers":[{"login":"reyoung","id":728699,"avatar_url":"https://avatars2.githubusercontent.com/u/728699?v=4","gravatar_id":"","url":"https://api.github.com/users/reyoung","html_url":"https://github.com/reyoung","followers_url":"https://api.github.com/users/reyoung/followers","following_url":"https://api.github.com/users/reyoung/following{/other_user}","gists_url":"https://api.github.com/users/reyoung/gists{/gist_id}","starred_url":"https://api.github.com/users/reyoung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reyoung/subscriptions","organizations_url":"https://api.github.com/users/reyoung/orgs","repos_url":"https://api.github.com/users/reyoung/repos","events_url":"https://api.github.com/users/reyoung/events{/privacy}","received_events_url":"https://api.github.com/users/reyoung/received_events","type":"User","site_admin":false},{"login":"wangkuiyi","id":1548775,"avatar_url":"https://avatars0.githubusercontent.com/u/1548775?v=4","gravatar_id":"","url":"https://api.github.com/users/wangkuiyi","html_url":"https://github.com/wangkuiyi","followers_url":"https://api.github.com/users/wangkuiyi/followers","following_url":"https://api.github.com/users/wangkuiyi/following{/other_user}","gists_url":"https://api.github.com/users/wangkuiyi/gists{/gist_id}","starred_url":"https://api.github.com/users/wangkuiyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wangkuiyi/subscriptions","organizations_url":"https://api.github.com/users/wangkuiyi/orgs","repos_url":"https://api.github.com/users/wangkuiyi/repos","events_url":"https://api.github.com/users/wangkuiyi/events{/privacy}","received_events_url":"https://api.github.com/users/wangkuiyi/received_events","type":"User","site_admin":false},{"login":"helinwang","id":1724178,"avatar_url":"https://avatars3.githubusercontent.com/u/1724178?v=4","gravatar_id":"","url":"https://api.github.com/users/helinwang","html_url":"https://github.com/helinwang","followers_url":"https://api.github.com/users/helinwang/followers","following_url":"https://api.github.com/users/helinwang/following{/other_user}","gists_url":"https://api.github.com/users/helinwang/gists{/gist_id}","starred_url":"https://api.github.com/users/helinwang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helinwang/subscriptions","organizations_url":"https://api.github.com/users/helinwang/orgs","repos_url":"https://api.github.com/users/helinwang/repos","events_url":"https://api.github.com/users/helinwang/events{/privacy}","received_events_url":"https://api.github.com/users/helinwang/received_events","type":"User","site_admin":false},{"login":"typhoonzero","id":13348433,"avatar_url":"https://avatars1.githubusercontent.com/u/13348433?v=4","gravatar_id":"","url":"https://api.github.com/users/typhoonzero","html_url":"https://github.com/typhoonzero","followers_url":"https://api.github.com/users/typhoonzero/followers","following_url":"https://api.github.com/users/typhoonzero/following{/other_user}","gists_url":"https://api.github.com/users/typhoonzero/gists{/gist_id}","starred_url":"https://api.github.com/users/typhoonzero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/typhoonzero/subscriptions","organizations_url":"https://api.github.com/users/typhoonzero/orgs","repos_url":"https://api.github.com/users/typhoonzero/repos","events_url":"https://api.github.com/users/typhoonzero/events{/privacy}","received_events_url":"https://api.github.com/users/typhoonzero/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/9848/commits","review_comments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/9848/comments","review_comment_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/9848/comments","statuses_url":"https://api.github.com/repos/PaddlePaddle/Paddle/statuses/cdb489da99e708fc8e269cc53fff7df7cf3d5261","head":{"label":"gongweibao:pylint","ref":"pylint","sha":"cdb489da99e708fc8e269cc53fff7df7cf3d5261","user":{"login":"gongweibao","id":10721757,"avatar_url":"https://avatars3.githubusercontent.com/u/10721757?v=4","gravatar_id":"","url":"https://api.github.com/users/gongweibao","html_url":"https://github.com/gongweibao","followers_url":"https://api.github.com/users/gongweibao/followers","following_url":"https://api.github.com/users/gongweibao/following{/other_user}","gists_url":"https://api.github.com/users/gongweibao/gists{/gist_id}","starred_url":"https://api.github.com/users/gongweibao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gongweibao/subscriptions","organizations_url":"https://api.github.com/users/gongweibao/orgs","repos_url":"https://api.github.com/users/gongweibao/repos","events_url":"https://api.github.com/users/gongweibao/events{/privacy}","received_events_url":"https://api.github.com/users/gongweibao/received_events","type":"User","site_admin":false},"repo":{"id":82279237,"name":"Paddle","full_name":"gongweibao/Paddle","owner":{"login":"gongweibao","id":10721757,"avatar_url":"https://avatars3.githubusercontent.com/u/10721757?v=4","gravatar_id":"","url":"https://api.github.com/users/gongweibao","html_url":"https://github.com/gongweibao","followers_url":"https://api.github.com/users/gongweibao/followers","following_url":"https://api.github.com/users/gongweibao/following{/other_user}","gists_url":"https://api.github.com/users/gongweibao/gists{/gist_id}","starred_url":"https://api.github.com/users/gongweibao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gongweibao/subscriptions","organizations_url":"https://api.github.com/users/gongweibao/orgs","repos_url":"https://api.github.com/users/gongweibao/repos","events_url":"https://api.github.com/users/gongweibao/events{/privacy}","received_events_url":"https://api.github.com/users/gongweibao/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gongweibao/Paddle","description":"PArallel Distributed Deep LEarning","fork":true,"url":"https://api.github.com/repos/gongweibao/Paddle","forks_url":"https://api.github.com/repos/gongweibao/Paddle/forks","keys_url":"https://api.github.com/repos/gongweibao/Paddle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gongweibao/Paddle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gongweibao/Paddle/teams","hooks_url":"https://api.github.com/repos/gongweibao/Paddle/hooks","issue_events_url":"https://api.github.com/repos/gongweibao/Paddle/issues/events{/number}","events_url":"https://api.github.com/repos/gongweibao/Paddle/events","assignees_url":"https://api.github.com/repos/gongweibao/Paddle/assignees{/user}","branches_url":"https://api.github.com/repos/gongweibao/Paddle/branches{/branch}","tags_url":"https://api.github.com/repos/gongweibao/Paddle/tags","blobs_url":"https://api.github.com/repos/gongweibao/Paddle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gongweibao/Paddle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gongweibao/Paddle/git/refs{/sha}","trees_url":"https://api.github.com/repos/gongweibao/Paddle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gongweibao/Paddle/statuses/{sha}","languages_url":"https://api.github.com/repos/gongweibao/Paddle/languages","stargazers_url":"https://api.github.com/repos/gongweibao/Paddle/stargazers","contributors_url":"https://api.github.com/repos/gongweibao/Paddle/contributors","subscribers_url":"https://api.github.com/repos/gongweibao/Paddle/subscribers","subscription_url":"https://api.github.com/repos/gongweibao/Paddle/subscription","commits_url":"https://api.github.com/repos/gongweibao/Paddle/commits{/sha}","git_commits_url":"https://api.github.com/repos/gongweibao/Paddle/git/commits{/sha}","comments_url":"https://api.github.com/repos/gongweibao/Paddle/comments{/number}","issue_comment_url":"https://api.github.com/repos/gongweibao/Paddle/issues/comments{/number}","contents_url":"https://api.github.com/repos/gongweibao/Paddle/contents/{+path}","compare_url":"https://api.github.com/repos/gongweibao/Paddle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gongweibao/Paddle/merges","archive_url":"https://api.github.com/repos/gongweibao/Paddle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gongweibao/Paddle/downloads","issues_url":"https://api.github.com/repos/gongweibao/Paddle/issues{/number}","pulls_url":"https://api.github.com/repos/gongweibao/Paddle/pulls{/number}","milestones_url":"https://api.github.com/repos/gongweibao/Paddle/milestones{/number}","notifications_url":"https://api.github.com/repos/gongweibao/Paddle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gongweibao/Paddle/labels{/name}","releases_url":"https://api.github.com/repos/gongweibao/Paddle/releases{/id}","deployments_url":"https://api.github.com/repos/gongweibao/Paddle/deployments","created_at":"2017-02-17T09:16:16Z","updated_at":"2017-10-23T09:13:15Z","pushed_at":"2018-04-11T13:02:14Z","git_url":"git://github.com/gongweibao/Paddle.git","ssh_url":"git@github.com:gongweibao/Paddle.git","clone_url":"https://github.com/gongweibao/Paddle.git","svn_url":"https://github.com/gongweibao/Paddle","homepage":"http://www.paddlepaddle.org/","size":57895,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":1,"default_branch":"develop"}},"base":{"label":"PaddlePaddle:develop","ref":"develop","sha":"b45776abf67eee10e76c7f94dae10eab2fe4c2c6","user":{"login":"PaddlePaddle","id":23534030,"avatar_url":"https://avatars3.githubusercontent.com/u/23534030?v=4","gravatar_id":"","url":"https://api.github.com/users/PaddlePaddle","html_url":"https://github.com/PaddlePaddle","followers_url":"https://api.github.com/users/PaddlePaddle/followers","following_url":"https://api.github.com/users/PaddlePaddle/following{/other_user}","gists_url":"https://api.github.com/users/PaddlePaddle/gists{/gist_id}","starred_url":"https://api.github.com/users/PaddlePaddle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaddlePaddle/subscriptions","organizations_url":"https://api.github.com/users/PaddlePaddle/orgs","repos_url":"https://api.github.com/users/PaddlePaddle/repos","events_url":"https://api.github.com/users/PaddlePaddle/events{/privacy}","received_events_url":"https://api.github.com/users/PaddlePaddle/received_events","type":"Organization","site_admin":false},"repo":{"id":65711522,"name":"Paddle","full_name":"PaddlePaddle/Paddle","owner":{"login":"PaddlePaddle","id":23534030,"avatar_url":"https://avatars3.githubusercontent.com/u/23534030?v=4","gravatar_id":"","url":"https://api.github.com/users/PaddlePaddle","html_url":"https://github.com/PaddlePaddle","followers_url":"https://api.github.com/users/PaddlePaddle/followers","following_url":"https://api.github.com/users/PaddlePaddle/following{/other_user}","gists_url":"https://api.github.com/users/PaddlePaddle/gists{/gist_id}","starred_url":"https://api.github.com/users/PaddlePaddle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaddlePaddle/subscriptions","organizations_url":"https://api.github.com/users/PaddlePaddle/orgs","repos_url":"https://api.github.com/users/PaddlePaddle/repos","events_url":"https://api.github.com/users/PaddlePaddle/events{/privacy}","received_events_url":"https://api.github.com/users/PaddlePaddle/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PaddlePaddle/Paddle","description":"PArallel Distributed Deep LEarning","fork":false,"url":"https://api.github.com/repos/PaddlePaddle/Paddle","forks_url":"https://api.github.com/repos/PaddlePaddle/Paddle/forks","keys_url":"https://api.github.com/repos/PaddlePaddle/Paddle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PaddlePaddle/Paddle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PaddlePaddle/Paddle/teams","hooks_url":"https://api.github.com/repos/PaddlePaddle/Paddle/hooks","issue_events_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/events{/number}","events_url":"https://api.github.com/repos/PaddlePaddle/Paddle/events","assignees_url":"https://api.github.com/repos/PaddlePaddle/Paddle/assignees{/user}","branches_url":"https://api.github.com/repos/PaddlePaddle/Paddle/branches{/branch}","tags_url":"https://api.github.com/repos/PaddlePaddle/Paddle/tags","blobs_url":"https://api.github.com/repos/PaddlePaddle/Paddle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PaddlePaddle/Paddle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PaddlePaddle/Paddle/git/refs{/sha}","trees_url":"https://api.github.com/repos/PaddlePaddle/Paddle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PaddlePaddle/Paddle/statuses/{sha}","languages_url":"https://api.github.com/repos/PaddlePaddle/Paddle/languages","stargazers_url":"https://api.github.com/repos/PaddlePaddle/Paddle/stargazers","contributors_url":"https://api.github.com/repos/PaddlePaddle/Paddle/contributors","subscribers_url":"https://api.github.com/repos/PaddlePaddle/Paddle/subscribers","subscription_url":"https://api.github.com/repos/PaddlePaddle/Paddle/subscription","commits_url":"https://api.github.com/repos/PaddlePaddle/Paddle/commits{/sha}","git_commits_url":"https://api.github.com/repos/PaddlePaddle/Paddle/git/commits{/sha}","comments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/comments{/number}","issue_comment_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/comments{/number}","contents_url":"https://api.github.com/repos/PaddlePaddle/Paddle/contents/{+path}","compare_url":"https://api.github.com/repos/PaddlePaddle/Paddle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PaddlePaddle/Paddle/merges","archive_url":"https://api.github.com/repos/PaddlePaddle/Paddle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PaddlePaddle/Paddle/downloads","issues_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues{/number}","pulls_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls{/number}","milestones_url":"https://api.github.com/repos/PaddlePaddle/Paddle/milestones{/number}","notifications_url":"https://api.github.com/repos/PaddlePaddle/Paddle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PaddlePaddle/Paddle/labels{/name}","releases_url":"https://api.github.com/repos/PaddlePaddle/Paddle/releases{/id}","deployments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/deployments","created_at":"2016-08-15T06:59:08Z","updated_at":"2018-04-11T12:39:47Z","pushed_at":"2018-04-11T13:29:14Z","git_url":"git://github.com/PaddlePaddle/Paddle.git","ssh_url":"git@github.com:PaddlePaddle/Paddle.git","clone_url":"https://github.com/PaddlePaddle/Paddle.git","svn_url":"https://github.com/PaddlePaddle/Paddle","homepage":"http://www.paddlepaddle.org/","size":99352,"stargazers_count":6686,"watchers_count":6686,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1794,"mirror_url":null,"archived":false,"open_issues_count":1301,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":1794,"open_issues":1301,"watchers":6686,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/9848"},"html":{"href":"https://github.com/PaddlePaddle/Paddle/pull/9848"},"issue":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/9848"},"comments":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/9848/comments"},"review_comments":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/9848/comments"},"review_comment":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/9848/commits"},"statuses":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/statuses/cdb489da99e708fc8e269cc53fff7df7cf3d5261"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"panyx0718"}}