{"action":"created","comment":{"url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments/121276122","pull_request_review_id":43315022,"id":121276122,"diff_hunk":"@@ -149,3 +149,47 @@ def reader():\n                     yield line\n \n     return reader\n+\n+\n+def convert(output_path, eader, num_shards, name_prefix):\n+    import recordio\n+    import cPickle as pickle\n+    \"\"\"\n+    Convert data from reader to recordio format files.\n+\n+    :param output_path: directory in which output files will be saved.\n+    :param reader: a data reader, from which the convert program will read data instances.\n+    :param num_shards: the number of shards that the dataset will be partitioned into.\n+    :param name_prefix: the name prefix of generated files.\n+    \"\"\"\n+\n+    def open_needs(idx):\n+        n = \"%s/%s-%05d\" % (output_path, name_prefix, idx)\n+        w = recordio.writer(n)\n+        f = open(n, \"w\")","path":"python/paddle/v2/dataset/common.py","position":21,"original_position":21,"commit_id":"96a56b962acffd0be7790c0641ab9bc87c7e98a1","original_commit_id":"96a56b962acffd0be7790c0641ab9bc87c7e98a1","user":{"login":"gongweibao","id":10721757,"avatar_url":"https://avatars0.githubusercontent.com/u/10721757?v=3","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":"Done","created_at":"2017-06-11T09:07:35Z","updated_at":"2017-06-11T09:07:35Z","html_url":"https://github.com/PaddlePaddle/Paddle/pull/2407#discussion_r121276122","pull_request_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/2407","_links":{"self":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments/121276122"},"html":{"href":"https://github.com/PaddlePaddle/Paddle/pull/2407#discussion_r121276122"},"pull_request":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/2407"}}},"pull_request":{"url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/2407","id":124358063,"html_url":"https://github.com/PaddlePaddle/Paddle/pull/2407","diff_url":"https://github.com/PaddlePaddle/Paddle/pull/2407.diff","patch_url":"https://github.com/PaddlePaddle/Paddle/pull/2407.patch","issue_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/2407","number":2407,"state":"open","locked":false,"title":"Add convert function","user":{"login":"gongweibao","id":10721757,"avatar_url":"https://avatars0.githubusercontent.com/u/10721757?v=3","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 [convert library](https://github.com/PaddlePaddle/Paddle/blob/develop/doc/design/cluster_train/data_dispatch.md#%E8%BD%AC%E6%8D%A2%E5%BA%93)","created_at":"2017-06-07T08:01:35Z","updated_at":"2017-06-11T09:07:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"08d279d3a0aee5a4058252f268c248826f29a806","assignee":null,"assignees":[],"requested_reviewers":[{"login":"Yancey1989","id":1426912,"avatar_url":"https://avatars1.githubusercontent.com/u/1426912?v=3","gravatar_id":"","url":"https://api.github.com/users/Yancey1989","html_url":"https://github.com/Yancey1989","followers_url":"https://api.github.com/users/Yancey1989/followers","following_url":"https://api.github.com/users/Yancey1989/following{/other_user}","gists_url":"https://api.github.com/users/Yancey1989/gists{/gist_id}","starred_url":"https://api.github.com/users/Yancey1989/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yancey1989/subscriptions","organizations_url":"https://api.github.com/users/Yancey1989/orgs","repos_url":"https://api.github.com/users/Yancey1989/repos","events_url":"https://api.github.com/users/Yancey1989/events{/privacy}","received_events_url":"https://api.github.com/users/Yancey1989/received_events","type":"User","site_admin":false},{"login":"typhoonzero","id":13348433,"avatar_url":"https://avatars2.githubusercontent.com/u/13348433?v=3","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}],"milestone":null,"commits_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/2407/commits","review_comments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/2407/comments","review_comment_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/2407/comments","statuses_url":"https://api.github.com/repos/PaddlePaddle/Paddle/statuses/96a56b962acffd0be7790c0641ab9bc87c7e98a1","head":{"label":"gongweibao:convert","ref":"convert","sha":"96a56b962acffd0be7790c0641ab9bc87c7e98a1","user":{"login":"gongweibao","id":10721757,"avatar_url":"https://avatars0.githubusercontent.com/u/10721757?v=3","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://avatars0.githubusercontent.com/u/10721757?v=3","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-05-11T11:10:13Z","pushed_at":"2017-06-07T08:05:05Z","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":26659,"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,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"develop"}},"base":{"label":"PaddlePaddle:develop","ref":"develop","sha":"29a0bc83e0204f6a7ef70558cb4e7d178306e66b","user":{"login":"PaddlePaddle","id":23534030,"avatar_url":"https://avatars0.githubusercontent.com/u/23534030?v=3","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://avatars0.githubusercontent.com/u/23534030?v=3","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":"2017-06-11T00:26:07Z","pushed_at":"2017-06-11T07:11:36Z","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":35989,"stargazers_count":4935,"watchers_count":4935,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1316,"mirror_url":null,"open_issues_count":520,"forks":1316,"open_issues":520,"watchers":4935,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/2407"},"html":{"href":"https://github.com/PaddlePaddle/Paddle/pull/2407"},"issue":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/2407"},"comments":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/2407/comments"},"review_comments":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/2407/comments"},"review_comment":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/2407/commits"},"statuses":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/statuses/96a56b962acffd0be7790c0641ab9bc87c7e98a1"}}}}
{"actor":{"display_login":"gongweibao"}}