Background
System:
- Debian, running on Amazong
/root
is backed by NFS (Amazon's EFS)
Launch jupyter console --kernel python3
in one terminal, then pstree
in another.
System:
/root
is backed by NFS (Amazon's EFS)Launch jupyter console --kernel python3
in one terminal, then pstree
in another.
This is a (lightly) annotated run through of launching a jupyter kernel, sending some messages, and cleaning it up.
git clone https://gist.github.com/3239c1547b53c97cc648d5abb3cbe3e0.git kernely
cd kernely
npm install
node index.js
(function(console){ | |
console.save = function(data, filename){ | |
if(!data) { | |
data = Jupyter.notebook.toJSON(); | |
} | |
filename = Jupyter.notebook.notebook_name; | |
if(!filename) { |
nteract doesn't support requirejs because we have the builtin require
at our fingertips. Jupyter notebook however has long operated under the assumption that you can use the builtin requirejs for loading modules asynchronously:
require(['d3'], function(d3) {...
I started exploring the idea of providing some of these modules in a "quirks" sort of mode where we provide limited access to "requirejs" while still sandboxed. To find out what modules were commonly required, I turned to Google BigQuery, the GitHub dataset, and a User Defined Function (UDF) written in JavaScript.
I'll flesh out this gist or a blog post later. For now, I'll just provide my query code:
-- https://news.ycombinator.com/item?id=11396045
SELECT count(*)
FROM (SELECT id, repo_name, path
FROM [bigquery-public-data:github_repos.sample_files]
) AS F
import IPython.display | |
import requests | |
def random_image_url(tags=None): | |
query = "" | |
if tags is not None: | |
query = "&tag=" + "+".join(tags) | |
api_url = "http://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC" + query | |
resp = requests.get(api_url) |