{"action":"created","comment":{"url":"https://api.github.com/repos/erik/alexandra/pulls/comments/54328522","id":54328522,"diff_hunk":"@@ -62,14 +61,28 @@ def dispatch_request(self, body):\n         elif req_type == 'IntentRequest':\n             intent = body['request']['intent']['name']\n             intent_fn = self.intent_map.get(intent, self.unknown_intent_fn)\n+            slots = body['request']['intent'].get('slots', {})\n+\n+            # Python 2.7 compatibility.\n+            try:\n+                slot_list = slots.iteritems()\n+            except AttributeError:\n+                slot_list = slots.items()\n \n             slots = {\n                 slot['name']: slot.get('value')\n-                for _, slot in\n-                body['request']['intent'].get('slots', {}).iteritems()\n+                for _, slot in slot_list\n             }\n \n-            if intent_fn.func_code.co_argcount == 2:\n+            code_list = inspect.getmembers(intent_fn, inspect.iscode)\n+\n+            # Python 2.7 compatibility.\n+            if len(code_list) == 1:\n+                (_, code) = code_list[0]\n+            else:\n+                (_, code) = code_list[1]","path":"alexandra/app.py","position":41,"original_position":41,"commit_id":"5356ee38d4d5fb55cd38c2da0a139c3f71ab984c","original_commit_id":"5356ee38d4d5fb55cd38c2da0a139c3f71ab984c","user":{"login":"Raynes","id":54435,"avatar_url":"https://avatars.githubusercontent.com/u/54435?v=3","gravatar_id":"","url":"https://api.github.com/users/Raynes","html_url":"https://github.com/Raynes","followers_url":"https://api.github.com/users/Raynes/followers","following_url":"https://api.github.com/users/Raynes/following{/other_user}","gists_url":"https://api.github.com/users/Raynes/gists{/gist_id}","starred_url":"https://api.github.com/users/Raynes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Raynes/subscriptions","organizations_url":"https://api.github.com/users/Raynes/orgs","repos_url":"https://api.github.com/users/Raynes/repos","events_url":"https://api.github.com/users/Raynes/events{/privacy}","received_events_url":"https://api.github.com/users/Raynes/received_events","type":"User","site_admin":false},"body":"Unfortunately the output is slightly different depending between py3 and py2","created_at":"2016-02-27T05:00:30Z","updated_at":"2016-02-27T05:00:30Z","html_url":"https://github.com/erik/alexandra/pull/1#discussion_r54328522","pull_request_url":"https://api.github.com/repos/erik/alexandra/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/erik/alexandra/pulls/comments/54328522"},"html":{"href":"https://github.com/erik/alexandra/pull/1#discussion_r54328522"},"pull_request":{"href":"https://api.github.com/repos/erik/alexandra/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/erik/alexandra/pulls/1","id":60931106,"html_url":"https://github.com/erik/alexandra/pull/1","diff_url":"https://github.com/erik/alexandra/pull/1.diff","patch_url":"https://github.com/erik/alexandra/pull/1.patch","issue_url":"https://api.github.com/repos/erik/alexandra/issues/1","number":1,"state":"open","locked":false,"title":"Python 3.5 compatibility + test + travis","user":{"login":"Raynes","id":54435,"avatar_url":"https://avatars.githubusercontent.com/u/54435?v=3","gravatar_id":"","url":"https://api.github.com/users/Raynes","html_url":"https://github.com/Raynes","followers_url":"https://api.github.com/users/Raynes/followers","following_url":"https://api.github.com/users/Raynes/following{/other_user}","gists_url":"https://api.github.com/users/Raynes/gists{/gist_id}","starred_url":"https://api.github.com/users/Raynes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Raynes/subscriptions","organizations_url":"https://api.github.com/users/Raynes/orgs","repos_url":"https://api.github.com/users/Raynes/repos","events_url":"https://api.github.com/users/Raynes/events{/privacy}","received_events_url":"https://api.github.com/users/Raynes/received_events","type":"User","site_admin":false},"body":"That oughta do it.","created_at":"2016-02-27T02:01:33Z","updated_at":"2016-02-27T05:00:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bfe28fc11a60396f677ae660aebd30296821b78f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/erik/alexandra/pulls/1/commits","review_comments_url":"https://api.github.com/repos/erik/alexandra/pulls/1/comments","review_comment_url":"https://api.github.com/repos/erik/alexandra/pulls/comments{/number}","comments_url":"https://api.github.com/repos/erik/alexandra/issues/1/comments","statuses_url":"https://api.github.com/repos/erik/alexandra/statuses/5356ee38d4d5fb55cd38c2da0a139c3f71ab984c","head":{"label":"Raynes:py35-py27","ref":"py35-py27","sha":"5356ee38d4d5fb55cd38c2da0a139c3f71ab984c","user":{"login":"Raynes","id":54435,"avatar_url":"https://avatars.githubusercontent.com/u/54435?v=3","gravatar_id":"","url":"https://api.github.com/users/Raynes","html_url":"https://github.com/Raynes","followers_url":"https://api.github.com/users/Raynes/followers","following_url":"https://api.github.com/users/Raynes/following{/other_user}","gists_url":"https://api.github.com/users/Raynes/gists{/gist_id}","starred_url":"https://api.github.com/users/Raynes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Raynes/subscriptions","organizations_url":"https://api.github.com/users/Raynes/orgs","repos_url":"https://api.github.com/users/Raynes/repos","events_url":"https://api.github.com/users/Raynes/events{/privacy}","received_events_url":"https://api.github.com/users/Raynes/received_events","type":"User","site_admin":false},"repo":{"id":52577035,"name":"alexandra","full_name":"Raynes/alexandra","owner":{"login":"Raynes","id":54435,"avatar_url":"https://avatars.githubusercontent.com/u/54435?v=3","gravatar_id":"","url":"https://api.github.com/users/Raynes","html_url":"https://github.com/Raynes","followers_url":"https://api.github.com/users/Raynes/followers","following_url":"https://api.github.com/users/Raynes/following{/other_user}","gists_url":"https://api.github.com/users/Raynes/gists{/gist_id}","starred_url":"https://api.github.com/users/Raynes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Raynes/subscriptions","organizations_url":"https://api.github.com/users/Raynes/orgs","repos_url":"https://api.github.com/users/Raynes/repos","events_url":"https://api.github.com/users/Raynes/events{/privacy}","received_events_url":"https://api.github.com/users/Raynes/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Raynes/alexandra","description":"Python toolkit for writing Amazon Alexa skills as web services","fork":true,"url":"https://api.github.com/repos/Raynes/alexandra","forks_url":"https://api.github.com/repos/Raynes/alexandra/forks","keys_url":"https://api.github.com/repos/Raynes/alexandra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Raynes/alexandra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Raynes/alexandra/teams","hooks_url":"https://api.github.com/repos/Raynes/alexandra/hooks","issue_events_url":"https://api.github.com/repos/Raynes/alexandra/issues/events{/number}","events_url":"https://api.github.com/repos/Raynes/alexandra/events","assignees_url":"https://api.github.com/repos/Raynes/alexandra/assignees{/user}","branches_url":"https://api.github.com/repos/Raynes/alexandra/branches{/branch}","tags_url":"https://api.github.com/repos/Raynes/alexandra/tags","blobs_url":"https://api.github.com/repos/Raynes/alexandra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Raynes/alexandra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Raynes/alexandra/git/refs{/sha}","trees_url":"https://api.github.com/repos/Raynes/alexandra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Raynes/alexandra/statuses/{sha}","languages_url":"https://api.github.com/repos/Raynes/alexandra/languages","stargazers_url":"https://api.github.com/repos/Raynes/alexandra/stargazers","contributors_url":"https://api.github.com/repos/Raynes/alexandra/contributors","subscribers_url":"https://api.github.com/repos/Raynes/alexandra/subscribers","subscription_url":"https://api.github.com/repos/Raynes/alexandra/subscription","commits_url":"https://api.github.com/repos/Raynes/alexandra/commits{/sha}","git_commits_url":"https://api.github.com/repos/Raynes/alexandra/git/commits{/sha}","comments_url":"https://api.github.com/repos/Raynes/alexandra/comments{/number}","issue_comment_url":"https://api.github.com/repos/Raynes/alexandra/issues/comments{/number}","contents_url":"https://api.github.com/repos/Raynes/alexandra/contents/{+path}","compare_url":"https://api.github.com/repos/Raynes/alexandra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Raynes/alexandra/merges","archive_url":"https://api.github.com/repos/Raynes/alexandra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Raynes/alexandra/downloads","issues_url":"https://api.github.com/repos/Raynes/alexandra/issues{/number}","pulls_url":"https://api.github.com/repos/Raynes/alexandra/pulls{/number}","milestones_url":"https://api.github.com/repos/Raynes/alexandra/milestones{/number}","notifications_url":"https://api.github.com/repos/Raynes/alexandra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Raynes/alexandra/labels{/name}","releases_url":"https://api.github.com/repos/Raynes/alexandra/releases{/id}","deployments_url":"https://api.github.com/repos/Raynes/alexandra/deployments","created_at":"2016-02-26T03:51:21Z","updated_at":"2016-02-26T03:51:22Z","pushed_at":"2016-02-27T03:01:28Z","git_url":"git://github.com/Raynes/alexandra.git","ssh_url":"git@github.com:Raynes/alexandra.git","clone_url":"https://github.com/Raynes/alexandra.git","svn_url":"https://github.com/Raynes/alexandra","homepage":"http://alexandra.rtfd.org","size":47,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"erik:master","ref":"master","sha":"f01efc4ed46bb37adae2ce42b955b6d2d5a11e01","user":{"login":"erik","id":188935,"avatar_url":"https://avatars.githubusercontent.com/u/188935?v=3","gravatar_id":"","url":"https://api.github.com/users/erik","html_url":"https://github.com/erik","followers_url":"https://api.github.com/users/erik/followers","following_url":"https://api.github.com/users/erik/following{/other_user}","gists_url":"https://api.github.com/users/erik/gists{/gist_id}","starred_url":"https://api.github.com/users/erik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erik/subscriptions","organizations_url":"https://api.github.com/users/erik/orgs","repos_url":"https://api.github.com/users/erik/repos","events_url":"https://api.github.com/users/erik/events{/privacy}","received_events_url":"https://api.github.com/users/erik/received_events","type":"User","site_admin":false},"repo":{"id":46254766,"name":"alexandra","full_name":"erik/alexandra","owner":{"login":"erik","id":188935,"avatar_url":"https://avatars.githubusercontent.com/u/188935?v=3","gravatar_id":"","url":"https://api.github.com/users/erik","html_url":"https://github.com/erik","followers_url":"https://api.github.com/users/erik/followers","following_url":"https://api.github.com/users/erik/following{/other_user}","gists_url":"https://api.github.com/users/erik/gists{/gist_id}","starred_url":"https://api.github.com/users/erik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erik/subscriptions","organizations_url":"https://api.github.com/users/erik/orgs","repos_url":"https://api.github.com/users/erik/repos","events_url":"https://api.github.com/users/erik/events{/privacy}","received_events_url":"https://api.github.com/users/erik/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/erik/alexandra","description":"Python toolkit for writing Amazon Alexa skills as web services","fork":false,"url":"https://api.github.com/repos/erik/alexandra","forks_url":"https://api.github.com/repos/erik/alexandra/forks","keys_url":"https://api.github.com/repos/erik/alexandra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/erik/alexandra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/erik/alexandra/teams","hooks_url":"https://api.github.com/repos/erik/alexandra/hooks","issue_events_url":"https://api.github.com/repos/erik/alexandra/issues/events{/number}","events_url":"https://api.github.com/repos/erik/alexandra/events","assignees_url":"https://api.github.com/repos/erik/alexandra/assignees{/user}","branches_url":"https://api.github.com/repos/erik/alexandra/branches{/branch}","tags_url":"https://api.github.com/repos/erik/alexandra/tags","blobs_url":"https://api.github.com/repos/erik/alexandra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/erik/alexandra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/erik/alexandra/git/refs{/sha}","trees_url":"https://api.github.com/repos/erik/alexandra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/erik/alexandra/statuses/{sha}","languages_url":"https://api.github.com/repos/erik/alexandra/languages","stargazers_url":"https://api.github.com/repos/erik/alexandra/stargazers","contributors_url":"https://api.github.com/repos/erik/alexandra/contributors","subscribers_url":"https://api.github.com/repos/erik/alexandra/subscribers","subscription_url":"https://api.github.com/repos/erik/alexandra/subscription","commits_url":"https://api.github.com/repos/erik/alexandra/commits{/sha}","git_commits_url":"https://api.github.com/repos/erik/alexandra/git/commits{/sha}","comments_url":"https://api.github.com/repos/erik/alexandra/comments{/number}","issue_comment_url":"https://api.github.com/repos/erik/alexandra/issues/comments{/number}","contents_url":"https://api.github.com/repos/erik/alexandra/contents/{+path}","compare_url":"https://api.github.com/repos/erik/alexandra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/erik/alexandra/merges","archive_url":"https://api.github.com/repos/erik/alexandra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/erik/alexandra/downloads","issues_url":"https://api.github.com/repos/erik/alexandra/issues{/number}","pulls_url":"https://api.github.com/repos/erik/alexandra/pulls{/number}","milestones_url":"https://api.github.com/repos/erik/alexandra/milestones{/number}","notifications_url":"https://api.github.com/repos/erik/alexandra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/erik/alexandra/labels{/name}","releases_url":"https://api.github.com/repos/erik/alexandra/releases{/id}","deployments_url":"https://api.github.com/repos/erik/alexandra/deployments","created_at":"2015-11-16T05:49:51Z","updated_at":"2016-02-26T05:24:40Z","pushed_at":"2016-02-27T03:01:28Z","git_url":"git://github.com/erik/alexandra.git","ssh_url":"git@github.com:erik/alexandra.git","clone_url":"https://github.com/erik/alexandra.git","svn_url":"https://github.com/erik/alexandra","homepage":"http://alexandra.rtfd.org","size":38,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/erik/alexandra/pulls/1"},"html":{"href":"https://github.com/erik/alexandra/pull/1"},"issue":{"href":"https://api.github.com/repos/erik/alexandra/issues/1"},"comments":{"href":"https://api.github.com/repos/erik/alexandra/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/erik/alexandra/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/erik/alexandra/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/erik/alexandra/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/erik/alexandra/statuses/5356ee38d4d5fb55cd38c2da0a139c3f71ab984c"}}}}