{"action":"created","comment":{"url":"https://api.github.com/repos/aws/sagemaker-containers/pulls/comments/189681356","pull_request_review_id":121907903,"id":189681356,"diff_hunk":"@@ -63,15 +61,27 @@ def arg_value(value):\n     return [item for item in itertools.chain.from_iterable(items)]\n \n \n-def decode(object):\n-    if six.PY3 and isinstance(object, six.binary_type):\n-        return object.decode('latin1')\n+def _decode(obj):  # type: (bytes or str or unicode or object) -> unicode\n+    \"\"\"Decode an object to unicode.\n+\n+    Args:\n+        obj (bytes or str or unicode or anything serializable): object to be decoded\n+\n+    Returns:\n+        object decoded in unicode.\n+    \"\"\"\n+    if six.PY3 and isinstance(obj, six.binary_type):\n+        # transforms a byte string (b'') in unicode\n+        return obj.decode('latin1')\n     elif six.PY3:\n-        return str(object)\n-    elif isinstance(object, six.text_type):\n-        return object\n+        # PY3 strings are unicode.\n+        return str(obj)\n+    elif isinstance(obj, six.text_type):\n+        # returns itself if it is unicode\n+        return obj\n     else:\n-        return str(object).decode('utf-8')\n+        # decodes pY2 string to unicode","path":"src/sagemaker_containers/mapping.py","position":57,"original_position":57,"commit_id":"a2547c8c5a0cc06f81577fb38cc3900cff99a6d2","original_commit_id":"a2547c8c5a0cc06f81577fb38cc3900cff99a6d2","user":{"login":"andremoeller","id":5501191,"avatar_url":"https://avatars3.githubusercontent.com/u/5501191?v=4","gravatar_id":"","url":"https://api.github.com/users/andremoeller","html_url":"https://github.com/andremoeller","followers_url":"https://api.github.com/users/andremoeller/followers","following_url":"https://api.github.com/users/andremoeller/following{/other_user}","gists_url":"https://api.github.com/users/andremoeller/gists{/gist_id}","starred_url":"https://api.github.com/users/andremoeller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andremoeller/subscriptions","organizations_url":"https://api.github.com/users/andremoeller/orgs","repos_url":"https://api.github.com/users/andremoeller/repos","events_url":"https://api.github.com/users/andremoeller/events{/privacy}","received_events_url":"https://api.github.com/users/andremoeller/received_events","type":"User","site_admin":false},"body":"pY2 -> PY2","created_at":"2018-05-21T18:53:44Z","updated_at":"2018-05-21T18:53:44Z","html_url":"https://github.com/aws/sagemaker-containers/pull/65#discussion_r189681356","pull_request_url":"https://api.github.com/repos/aws/sagemaker-containers/pulls/65","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/aws/sagemaker-containers/pulls/comments/189681356"},"html":{"href":"https://github.com/aws/sagemaker-containers/pull/65#discussion_r189681356"},"pull_request":{"href":"https://api.github.com/repos/aws/sagemaker-containers/pulls/65"}}},"pull_request":{"url":"https://api.github.com/repos/aws/sagemaker-containers/pulls/65","id":189445879,"html_url":"https://github.com/aws/sagemaker-containers/pull/65","diff_url":"https://github.com/aws/sagemaker-containers/pull/65.diff","patch_url":"https://github.com/aws/sagemaker-containers/pull/65.patch","issue_url":"https://api.github.com/repos/aws/sagemaker-containers/issues/65","number":65,"state":"open","locked":false,"title":"Add comments to decoding functions","user":{"login":"mvsusp","id":142074,"avatar_url":"https://avatars0.githubusercontent.com/u/142074?v=4","gravatar_id":"","url":"https://api.github.com/users/mvsusp","html_url":"https://github.com/mvsusp","followers_url":"https://api.github.com/users/mvsusp/followers","following_url":"https://api.github.com/users/mvsusp/following{/other_user}","gists_url":"https://api.github.com/users/mvsusp/gists{/gist_id}","starred_url":"https://api.github.com/users/mvsusp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvsusp/subscriptions","organizations_url":"https://api.github.com/users/mvsusp/orgs","repos_url":"https://api.github.com/users/mvsusp/repos","events_url":"https://api.github.com/users/mvsusp/events{/privacy}","received_events_url":"https://api.github.com/users/mvsusp/received_events","type":"User","site_admin":false},"body":"## Description of changes:\r\n\r\n- Add comments to decoding functions\r\n\r\nBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.\r\n","created_at":"2018-05-21T17:53:54Z","updated_at":"2018-05-21T18:53:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e427957841b32da3caa6adb550794a2077523d80","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/aws/sagemaker-containers/pulls/65/commits","review_comments_url":"https://api.github.com/repos/aws/sagemaker-containers/pulls/65/comments","review_comment_url":"https://api.github.com/repos/aws/sagemaker-containers/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aws/sagemaker-containers/issues/65/comments","statuses_url":"https://api.github.com/repos/aws/sagemaker-containers/statuses/a2547c8c5a0cc06f81577fb38cc3900cff99a6d2","head":{"label":"mvsusp:mvs-decode-docstrings","ref":"mvs-decode-docstrings","sha":"a2547c8c5a0cc06f81577fb38cc3900cff99a6d2","user":{"login":"mvsusp","id":142074,"avatar_url":"https://avatars0.githubusercontent.com/u/142074?v=4","gravatar_id":"","url":"https://api.github.com/users/mvsusp","html_url":"https://github.com/mvsusp","followers_url":"https://api.github.com/users/mvsusp/followers","following_url":"https://api.github.com/users/mvsusp/following{/other_user}","gists_url":"https://api.github.com/users/mvsusp/gists{/gist_id}","starred_url":"https://api.github.com/users/mvsusp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvsusp/subscriptions","organizations_url":"https://api.github.com/users/mvsusp/orgs","repos_url":"https://api.github.com/users/mvsusp/repos","events_url":"https://api.github.com/users/mvsusp/events{/privacy}","received_events_url":"https://api.github.com/users/mvsusp/received_events","type":"User","site_admin":false},"repo":{"id":128098611,"name":"sagemaker-containers","full_name":"mvsusp/sagemaker-containers","owner":{"login":"mvsusp","id":142074,"avatar_url":"https://avatars0.githubusercontent.com/u/142074?v=4","gravatar_id":"","url":"https://api.github.com/users/mvsusp","html_url":"https://github.com/mvsusp","followers_url":"https://api.github.com/users/mvsusp/followers","following_url":"https://api.github.com/users/mvsusp/following{/other_user}","gists_url":"https://api.github.com/users/mvsusp/gists{/gist_id}","starred_url":"https://api.github.com/users/mvsusp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvsusp/subscriptions","organizations_url":"https://api.github.com/users/mvsusp/orgs","repos_url":"https://api.github.com/users/mvsusp/repos","events_url":"https://api.github.com/users/mvsusp/events{/privacy}","received_events_url":"https://api.github.com/users/mvsusp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mvsusp/sagemaker-containers","description":"This support code is used for making machine learning frameworks (e.g. MXNet, TensorFlow) run on Amazon SageMaker. ","fork":true,"url":"https://api.github.com/repos/mvsusp/sagemaker-containers","forks_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/forks","keys_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/teams","hooks_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/hooks","issue_events_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/issues/events{/number}","events_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/events","assignees_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/assignees{/user}","branches_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/branches{/branch}","tags_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/tags","blobs_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/git/refs{/sha}","trees_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/statuses/{sha}","languages_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/languages","stargazers_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/stargazers","contributors_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/contributors","subscribers_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/subscribers","subscription_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/subscription","commits_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/commits{/sha}","git_commits_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/git/commits{/sha}","comments_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/comments{/number}","issue_comment_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/issues/comments{/number}","contents_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/contents/{+path}","compare_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/merges","archive_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/downloads","issues_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/issues{/number}","pulls_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/pulls{/number}","milestones_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/milestones{/number}","notifications_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/labels{/name}","releases_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/releases{/id}","deployments_url":"https://api.github.com/repos/mvsusp/sagemaker-containers/deployments","created_at":"2018-04-04T17:43:59Z","updated_at":"2018-04-23T17:13:16Z","pushed_at":"2018-05-21T17:52:32Z","git_url":"git://github.com/mvsusp/sagemaker-containers.git","ssh_url":"git@github.com:mvsusp/sagemaker-containers.git","clone_url":"https://github.com/mvsusp/sagemaker-containers.git","svn_url":"https://github.com/mvsusp/sagemaker-containers","homepage":null,"size":412,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"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":2,"watchers":0,"default_branch":"master"}},"base":{"label":"aws:r2.0","ref":"r2.0","sha":"757eb1f78a9cf8034f99f61aa91754a3181a9010","user":{"login":"aws","id":2232217,"avatar_url":"https://avatars3.githubusercontent.com/u/2232217?v=4","gravatar_id":"","url":"https://api.github.com/users/aws","html_url":"https://github.com/aws","followers_url":"https://api.github.com/users/aws/followers","following_url":"https://api.github.com/users/aws/following{/other_user}","gists_url":"https://api.github.com/users/aws/gists{/gist_id}","starred_url":"https://api.github.com/users/aws/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aws/subscriptions","organizations_url":"https://api.github.com/users/aws/orgs","repos_url":"https://api.github.com/users/aws/repos","events_url":"https://api.github.com/users/aws/events{/privacy}","received_events_url":"https://api.github.com/users/aws/received_events","type":"Organization","site_admin":false},"repo":{"id":118807445,"name":"sagemaker-containers","full_name":"aws/sagemaker-containers","owner":{"login":"aws","id":2232217,"avatar_url":"https://avatars3.githubusercontent.com/u/2232217?v=4","gravatar_id":"","url":"https://api.github.com/users/aws","html_url":"https://github.com/aws","followers_url":"https://api.github.com/users/aws/followers","following_url":"https://api.github.com/users/aws/following{/other_user}","gists_url":"https://api.github.com/users/aws/gists{/gist_id}","starred_url":"https://api.github.com/users/aws/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aws/subscriptions","organizations_url":"https://api.github.com/users/aws/orgs","repos_url":"https://api.github.com/users/aws/repos","events_url":"https://api.github.com/users/aws/events{/privacy}","received_events_url":"https://api.github.com/users/aws/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aws/sagemaker-containers","description":"This support code is used for making machine learning frameworks (e.g. MXNet, TensorFlow) run on Amazon SageMaker. ","fork":false,"url":"https://api.github.com/repos/aws/sagemaker-containers","forks_url":"https://api.github.com/repos/aws/sagemaker-containers/forks","keys_url":"https://api.github.com/repos/aws/sagemaker-containers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aws/sagemaker-containers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aws/sagemaker-containers/teams","hooks_url":"https://api.github.com/repos/aws/sagemaker-containers/hooks","issue_events_url":"https://api.github.com/repos/aws/sagemaker-containers/issues/events{/number}","events_url":"https://api.github.com/repos/aws/sagemaker-containers/events","assignees_url":"https://api.github.com/repos/aws/sagemaker-containers/assignees{/user}","branches_url":"https://api.github.com/repos/aws/sagemaker-containers/branches{/branch}","tags_url":"https://api.github.com/repos/aws/sagemaker-containers/tags","blobs_url":"https://api.github.com/repos/aws/sagemaker-containers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aws/sagemaker-containers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aws/sagemaker-containers/git/refs{/sha}","trees_url":"https://api.github.com/repos/aws/sagemaker-containers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aws/sagemaker-containers/statuses/{sha}","languages_url":"https://api.github.com/repos/aws/sagemaker-containers/languages","stargazers_url":"https://api.github.com/repos/aws/sagemaker-containers/stargazers","contributors_url":"https://api.github.com/repos/aws/sagemaker-containers/contributors","subscribers_url":"https://api.github.com/repos/aws/sagemaker-containers/subscribers","subscription_url":"https://api.github.com/repos/aws/sagemaker-containers/subscription","commits_url":"https://api.github.com/repos/aws/sagemaker-containers/commits{/sha}","git_commits_url":"https://api.github.com/repos/aws/sagemaker-containers/git/commits{/sha}","comments_url":"https://api.github.com/repos/aws/sagemaker-containers/comments{/number}","issue_comment_url":"https://api.github.com/repos/aws/sagemaker-containers/issues/comments{/number}","contents_url":"https://api.github.com/repos/aws/sagemaker-containers/contents/{+path}","compare_url":"https://api.github.com/repos/aws/sagemaker-containers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aws/sagemaker-containers/merges","archive_url":"https://api.github.com/repos/aws/sagemaker-containers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aws/sagemaker-containers/downloads","issues_url":"https://api.github.com/repos/aws/sagemaker-containers/issues{/number}","pulls_url":"https://api.github.com/repos/aws/sagemaker-containers/pulls{/number}","milestones_url":"https://api.github.com/repos/aws/sagemaker-containers/milestones{/number}","notifications_url":"https://api.github.com/repos/aws/sagemaker-containers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aws/sagemaker-containers/labels{/name}","releases_url":"https://api.github.com/repos/aws/sagemaker-containers/releases{/id}","deployments_url":"https://api.github.com/repos/aws/sagemaker-containers/deployments","created_at":"2018-01-24T18:48:58Z","updated_at":"2018-05-17T01:45:28Z","pushed_at":"2018-05-21T18:22:32Z","git_url":"git://github.com/aws/sagemaker-containers.git","ssh_url":"git@github.com:aws/sagemaker-containers.git","clone_url":"https://github.com/aws/sagemaker-containers.git","svn_url":"https://github.com/aws/sagemaker-containers","homepage":null,"size":262,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":2,"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":9,"open_issues":2,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aws/sagemaker-containers/pulls/65"},"html":{"href":"https://github.com/aws/sagemaker-containers/pull/65"},"issue":{"href":"https://api.github.com/repos/aws/sagemaker-containers/issues/65"},"comments":{"href":"https://api.github.com/repos/aws/sagemaker-containers/issues/65/comments"},"review_comments":{"href":"https://api.github.com/repos/aws/sagemaker-containers/pulls/65/comments"},"review_comment":{"href":"https://api.github.com/repos/aws/sagemaker-containers/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aws/sagemaker-containers/pulls/65/commits"},"statuses":{"href":"https://api.github.com/repos/aws/sagemaker-containers/statuses/a2547c8c5a0cc06f81577fb38cc3900cff99a6d2"}},"author_association":"NONE"}}
{"actor":{"display_login":"andremoeller"}}