{"action":"created","comment":{"url":"https://api.github.com/repos/bartvm/blocks/pulls/comments/26966837","id":26966837,"diff_hunk":"@@ -204,10 +204,15 @@ def replace(self, replacements):\n         # Sort `replacements` in topological order\n         for node in apply_nodes_sorted:\n             for input_ in node.inputs:\n-                if input_ not in replacements:\n-                    continue\n-                replacement_keys_cur.append(input_)\n-                replacement_vals_cur.append(replacements[input_])\n+                if input_ in replacements:","path":"blocks/graph.py","position":8,"original_position":8,"commit_id":"c6fd716c71441ba78314ec4b6fa1b0dd6b4a420b","original_commit_id":"c6fd716c71441ba78314ec4b6fa1b0dd6b4a420b","user":{"login":"rizar","id":654434,"avatar_url":"https://avatars.githubusercontent.com/u/654434?v=3","gravatar_id":"","url":"https://api.github.com/users/rizar","html_url":"https://github.com/rizar","followers_url":"https://api.github.com/users/rizar/followers","following_url":"https://api.github.com/users/rizar/following{/other_user}","gists_url":"https://api.github.com/users/rizar/gists{/gist_id}","starred_url":"https://api.github.com/users/rizar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rizar/subscriptions","organizations_url":"https://api.github.com/users/rizar/orgs","repos_url":"https://api.github.com/users/rizar/repos","events_url":"https://api.github.com/users/rizar/events{/privacy}","received_events_url":"https://api.github.com/users/rizar/received_events","type":"User","site_admin":false},"body":"It seems to me that the whole iteration could be actually replaced by `for variable in self.variables`. They are also sorted topologically, exactly in the way as done here (correct me if I am wrong), but the duplicates are removed, which is just what we need here.","created_at":"2015-03-23T18:48:01Z","updated_at":"2015-03-23T18:48:01Z","html_url":"https://github.com/bartvm/blocks/pull/516#discussion_r26966837","pull_request_url":"https://api.github.com/repos/bartvm/blocks/pulls/516","_links":{"self":{"href":"https://api.github.com/repos/bartvm/blocks/pulls/comments/26966837"},"html":{"href":"https://github.com/bartvm/blocks/pull/516#discussion_r26966837"},"pull_request":{"href":"https://api.github.com/repos/bartvm/blocks/pulls/516"}}},"pull_request":{"url":"https://api.github.com/repos/bartvm/blocks/pulls/516","id":31560805,"html_url":"https://github.com/bartvm/blocks/pull/516","diff_url":"https://github.com/bartvm/blocks/pull/516.diff","patch_url":"https://github.com/bartvm/blocks/pull/516.patch","issue_url":"https://api.github.com/repos/bartvm/blocks/issues/516","number":516,"state":"closed","locked":false,"title":"Fixed replacement of outputs","user":{"login":"dmitriy-serdyuk","id":2872615,"avatar_url":"https://avatars.githubusercontent.com/u/2872615?v=3","gravatar_id":"","url":"https://api.github.com/users/dmitriy-serdyuk","html_url":"https://github.com/dmitriy-serdyuk","followers_url":"https://api.github.com/users/dmitriy-serdyuk/followers","following_url":"https://api.github.com/users/dmitriy-serdyuk/following{/other_user}","gists_url":"https://api.github.com/users/dmitriy-serdyuk/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitriy-serdyuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitriy-serdyuk/subscriptions","organizations_url":"https://api.github.com/users/dmitriy-serdyuk/orgs","repos_url":"https://api.github.com/users/dmitriy-serdyuk/repos","events_url":"https://api.github.com/users/dmitriy-serdyuk/events{/privacy}","received_events_url":"https://api.github.com/users/dmitriy-serdyuk/received_events","type":"User","site_admin":false},"body":"Fixes #515.","created_at":"2015-03-19T20:06:26Z","updated_at":"2015-03-23T18:48:01Z","closed_at":"2015-03-19T21:34:13Z","merged_at":"2015-03-19T21:34:13Z","merge_commit_sha":"6bf2a23b5e361419a916e0bb658c2c3b62d8e42b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bartvm/blocks/pulls/516/commits","review_comments_url":"https://api.github.com/repos/bartvm/blocks/pulls/516/comments","review_comment_url":"https://api.github.com/repos/bartvm/blocks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bartvm/blocks/issues/516/comments","statuses_url":"https://api.github.com/repos/bartvm/blocks/statuses/c6fd716c71441ba78314ec4b6fa1b0dd6b4a420b","head":{"label":"dmitriy-serdyuk:replace-outputs","ref":"replace-outputs","sha":"c6fd716c71441ba78314ec4b6fa1b0dd6b4a420b","user":{"login":"dmitriy-serdyuk","id":2872615,"avatar_url":"https://avatars.githubusercontent.com/u/2872615?v=3","gravatar_id":"","url":"https://api.github.com/users/dmitriy-serdyuk","html_url":"https://github.com/dmitriy-serdyuk","followers_url":"https://api.github.com/users/dmitriy-serdyuk/followers","following_url":"https://api.github.com/users/dmitriy-serdyuk/following{/other_user}","gists_url":"https://api.github.com/users/dmitriy-serdyuk/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitriy-serdyuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitriy-serdyuk/subscriptions","organizations_url":"https://api.github.com/users/dmitriy-serdyuk/orgs","repos_url":"https://api.github.com/users/dmitriy-serdyuk/repos","events_url":"https://api.github.com/users/dmitriy-serdyuk/events{/privacy}","received_events_url":"https://api.github.com/users/dmitriy-serdyuk/received_events","type":"User","site_admin":false},"repo":{"id":27456006,"name":"blocks","full_name":"dmitriy-serdyuk/blocks","owner":{"login":"dmitriy-serdyuk","id":2872615,"avatar_url":"https://avatars.githubusercontent.com/u/2872615?v=3","gravatar_id":"","url":"https://api.github.com/users/dmitriy-serdyuk","html_url":"https://github.com/dmitriy-serdyuk","followers_url":"https://api.github.com/users/dmitriy-serdyuk/followers","following_url":"https://api.github.com/users/dmitriy-serdyuk/following{/other_user}","gists_url":"https://api.github.com/users/dmitriy-serdyuk/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitriy-serdyuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitriy-serdyuk/subscriptions","organizations_url":"https://api.github.com/users/dmitriy-serdyuk/orgs","repos_url":"https://api.github.com/users/dmitriy-serdyuk/repos","events_url":"https://api.github.com/users/dmitriy-serdyuk/events{/privacy}","received_events_url":"https://api.github.com/users/dmitriy-serdyuk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dmitriy-serdyuk/blocks","description":"","fork":true,"url":"https://api.github.com/repos/dmitriy-serdyuk/blocks","forks_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/forks","keys_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/teams","hooks_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/hooks","issue_events_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/issues/events{/number}","events_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/events","assignees_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/assignees{/user}","branches_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/branches{/branch}","tags_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/tags","blobs_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/git/refs{/sha}","trees_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/statuses/{sha}","languages_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/languages","stargazers_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/stargazers","contributors_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/contributors","subscribers_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/subscribers","subscription_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/subscription","commits_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/commits{/sha}","git_commits_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/git/commits{/sha}","comments_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/comments{/number}","issue_comment_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/issues/comments{/number}","contents_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/contents/{+path}","compare_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/merges","archive_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/downloads","issues_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/issues{/number}","pulls_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/pulls{/number}","milestones_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/milestones{/number}","notifications_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/labels{/name}","releases_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/releases{/id}","created_at":"2014-12-02T22:07:51Z","updated_at":"2015-03-10T21:49:55Z","pushed_at":"2015-03-20T19:21:52Z","git_url":"git://github.com/dmitriy-serdyuk/blocks.git","ssh_url":"git@github.com:dmitriy-serdyuk/blocks.git","clone_url":"https://github.com/dmitriy-serdyuk/blocks.git","svn_url":"https://github.com/dmitriy-serdyuk/blocks","homepage":null,"size":3320,"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":"bartvm:master","ref":"master","sha":"b621569d4208e095e9d892f775f38ddc91d5b326","user":{"login":"bartvm","id":2299595,"avatar_url":"https://avatars.githubusercontent.com/u/2299595?v=3","gravatar_id":"","url":"https://api.github.com/users/bartvm","html_url":"https://github.com/bartvm","followers_url":"https://api.github.com/users/bartvm/followers","following_url":"https://api.github.com/users/bartvm/following{/other_user}","gists_url":"https://api.github.com/users/bartvm/gists{/gist_id}","starred_url":"https://api.github.com/users/bartvm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bartvm/subscriptions","organizations_url":"https://api.github.com/users/bartvm/orgs","repos_url":"https://api.github.com/users/bartvm/repos","events_url":"https://api.github.com/users/bartvm/events{/privacy}","received_events_url":"https://api.github.com/users/bartvm/received_events","type":"User","site_admin":false},"repo":{"id":24829371,"name":"blocks","full_name":"bartvm/blocks","owner":{"login":"bartvm","id":2299595,"avatar_url":"https://avatars.githubusercontent.com/u/2299595?v=3","gravatar_id":"","url":"https://api.github.com/users/bartvm","html_url":"https://github.com/bartvm","followers_url":"https://api.github.com/users/bartvm/followers","following_url":"https://api.github.com/users/bartvm/following{/other_user}","gists_url":"https://api.github.com/users/bartvm/gists{/gist_id}","starred_url":"https://api.github.com/users/bartvm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bartvm/subscriptions","organizations_url":"https://api.github.com/users/bartvm/orgs","repos_url":"https://api.github.com/users/bartvm/repos","events_url":"https://api.github.com/users/bartvm/events{/privacy}","received_events_url":"https://api.github.com/users/bartvm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bartvm/blocks","description":"A Theano framework for building and training neural networks","fork":false,"url":"https://api.github.com/repos/bartvm/blocks","forks_url":"https://api.github.com/repos/bartvm/blocks/forks","keys_url":"https://api.github.com/repos/bartvm/blocks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bartvm/blocks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bartvm/blocks/teams","hooks_url":"https://api.github.com/repos/bartvm/blocks/hooks","issue_events_url":"https://api.github.com/repos/bartvm/blocks/issues/events{/number}","events_url":"https://api.github.com/repos/bartvm/blocks/events","assignees_url":"https://api.github.com/repos/bartvm/blocks/assignees{/user}","branches_url":"https://api.github.com/repos/bartvm/blocks/branches{/branch}","tags_url":"https://api.github.com/repos/bartvm/blocks/tags","blobs_url":"https://api.github.com/repos/bartvm/blocks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bartvm/blocks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bartvm/blocks/git/refs{/sha}","trees_url":"https://api.github.com/repos/bartvm/blocks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bartvm/blocks/statuses/{sha}","languages_url":"https://api.github.com/repos/bartvm/blocks/languages","stargazers_url":"https://api.github.com/repos/bartvm/blocks/stargazers","contributors_url":"https://api.github.com/repos/bartvm/blocks/contributors","subscribers_url":"https://api.github.com/repos/bartvm/blocks/subscribers","subscription_url":"https://api.github.com/repos/bartvm/blocks/subscription","commits_url":"https://api.github.com/repos/bartvm/blocks/commits{/sha}","git_commits_url":"https://api.github.com/repos/bartvm/blocks/git/commits{/sha}","comments_url":"https://api.github.com/repos/bartvm/blocks/comments{/number}","issue_comment_url":"https://api.github.com/repos/bartvm/blocks/issues/comments{/number}","contents_url":"https://api.github.com/repos/bartvm/blocks/contents/{+path}","compare_url":"https://api.github.com/repos/bartvm/blocks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bartvm/blocks/merges","archive_url":"https://api.github.com/repos/bartvm/blocks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bartvm/blocks/downloads","issues_url":"https://api.github.com/repos/bartvm/blocks/issues{/number}","pulls_url":"https://api.github.com/repos/bartvm/blocks/pulls{/number}","milestones_url":"https://api.github.com/repos/bartvm/blocks/milestones{/number}","notifications_url":"https://api.github.com/repos/bartvm/blocks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bartvm/blocks/labels{/name}","releases_url":"https://api.github.com/repos/bartvm/blocks/releases{/id}","created_at":"2014-10-06T00:08:32Z","updated_at":"2015-03-23T11:08:17Z","pushed_at":"2015-03-23T15:37:32Z","git_url":"git://github.com/bartvm/blocks.git","ssh_url":"git@github.com:bartvm/blocks.git","clone_url":"https://github.com/bartvm/blocks.git","svn_url":"https://github.com/bartvm/blocks","homepage":"","size":20055,"stargazers_count":137,"watchers_count":137,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":47,"mirror_url":null,"open_issues_count":90,"forks":47,"open_issues":90,"watchers":137,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bartvm/blocks/pulls/516"},"html":{"href":"https://github.com/bartvm/blocks/pull/516"},"issue":{"href":"https://api.github.com/repos/bartvm/blocks/issues/516"},"comments":{"href":"https://api.github.com/repos/bartvm/blocks/issues/516/comments"},"review_comments":{"href":"https://api.github.com/repos/bartvm/blocks/pulls/516/comments"},"review_comment":{"href":"https://api.github.com/repos/bartvm/blocks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bartvm/blocks/pulls/516/commits"},"statuses":{"href":"https://api.github.com/repos/bartvm/blocks/statuses/c6fd716c71441ba78314ec4b6fa1b0dd6b4a420b"}}}}