{"action":"created","comment":{"url":"https://api.github.com/repos/numenta/nupic.core/pulls/comments/50489781","id":50489781,"diff_hunk":"@@ -1672,7 +1672,19 @@ inline PyObject* generate2DGaussianSample(nupic::UInt32 nrows, nupic::UInt32 nco\n //--------------------------------------------------------------------------------\n // Temporal Memory\n //--------------------------------------------------------------------------------\n-%include <nupic/algorithms/TemporalMemory.hpp>\n+%inline %{\n+  template <typename IntType>\n+  inline PyObject* vectorToList(const vector<IntType> &cellIdxs)\n+  {\n+    PyObject *list = PyList_New(cellIdxs.size());","path":"src/nupic/bindings/algorithms.i","position":9,"original_position":9,"commit_id":"0a9cbc4e578b3be945ddf1a5a3837da8b10f29e3","original_commit_id":"0a9cbc4e578b3be945ddf1a5a3837da8b10f29e3","user":{"login":"SaganBolliger","id":6234732,"avatar_url":"https://avatars.githubusercontent.com/u/6234732?v=3","gravatar_id":"","url":"https://api.github.com/users/SaganBolliger","html_url":"https://github.com/SaganBolliger","followers_url":"https://api.github.com/users/SaganBolliger/followers","following_url":"https://api.github.com/users/SaganBolliger/following{/other_user}","gists_url":"https://api.github.com/users/SaganBolliger/gists{/gist_id}","starred_url":"https://api.github.com/users/SaganBolliger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SaganBolliger/subscriptions","organizations_url":"https://api.github.com/users/SaganBolliger/orgs","repos_url":"https://api.github.com/users/SaganBolliger/repos","events_url":"https://api.github.com/users/SaganBolliger/events{/privacy}","received_events_url":"https://api.github.com/users/SaganBolliger/received_events","type":"User","site_admin":false},"body":"Yes, I believe so. `PyList_New` creates a new list with ref count 1. When the function returns, it transfers the ownership to the Python caller. If the Python caller then discards that list, it decrements the ref count is to 0, at which point the list will be freed.\r\n\r\nSimilarly, `PyList_SET_ITEM()` takes ownership of the reference returned by `PyInt_FromLong`.","created_at":"2016-01-22T00:57:59Z","updated_at":"2016-01-22T00:57:59Z","html_url":"https://github.com/numenta/nupic.core/pull/837#discussion_r50489781","pull_request_url":"https://api.github.com/repos/numenta/nupic.core/pulls/837","_links":{"self":{"href":"https://api.github.com/repos/numenta/nupic.core/pulls/comments/50489781"},"html":{"href":"https://github.com/numenta/nupic.core/pull/837#discussion_r50489781"},"pull_request":{"href":"https://api.github.com/repos/numenta/nupic.core/pulls/837"}}},"pull_request":{"url":"https://api.github.com/repos/numenta/nupic.core/pulls/837","id":56796323,"html_url":"https://github.com/numenta/nupic.core/pull/837","diff_url":"https://github.com/numenta/nupic.core/pull/837.diff","patch_url":"https://github.com/numenta/nupic.core/pull/837.patch","issue_url":"https://api.github.com/repos/numenta/nupic.core/issues/837","number":837,"state":"open","locked":false,"title":"TM: Add accessor methods and update API to use lists of indices","user":{"login":"SaganBolliger","id":6234732,"avatar_url":"https://avatars.githubusercontent.com/u/6234732?v=3","gravatar_id":"","url":"https://api.github.com/users/SaganBolliger","html_url":"https://github.com/SaganBolliger","followers_url":"https://api.github.com/users/SaganBolliger/followers","following_url":"https://api.github.com/users/SaganBolliger/following{/other_user}","gists_url":"https://api.github.com/users/SaganBolliger/gists{/gist_id}","starred_url":"https://api.github.com/users/SaganBolliger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SaganBolliger/subscriptions","organizations_url":"https://api.github.com/users/SaganBolliger/orgs","repos_url":"https://api.github.com/users/SaganBolliger/repos","events_url":"https://api.github.com/users/SaganBolliger/events{/privacy}","received_events_url":"https://api.github.com/users/SaganBolliger/received_events","type":"User","site_admin":false},"body":"Fixes #834 ","created_at":"2016-01-21T19:24:40Z","updated_at":"2016-01-22T00:57:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"684a3d7529ddf9c3dbc5227a30b4b61c49c2639f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/numenta/nupic.core/pulls/837/commits","review_comments_url":"https://api.github.com/repos/numenta/nupic.core/pulls/837/comments","review_comment_url":"https://api.github.com/repos/numenta/nupic.core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/numenta/nupic.core/issues/837/comments","statuses_url":"https://api.github.com/repos/numenta/nupic.core/statuses/0a9cbc4e578b3be945ddf1a5a3837da8b10f29e3","head":{"label":"SaganBolliger:834-accessors-and-api-update","ref":"834-accessors-and-api-update","sha":"0a9cbc4e578b3be945ddf1a5a3837da8b10f29e3","user":{"login":"SaganBolliger","id":6234732,"avatar_url":"https://avatars.githubusercontent.com/u/6234732?v=3","gravatar_id":"","url":"https://api.github.com/users/SaganBolliger","html_url":"https://github.com/SaganBolliger","followers_url":"https://api.github.com/users/SaganBolliger/followers","following_url":"https://api.github.com/users/SaganBolliger/following{/other_user}","gists_url":"https://api.github.com/users/SaganBolliger/gists{/gist_id}","starred_url":"https://api.github.com/users/SaganBolliger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SaganBolliger/subscriptions","organizations_url":"https://api.github.com/users/SaganBolliger/orgs","repos_url":"https://api.github.com/users/SaganBolliger/repos","events_url":"https://api.github.com/users/SaganBolliger/events{/privacy}","received_events_url":"https://api.github.com/users/SaganBolliger/received_events","type":"User","site_admin":false},"repo":{"id":43717695,"name":"nupic.core","full_name":"SaganBolliger/nupic.core","owner":{"login":"SaganBolliger","id":6234732,"avatar_url":"https://avatars.githubusercontent.com/u/6234732?v=3","gravatar_id":"","url":"https://api.github.com/users/SaganBolliger","html_url":"https://github.com/SaganBolliger","followers_url":"https://api.github.com/users/SaganBolliger/followers","following_url":"https://api.github.com/users/SaganBolliger/following{/other_user}","gists_url":"https://api.github.com/users/SaganBolliger/gists{/gist_id}","starred_url":"https://api.github.com/users/SaganBolliger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SaganBolliger/subscriptions","organizations_url":"https://api.github.com/users/SaganBolliger/orgs","repos_url":"https://api.github.com/users/SaganBolliger/repos","events_url":"https://api.github.com/users/SaganBolliger/events{/privacy}","received_events_url":"https://api.github.com/users/SaganBolliger/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/SaganBolliger/nupic.core","description":"Implementation of core NuPIC algorithms in C++ (under construction)","fork":true,"url":"https://api.github.com/repos/SaganBolliger/nupic.core","forks_url":"https://api.github.com/repos/SaganBolliger/nupic.core/forks","keys_url":"https://api.github.com/repos/SaganBolliger/nupic.core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SaganBolliger/nupic.core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SaganBolliger/nupic.core/teams","hooks_url":"https://api.github.com/repos/SaganBolliger/nupic.core/hooks","issue_events_url":"https://api.github.com/repos/SaganBolliger/nupic.core/issues/events{/number}","events_url":"https://api.github.com/repos/SaganBolliger/nupic.core/events","assignees_url":"https://api.github.com/repos/SaganBolliger/nupic.core/assignees{/user}","branches_url":"https://api.github.com/repos/SaganBolliger/nupic.core/branches{/branch}","tags_url":"https://api.github.com/repos/SaganBolliger/nupic.core/tags","blobs_url":"https://api.github.com/repos/SaganBolliger/nupic.core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SaganBolliger/nupic.core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SaganBolliger/nupic.core/git/refs{/sha}","trees_url":"https://api.github.com/repos/SaganBolliger/nupic.core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SaganBolliger/nupic.core/statuses/{sha}","languages_url":"https://api.github.com/repos/SaganBolliger/nupic.core/languages","stargazers_url":"https://api.github.com/repos/SaganBolliger/nupic.core/stargazers","contributors_url":"https://api.github.com/repos/SaganBolliger/nupic.core/contributors","subscribers_url":"https://api.github.com/repos/SaganBolliger/nupic.core/subscribers","subscription_url":"https://api.github.com/repos/SaganBolliger/nupic.core/subscription","commits_url":"https://api.github.com/repos/SaganBolliger/nupic.core/commits{/sha}","git_commits_url":"https://api.github.com/repos/SaganBolliger/nupic.core/git/commits{/sha}","comments_url":"https://api.github.com/repos/SaganBolliger/nupic.core/comments{/number}","issue_comment_url":"https://api.github.com/repos/SaganBolliger/nupic.core/issues/comments{/number}","contents_url":"https://api.github.com/repos/SaganBolliger/nupic.core/contents/{+path}","compare_url":"https://api.github.com/repos/SaganBolliger/nupic.core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SaganBolliger/nupic.core/merges","archive_url":"https://api.github.com/repos/SaganBolliger/nupic.core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SaganBolliger/nupic.core/downloads","issues_url":"https://api.github.com/repos/SaganBolliger/nupic.core/issues{/number}","pulls_url":"https://api.github.com/repos/SaganBolliger/nupic.core/pulls{/number}","milestones_url":"https://api.github.com/repos/SaganBolliger/nupic.core/milestones{/number}","notifications_url":"https://api.github.com/repos/SaganBolliger/nupic.core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SaganBolliger/nupic.core/labels{/name}","releases_url":"https://api.github.com/repos/SaganBolliger/nupic.core/releases{/id}","deployments_url":"https://api.github.com/repos/SaganBolliger/nupic.core/deployments","created_at":"2015-10-05T22:35:42Z","updated_at":"2015-10-05T22:35:50Z","pushed_at":"2016-01-21T19:21:39Z","git_url":"git://github.com/SaganBolliger/nupic.core.git","ssh_url":"git@github.com:SaganBolliger/nupic.core.git","clone_url":"https://github.com/SaganBolliger/nupic.core.git","svn_url":"https://github.com/SaganBolliger/nupic.core","homepage":"http://numenta.org","size":162230,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"numenta:master","ref":"master","sha":"c83b6ef0ae99ec0b6ad7fb2cc2612e3982a691da","user":{"login":"numenta","id":1039191,"avatar_url":"https://avatars.githubusercontent.com/u/1039191?v=3","gravatar_id":"","url":"https://api.github.com/users/numenta","html_url":"https://github.com/numenta","followers_url":"https://api.github.com/users/numenta/followers","following_url":"https://api.github.com/users/numenta/following{/other_user}","gists_url":"https://api.github.com/users/numenta/gists{/gist_id}","starred_url":"https://api.github.com/users/numenta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/numenta/subscriptions","organizations_url":"https://api.github.com/users/numenta/orgs","repos_url":"https://api.github.com/users/numenta/repos","events_url":"https://api.github.com/users/numenta/events{/privacy}","received_events_url":"https://api.github.com/users/numenta/received_events","type":"Organization","site_admin":false},"repo":{"id":16366081,"name":"nupic.core","full_name":"numenta/nupic.core","owner":{"login":"numenta","id":1039191,"avatar_url":"https://avatars.githubusercontent.com/u/1039191?v=3","gravatar_id":"","url":"https://api.github.com/users/numenta","html_url":"https://github.com/numenta","followers_url":"https://api.github.com/users/numenta/followers","following_url":"https://api.github.com/users/numenta/following{/other_user}","gists_url":"https://api.github.com/users/numenta/gists{/gist_id}","starred_url":"https://api.github.com/users/numenta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/numenta/subscriptions","organizations_url":"https://api.github.com/users/numenta/orgs","repos_url":"https://api.github.com/users/numenta/repos","events_url":"https://api.github.com/users/numenta/events{/privacy}","received_events_url":"https://api.github.com/users/numenta/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/numenta/nupic.core","description":"Implementation of core NuPIC algorithms in C++ (under construction)","fork":false,"url":"https://api.github.com/repos/numenta/nupic.core","forks_url":"https://api.github.com/repos/numenta/nupic.core/forks","keys_url":"https://api.github.com/repos/numenta/nupic.core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/numenta/nupic.core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/numenta/nupic.core/teams","hooks_url":"https://api.github.com/repos/numenta/nupic.core/hooks","issue_events_url":"https://api.github.com/repos/numenta/nupic.core/issues/events{/number}","events_url":"https://api.github.com/repos/numenta/nupic.core/events","assignees_url":"https://api.github.com/repos/numenta/nupic.core/assignees{/user}","branches_url":"https://api.github.com/repos/numenta/nupic.core/branches{/branch}","tags_url":"https://api.github.com/repos/numenta/nupic.core/tags","blobs_url":"https://api.github.com/repos/numenta/nupic.core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/numenta/nupic.core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/numenta/nupic.core/git/refs{/sha}","trees_url":"https://api.github.com/repos/numenta/nupic.core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/numenta/nupic.core/statuses/{sha}","languages_url":"https://api.github.com/repos/numenta/nupic.core/languages","stargazers_url":"https://api.github.com/repos/numenta/nupic.core/stargazers","contributors_url":"https://api.github.com/repos/numenta/nupic.core/contributors","subscribers_url":"https://api.github.com/repos/numenta/nupic.core/subscribers","subscription_url":"https://api.github.com/repos/numenta/nupic.core/subscription","commits_url":"https://api.github.com/repos/numenta/nupic.core/commits{/sha}","git_commits_url":"https://api.github.com/repos/numenta/nupic.core/git/commits{/sha}","comments_url":"https://api.github.com/repos/numenta/nupic.core/comments{/number}","issue_comment_url":"https://api.github.com/repos/numenta/nupic.core/issues/comments{/number}","contents_url":"https://api.github.com/repos/numenta/nupic.core/contents/{+path}","compare_url":"https://api.github.com/repos/numenta/nupic.core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/numenta/nupic.core/merges","archive_url":"https://api.github.com/repos/numenta/nupic.core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/numenta/nupic.core/downloads","issues_url":"https://api.github.com/repos/numenta/nupic.core/issues{/number}","pulls_url":"https://api.github.com/repos/numenta/nupic.core/pulls{/number}","milestones_url":"https://api.github.com/repos/numenta/nupic.core/milestones{/number}","notifications_url":"https://api.github.com/repos/numenta/nupic.core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/numenta/nupic.core/labels{/name}","releases_url":"https://api.github.com/repos/numenta/nupic.core/releases{/id}","deployments_url":"https://api.github.com/repos/numenta/nupic.core/deployments","created_at":"2014-01-30T02:13:40Z","updated_at":"2016-01-15T16:57:32Z","pushed_at":"2016-01-21T19:24:41Z","git_url":"git://github.com/numenta/nupic.core.git","ssh_url":"git@github.com:numenta/nupic.core.git","clone_url":"https://github.com/numenta/nupic.core.git","svn_url":"https://github.com/numenta/nupic.core","homepage":"http://numenta.org","size":207215,"stargazers_count":146,"watchers_count":146,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":135,"mirror_url":null,"open_issues_count":121,"forks":135,"open_issues":121,"watchers":146,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/numenta/nupic.core/pulls/837"},"html":{"href":"https://github.com/numenta/nupic.core/pull/837"},"issue":{"href":"https://api.github.com/repos/numenta/nupic.core/issues/837"},"comments":{"href":"https://api.github.com/repos/numenta/nupic.core/issues/837/comments"},"review_comments":{"href":"https://api.github.com/repos/numenta/nupic.core/pulls/837/comments"},"review_comment":{"href":"https://api.github.com/repos/numenta/nupic.core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/numenta/nupic.core/pulls/837/commits"},"statuses":{"href":"https://api.github.com/repos/numenta/nupic.core/statuses/0a9cbc4e578b3be945ddf1a5a3837da8b10f29e3"}}}}