{"payload":{"allShortcutsEnabled":false,"fileTree":{"IPython/frontend/html/notebook/static/js":{"items":[{"name":"cell.js","path":"IPython/frontend/html/notebook/static/js/cell.js","contentType":"file"},{"name":"codecell.js","path":"IPython/frontend/html/notebook/static/js/codecell.js","contentType":"file"},{"name":"kernel.js","path":"IPython/frontend/html/notebook/static/js/kernel.js","contentType":"file"},{"name":"kernelstatus.js","path":"IPython/frontend/html/notebook/static/js/kernelstatus.js","contentType":"file"},{"name":"layout.js","path":"IPython/frontend/html/notebook/static/js/layout.js","contentType":"file"},{"name":"leftpanel.js","path":"IPython/frontend/html/notebook/static/js/leftpanel.js","contentType":"file"},{"name":"loginmain.js","path":"IPython/frontend/html/notebook/static/js/loginmain.js","contentType":"file"},{"name":"loginwidget.js","path":"IPython/frontend/html/notebook/static/js/loginwidget.js","contentType":"file"},{"name":"namespace.js","path":"IPython/frontend/html/notebook/static/js/namespace.js","contentType":"file"},{"name":"notebook.js","path":"IPython/frontend/html/notebook/static/js/notebook.js","contentType":"file"},{"name":"notebooklist.js","path":"IPython/frontend/html/notebook/static/js/notebooklist.js","contentType":"file"},{"name":"notebookmain.js","path":"IPython/frontend/html/notebook/static/js/notebookmain.js","contentType":"file"},{"name":"pager.js","path":"IPython/frontend/html/notebook/static/js/pager.js","contentType":"file"},{"name":"panelsection.js","path":"IPython/frontend/html/notebook/static/js/panelsection.js","contentType":"file"},{"name":"printwidget.js","path":"IPython/frontend/html/notebook/static/js/printwidget.js","contentType":"file"},{"name":"projectdashboardmain.js","path":"IPython/frontend/html/notebook/static/js/projectdashboardmain.js","contentType":"file"},{"name":"quickhelp.js","path":"IPython/frontend/html/notebook/static/js/quickhelp.js","contentType":"file"},{"name":"savewidget.js","path":"IPython/frontend/html/notebook/static/js/savewidget.js","contentType":"file"},{"name":"textcell.js","path":"IPython/frontend/html/notebook/static/js/textcell.js","contentType":"file"},{"name":"utils.js","path":"IPython/frontend/html/notebook/static/js/utils.js","contentType":"file"}],"totalCount":20},"IPython/frontend/html/notebook/static":{"items":[{"name":"codemirror","path":"IPython/frontend/html/notebook/static/codemirror","contentType":"directory"},{"name":"css","path":"IPython/frontend/html/notebook/static/css","contentType":"directory"},{"name":"jquery","path":"IPython/frontend/html/notebook/static/jquery","contentType":"directory"},{"name":"js","path":"IPython/frontend/html/notebook/static/js","contentType":"directory"},{"name":"pagedown","path":"IPython/frontend/html/notebook/static/pagedown","contentType":"directory"},{"name":"prettify","path":"IPython/frontend/html/notebook/static/prettify","contentType":"directory"},{"name":"favicon.ico","path":"IPython/frontend/html/notebook/static/favicon.ico","contentType":"file"}],"totalCount":7},"IPython/frontend/html/notebook":{"items":[{"name":"static","path":"IPython/frontend/html/notebook/static","contentType":"directory"},{"name":"templates","path":"IPython/frontend/html/notebook/templates","contentType":"directory"},{"name":"tests","path":"IPython/frontend/html/notebook/tests","contentType":"directory"},{"name":"__init__.py","path":"IPython/frontend/html/notebook/__init__.py","contentType":"file"},{"name":"handlers.py","path":"IPython/frontend/html/notebook/handlers.py","contentType":"file"},{"name":"kernelmanager.py","path":"IPython/frontend/html/notebook/kernelmanager.py","contentType":"file"},{"name":"notebookapp.py","path":"IPython/frontend/html/notebook/notebookapp.py","contentType":"file"},{"name":"notebookmanager.py","path":"IPython/frontend/html/notebook/notebookmanager.py","contentType":"file"},{"name":"zmqhttp.py","path":"IPython/frontend/html/notebook/zmqhttp.py","contentType":"file"}],"totalCount":9},"IPython/frontend/html":{"items":[{"name":"notebook","path":"IPython/frontend/html/notebook","contentType":"directory"},{"name":"__init__.py","path":"IPython/frontend/html/__init__.py","contentType":"file"}],"totalCount":2},"IPython/frontend":{"items":[{"name":"html","path":"IPython/frontend/html","contentType":"directory"},{"name":"qt","path":"IPython/frontend/qt","contentType":"directory"},{"name":"terminal","path":"IPython/frontend/terminal","contentType":"directory"},{"name":"__init__.py","path":"IPython/frontend/__init__.py","contentType":"file"}],"totalCount":4},"IPython":{"items":[{"name":"config","path":"IPython/config","contentType":"directory"},{"name":"core","path":"IPython/core","contentType":"directory"},{"name":"deathrow","path":"IPython/deathrow","contentType":"directory"},{"name":"extensions","path":"IPython/extensions","contentType":"directory"},{"name":"external","path":"IPython/external","contentType":"directory"},{"name":"frontend","path":"IPython/frontend","contentType":"directory"},{"name":"kernel","path":"IPython/kernel","contentType":"directory"},{"name":"lib","path":"IPython/lib","contentType":"directory"},{"name":"nbformat","path":"IPython/nbformat","contentType":"directory"},{"name":"parallel","path":"IPython/parallel","contentType":"directory"},{"name":"quarantine","path":"IPython/quarantine","contentType":"directory"},{"name":"scripts","path":"IPython/scripts","contentType":"directory"},{"name":"testing","path":"IPython/testing","contentType":"directory"},{"name":"utils","path":"IPython/utils","contentType":"directory"},{"name":"zmq","path":"IPython/zmq","contentType":"directory"},{"name":".git_commit_info.ini","path":"IPython/.git_commit_info.ini","contentType":"file"},{"name":"__init__.py","path":"IPython/__init__.py","contentType":"file"}],"totalCount":17},"":{"items":[{"name":"IPython","path":"IPython","contentType":"directory"},{"name":"docs","path":"docs","contentType":"directory"},{"name":"scripts","path":"scripts","contentType":"directory"},{"name":"setupext","path":"setupext","contentType":"directory"},{"name":"tools","path":"tools","contentType":"directory"},{"name":".gitattributes","path":".gitattributes","contentType":"file"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":".mailmap","path":".mailmap","contentType":"file"},{"name":"COPYING.txt","path":"COPYING.txt","contentType":"file"},{"name":"MANIFEST.in","path":"MANIFEST.in","contentType":"file"},{"name":"README.rst","path":"README.rst","contentType":"file"},{"name":"ipython.py","path":"ipython.py","contentType":"file"},{"name":"setup.py","path":"setup.py","contentType":"file"},{"name":"setup2.py","path":"setup2.py","contentType":"file"},{"name":"setup3.py","path":"setup3.py","contentType":"file"},{"name":"setupbase.py","path":"setupbase.py","contentType":"file"},{"name":"setupegg.py","path":"setupegg.py","contentType":"file"}],"totalCount":17}},"fileTreeProcessingTime":33.676525999999996,"foldersToFetch":[],"repo":{"id":659446,"defaultBranch":"master","name":"ipython","ownerLogin":"minrk","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2010-05-10T18:37:01.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/151929?v=4","public":true,"private":false,"isOrgOwned":false},"symbolsExpanded":false,"treeExpanded":true,"refInfo":{"name":"f6b3d8fff90f0aa58a7c00ca1dda36447b0f7c87","listCacheKey":"v0:1676298693.418668","canEdit":false,"refType":"tree","currentOid":"f6b3d8fff90f0aa58a7c00ca1dda36447b0f7c87"},"path":"IPython/frontend/html/notebook/static/js/kernel.js","currentUser":null,"blob":{"rawLines":["//----------------------------------------------------------------------------","// Copyright (C) 2008-2011 The IPython Development Team","//","// Distributed under the terms of the BSD License. The full license is in","// the file COPYING, distributed as part of this software.","//----------------------------------------------------------------------------","","//============================================================================","// Kernel","//============================================================================","","var IPython = (function (IPython) {",""," var utils = IPython.utils;",""," var Kernel = function () {"," this.kernel_id = null;"," this.shell_channel = null;"," this.iopub_channel = null;"," this.base_url = $('body').data('baseKernelUrl') + \"kernels\";"," this.running = false;"," this.username = \"username\";"," this.session_id = utils.uuid();"," "," if (typeof(WebSocket) !== 'undefined') {"," this.WebSocket = WebSocket"," } else if (typeof(MozWebSocket) !== 'undefined') {"," this.WebSocket = MozWebSocket"," } else {"," alert('Your browser does not have WebSocket support, please try Chrome, Safari or Firefox ≥ 6. Firefox 4 and 5 are also supported by you have to enable WebSockets in about:config.');"," };"," };","",""," Kernel.prototype.get_msg = function (msg_type, content) {"," var msg = {"," header : {"," msg_id : utils.uuid(),"," username : this.username,"," session : this.session_id,"," msg_type : msg_type"," },"," content : content,"," parent_header : {}"," };"," return msg;"," }",""," Kernel.prototype.start = function (notebook_id, callback) {"," var that = this;"," if (!this.running) {"," var qs = $.param({notebook:notebook_id});"," var url = this.base_url + '?' + qs"," $.post(url,"," function (kernel_id) {"," that._handle_start_kernel(kernel_id, callback);"," }, "," 'json'"," );"," };"," };","",""," Kernel.prototype.restart = function (callback) {"," IPython.kernel_status_widget.status_restarting();"," var url = this.kernel_url + \"/restart\";"," var that = this;"," if (this.running) {"," this.stop_channels();"," $.post(url,"," function (kernel_id) {"," that._handle_start_kernel(kernel_id, callback);"," },"," 'json'"," );"," };"," };","",""," Kernel.prototype._handle_start_kernel = function (json, callback) {"," this.running = true;"," this.kernel_id = json.kernel_id;"," this.ws_url = json.ws_url;"," this.kernel_url = this.base_url + \"/\" + this.kernel_id;"," this.start_channels();"," callback();"," IPython.kernel_status_widget.status_idle();"," };",""," Kernel.prototype._websocket_closed = function(ws_url, early){"," var msg;"," var parent_item = $('body');"," if (early) {"," msg = \"Websocket connection to \" + ws_url + \" could not be established.
\" +"," \" You will NOT be able to run code.
\" +"," \" Your browser may not be compatible with the websocket version in the server,\" +"," \" or if the url does not look right, there could be an error in the\" +"," \" server's configuration.\""," } else {"," msg = \"Websocket connection closed unexpectedly.
\" +"," \" The kernel will no longer be responsive.\""," }"," var dialog = $('