{"action":"created","comment":{"url":"https://api.github.com/repos/numenta/nupic.cerebro2/pulls/comments/26512922","id":26512922,"diff_hunk":"@@ -0,0 +1,107 @@\n+#!/usr/bin/env python\n+\n+import os\n+import sys\n+import webbrowser\n+import subprocess\n+\"\"\"\n+## Usage\n+Make sure the 'nupic.cerebro2.server directory' is extracted in here and all requirements are installed. \n+(Furter information : see the READMEs)\n+\n+First, patch your model:\n+\n+    // Assuming `model` is a CLA model you already have\n+    from cerebro2.patcher import Patcher\n+    Patcher().patchCLAModel(model)\n+\n+You can also patch an SP or a TP directly:\n+\n+    // Assuming `sp` and `tp` are already defined\n+    from cerebro2.patcher import Patcher\n+    Patcher().patchSP(sp)\n+    Patcher().patchTP(tp)\n+\n+Then, after the model / SP / TP has through a number of iterations:\n+\n+\n+Then, run:\n+\n+    ./run_server <PortNumber>\n+\n+### Screenshots\n+\n+To enable taking screenshots with the `p` keyboard shortcut, open `js/classes/abstract_visualization.js` and uncomment the line under the note about screenshots.\n+\n+@author: passiweinberger\n+\"\"\"\n+\n+DESCRIPTION = (\"This is to set up a Cerebro2 server and open it in your browser.\\n\"\n+\t\t\"It is assumed, that you already patched your model or the SP & TP parameters.\\n\"\n+\t\t\"If not, do this as follows:\\n\\n\"\n+\t\t\"First, patch your model:\\n\"\n+\t\t\n+    \t\t\"// Assuming `model` is a CLA model you already have\\n\\n\"\n+    \t\t\"from cerebro2.patcher import Patcher\\n\"\n+    \t\t\"Patcher().patchCLAModel(model)\\n\\n\"\n+    \t\t\n+\t\t\"You can also patch an SP or a TP directly:\\n\"\n+\n+    \t\t\"// Assuming `sp` and `tp` are already defined\\n\\n\"\n+    \t\t\"from cerebro2.patcher import Patcher\\n\"\n+    \t\t\"Patcher().patchSP(sp)\\n\"\n+    \t\t\"Patcher().patchTP(tp)\\n\\n\"\n+    \t\t\n+\t\t\"This scripc also assumes that you have the 'nupic.cerebro2.server' folder inside this directory!\\n\"\n+\t\t\"For further information read the READMEs in these two folders!\\n\\n\"\n+\t\t\"If last lines for Exit Cmd uncommented:\\n\"\n+\t\t\"Press C-c to kill all the processes. \\n\"\n+\t\t\"(CAUTION: executes 'killall python' !!)\\n\")\n+\n+\t\t\n+def server_setup(StartDir):\n+    ServerDir = os.path.join(StartDir, 'nupic.cerebro2.server')\n+    if not os.path.isdir(ServerDir):\n+      print \"Could not find the nupic.cerebro2.server directory! Please copy it into this Directory!\\nTerminated.\"\n+      return 1\n+    else:\n+      os.chdir(ServerDir)\n+      print \"Server is being set up...\\n\"\n+      subprocess.Popen([\"python\", \"server.py\"])\n+\n+\n+def server_call(StartDir, port):\n+    StaticDir = os.path.join(StartDir, 'static')\n+    os.chdir(StaticDir)\n+    print \"Calling the server at port number %s\" % port \n+    command = \"python -m SimpleHTTPServer \" + str(port)    \n+    subprocess.Popen([\"python\", \"-m\", \"SimpleHTTPServer\", port])    \n+    print \"Server is up and running at port %s!\\n\" % port\n+\n+\n+def open_browser(port):","path":"run_server.py","position":82,"original_position":82,"commit_id":"ba0ce2f52ec4c50a30a3649608c44b82e0b9cdb8","original_commit_id":"ba0ce2f52ec4c50a30a3649608c44b82e0b9cdb8","user":{"login":"rhyolight","id":15566,"avatar_url":"https://avatars.githubusercontent.com/u/15566?v=3","gravatar_id":"","url":"https://api.github.com/users/rhyolight","html_url":"https://github.com/rhyolight","followers_url":"https://api.github.com/users/rhyolight/followers","following_url":"https://api.github.com/users/rhyolight/following{/other_user}","gists_url":"https://api.github.com/users/rhyolight/gists{/gist_id}","starred_url":"https://api.github.com/users/rhyolight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhyolight/subscriptions","organizations_url":"https://api.github.com/users/rhyolight/orgs","repos_url":"https://api.github.com/users/rhyolight/repos","events_url":"https://api.github.com/users/rhyolight/events{/privacy}","received_events_url":"https://api.github.com/users/rhyolight/received_events","type":"User","site_admin":false},"body":"`openBrowser`","created_at":"2015-03-16T18:22:47Z","updated_at":"2015-03-16T18:22:47Z","html_url":"https://github.com/numenta/nupic.cerebro2/pull/71#discussion_r26512922","pull_request_url":"https://api.github.com/repos/numenta/nupic.cerebro2/pulls/71","_links":{"self":{"href":"https://api.github.com/repos/numenta/nupic.cerebro2/pulls/comments/26512922"},"html":{"href":"https://github.com/numenta/nupic.cerebro2/pull/71#discussion_r26512922"},"pull_request":{"href":"https://api.github.com/repos/numenta/nupic.cerebro2/pulls/71"}}},"pull_request":{"url":"https://api.github.com/repos/numenta/nupic.cerebro2/pulls/71","id":31261478,"html_url":"https://github.com/numenta/nupic.cerebro2/pull/71","diff_url":"https://github.com/numenta/nupic.cerebro2/pull/71.diff","patch_url":"https://github.com/numenta/nupic.cerebro2/pull/71.patch","issue_url":"https://api.github.com/repos/numenta/nupic.cerebro2/issues/71","number":71,"state":"open","locked":false,"title":"Create one script to setup and run ther cerebro2 server","user":{"login":"passiweinberger","id":9993908,"avatar_url":"https://avatars.githubusercontent.com/u/9993908?v=3","gravatar_id":"","url":"https://api.github.com/users/passiweinberger","html_url":"https://github.com/passiweinberger","followers_url":"https://api.github.com/users/passiweinberger/followers","following_url":"https://api.github.com/users/passiweinberger/following{/other_user}","gists_url":"https://api.github.com/users/passiweinberger/gists{/gist_id}","starred_url":"https://api.github.com/users/passiweinberger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/passiweinberger/subscriptions","organizations_url":"https://api.github.com/users/passiweinberger/orgs","repos_url":"https://api.github.com/users/passiweinberger/repos","events_url":"https://api.github.com/users/passiweinberger/events{/privacy}","received_events_url":"https://api.github.com/users/passiweinberger/received_events","type":"User","site_admin":false},"body":"For easier use.... ","created_at":"2015-03-16T16:48:40Z","updated_at":"2015-03-16T18:22:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fc0eaf30fc51c64ac64cdf7e32d50e7589f87c38","assignee":{"login":"chetan51","id":310282,"avatar_url":"https://avatars.githubusercontent.com/u/310282?v=3","gravatar_id":"","url":"https://api.github.com/users/chetan51","html_url":"https://github.com/chetan51","followers_url":"https://api.github.com/users/chetan51/followers","following_url":"https://api.github.com/users/chetan51/following{/other_user}","gists_url":"https://api.github.com/users/chetan51/gists{/gist_id}","starred_url":"https://api.github.com/users/chetan51/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chetan51/subscriptions","organizations_url":"https://api.github.com/users/chetan51/orgs","repos_url":"https://api.github.com/users/chetan51/repos","events_url":"https://api.github.com/users/chetan51/events{/privacy}","received_events_url":"https://api.github.com/users/chetan51/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/numenta/nupic.cerebro2/pulls/71/commits","review_comments_url":"https://api.github.com/repos/numenta/nupic.cerebro2/pulls/71/comments","review_comment_url":"https://api.github.com/repos/numenta/nupic.cerebro2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/numenta/nupic.cerebro2/issues/71/comments","statuses_url":"https://api.github.com/repos/numenta/nupic.cerebro2/statuses/ba0ce2f52ec4c50a30a3649608c44b82e0b9cdb8","head":{"label":"passiweinberger:master","ref":"master","sha":"ba0ce2f52ec4c50a30a3649608c44b82e0b9cdb8","user":{"login":"passiweinberger","id":9993908,"avatar_url":"https://avatars.githubusercontent.com/u/9993908?v=3","gravatar_id":"","url":"https://api.github.com/users/passiweinberger","html_url":"https://github.com/passiweinberger","followers_url":"https://api.github.com/users/passiweinberger/followers","following_url":"https://api.github.com/users/passiweinberger/following{/other_user}","gists_url":"https://api.github.com/users/passiweinberger/gists{/gist_id}","starred_url":"https://api.github.com/users/passiweinberger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/passiweinberger/subscriptions","organizations_url":"https://api.github.com/users/passiweinberger/orgs","repos_url":"https://api.github.com/users/passiweinberger/repos","events_url":"https://api.github.com/users/passiweinberger/events{/privacy}","received_events_url":"https://api.github.com/users/passiweinberger/received_events","type":"User","site_admin":false},"repo":{"id":32318136,"name":"nupic.cerebro2","full_name":"passiweinberger/nupic.cerebro2","owner":{"login":"passiweinberger","id":9993908,"avatar_url":"https://avatars.githubusercontent.com/u/9993908?v=3","gravatar_id":"","url":"https://api.github.com/users/passiweinberger","html_url":"https://github.com/passiweinberger","followers_url":"https://api.github.com/users/passiweinberger/followers","following_url":"https://api.github.com/users/passiweinberger/following{/other_user}","gists_url":"https://api.github.com/users/passiweinberger/gists{/gist_id}","starred_url":"https://api.github.com/users/passiweinberger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/passiweinberger/subscriptions","organizations_url":"https://api.github.com/users/passiweinberger/orgs","repos_url":"https://api.github.com/users/passiweinberger/repos","events_url":"https://api.github.com/users/passiweinberger/events{/privacy}","received_events_url":"https://api.github.com/users/passiweinberger/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/passiweinberger/nupic.cerebro2","description":"A web-based visualization and debugging platform for NuPIC.","fork":true,"url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2","forks_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/forks","keys_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/teams","hooks_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/hooks","issue_events_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/issues/events{/number}","events_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/events","assignees_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/assignees{/user}","branches_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/branches{/branch}","tags_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/tags","blobs_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/git/refs{/sha}","trees_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/statuses/{sha}","languages_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/languages","stargazers_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/stargazers","contributors_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/contributors","subscribers_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/subscribers","subscription_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/subscription","commits_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/commits{/sha}","git_commits_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/git/commits{/sha}","comments_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/comments{/number}","issue_comment_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/issues/comments{/number}","contents_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/contents/{+path}","compare_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/merges","archive_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/downloads","issues_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/issues{/number}","pulls_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/pulls{/number}","milestones_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/milestones{/number}","notifications_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/labels{/name}","releases_url":"https://api.github.com/repos/passiweinberger/nupic.cerebro2/releases{/id}","created_at":"2015-03-16T10:41:00Z","updated_at":"2015-03-16T16:47:02Z","pushed_at":"2015-03-16T16:47:01Z","git_url":"git://github.com/passiweinberger/nupic.cerebro2.git","ssh_url":"git@github.com:passiweinberger/nupic.cerebro2.git","clone_url":"https://github.com/passiweinberger/nupic.cerebro2.git","svn_url":"https://github.com/passiweinberger/nupic.cerebro2","homepage":"","size":3428,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"47084af57931f301aaf1ad981bcb1bce88128927","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":17393601,"name":"nupic.cerebro2","full_name":"numenta/nupic.cerebro2","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.cerebro2","description":"A web-based visualization and debugging platform for NuPIC.","fork":false,"url":"https://api.github.com/repos/numenta/nupic.cerebro2","forks_url":"https://api.github.com/repos/numenta/nupic.cerebro2/forks","keys_url":"https://api.github.com/repos/numenta/nupic.cerebro2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/numenta/nupic.cerebro2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/numenta/nupic.cerebro2/teams","hooks_url":"https://api.github.com/repos/numenta/nupic.cerebro2/hooks","issue_events_url":"https://api.github.com/repos/numenta/nupic.cerebro2/issues/events{/number}","events_url":"https://api.github.com/repos/numenta/nupic.cerebro2/events","assignees_url":"https://api.github.com/repos/numenta/nupic.cerebro2/assignees{/user}","branches_url":"https://api.github.com/repos/numenta/nupic.cerebro2/branches{/branch}","tags_url":"https://api.github.com/repos/numenta/nupic.cerebro2/tags","blobs_url":"https://api.github.com/repos/numenta/nupic.cerebro2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/numenta/nupic.cerebro2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/numenta/nupic.cerebro2/git/refs{/sha}","trees_url":"https://api.github.com/repos/numenta/nupic.cerebro2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/numenta/nupic.cerebro2/statuses/{sha}","languages_url":"https://api.github.com/repos/numenta/nupic.cerebro2/languages","stargazers_url":"https://api.github.com/repos/numenta/nupic.cerebro2/stargazers","contributors_url":"https://api.github.com/repos/numenta/nupic.cerebro2/contributors","subscribers_url":"https://api.github.com/repos/numenta/nupic.cerebro2/subscribers","subscription_url":"https://api.github.com/repos/numenta/nupic.cerebro2/subscription","commits_url":"https://api.github.com/repos/numenta/nupic.cerebro2/commits{/sha}","git_commits_url":"https://api.github.com/repos/numenta/nupic.cerebro2/git/commits{/sha}","comments_url":"https://api.github.com/repos/numenta/nupic.cerebro2/comments{/number}","issue_comment_url":"https://api.github.com/repos/numenta/nupic.cerebro2/issues/comments{/number}","contents_url":"https://api.github.com/repos/numenta/nupic.cerebro2/contents/{+path}","compare_url":"https://api.github.com/repos/numenta/nupic.cerebro2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/numenta/nupic.cerebro2/merges","archive_url":"https://api.github.com/repos/numenta/nupic.cerebro2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/numenta/nupic.cerebro2/downloads","issues_url":"https://api.github.com/repos/numenta/nupic.cerebro2/issues{/number}","pulls_url":"https://api.github.com/repos/numenta/nupic.cerebro2/pulls{/number}","milestones_url":"https://api.github.com/repos/numenta/nupic.cerebro2/milestones{/number}","notifications_url":"https://api.github.com/repos/numenta/nupic.cerebro2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/numenta/nupic.cerebro2/labels{/name}","releases_url":"https://api.github.com/repos/numenta/nupic.cerebro2/releases{/id}","created_at":"2014-03-04T07:14:44Z","updated_at":"2014-11-15T07:14:34Z","pushed_at":"2014-11-05T16:59:38Z","git_url":"git://github.com/numenta/nupic.cerebro2.git","ssh_url":"git@github.com:numenta/nupic.cerebro2.git","clone_url":"https://github.com/numenta/nupic.cerebro2.git","svn_url":"https://github.com/numenta/nupic.cerebro2","homepage":"","size":4457,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":28,"forks":12,"open_issues":28,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/numenta/nupic.cerebro2/pulls/71"},"html":{"href":"https://github.com/numenta/nupic.cerebro2/pull/71"},"issue":{"href":"https://api.github.com/repos/numenta/nupic.cerebro2/issues/71"},"comments":{"href":"https://api.github.com/repos/numenta/nupic.cerebro2/issues/71/comments"},"review_comments":{"href":"https://api.github.com/repos/numenta/nupic.cerebro2/pulls/71/comments"},"review_comment":{"href":"https://api.github.com/repos/numenta/nupic.cerebro2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/numenta/nupic.cerebro2/pulls/71/commits"},"statuses":{"href":"https://api.github.com/repos/numenta/nupic.cerebro2/statuses/ba0ce2f52ec4c50a30a3649608c44b82e0b9cdb8"}}}}