{"action":"created","comment":{"url":"https://api.github.com/repos/nilearn/nilearn/pulls/comments/25780214","id":25780214,"diff_hunk":"@@ -26,7 +26,7 @@ def plot_matrices(cov, prec, title):\n \n     # Put zeros on the diagonal, for graph clarity.\n     size = prec.shape[0]\n-    prec[range(size), range(size)] = 0\n+    prec[list(range(size)), list(range(size))] = 0","path":"examples/connectivity/plot_adhd_covariance.py","position":5,"original_position":5,"commit_id":"a9c291ce79712beefa69a27fdc6b58857130c66d","original_commit_id":"8c0ffd037fe7080fe29582eeb20ac16c3627847f","user":{"login":"lesteve","id":1680079,"avatar_url":"https://avatars.githubusercontent.com/u/1680079?v=3","gravatar_id":"","url":"https://api.github.com/users/lesteve","html_url":"https://github.com/lesteve","followers_url":"https://api.github.com/users/lesteve/followers","following_url":"https://api.github.com/users/lesteve/following{/other_user}","gists_url":"https://api.github.com/users/lesteve/gists{/gist_id}","starred_url":"https://api.github.com/users/lesteve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lesteve/subscriptions","organizations_url":"https://api.github.com/users/lesteve/orgs","repos_url":"https://api.github.com/users/lesteve/repos","events_url":"https://api.github.com/users/lesteve/events{/privacy}","received_events_url":"https://api.github.com/users/lesteve/received_events","type":"User","site_admin":false},"body":"Arrgh, probably one for soonish when we raise the minimum versions similarly to #397.","created_at":"2015-03-04T15:00:11Z","updated_at":"2015-03-04T15:00:11Z","html_url":"https://github.com/nilearn/nilearn/pull/476#discussion_r25780214","pull_request_url":"https://api.github.com/repos/nilearn/nilearn/pulls/476","_links":{"self":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/comments/25780214"},"html":{"href":"https://github.com/nilearn/nilearn/pull/476#discussion_r25780214"},"pull_request":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/476"}}},"pull_request":{"url":"https://api.github.com/repos/nilearn/nilearn/pulls/476","id":30257398,"html_url":"https://github.com/nilearn/nilearn/pull/476","diff_url":"https://github.com/nilearn/nilearn/pull/476.diff","patch_url":"https://github.com/nilearn/nilearn/pull/476.patch","issue_url":"https://api.github.com/repos/nilearn/nilearn/issues/476","number":476,"state":"open","locked":false,"title":"Python 3.x support in nilearn","user":{"login":"bcipolli","id":4072455,"avatar_url":"https://avatars.githubusercontent.com/u/4072455?v=3","gravatar_id":"","url":"https://api.github.com/users/bcipolli","html_url":"https://github.com/bcipolli","followers_url":"https://api.github.com/users/bcipolli/followers","following_url":"https://api.github.com/users/bcipolli/following{/other_user}","gists_url":"https://api.github.com/users/bcipolli/gists{/gist_id}","starred_url":"https://api.github.com/users/bcipolli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcipolli/subscriptions","organizations_url":"https://api.github.com/users/bcipolli/orgs","repos_url":"https://api.github.com/users/bcipolli/repos","events_url":"https://api.github.com/users/bcipolli/events{/privacy}","received_events_url":"https://api.github.com/users/bcipolli/received_events","type":"User","site_admin":false},"body":"@lesteve has helped finish the work here, and I removed the dependency on #371, so I've removed the \"WIP\" and I think things are more ready to go.\r\n\r\nAll code, tests, and examples should be runnable in Python 3.x.  We've enabled test coverage for Python 3.x, and the build is passing.  In addition, I tested with a version on #371 (resolving warnings), and verified that no new warnings are introduced by this code.\r\n\r\nThe following conventions were used to migrate `nilearn` code to Python 2/3 compatibility:\r\n* All `nilearn` imports should be relative (except, perhaps, in tests)\r\n* Write `except Exception, e` as `except Exception as e`\r\n* Write `isinstance(x, types.ListType)` as `isinstance(x, list)`\r\n* Write `callable(x)` as `isinstance(x, collections.Callable)`\r\n* Write `operator.isSequenceType(x)` as `isinstance(x, collections.Sequence)`\r\n* Write `operator.isNumberType(x)` as `isinstance(x, collections.Number)`\r\n* Write `nose.tools.assert_equals` as `nose.tools.assert_equal`\r\n* Write `nilearn._utils.testing.assert_raises_regexp` as `nilearn._utils.testing.assert_raises_regex` (mirrors nose clarification)\r\n* Write `<Iterable>.next()` as `next(<Iterable>)`\r\n* Write `filename = os.tempnam()` as `(_, filename) = tempfile.mkstemp()`\r\n* Write `not key in dict` as `key not in dict` (this actually warns in Python 3.x!)\r\n* Make sure to use `with open('file') as f' syntax; any file pointers that are not used in a context manager nor explicitly closed throw warnings.\r\n\r\n**Python 3 changes that require care to be backwards compatible**\r\n* Non-unicode strings must be prefixed with `b`: `b'string'`(mostly an issue interacting with numpy, but also some low-level operations like gzip code)\r\n* Write `print \"%s\" % (message,)` as `print(\"%s\" % (message,))`\r\n* Write integer division `3 / 2 == 1` as `3 // 2 == 1`\r\n* Write `<dict>.iteritems()` as `<dict>.items()` (there is no iteritems in Python 3)\r\n* Write `<dict>.itervalues()` as `<dict>.values()` (there is no itervalues in Python 3)\r\n* Write `itertools.izip()` as `zip()` (there is no `izip` in Python 3)\r\n* Write octal string `0100` `0o100`\r\n* Write `round` as `np.round` (avoids a numpy issue in Python 3)\r\n\r\n**Importing things from `six` instead of places you're used to**\r\n* Write `basestring` as `six.string_types` (requires `import six`)\r\n* Use the new urllib object structure instead of ulrllib/urllib2\r\n    * import from `six.moves.urllib`.\r\n    * there are no base-level functions/objects, all are present in subpackages\r\n* Import  `StringIO` and `cPickle from `six.moves`\r\n\r\n**Changes in how you design / write code**\r\n* Think carefully about any use of `xrange`.  If you *require* an iterator, then you must import `past.builtins.xrange`.  Otherwise, just use `range` (which is a list in Python 2, and an interator in Python 3).\r\n* Most things that used to generate lists now generate iterators; any time you need a list, make sure to wrap it in `list()`\r\n    * **THIS WILL GET YOU!**\r\n    * Includes:\r\n        * `dict.keys()`, `dict.values()`\r\n        * `zip`\r\n        * `range`\r\n        * `map`\r\n","created_at":"2015-03-02T04:01:52Z","updated_at":"2015-03-04T15:00:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1c30b55631262d427712d9429a7dc8a53a99cc93","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nilearn/nilearn/pulls/476/commits","review_comments_url":"https://api.github.com/repos/nilearn/nilearn/pulls/476/comments","review_comment_url":"https://api.github.com/repos/nilearn/nilearn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nilearn/nilearn/issues/476/comments","statuses_url":"https://api.github.com/repos/nilearn/nilearn/statuses/a9c291ce79712beefa69a27fdc6b58857130c66d","head":{"label":"bcipolli:python-3.x","ref":"python-3.x","sha":"a9c291ce79712beefa69a27fdc6b58857130c66d","user":{"login":"bcipolli","id":4072455,"avatar_url":"https://avatars.githubusercontent.com/u/4072455?v=3","gravatar_id":"","url":"https://api.github.com/users/bcipolli","html_url":"https://github.com/bcipolli","followers_url":"https://api.github.com/users/bcipolli/followers","following_url":"https://api.github.com/users/bcipolli/following{/other_user}","gists_url":"https://api.github.com/users/bcipolli/gists{/gist_id}","starred_url":"https://api.github.com/users/bcipolli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcipolli/subscriptions","organizations_url":"https://api.github.com/users/bcipolli/orgs","repos_url":"https://api.github.com/users/bcipolli/repos","events_url":"https://api.github.com/users/bcipolli/events{/privacy}","received_events_url":"https://api.github.com/users/bcipolli/received_events","type":"User","site_admin":false},"repo":{"id":28233031,"name":"nilearn","full_name":"bcipolli/nilearn","owner":{"login":"bcipolli","id":4072455,"avatar_url":"https://avatars.githubusercontent.com/u/4072455?v=3","gravatar_id":"","url":"https://api.github.com/users/bcipolli","html_url":"https://github.com/bcipolli","followers_url":"https://api.github.com/users/bcipolli/followers","following_url":"https://api.github.com/users/bcipolli/following{/other_user}","gists_url":"https://api.github.com/users/bcipolli/gists{/gist_id}","starred_url":"https://api.github.com/users/bcipolli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcipolli/subscriptions","organizations_url":"https://api.github.com/users/bcipolli/orgs","repos_url":"https://api.github.com/users/bcipolli/repos","events_url":"https://api.github.com/users/bcipolli/events{/privacy}","received_events_url":"https://api.github.com/users/bcipolli/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bcipolli/nilearn","description":"Machine learning for NeuroImaging in Python","fork":true,"url":"https://api.github.com/repos/bcipolli/nilearn","forks_url":"https://api.github.com/repos/bcipolli/nilearn/forks","keys_url":"https://api.github.com/repos/bcipolli/nilearn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bcipolli/nilearn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bcipolli/nilearn/teams","hooks_url":"https://api.github.com/repos/bcipolli/nilearn/hooks","issue_events_url":"https://api.github.com/repos/bcipolli/nilearn/issues/events{/number}","events_url":"https://api.github.com/repos/bcipolli/nilearn/events","assignees_url":"https://api.github.com/repos/bcipolli/nilearn/assignees{/user}","branches_url":"https://api.github.com/repos/bcipolli/nilearn/branches{/branch}","tags_url":"https://api.github.com/repos/bcipolli/nilearn/tags","blobs_url":"https://api.github.com/repos/bcipolli/nilearn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bcipolli/nilearn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bcipolli/nilearn/git/refs{/sha}","trees_url":"https://api.github.com/repos/bcipolli/nilearn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bcipolli/nilearn/statuses/{sha}","languages_url":"https://api.github.com/repos/bcipolli/nilearn/languages","stargazers_url":"https://api.github.com/repos/bcipolli/nilearn/stargazers","contributors_url":"https://api.github.com/repos/bcipolli/nilearn/contributors","subscribers_url":"https://api.github.com/repos/bcipolli/nilearn/subscribers","subscription_url":"https://api.github.com/repos/bcipolli/nilearn/subscription","commits_url":"https://api.github.com/repos/bcipolli/nilearn/commits{/sha}","git_commits_url":"https://api.github.com/repos/bcipolli/nilearn/git/commits{/sha}","comments_url":"https://api.github.com/repos/bcipolli/nilearn/comments{/number}","issue_comment_url":"https://api.github.com/repos/bcipolli/nilearn/issues/comments{/number}","contents_url":"https://api.github.com/repos/bcipolli/nilearn/contents/{+path}","compare_url":"https://api.github.com/repos/bcipolli/nilearn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bcipolli/nilearn/merges","archive_url":"https://api.github.com/repos/bcipolli/nilearn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bcipolli/nilearn/downloads","issues_url":"https://api.github.com/repos/bcipolli/nilearn/issues{/number}","pulls_url":"https://api.github.com/repos/bcipolli/nilearn/pulls{/number}","milestones_url":"https://api.github.com/repos/bcipolli/nilearn/milestones{/number}","notifications_url":"https://api.github.com/repos/bcipolli/nilearn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bcipolli/nilearn/labels{/name}","releases_url":"https://api.github.com/repos/bcipolli/nilearn/releases{/id}","created_at":"2014-12-19T14:43:35Z","updated_at":"2015-02-24T19:31:27Z","pushed_at":"2015-03-04T14:53:22Z","git_url":"git://github.com/bcipolli/nilearn.git","ssh_url":"git@github.com:bcipolli/nilearn.git","clone_url":"https://github.com/bcipolli/nilearn.git","svn_url":"https://github.com/bcipolli/nilearn","homepage":"http://nilearn.github.io","size":7467,"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":"nilearn:master","ref":"master","sha":"7c5c65a998ca9353d9a06efe69c04aca6f771705","user":{"login":"nilearn","id":4646912,"avatar_url":"https://avatars.githubusercontent.com/u/4646912?v=3","gravatar_id":"","url":"https://api.github.com/users/nilearn","html_url":"https://github.com/nilearn","followers_url":"https://api.github.com/users/nilearn/followers","following_url":"https://api.github.com/users/nilearn/following{/other_user}","gists_url":"https://api.github.com/users/nilearn/gists{/gist_id}","starred_url":"https://api.github.com/users/nilearn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nilearn/subscriptions","organizations_url":"https://api.github.com/users/nilearn/orgs","repos_url":"https://api.github.com/users/nilearn/repos","events_url":"https://api.github.com/users/nilearn/events{/privacy}","received_events_url":"https://api.github.com/users/nilearn/received_events","type":"Organization","site_admin":false},"repo":{"id":1235740,"name":"nilearn","full_name":"nilearn/nilearn","owner":{"login":"nilearn","id":4646912,"avatar_url":"https://avatars.githubusercontent.com/u/4646912?v=3","gravatar_id":"","url":"https://api.github.com/users/nilearn","html_url":"https://github.com/nilearn","followers_url":"https://api.github.com/users/nilearn/followers","following_url":"https://api.github.com/users/nilearn/following{/other_user}","gists_url":"https://api.github.com/users/nilearn/gists{/gist_id}","starred_url":"https://api.github.com/users/nilearn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nilearn/subscriptions","organizations_url":"https://api.github.com/users/nilearn/orgs","repos_url":"https://api.github.com/users/nilearn/repos","events_url":"https://api.github.com/users/nilearn/events{/privacy}","received_events_url":"https://api.github.com/users/nilearn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nilearn/nilearn","description":"Machine learning for NeuroImaging in Python","fork":false,"url":"https://api.github.com/repos/nilearn/nilearn","forks_url":"https://api.github.com/repos/nilearn/nilearn/forks","keys_url":"https://api.github.com/repos/nilearn/nilearn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nilearn/nilearn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nilearn/nilearn/teams","hooks_url":"https://api.github.com/repos/nilearn/nilearn/hooks","issue_events_url":"https://api.github.com/repos/nilearn/nilearn/issues/events{/number}","events_url":"https://api.github.com/repos/nilearn/nilearn/events","assignees_url":"https://api.github.com/repos/nilearn/nilearn/assignees{/user}","branches_url":"https://api.github.com/repos/nilearn/nilearn/branches{/branch}","tags_url":"https://api.github.com/repos/nilearn/nilearn/tags","blobs_url":"https://api.github.com/repos/nilearn/nilearn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nilearn/nilearn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nilearn/nilearn/git/refs{/sha}","trees_url":"https://api.github.com/repos/nilearn/nilearn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nilearn/nilearn/statuses/{sha}","languages_url":"https://api.github.com/repos/nilearn/nilearn/languages","stargazers_url":"https://api.github.com/repos/nilearn/nilearn/stargazers","contributors_url":"https://api.github.com/repos/nilearn/nilearn/contributors","subscribers_url":"https://api.github.com/repos/nilearn/nilearn/subscribers","subscription_url":"https://api.github.com/repos/nilearn/nilearn/subscription","commits_url":"https://api.github.com/repos/nilearn/nilearn/commits{/sha}","git_commits_url":"https://api.github.com/repos/nilearn/nilearn/git/commits{/sha}","comments_url":"https://api.github.com/repos/nilearn/nilearn/comments{/number}","issue_comment_url":"https://api.github.com/repos/nilearn/nilearn/issues/comments{/number}","contents_url":"https://api.github.com/repos/nilearn/nilearn/contents/{+path}","compare_url":"https://api.github.com/repos/nilearn/nilearn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nilearn/nilearn/merges","archive_url":"https://api.github.com/repos/nilearn/nilearn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nilearn/nilearn/downloads","issues_url":"https://api.github.com/repos/nilearn/nilearn/issues{/number}","pulls_url":"https://api.github.com/repos/nilearn/nilearn/pulls{/number}","milestones_url":"https://api.github.com/repos/nilearn/nilearn/milestones{/number}","notifications_url":"https://api.github.com/repos/nilearn/nilearn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nilearn/nilearn/labels{/name}","releases_url":"https://api.github.com/repos/nilearn/nilearn/releases{/id}","created_at":"2011-01-09T19:02:23Z","updated_at":"2015-03-04T13:51:57Z","pushed_at":"2015-03-04T13:51:56Z","git_url":"git://github.com/nilearn/nilearn.git","ssh_url":"git@github.com:nilearn/nilearn.git","clone_url":"https://github.com/nilearn/nilearn.git","svn_url":"https://github.com/nilearn/nilearn","homepage":"http://nilearn.github.io","size":12364,"stargazers_count":74,"watchers_count":74,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":54,"mirror_url":null,"open_issues_count":77,"forks":54,"open_issues":77,"watchers":74,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/476"},"html":{"href":"https://github.com/nilearn/nilearn/pull/476"},"issue":{"href":"https://api.github.com/repos/nilearn/nilearn/issues/476"},"comments":{"href":"https://api.github.com/repos/nilearn/nilearn/issues/476/comments"},"review_comments":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/476/comments"},"review_comment":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/476/commits"},"statuses":{"href":"https://api.github.com/repos/nilearn/nilearn/statuses/a9c291ce79712beefa69a27fdc6b58857130c66d"}}}}