')
+ .prependTo(cell.element)
+ .on('click', click_solution_lock);
+ element_set_locked(cell, locked);
+ return ctrl;
+ }
+
+ function remove_element(cell) {
+ cell.element.find('.exercise').remove();
+ }
+
+ function element_set_locked(cell, locked) {
+ return cell.element.find('.exercise')
+ .toggleClass('fa-plus-square-o', locked)
+ .toggleClass('fa-minus-square-o', !locked);
+ }
+
+ function refresh_exercises() {
+ var in_exercise = false;
+ IPython.notebook.get_cells().forEach(function(cell) {
+ if (in_exercise && cell.metadata.solution !== undefined && !cell.metadata.solution_first) {
+ cell.element.toggleClass('hidden', cell.metadata.solution === 'hidden');
+ } else {
+ in_exercise = false;
+ }
+ if (!in_exercise && cell.metadata.solution !== undefined) {
+ in_exercise = true;
+ add_element(cell);
+ }
+ });
+ }
+
+ function load_ipython_extension() {
+ // add css
+ $('
')
+ .attr('href', requirejs.toUrl('./main.css'))
+ .appendTo('head');
+
+ // Hide/display existing solutions at startup
+ events.on('notebook_loaded.Notebook', refresh_exercises);
+ if (IPython.notebook._fully_loaded) refresh_exercises();
+
+ var action_name = IPython.keyboard_manager.actions.register({
+ help : 'Exercise: Create/Remove exercise',
+ help_index: 'ht',
+ icon : 'fa-mortar-board',
+ handler : create_remove_exercise
+ }, 'create_remove_exercise', 'exercise');
+
+ IPython.notebook.config.loaded.then(function() {
+ $.extend(true, cfg, IPython.notebook.config.data);
+
+ if (cfg.add_button) {
+ IPython.toolbar.add_buttons_group([action_name]);
+ }
+ if (cfg.use_hotkey && cfg.hotkey) {
+ var cmd_shrts = {};
+ cmd_shrts[cfg.hotkey] = action_name;
+ IPython.keyboard_manager.command_shortcuts.add_shortcuts(cmd_shrts);
+ }
+ }).catch(function(err) {
+ console.warn('[exercise] error:', err);
+ });
+ }
+
+ return {
+ load_ipython_extension: load_ipython_extension,
+ };
+});
diff --git a/.local/share/jupyter/nbextensions/help_panel/help_panel_ext.png b/.local/share/jupyter/nbextensions/help_panel/help_panel_ext.png
new file mode 100644
index 0000000000000000000000000000000000000000..3069ea03f8b8318738bbfe79f8c3dc6aaeca2f66
Binary files /dev/null and b/.local/share/jupyter/nbextensions/help_panel/help_panel_ext.png differ
diff --git a/.local/share/jupyter/nbextensions/help_panel/icon.png b/.local/share/jupyter/nbextensions/help_panel/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..b6173372c96f35651376358ab662cd6de7050fef
Binary files /dev/null and b/.local/share/jupyter/nbextensions/help_panel/icon.png differ
diff --git a/.local/share/jupyter/nbextensions/hide_header/hide_header.yaml b/.local/share/jupyter/nbextensions/hide_header/hide_header.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..b486a2a9d2c4f87abc681dcccfc82ac01c85863c
--- /dev/null
+++ b/.local/share/jupyter/nbextensions/hide_header/hide_header.yaml
@@ -0,0 +1,12 @@
+Type: IPython Notebook Extension
+Name: Hide Header
+Link: README.md
+Description: Toggle visibility of all of header, menubar, toolbar using a hotkey
+Main: main.js
+Compatibility: 4.x, 5.x
+Parameters:
+- name: header_toggle
+ description: keybinding for toggling header visibility
+ input_type: hotkey
+ default: ctrl-H
+
diff --git a/.local/share/jupyter/nbextensions/hide_input_all/hide_input_all.yaml b/.local/share/jupyter/nbextensions/hide_input_all/hide_input_all.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..ec413205b9b61aeb2f7a86c53e87a2dbf114133f
--- /dev/null
+++ b/.local/share/jupyter/nbextensions/hide_input_all/hide_input_all.yaml
@@ -0,0 +1,7 @@
+Type: IPython Notebook Extension
+Compatibility: 3.x 4.x 5.x
+Main: main.js
+Name: Hide input all
+Description: "toggle display of all code cells' inputs"
+Icon: icon.png
+Link: readme.md
diff --git a/.local/share/jupyter/nbextensions/hide_input_all/hide_input_all_show.png b/.local/share/jupyter/nbextensions/hide_input_all/hide_input_all_show.png
new file mode 100644
index 0000000000000000000000000000000000000000..8d7e03091db8cf96293b123c49955fd5bcb91e35
Binary files /dev/null and b/.local/share/jupyter/nbextensions/hide_input_all/hide_input_all_show.png differ
diff --git a/.local/share/jupyter/nbextensions/hide_input_all/icon.png b/.local/share/jupyter/nbextensions/hide_input_all/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..28a7fd2a0b942967fc5e20d1cafba092d015f88e
Binary files /dev/null and b/.local/share/jupyter/nbextensions/hide_input_all/icon.png differ
diff --git a/.local/share/jupyter/nbextensions/hide_input_all/main.js b/.local/share/jupyter/nbextensions/hide_input_all/main.js
new file mode 100644
index 0000000000000000000000000000000000000000..ff1b51ef6b4452562b0cacb49e84e8f515521832
--- /dev/null
+++ b/.local/share/jupyter/nbextensions/hide_input_all/main.js
@@ -0,0 +1,59 @@
+// toggle display of all code cells' inputs
+
+define([
+ 'jquery',
+ 'base/js/namespace',
+ 'base/js/events'
+], function(
+ $,
+ Jupyter,
+ events
+) {
+ "use strict";
+
+ function set_input_visible(show) {
+ Jupyter.notebook.metadata.hide_input = !show;
+
+ if (show) $('div.input').show('slow');
+ else $('div.input').hide('slow');
+
+ var btn = $('#toggle_codecells');
+ btn.toggleClass('active', !show);
+
+ var icon = btn.find('i');
+ icon.toggleClass('fa-eye', show);
+ icon.toggleClass('fa-eye-slash', !show);
+ $('#toggle_codecells').attr(
+ 'title', (show ? 'Hide' : 'Show') + ' codecell inputs');
+ }
+
+ function toggle() {
+ set_input_visible($('#toggle_codecells').hasClass('active'));
+ }
+
+ function initialize () {
+ set_input_visible(Jupyter.notebook.metadata.hide_input !== true);
+ }
+
+ var load_ipython_extension = function() {
+ $(Jupyter.toolbar.add_buttons_group([
+ Jupyter.keyboard_manager.actions.register({
+ help : 'Hide codecell inputs',
+ icon : 'fa-eye',
+ handler: function() {
+ toggle();
+ setTimeout(function() { $('#toggle_codecells').blur(); }, 500);
+ }
+ }, 'hide-codecell-inputs', 'hide_input_all'),
+ ])).find('.btn').attr('id', 'toggle_codecells');
+ if (Jupyter.notebook !== undefined && Jupyter.notebook._fully_loaded) {
+ // notebook_loaded.Notebook event has already happened
+ initialize();
+ }
+ events.on('notebook_loaded.Notebook', initialize);
+ };
+
+ return {
+ load_ipython_extension : load_ipython_extension
+ };
+});
diff --git a/.local/share/jupyter/nbextensions/hide_input_all/readme.md b/.local/share/jupyter/nbextensions/hide_input_all/readme.md
new file mode 100644
index 0000000000000000000000000000000000000000..bd1704b934188e0e95d1af7b91ef28ece32945d6
--- /dev/null
+++ b/.local/share/jupyter/nbextensions/hide_input_all/readme.md
@@ -0,0 +1,44 @@
+Hide all Input
+==============
+This extension allows hiding all codecells of a notebook. This can be achieved by clicking on the button toolbar:
+
+
+
+Typically, all codecells are shown with their corresponding output:
+
+
+
+Clicking on the "Toggle codecell display" toolbar button hides all codecells:
+
+
+
+
+Internals
+---------
+
+The codecell hiding state is stored in the metadata `IPython.notebook.metadata.hide_input`.
+If it is set to `true`, all codecells will be hidden on reload.
+
+The `nbextensions.tpl` template is provided in the
+`jupyter_contrib_nbextensions.nbconvert_support` templates directory (see the
+docs mentioned above for how to find it)
+
+To use, add the template to your `nbconvert` call:
+
+ jupyter nbconvert --template=nbextensions --to=html my_notebook.ipynb
+
+The nbextensions template will respect the `nb.metadata.hide_input` flag, and
+filter the cell's output prompt (the bit that looks like `Out[27]:`).
+The filter is only used for html output, not for PDF or LaTeX output.
+
+If you want to _keep_ the cell output prompt, you will have to remove the lines
+
+ {% block output_group -%}
+ {%- if cell.metadata.hide_output or nb.metadata.hide_input -%}
+ {%- else -%}
+ {{ super() }}
+ {%- endif -%}
+ {% endblock output_group %}
+
+in the `nbextensions.tpl` file.
+
\ No newline at end of file
diff --git a/.local/share/jupyter/nbextensions/highlighter/demo_highlighter.ipynb b/.local/share/jupyter/nbextensions/highlighter/demo_highlighter.ipynb
new file mode 100644
index 0000000000000000000000000000000000000000..de8810502d35fb3f24d2063cd870a612d6485e37
--- /dev/null
+++ b/.local/share/jupyter/nbextensions/highlighter/demo_highlighter.ipynb
@@ -0,0 +1,96 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "\n",
+ "## The highlighter extension:\n",
+ "\n",
+ "- Firstable, the extension provides
several toolbar buttons for highlighting a selected text _within a markdown cell_. Three different \\`color schemes' are provided, which can be easily customized in the \\textit{stylesheet} `highlighter.css`. The last button enables to remove all highlightings in the current cell. \n",
+ "- This works both
when the cell is _rendered_ and when the cell is in edit mode ; \n",
+ "- In both modes, it is possible to highlight formatted portions of text (In rendered mode, since the selected text loose its formatting, an heuristic is applied to find the best alignment with the actual text)\n",
+ "- When no text is selected, the whole cell is highlighted; \n",
+ "- The extension also provides two keyboard shortcuts (Alt-G and Alt-H) which fire the highlighting of the selected text. \n",
+ "- Highlights can be preserved when exporting to html or to LaTeX -- details are provided in [export_highlights](export_highlights.ipynb)\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "## Installation:\n",
+ "\n",
+ "The extension can be installed with the nice UI available on jupyter_contrib_nbextensions website, which also allows to enable/disable the extension. \n",
+ "\n",
+ "You may also install the extension from the original repo: issue\n",
+ "```bash\n",
+ "jupyter nbextension install https://rawgit.com/jfbercher/small_nbextensions/master/highlighter.zip --user\n",
+ "\n",
+ "```\n",
+ "at the command line.\n",
+ "\n",
+ "### Testing: \n",
+ "\n",
+ "Use a code cell with\n",
+ "```javascript\n",
+ "%%javascript\n",
+ "require(\"base/js/utils\").load_extensions(\"highlighter/highlighter\")\n",
+ "```\n",
+ "\n",
+ "### Automatic load\n",
+ "You may also automatically load the extension for any notebook via\n",
+ "```bash\n",
+ "jupyter nbextension enable highlighter/highlighter\t\n",
+ "```\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "data": {
+ "application/javascript": [
+ "require(\"base/js/utils\").load_extensions(\"highlighter/highlighter\")"
+ ],
+ "text/plain": [
+ "
"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "%%javascript\n",
+ "require(\"base/js/utils\").load_extensions(\"highlighter/highlighter\")"
+ ]
+ }
+ ],
+ "metadata": {
+ "interactive_sols": {
+ "cbx_id": 1
+ },
+ "kernelspec": {
+ "display_name": "Python 3",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.4.3+"
+ },
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/.local/share/jupyter/nbextensions/highlighter/export_highlights.pdf b/.local/share/jupyter/nbextensions/highlighter/export_highlights.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..eea7a587ebf850882667d301a6dc8744b3851f65
Binary files /dev/null and b/.local/share/jupyter/nbextensions/highlighter/export_highlights.pdf differ
diff --git a/.local/share/jupyter/nbextensions/highlighter/export_highlights.tex b/.local/share/jupyter/nbextensions/highlighter/export_highlights.tex
new file mode 100644
index 0000000000000000000000000000000000000000..d08679b353858ad05dd217f7e28ed2bdfc11cf8d
--- /dev/null
+++ b/.local/share/jupyter/nbextensions/highlighter/export_highlights.tex
@@ -0,0 +1,457 @@
+
+% Default to the notebook output style
+
+
+% Inherit from the specified cell style.
+
+
+
+
+
+
+\documentclass{article}
+
+
+
+
+ \usepackage{graphicx} % Used to insert images
+ \usepackage{adjustbox} % Used to constrain images to a maximum size
+ \usepackage{color} % Allow colors to be defined
+ \usepackage{enumerate} % Needed for markdown enumerations to work
+ \usepackage{geometry} % Used to adjust the document margins
+ \usepackage{amsmath} % Equations
+ \usepackage{amssymb} % Equations
+ \usepackage{eurosym} % defines \euro
+ \usepackage[mathletters]{ucs} % Extended unicode (utf-8) support
+ \usepackage[utf8x]{inputenc} % Allow utf-8 characters in the tex document
+ \usepackage{fancyvrb} % verbatim replacement that allows latex
+ \usepackage{grffile} % extends the file name processing of package graphics
+ % to support a larger range
+ % The hyperref package gives us a pdf with properly built
+ % internal navigation ('pdf bookmarks' for the table of contents,
+ % internal cross-reference links, web links for URLs, etc.)
+ \usepackage{hyperref}
+ \usepackage{longtable} % longtable support required by pandoc >1.10
+ \usepackage{booktabs} % table support for pandoc > 1.12.2
+
+\usepackage{color}
+\usepackage{soul}
+\usepackage[framemethod=tikz]{mdframed}
+
+
+
+
+ \definecolor{orange}{cmyk}{0,0.4,0.8,0.2}
+ \definecolor{darkorange}{rgb}{.71,0.21,0.01}
+ \definecolor{darkgreen}{rgb}{.12,.54,.11}
+ \definecolor{myteal}{rgb}{.26, .44, .56}
+ \definecolor{gray}{gray}{0.45}
+ \definecolor{lightgray}{gray}{.95}
+ \definecolor{mediumgray}{gray}{.8}
+ \definecolor{inputbackground}{rgb}{.95, .95, .85}
+ \definecolor{outputbackground}{rgb}{.95, .95, .95}
+ \definecolor{traceback}{rgb}{1, .95, .95}
+ % ansi colors
+ \definecolor{red}{rgb}{.6,0,0}
+ \definecolor{green}{rgb}{0,.65,0}
+ \definecolor{brown}{rgb}{0.6,0.6,0}
+ \definecolor{blue}{rgb}{0,.145,.698}
+ \definecolor{purple}{rgb}{.698,.145,.698}
+ \definecolor{cyan}{rgb}{0,.698,.698}
+ \definecolor{lightgray}{gray}{0.5}
+
+ % bright ansi colors
+ \definecolor{darkgray}{gray}{0.25}
+ \definecolor{lightred}{rgb}{1.0,0.39,0.28}
+ \definecolor{lightgreen}{rgb}{0.48,0.99,0.0}
+ \definecolor{lightblue}{rgb}{0.53,0.81,0.92}
+ \definecolor{lightpurple}{rgb}{0.87,0.63,0.87}
+ \definecolor{lightcyan}{rgb}{0.5,1.0,0.83}
+
+ % commands and environments needed by pandoc snippets
+ % extracted from the output of `pandoc -s`
+ \providecommand{\tightlist}{%
+ \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
+ \DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}}
+ % Add ',fontsize=\small' for more characters per line
+ \newenvironment{Shaded}{}{}
+ \newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{{#1}}}}
+ \newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.56,0.13,0.00}{{#1}}}
+ \newcommand{\DecValTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}}
+ \newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}}
+ \newcommand{\FloatTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}}
+ \newcommand{\CharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}}
+ \newcommand{\StringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}}
+ \newcommand{\CommentTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textit{{#1}}}}
+ \newcommand{\OtherTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{{#1}}}
+ \newcommand{\AlertTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}}
+ \newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.02,0.16,0.49}{{#1}}}
+ \newcommand{\RegionMarkerTok}[1]{{#1}}
+ \newcommand{\ErrorTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}}
+ \newcommand{\NormalTok}[1]{{#1}}
+
+ % Define a nice break command that doesn't care if a line doesn't already
+ % exist.
+ \def\br{\hspace*{\fill} \\* }
+ % Math Jax compatability definitions
+ \def\gt{>}
+ \def\lt{<}
+ % Document parameters
+ \title{export\_highlights}
+
+
+\author{}
+
+
+
+ % Pygments definitions
+
+\makeatletter
+\def\PY@reset{\let\PY@it=\relax \let\PY@bf=\relax%
+ \let\PY@ul=\relax \let\PY@tc=\relax%
+ \let\PY@bc=\relax \let\PY@ff=\relax}
+\def\PY@tok#1{\csname PY@tok@#1\endcsname}
+\def\PY@toks#1+{\ifx\relax#1\empty\else%
+ \PY@tok{#1}\expandafter\PY@toks\fi}
+\def\PY@do#1{\PY@bc{\PY@tc{\PY@ul{%
+ \PY@it{\PY@bf{\PY@ff{#1}}}}}}}
+\def\PY#1#2{\PY@reset\PY@toks#1+\relax+\PY@do{#2}}
+
+\expandafter\def\csname PY@tok@gp\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}}
+\expandafter\def\csname PY@tok@no\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.53,0.00,0.00}{##1}}}
+\expandafter\def\csname PY@tok@il\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
+\expandafter\def\csname PY@tok@sx\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
+\expandafter\def\csname PY@tok@kt\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.69,0.00,0.25}{##1}}}
+\expandafter\def\csname PY@tok@mo\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
+\expandafter\def\csname PY@tok@sh\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
+\expandafter\def\csname PY@tok@bp\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
+\expandafter\def\csname PY@tok@gd\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.63,0.00,0.00}{##1}}}
+\expandafter\def\csname PY@tok@sb\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
+\expandafter\def\csname PY@tok@err\endcsname{\def\PY@bc##1{\setlength{\fboxsep}{0pt}\fcolorbox[rgb]{1.00,0.00,0.00}{1,1,1}{\strut ##1}}}
+\expandafter\def\csname PY@tok@nd\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.67,0.13,1.00}{##1}}}
+\expandafter\def\csname PY@tok@gr\endcsname{\def\PY@tc##1{\textcolor[rgb]{1.00,0.00,0.00}{##1}}}
+\expandafter\def\csname PY@tok@kd\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
+\expandafter\def\csname PY@tok@s\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
+\expandafter\def\csname PY@tok@cs\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}}
+\expandafter\def\csname PY@tok@sd\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
+\expandafter\def\csname PY@tok@ss\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
+\expandafter\def\csname PY@tok@nn\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
+\expandafter\def\csname PY@tok@w\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.73,0.73}{##1}}}
+\expandafter\def\csname PY@tok@kn\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
+\expandafter\def\csname PY@tok@sc\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
+\expandafter\def\csname PY@tok@s1\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
+\expandafter\def\csname PY@tok@ge\endcsname{\let\PY@it=\textit}
+\expandafter\def\csname PY@tok@cp\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.74,0.48,0.00}{##1}}}
+\expandafter\def\csname PY@tok@gh\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}}
+\expandafter\def\csname PY@tok@gi\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.63,0.00}{##1}}}
+\expandafter\def\csname PY@tok@vc\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
+\expandafter\def\csname PY@tok@si\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.73,0.40,0.53}{##1}}}
+\expandafter\def\csname PY@tok@ow\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.67,0.13,1.00}{##1}}}
+\expandafter\def\csname PY@tok@vg\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
+\expandafter\def\csname PY@tok@sr\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.40,0.53}{##1}}}
+\expandafter\def\csname PY@tok@cm\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}}
+\expandafter\def\csname PY@tok@c\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}}
+\expandafter\def\csname PY@tok@mi\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
+\expandafter\def\csname PY@tok@kc\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
+\expandafter\def\csname PY@tok@ne\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.82,0.25,0.23}{##1}}}
+\expandafter\def\csname PY@tok@nf\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
+\expandafter\def\csname PY@tok@go\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.53,0.53,0.53}{##1}}}
+\expandafter\def\csname PY@tok@m\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
+\expandafter\def\csname PY@tok@mh\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
+\expandafter\def\csname PY@tok@nc\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
+\expandafter\def\csname PY@tok@mb\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
+\expandafter\def\csname PY@tok@se\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.73,0.40,0.13}{##1}}}
+\expandafter\def\csname PY@tok@gt\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.27,0.87}{##1}}}
+\expandafter\def\csname PY@tok@nv\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
+\expandafter\def\csname PY@tok@c1\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}}
+\expandafter\def\csname PY@tok@kp\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
+\expandafter\def\csname PY@tok@s2\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
+\expandafter\def\csname PY@tok@nb\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
+\expandafter\def\csname PY@tok@ni\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.60,0.60,0.60}{##1}}}
+\expandafter\def\csname PY@tok@k\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
+\expandafter\def\csname PY@tok@na\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.49,0.56,0.16}{##1}}}
+\expandafter\def\csname PY@tok@o\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
+\expandafter\def\csname PY@tok@mf\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
+\expandafter\def\csname PY@tok@nl\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.63,0.63,0.00}{##1}}}
+\expandafter\def\csname PY@tok@nt\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
+\expandafter\def\csname PY@tok@gs\endcsname{\let\PY@bf=\textbf}
+\expandafter\def\csname PY@tok@vi\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
+\expandafter\def\csname PY@tok@gu\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.50,0.00,0.50}{##1}}}
+\expandafter\def\csname PY@tok@kr\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
+
+\def\PYZbs{\char`\\}
+\def\PYZus{\char`\_}
+\def\PYZob{\char`\{}
+\def\PYZcb{\char`\}}
+\def\PYZca{\char`\^}
+\def\PYZam{\char`\&}
+\def\PYZlt{\char`\<}
+\def\PYZgt{\char`\>}
+\def\PYZsh{\char`\#}
+\def\PYZpc{\char`\%}
+\def\PYZdl{\char`\$}
+\def\PYZhy{\char`\-}
+\def\PYZsq{\char`\'}
+\def\PYZdq{\char`\"}
+\def\PYZti{\char`\~}
+% for compatibility with earlier versions
+\def\PYZat{@}
+\def\PYZlb{[}
+\def\PYZrb{]}
+\makeatother
+
+
+
+
+
+
+ % Prevent overflowing lines due to hard-to-break entities
+ \sloppy
+ % Setup hyperref package
+ \hypersetup{
+ breaklinks=true, % so long urls are correctly broken across lines
+ colorlinks=true,
+ urlcolor=blue,
+ linkcolor=darkorange,
+ citecolor=darkgreen,
+ }
+ % Slightly bigger margins than the latex defaults
+
+ \geometry{verbose,tmargin=1in,bmargin=1in,lmargin=1in,rmargin=1in}
+
+
+ \newcommand{\highlighta}[1]{{\sethlcolor{yellow} \textcolor{red}{\hl{#1}}}}
+ \newcommand{\highlightb}[1]{{\sethlcolor{red} \textcolor{yellow}{\hl{#1}}}}
+ \newcommand{\highlightc}[1]{{\sethlcolor{green} \textcolor{yellow}{\hl{#1}}}}
+ \newenvironment{highlightA}{\begin{mdframed}[hidealllines=true,backgroundcolor=yellow!20]}{\end{mdframed}}
+ \newenvironment{highlightB}{\begin{mdframed}[hidealllines=true,backgroundcolor=red!20]}{\end{mdframed}}
+ \newenvironment{highlightC}{\begin{mdframed}[hidealllines=true,backgroundcolor=green!20]}{\end{mdframed}}
+
+
+%\usepackage{foo}
+
+ \begin{document}
+
+
+ \maketitle
+
+
+
+
+ \section{Exporting the notebook}\label{exporting-the-notebook}
+
+As suggested by @juhasch, it is interesting to keep the highlights when
+exporting the notebook to another format. We give and explain below some
+possibilities:
+
+ \subsection{Short version}\label{short-version}
+
+\begin{itemize}
+\item
+ Html export:
+
+\begin{Shaded}
+\begin{Highlighting}[]
+ \KeywordTok{jupyter} \NormalTok{nbconvert FILE --config JUPYTER_DATA_DIR/extensions/highlight_html_cfg.py }
+\end{Highlighting}
+\end{Shaded}
+\item
+ LaTeX export:
+
+\begin{Shaded}
+\begin{Highlighting}[]
+ \KeywordTok{jupyter} \NormalTok{nbconvert FILE --config JUPYTER_DATA_DIR/extensions/highlight_latex_cfg.py }
+\end{Highlighting}
+\end{Shaded}
+
+ where JUPYTER\_DATA\_DIR can be found from the output of
+
+\begin{Shaded}
+\begin{Highlighting}[]
+ \KeywordTok{jupyter} \NormalTok{--paths}
+\end{Highlighting}
+\end{Shaded}
+
+ eg \texttt{\textasciitilde{}/.local/share/jupyter} in my case. Seems
+ to be
+ \texttt{c:\textbackslash{}users\textbackslash{}NAME\textbackslash{}AppData\textbackslash{}Roaming\textbackslash{}jupyter}
+ under Windows.
+\end{itemize}
+
+Examples can be found here: \href{tst_highlights.ipynb}{initial
+notebook}, \href{tst_highlights.html}{html version},
+\href{tst_highlights.pdf}{pdf version} (after an additional LaTeX
+\(\rightarrow\) pdf compilation).
+
+ \subsection{Html export}\label{html-export}
+
+This is quite easy. Actually, highlight formatting embedded in markdown
+cells is preserved while converting with the standard
+
+\begin{Shaded}
+\begin{Highlighting}[]
+\KeywordTok{jupyter} \NormalTok{nbconvert file.ipynb}
+\end{Highlighting}
+\end{Shaded}
+
+However, the css file is missing and must be added. Here we have several
+possibilities
+
+\begin{itemize}
+\item
+ Embed the css \emph{within} the notebook. For that, consider the last
+ cell of the present notebook. This code reads the css file
+ \texttt{highlighter.css} in the extension directory and displays the
+ corresponding style. So doing the
+ \texttt{\textless{}style\textgreater{}\ ...\textless{}/style\textgreater{}}
+ section will be present in the cell output and interpreted by the web
+ browser. Drawbacks of this solution is that user still have to execute
+ this cell and that the this is not language agnostic.
+\item
+ Use a \textbf{template file} to link or include the css file during
+ conversion. Such a file is provided as
+ \texttt{templates/highlighter.tpl}. It was choosen here to
+ \emph{include} the css content in the produced html file rather than
+ linking it. This avoids the necessity to keep the css file with the
+ html files.
+\item
+ This works directly if the css resides in the same directory as the
+ file the user is attempting to convert --thus requires the user to
+ copy \texttt{highlighter.css} in the current directory. Then the
+ conversion is simply
+
+\begin{Shaded}
+\begin{Highlighting}[]
+ \KeywordTok{jupyter} \NormalTok{nbconvert file.ipynb --template highlighter}
+\end{Highlighting}
+\end{Shaded}
+\item
+ It still remains two problems with this approach. First, it can be
+ annoying to have to systematically copy the css file in the current
+ directory. Second, the data within the html tags is not converted (and
+ thus markdown remains unmodified). A solution is to use a pair of
+ preprocessor/postprocessor that modify the html tags and enable the
+ subsequent markdown to html converter to operate on the included data.
+ Also, a config file is provided which redefines the template path to
+ enable direct inclusion of the css file in the extension directory.
+ Unfortunately, \highlighta{it seems that the \emph{full path} to
+ the config file has to be provided}. This file resides in the
+ extensions subdirectory of the jupyter\_data\_dir. The path can be
+ found by looking at the output of
+
+\begin{Shaded}
+\begin{Highlighting}[]
+ \KeywordTok{jupyter} \NormalTok{--paths}
+\end{Highlighting}
+\end{Shaded}
+
+ Then the command to issue for converting the notebook to html is
+
+\begin{Shaded}
+\begin{Highlighting}[]
+ \KeywordTok{jupyter} \NormalTok{nbconvert FILE --config JUPYTER_DATA_DIR/extensions/highlight_html_cfg.py }
+\end{Highlighting}
+\end{Shaded}
+\end{itemize}
+
+For instance
+
+\begin{Shaded}
+\begin{Highlighting}[]
+\KeywordTok{jupyter} \NormalTok{nbconvert tst_highlights.ipynb --config ~/.local/share/jupyter/extensions/highlight_html_cfg.py }
+\end{Highlighting}
+\end{Shaded}
+
+ \subsection{LaTeX export}\label{latex-export}
+
+This is a bit more complicated since the direct conversion removes all
+html formatting present in markdown cells. Thus use again a
+\textbf{preprocessor} which runs before the markdown \(\rightarrow\)
+LaTeX conversion. In turn, it appears that we also need to postprocess
+the result.
+
+Three LaTeX commands, namely \emph{highlighta, highlightb, highlightc},
+and three environments \emph{highlightA, highlightB, highlightC} are
+defined. Highlighting html markup is then transformed into the
+corresponding LaTeX commands and the text for completely highlighted
+cells is put in the adequate LaTeX environment.
+
+Pre and PostProcessor classes are defined in the file
+\texttt{pp\_highlighter.py} located in the \texttt{extensions}
+directory. A LaTeX template, that includes the necessary packages and
+the definitions of commands/environments is provides as
+\texttt{highlighter.tplx} in the template directory. The template
+inherits from \texttt{article.ltx}. For more complex scenarios,
+typically if the latex template file has be customized, the user shall
+modify its template or inherit from his base template rather than from
+article.
+
+Finally, a config file fixes the different options for the conversion.
+Then the command to issue is simply
+
+\begin{Shaded}
+\begin{Highlighting}[]
+ \KeywordTok{jupyter} \NormalTok{nbconvert FILE --config JUPYTER_DATA_DIR/extensions/highlight_latex_cfg.py }
+\end{Highlighting}
+\end{Shaded}
+
+e.g.
+
+\begin{Shaded}
+\begin{Highlighting}[]
+\KeywordTok{jupyter} \NormalTok{nbconvert tst_highlights.ipynb --config ~/.local/share/jupyter/extensions/highlight_latex_cfg.py }
+\end{Highlighting}
+\end{Shaded}
+
+ \subsection{Configuring paths}\label{configuring-paths}
+
+\highlighta{For those who do not have taken the extension from the
+\texttt{jupyter_contrib_nbextensions} repository or have not configured
+extensions via its \texttt{setup.py} utility,} a file
+\texttt{set\_paths.py} is present in the extension directory (it is
+merely a verbatim copy of the relevant parts in setup.py). This file
+configure the paths to the \texttt{templates} and \texttt{extension}
+directories. It should be executed by something like
+
+\begin{Shaded}
+\begin{Highlighting}[]
+\KeywordTok{python3} \NormalTok{set_paths.py}
+\end{Highlighting}
+\end{Shaded}
+
+Additionaly, you may also have to execute \texttt{mv\_paths.py} if you
+installed from the original repo via
+\texttt{jupyter\ nbextension\ install\ ..}
+
+\begin{Shaded}
+\begin{Highlighting}[]
+\KeywordTok{python3} \NormalTok{mv_paths.py}
+\end{Highlighting}
+\end{Shaded}
+
+ \subsection{Example for embedding the css within the notebook before
+conversion}\label{example-for-embedding-the-css-within-the-notebook-before-conversion}
+
+ \begin{Verbatim}[commandchars=\\\{\}]
+>>> \PY{k+kn}{from} \PY{n+nn}{IPython}\PY{n+nn}{.}\PY{n+nn}{core}\PY{n+nn}{.}\PY{n+nn}{display} \PY{k}{import} \PY{n}{display}\PY{p}{,} \PY{n}{HTML}
+... \PY{k+kn}{from} \PY{n+nn}{jupyter\PYZus{}core}\PY{n+nn}{.}\PY{n+nn}{paths} \PY{k}{import} \PY{n}{jupyter\PYZus{}config\PYZus{}dir}\PY{p}{,} \PY{n}{jupyter\PYZus{}data\PYZus{}dir}
+... \PY{k+kn}{import} \PY{n+nn}{os}
+... \PY{n}{csspath}\PY{o}{=}\PY{n}{os}\PY{o}{.}\PY{n}{path}\PY{o}{.}\PY{n}{join}\PY{p}{(}\PY{n}{jupyter\PYZus{}data\PYZus{}dir}\PY{p}{(}\PY{p}{)}\PY{p}{,}\PY{l+s}{\PYZsq{}}\PY{l+s}{nbextensions}\PY{l+s}{\PYZsq{}}\PY{p}{,}
+... \PY{l+s}{\PYZsq{}}\PY{l+s}{highlighter}\PY{l+s}{\PYZsq{}}\PY{p}{,}\PY{l+s}{\PYZsq{}}\PY{l+s}{highlighter.css}\PY{l+s}{\PYZsq{}}\PY{p}{)}
+... \PY{n}{HTML}\PY{p}{(}\PY{l+s}{\PYZsq{}}\PY{l+s}{\PYZlt{}style\PYZgt{}}\PY{l+s}{\PYZsq{}}\PY{o}{+}\PY{n+nb}{open}\PY{p}{(}\PY{n}{csspath}\PY{p}{,} \PY{l+s}{\PYZdq{}}\PY{l+s}{r}\PY{l+s}{\PYZdq{}}\PY{p}{)}\PY{o}{.}\PY{n}{read}\PY{p}{(}\PY{p}{)}\PY{o}{+}\PY{l+s}{\PYZsq{}}\PY{l+s}{\PYZlt{}/style\PYZgt{}}\PY{l+s}{\PYZsq{}}\PY{p}{)}
+ \end{Verbatim}
+
+
+
+ \begin{verbatim}
+
+ \end{verbatim}
+
+
+
+
+ % Add a bibliography block to the postdoc
+
+
+
+ \end{document}
diff --git a/.local/share/jupyter/nbextensions/highlighter/highlighter.css b/.local/share/jupyter/nbextensions/highlighter/highlighter.css
new file mode 100644
index 0000000000000000000000000000000000000000..089d21a267d503ad2c5874160f0336b792097bdb
--- /dev/null
+++ b/.local/share/jupyter/nbextensions/highlighter/highlighter.css
@@ -0,0 +1,98 @@
+.mark {
+ background-color: #f2ee97;
+ color: black;
+ display: inline;
+}
+
+.burk {
+ background-color: #ff9292;
+ color: #f9f9f9;
+ display: inline;
+}
+
+.girk {
+ background-color: #afe5ad;
+ color: black;
+ display: inline;
+}
+
+.birk {
+ background-color: #83b8f4;
+ color: #fff;
+ display: inline;
+}
+
+.pirk {
+ background-color: #ecb3d2;
+ color: #000;
+ display: inline;
+}
+
+/**/
+
+button.mark {
+ background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='iso-8859-1'%3F%3E%3C!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 297 297' style='enable-background:new 0 0 297 297;' xml:space='preserve'%3E%3Cg%3E%3Cg id='XMLID_48_'%3E%3Cg%3E%3Cpath style='fill:%23fff;' d='M63.648,169.162l71.18,71.19l-61.09,12.21c-0.93,0.19-1.78,0.65-2.45,1.32l-9.74,9.74 l-21.17-21.18l9.74-9.73c0.66-0.67,1.12-1.53,1.31-2.45L63.648,169.162z'/%3E%3Cpath style='fill:%23000;' d='M230.278,81.592c2.81,2.81,2.81,7.38,0,10.19l-73.19,73.2c-2.81,2.81-7.38,2.81-10.19,0 l-7.62-7.62c-2.81-2.81-2.81-7.38,0-10.19l73.19-73.2c1.36-1.36,3.17-2.11,5.1-2.11c1.92,0,3.73,0.75,5.09,2.11L230.278,81.592z' /%3E%3Cpolygon style='fill:%23f2ee97;' points='53.918,271.242 45.428,279.732 13.668,269.152 32.748,250.072 '/%3E%3Cpath style='fill:%23f2ee97;' d='M283.918,54.022c4.41,4.41,4.71,11.58,0.68,16.34l-140.34,165.86l-76.48-76.49l165.85-140.34 c4.76-4.02,11.94-3.73,16.34,0.68L283.918,54.022z M241.968,86.682c0-4.3-1.64-8.6-4.91-11.87l-7.61-7.62 c-3.18-3.17-7.39-4.92-11.88-4.92s-8.71,1.75-11.88,4.92l-73.19,73.2c-3.17,3.17-4.92,7.39-4.92,11.87 c0,4.49,1.75,8.71,4.92,11.88l7.62,7.62c3.27,3.27,7.57,4.91,11.87,4.91c4.3,0,8.61-1.64,11.88-4.91l73.19-73.2 C240.328,95.282,241.968,90.982,241.968,86.682z'/%3E%3Cpath d='M290.698,47.242c7.91,7.9,8.44,20.78,1.22,29.31c0,0-143.78,169.92-143.83,169.95c-0.66,0.74-1.55,1.28-2.59,1.49 l-68.46,13.69l-26.92,26.93c-0.92,0.91-2.14,1.4-3.4,1.4c-0.5,0-1.01-0.08-1.51-0.24l-41.93-13.98 c-1.58-0.53-2.77-1.83-3.15-3.45c-0.38-1.61,0.1-3.31,1.28-4.49l40.9-40.9l13.69-68.45c0.22-1.09,0.79-1.99,1.57-2.67 c0.01-0.01,169.87-143.76,169.87-143.76c8.53-7.22,21.41-6.69,29.31,1.22L290.698,47.242z M284.598,70.362 c4.03-4.76,3.73-11.93-0.68-16.34l-33.95-33.95c-4.4-4.41-11.58-4.7-16.34-0.68l-165.85,140.34l76.48,76.49L284.598,70.362z M134.828,240.352l-71.18-71.19l-12.22,61.1c-0.19,0.92-0.65,1.78-1.31,2.45l-9.74,9.73l21.17,21.18l9.74-9.74 c0.67-0.67,1.52-1.13,2.45-1.32L134.828,240.352z M45.428,279.732l8.49-8.49l-21.17-21.17l-19.08,19.08L45.428,279.732z'/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3C/svg%3E%0A");
+ background-repeat: no-repeat;
+}
+
+button.highlighter-btn {
+ height: 24px;
+ width: 29px;
+ background-size: 21px;
+ background-position: center;
+ border: none;
+}
+
+button.burk {
+ background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='iso-8859-1'%3F%3E%3C!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 297 297' style='enable-background:new 0 0 297 297;' xml:space='preserve'%3E%3Cg%3E%3Cg id='XMLID_48_'%3E%3Cg%3E%3Cpath style='fill:%23fff;' d='M63.648,169.162l71.18,71.19l-61.09,12.21c-0.93,0.19-1.78,0.65-2.45,1.32l-9.74,9.74 l-21.17-21.18l9.74-9.73c0.66-0.67,1.12-1.53,1.31-2.45L63.648,169.162z'/%3E%3Cpath style='fill:%23000;' d='M230.278,81.592c2.81,2.81,2.81,7.38,0,10.19l-73.19,73.2c-2.81,2.81-7.38,2.81-10.19,0 l-7.62-7.62c-2.81-2.81-2.81-7.38,0-10.19l73.19-73.2c1.36-1.36,3.17-2.11,5.1-2.11c1.92,0,3.73,0.75,5.09,2.11L230.278,81.592z' /%3E%3Cpolygon style='fill:%23ff9292;' points='53.918,271.242 45.428,279.732 13.668,269.152 32.748,250.072 '/%3E%3Cpath style='fill:%23ff9292;' d='M283.918,54.022c4.41,4.41,4.71,11.58,0.68,16.34l-140.34,165.86l-76.48-76.49l165.85-140.34 c4.76-4.02,11.94-3.73,16.34,0.68L283.918,54.022z M241.968,86.682c0-4.3-1.64-8.6-4.91-11.87l-7.61-7.62 c-3.18-3.17-7.39-4.92-11.88-4.92s-8.71,1.75-11.88,4.92l-73.19,73.2c-3.17,3.17-4.92,7.39-4.92,11.87 c0,4.49,1.75,8.71,4.92,11.88l7.62,7.62c3.27,3.27,7.57,4.91,11.87,4.91c4.3,0,8.61-1.64,11.88-4.91l73.19-73.2 C240.328,95.282,241.968,90.982,241.968,86.682z'/%3E%3Cpath d='M290.698,47.242c7.91,7.9,8.44,20.78,1.22,29.31c0,0-143.78,169.92-143.83,169.95c-0.66,0.74-1.55,1.28-2.59,1.49 l-68.46,13.69l-26.92,26.93c-0.92,0.91-2.14,1.4-3.4,1.4c-0.5,0-1.01-0.08-1.51-0.24l-41.93-13.98 c-1.58-0.53-2.77-1.83-3.15-3.45c-0.38-1.61,0.1-3.31,1.28-4.49l40.9-40.9l13.69-68.45c0.22-1.09,0.79-1.99,1.57-2.67 c0.01-0.01,169.87-143.76,169.87-143.76c8.53-7.22,21.41-6.69,29.31,1.22L290.698,47.242z M284.598,70.362 c4.03-4.76,3.73-11.93-0.68-16.34l-33.95-33.95c-4.4-4.41-11.58-4.7-16.34-0.68l-165.85,140.34l76.48,76.49L284.598,70.362z M134.828,240.352l-71.18-71.19l-12.22,61.1c-0.19,0.92-0.65,1.78-1.31,2.45l-9.74,9.73l21.17,21.18l9.74-9.74 c0.67-0.67,1.52-1.13,2.45-1.32L134.828,240.352z M45.428,279.732l8.49-8.49l-21.17-21.17l-19.08,19.08L45.428,279.732z'/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3C/svg%3E%0A");
+ background-repeat: no-repeat;
+}
+
+button.girk {
+ background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='iso-8859-1'%3F%3E%3C!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 297 297' style='enable-background:new 0 0 297 297;' xml:space='preserve'%3E%3Cg%3E%3Cg id='XMLID_48_'%3E%3Cg%3E%3Cpath style='fill:%23fff;' d='M63.648,169.162l71.18,71.19l-61.09,12.21c-0.93,0.19-1.78,0.65-2.45,1.32l-9.74,9.74 l-21.17-21.18l9.74-9.73c0.66-0.67,1.12-1.53,1.31-2.45L63.648,169.162z'/%3E%3Cpath style='fill:%23000;' d='M230.278,81.592c2.81,2.81,2.81,7.38,0,10.19l-73.19,73.2c-2.81,2.81-7.38,2.81-10.19,0 l-7.62-7.62c-2.81-2.81-2.81-7.38,0-10.19l73.19-73.2c1.36-1.36,3.17-2.11,5.1-2.11c1.92,0,3.73,0.75,5.09,2.11L230.278,81.592z' /%3E%3Cpolygon style='fill:%23afe5ad;' points='53.918,271.242 45.428,279.732 13.668,269.152 32.748,250.072 '/%3E%3Cpath style='fill:%23afe5ad;' d='M283.918,54.022c4.41,4.41,4.71,11.58,0.68,16.34l-140.34,165.86l-76.48-76.49l165.85-140.34 c4.76-4.02,11.94-3.73,16.34,0.68L283.918,54.022z M241.968,86.682c0-4.3-1.64-8.6-4.91-11.87l-7.61-7.62 c-3.18-3.17-7.39-4.92-11.88-4.92s-8.71,1.75-11.88,4.92l-73.19,73.2c-3.17,3.17-4.92,7.39-4.92,11.87 c0,4.49,1.75,8.71,4.92,11.88l7.62,7.62c3.27,3.27,7.57,4.91,11.87,4.91c4.3,0,8.61-1.64,11.88-4.91l73.19-73.2 C240.328,95.282,241.968,90.982,241.968,86.682z'/%3E%3Cpath d='M290.698,47.242c7.91,7.9,8.44,20.78,1.22,29.31c0,0-143.78,169.92-143.83,169.95c-0.66,0.74-1.55,1.28-2.59,1.49 l-68.46,13.69l-26.92,26.93c-0.92,0.91-2.14,1.4-3.4,1.4c-0.5,0-1.01-0.08-1.51-0.24l-41.93-13.98 c-1.58-0.53-2.77-1.83-3.15-3.45c-0.38-1.61,0.1-3.31,1.28-4.49l40.9-40.9l13.69-68.45c0.22-1.09,0.79-1.99,1.57-2.67 c0.01-0.01,169.87-143.76,169.87-143.76c8.53-7.22,21.41-6.69,29.31,1.22L290.698,47.242z M284.598,70.362 c4.03-4.76,3.73-11.93-0.68-16.34l-33.95-33.95c-4.4-4.41-11.58-4.7-16.34-0.68l-165.85,140.34l76.48,76.49L284.598,70.362z M134.828,240.352l-71.18-71.19l-12.22,61.1c-0.19,0.92-0.65,1.78-1.31,2.45l-9.74,9.73l21.17,21.18l9.74-9.74 c0.67-0.67,1.52-1.13,2.45-1.32L134.828,240.352z M45.428,279.732l8.49-8.49l-21.17-21.17l-19.08,19.08L45.428,279.732z'/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3C/svg%3E%0A");
+ background-repeat: no-repeat;
+}
+
+button.birk {
+ background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='iso-8859-1'%3F%3E%3C!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 297 297' style='enable-background:new 0 0 297 297;' xml:space='preserve'%3E%3Cg%3E%3Cg id='XMLID_48_'%3E%3Cg%3E%3Cpath style='fill:%23fff;' d='M63.648,169.162l71.18,71.19l-61.09,12.21c-0.93,0.19-1.78,0.65-2.45,1.32l-9.74,9.74 l-21.17-21.18l9.74-9.73c0.66-0.67,1.12-1.53,1.31-2.45L63.648,169.162z'/%3E%3Cpath style='fill:%23000;' d='M230.278,81.592c2.81,2.81,2.81,7.38,0,10.19l-73.19,73.2c-2.81,2.81-7.38,2.81-10.19,0 l-7.62-7.62c-2.81-2.81-2.81-7.38,0-10.19l73.19-73.2c1.36-1.36,3.17-2.11,5.1-2.11c1.92,0,3.73,0.75,5.09,2.11L230.278,81.592z' /%3E%3Cpolygon style='fill:%2383b8f4;' points='53.918,271.242 45.428,279.732 13.668,269.152 32.748,250.072 '/%3E%3Cpath style='fill:%2383b8f4;' d='M283.918,54.022c4.41,4.41,4.71,11.58,0.68,16.34l-140.34,165.86l-76.48-76.49l165.85-140.34 c4.76-4.02,11.94-3.73,16.34,0.68L283.918,54.022z M241.968,86.682c0-4.3-1.64-8.6-4.91-11.87l-7.61-7.62 c-3.18-3.17-7.39-4.92-11.88-4.92s-8.71,1.75-11.88,4.92l-73.19,73.2c-3.17,3.17-4.92,7.39-4.92,11.87 c0,4.49,1.75,8.71,4.92,11.88l7.62,7.62c3.27,3.27,7.57,4.91,11.87,4.91c4.3,0,8.61-1.64,11.88-4.91l73.19-73.2 C240.328,95.282,241.968,90.982,241.968,86.682z'/%3E%3Cpath d='M290.698,47.242c7.91,7.9,8.44,20.78,1.22,29.31c0,0-143.78,169.92-143.83,169.95c-0.66,0.74-1.55,1.28-2.59,1.49 l-68.46,13.69l-26.92,26.93c-0.92,0.91-2.14,1.4-3.4,1.4c-0.5,0-1.01-0.08-1.51-0.24l-41.93-13.98 c-1.58-0.53-2.77-1.83-3.15-3.45c-0.38-1.61,0.1-3.31,1.28-4.49l40.9-40.9l13.69-68.45c0.22-1.09,0.79-1.99,1.57-2.67 c0.01-0.01,169.87-143.76,169.87-143.76c8.53-7.22,21.41-6.69,29.31,1.22L290.698,47.242z M284.598,70.362 c4.03-4.76,3.73-11.93-0.68-16.34l-33.95-33.95c-4.4-4.41-11.58-4.7-16.34-0.68l-165.85,140.34l76.48,76.49L284.598,70.362z M134.828,240.352l-71.18-71.19l-12.22,61.1c-0.19,0.92-0.65,1.78-1.31,2.45l-9.74,9.73l21.17,21.18l9.74-9.74 c0.67-0.67,1.52-1.13,2.45-1.32L134.828,240.352z M45.428,279.732l8.49-8.49l-21.17-21.17l-19.08,19.08L45.428,279.732z'/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3C/svg%3E%0A");
+ background-repeat: no-repeat;
+}
+
+button.pirk {
+ background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='iso-8859-1'%3F%3E%3C!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 297 297' style='enable-background:new 0 0 297 297;' xml:space='preserve'%3E%3Cg%3E%3Cg id='XMLID_48_'%3E%3Cg%3E%3Cpath style='fill:%23fff;' d='M63.648,169.162l71.18,71.19l-61.09,12.21c-0.93,0.19-1.78,0.65-2.45,1.32l-9.74,9.74 l-21.17-21.18l9.74-9.73c0.66-0.67,1.12-1.53,1.31-2.45L63.648,169.162z'/%3E%3Cpath style='fill:%23000;' d='M230.278,81.592c2.81,2.81,2.81,7.38,0,10.19l-73.19,73.2c-2.81,2.81-7.38,2.81-10.19,0 l-7.62-7.62c-2.81-2.81-2.81-7.38,0-10.19l73.19-73.2c1.36-1.36,3.17-2.11,5.1-2.11c1.92,0,3.73,0.75,5.09,2.11L230.278,81.592z' /%3E%3Cpolygon style='fill:%23ecb3d2;' points='53.918,271.242 45.428,279.732 13.668,269.152 32.748,250.072 '/%3E%3Cpath style='fill:%23ecb3d2;' d='M283.918,54.022c4.41,4.41,4.71,11.58,0.68,16.34l-140.34,165.86l-76.48-76.49l165.85-140.34 c4.76-4.02,11.94-3.73,16.34,0.68L283.918,54.022z M241.968,86.682c0-4.3-1.64-8.6-4.91-11.87l-7.61-7.62 c-3.18-3.17-7.39-4.92-11.88-4.92s-8.71,1.75-11.88,4.92l-73.19,73.2c-3.17,3.17-4.92,7.39-4.92,11.87 c0,4.49,1.75,8.71,4.92,11.88l7.62,7.62c3.27,3.27,7.57,4.91,11.87,4.91c4.3,0,8.61-1.64,11.88-4.91l73.19-73.2 C240.328,95.282,241.968,90.982,241.968,86.682z'/%3E%3Cpath d='M290.698,47.242c7.91,7.9,8.44,20.78,1.22,29.31c0,0-143.78,169.92-143.83,169.95c-0.66,0.74-1.55,1.28-2.59,1.49 l-68.46,13.69l-26.92,26.93c-0.92,0.91-2.14,1.4-3.4,1.4c-0.5,0-1.01-0.08-1.51-0.24l-41.93-13.98 c-1.58-0.53-2.77-1.83-3.15-3.45c-0.38-1.61,0.1-3.31,1.28-4.49l40.9-40.9l13.69-68.45c0.22-1.09,0.79-1.99,1.57-2.67 c0.01-0.01,169.87-143.76,169.87-143.76c8.53-7.22,21.41-6.69,29.31,1.22L290.698,47.242z M284.598,70.362 c4.03-4.76,3.73-11.93-0.68-16.34l-33.95-33.95c-4.4-4.41-11.58-4.7-16.34-0.68l-165.85,140.34l76.48,76.49L284.598,70.362z M134.828,240.352l-71.18-71.19l-12.22,61.1c-0.19,0.92-0.65,1.78-1.31,2.45l-9.74,9.73l21.17,21.18l9.74-9.74 c0.67-0.67,1.52-1.13,2.45-1.32L134.828,240.352z M45.428,279.732l8.49-8.49l-21.17-21.17l-19.08,19.08L45.428,279.732z'/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3C/svg%3E%0A");
+ background-repeat: no-repeat;
+}
+
+i#menu-hgl, i.highlighter-close {
+ padding-left: 20px;
+}
+
+#higlighter_menu.btn:focus, #higlighter_menu.btn:active:focus, #higlighter_menu.btn.active:focus, #higlighter_menu.btn.focus, #higlighter_menu.btn:active.focus, #higlighter_menu.btn.active.focus :focus {
+ outline: 0 !important;
+}
+
+#higlighter_menu {
+ background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='iso-8859-1'%3F%3E%3C!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' id='Capa_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 512.001 512.001' style='enable-background:new 0 0 512.001 512.001;' xml:space='preserve'%3E%3Cpolygon style='fill:%23FFABCD;' points='387.375,480.658 383.919,157.034 503.991,157.034 500.535,480.658 '/%3E%3Cpolygon style='fill:%23FF6BA6;' points='382.637,161.05 419.416,90.494 468.484,90.494 505.272,161.05 '/%3E%3Cpolygon style='fill:%23FFABCD;' points='418.626,94.51 418.626,43.148 469.274,30.795 469.274,94.51 '/%3E%3Cg%3E%3Cpolygon style='fill:%23FBDF97;' points='230.672,94.51 230.672,43.148 281.33,30.795 281.33,94.51 '/%3E%3Cpolygon style='fill:%23FBDF97;' points='199.422,480.658 195.965,157.034 316.036,157.034 312.58,480.658 '/%3E%3C/g%3E%3Cpolygon style='fill:%23FBC640;' points='194.683,161.05 231.462,90.494 280.539,90.494 317.318,161.05 '/%3E%3Cg%3E%3Cpolygon style='fill:%2344C973;' points='11.466,480.658 8.011,157.034 128.083,157.034 124.626,480.658 '/%3E%3Cpolygon style='fill:%2344C973;' points='42.728,94.51 42.728,43.148 93.375,30.795 93.375,94.51 '/%3E%3C/g%3E%3Cpolygon style='fill:%23248A48;' points='6.729,161.05 43.518,90.494 92.585,90.494 129.364,161.05 '/%3E%3Cpath d='M443.734,375.969c-12.919,0-12.941,20.078,0,20.078C456.653,396.048,456.675,375.969,443.734,375.969z'/%3E%3Cpath d='M13.453,488.689H122.64c5.502,0,9.98-4.43,10.039-9.932l3.413-319.608c0.004-0.354-0.012-0.705-0.044-1.05 c-0.001-0.014-0.004-0.027-0.006-0.041c-0.037-0.382-0.1-0.758-0.18-1.127c-0.02-0.093-0.045-0.185-0.068-0.277 c-0.074-0.305-0.163-0.604-0.264-0.898c-0.031-0.09-0.061-0.181-0.095-0.27c-0.138-0.361-0.289-0.715-0.466-1.055 c-0.005-0.01-0.008-0.02-0.013-0.029l-0.008-0.015c-0.01-0.02-0.021-0.04-0.031-0.06l-33.51-64.284V33.351 c0-3.081-1.416-5.992-3.838-7.895c-2.423-1.903-5.584-2.588-8.58-1.858L42.357,34.972c-4.497,1.097-7.66,5.125-7.66,9.753v45.316 L1.176,154.325c-0.011,0.02-0.021,0.04-0.031,0.06l-0.008,0.015c-0.005,0.009-0.008,0.019-0.012,0.028 c-0.177,0.34-0.328,0.694-0.466,1.055c-0.034,0.09-0.064,0.181-0.096,0.272c-0.101,0.293-0.19,0.592-0.264,0.898 c-0.023,0.092-0.048,0.184-0.068,0.277c-0.079,0.369-0.143,0.744-0.18,1.126c-0.001,0.014-0.005,0.028-0.006,0.042 c-0.032,0.345-0.048,0.697-0.044,1.051l3.413,319.608C3.473,484.259,7.951,488.689,13.453,488.689z M23.386,468.611l-3.198-299.53 h95.719l-3.198,299.53H23.386z M54.775,52.61l26.554-6.476v36.329H54.775V52.61z M50.823,102.541h34.456l24.22,46.461H26.596 L50.823,102.541z'/%3E%3Cpath d='M68.046,215.121c-5.545,0-10.039,4.495-10.039,10.039v160.366c0,5.545,4.495,10.039,10.039,10.039 s10.039-4.495,10.039-10.039V225.16C78.086,219.615,73.591,215.121,68.046,215.121z'/%3E%3Cpath d='M188.518,155.756c-0.102,0.293-0.19,0.592-0.264,0.898c-0.023,0.092-0.048,0.184-0.068,0.277 c-0.079,0.369-0.143,0.744-0.18,1.127c-0.001,0.014-0.005,0.027-0.006,0.041c-0.032,0.345-0.048,0.696-0.044,1.05l3.413,319.608 c0.059,5.501,4.537,9.932,10.039,9.932h109.187c5.502,0,9.98-4.43,10.039-9.932l3.413-319.608c0.004-0.354-0.012-0.705-0.044-1.05 c-0.001-0.014-0.004-0.027-0.006-0.041c-0.037-0.382-0.1-0.758-0.18-1.127c-0.02-0.093-0.045-0.185-0.068-0.277 c-0.074-0.305-0.163-0.604-0.264-0.898c-0.031-0.09-0.061-0.181-0.095-0.27c-0.138-0.361-0.289-0.715-0.466-1.055 c-0.005-0.01-0.008-0.02-0.013-0.029l-0.008-0.015c-0.01-0.02-0.021-0.04-0.031-0.06l-33.511-64.284V33.351 c0-3.081-1.415-5.991-3.838-7.895c-2.422-1.903-5.585-2.588-8.579-1.858l-46.642,11.374c-4.497,1.096-7.661,5.125-7.661,9.753 v45.317l-33.509,64.283c-0.011,0.02-0.021,0.04-0.031,0.06l-0.008,0.015c-0.005,0.009-0.008,0.02-0.013,0.029 c-0.177,0.34-0.328,0.694-0.466,1.055C188.579,155.575,188.549,155.665,188.518,155.756z M211.34,468.611l-3.198-299.53h95.719 l-3.199,299.53H211.34z M242.719,52.61l26.564-6.478v36.331h-26.564L242.719,52.61L242.719,52.61z M238.768,102.541h34.466 l24.22,46.461H214.55L238.768,102.541z'/%3E%3Cpath d='M256.001,215.121c-5.545,0-10.039,4.495-10.039,10.039v160.366c0,5.545,4.495,10.039,10.039,10.039 c5.545,0,10.039-4.495,10.039-10.039V225.16C266.04,219.615,261.545,215.121,256.001,215.121z'/%3E%3Cpath d='M508.587,478.758l3.413-319.608c0.004-0.355-0.012-0.706-0.044-1.051c-0.001-0.014-0.005-0.028-0.006-0.042 c-0.037-0.382-0.1-0.758-0.18-1.126c-0.02-0.092-0.045-0.185-0.068-0.277c-0.074-0.305-0.163-0.604-0.264-0.898 c-0.031-0.091-0.062-0.182-0.096-0.272c-0.138-0.361-0.289-0.715-0.466-1.055c-0.005-0.009-0.008-0.019-0.012-0.028l-0.008-0.015 c-0.01-0.02-0.02-0.04-0.031-0.06l-33.52-64.283v-56.69c0-3.081-1.416-5.992-3.838-7.895c-2.423-1.903-5.585-2.588-8.579-1.858 l-46.632,11.374c-4.497,1.097-7.66,5.125-7.66,9.753v45.317l-33.51,64.283c-0.011,0.02-0.021,0.04-0.031,0.06l-0.008,0.015 c-0.005,0.009-0.008,0.02-0.013,0.029c-0.177,0.34-0.328,0.694-0.466,1.055c-0.034,0.089-0.064,0.18-0.095,0.27 c-0.102,0.293-0.19,0.592-0.264,0.898c-0.023,0.092-0.048,0.184-0.068,0.277c-0.079,0.369-0.143,0.744-0.18,1.127 c-0.001,0.014-0.005,0.027-0.006,0.041c-0.032,0.345-0.048,0.696-0.044,1.05l3.413,319.608c0.059,5.501,4.537,9.932,10.039,9.932 h109.186C504.051,488.689,508.528,484.259,508.587,478.758z M430.673,52.61l26.554-6.476v36.329h-26.554V52.61z M426.723,102.541 h34.456l24.227,46.461h-82.902L426.723,102.541z M399.293,468.611l-3.198-299.53h95.719l-3.199,299.53H399.293z'/%3E%3Cpath d='M443.955,215.121c-5.545,0-10.039,4.495-10.039,10.039v128.221c0,5.545,4.495,10.039,10.039,10.039 s10.039-4.495,10.039-10.039V225.16C453.994,219.615,449.5,215.121,443.955,215.121z'/%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3C/svg%3E%0A");
+ background-repeat: no-repeat;
+ background-position-x: 6px;
+ padding-right: 2px !important;
+ background-size: 18px;
+ background-position-y: center;
+}
+
+.toolbar .btn-group {
+ margin-top: 3px !important;
+}
+
+div#hgl {
+ padding-top: 2px;
+}
+
+#remove_highlights {
+ background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='iso-8859-1'%3F%3E%3C!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 297 297' style='enable-background:new 0 0 297 297;' xml:space='preserve'%3E%3Cg%3E%3Cg id='XMLID_48_'%3E%3Cg%3E%3Cpath style='fill:%23fff;' d='M63.648,169.162l71.18,71.19l-61.09,12.21c-0.93,0.19-1.78,0.65-2.45,1.32l-9.74,9.74 l-21.17-21.18l9.74-9.73c0.66-0.67,1.12-1.53,1.31-2.45L63.648,169.162z'/%3E%3Cpath style='fill:%23000;' d='M230.278,81.592c2.81,2.81,2.81,7.38,0,10.19l-73.19,73.2c-2.81,2.81-7.38,2.81-10.19,0 l-7.62-7.62c-2.81-2.81-2.81-7.38,0-10.19l73.19-73.2c1.36-1.36,3.17-2.11,5.1-2.11c1.92,0,3.73,0.75,5.09,2.11L230.278,81.592z' /%3E%3Cpolygon style='fill:%23fff;' points='53.918,271.242 45.428,279.732 13.668,269.152 32.748,250.072 '/%3E%3Cpath style='fill:%23fff;' d='M283.918,54.022c4.41,4.41,4.71,11.58,0.68,16.34l-140.34,165.86l-76.48-76.49l165.85-140.34 c4.76-4.02,11.94-3.73,16.34,0.68L283.918,54.022z M241.968,86.682c0-4.3-1.64-8.6-4.91-11.87l-7.61-7.62 c-3.18-3.17-7.39-4.92-11.88-4.92s-8.71,1.75-11.88,4.92l-73.19,73.2c-3.17,3.17-4.92,7.39-4.92,11.87 c0,4.49,1.75,8.71,4.92,11.88l7.62,7.62c3.27,3.27,7.57,4.91,11.87,4.91c4.3,0,8.61-1.64,11.88-4.91l73.19-73.2 C240.328,95.282,241.968,90.982,241.968,86.682z'/%3E%3Cpath d='M290.698,47.242c7.91,7.9,8.44,20.78,1.22,29.31c0,0-143.78,169.92-143.83,169.95c-0.66,0.74-1.55,1.28-2.59,1.49 l-68.46,13.69l-26.92,26.93c-0.92,0.91-2.14,1.4-3.4,1.4c-0.5,0-1.01-0.08-1.51-0.24l-41.93-13.98 c-1.58-0.53-2.77-1.83-3.15-3.45c-0.38-1.61,0.1-3.31,1.28-4.49l40.9-40.9l13.69-68.45c0.22-1.09,0.79-1.99,1.57-2.67 c0.01-0.01,169.87-143.76,169.87-143.76c8.53-7.22,21.41-6.69,29.31,1.22L290.698,47.242z M284.598,70.362 c4.03-4.76,3.73-11.93-0.68-16.34l-33.95-33.95c-4.4-4.41-11.58-4.7-16.34-0.68l-165.85,140.34l76.48,76.49L284.598,70.362z M134.828,240.352l-71.18-71.19l-12.22,61.1c-0.19,0.92-0.65,1.78-1.31,2.45l-9.74,9.73l21.17,21.18l9.74-9.74 c0.67-0.67,1.52-1.13,2.45-1.32L134.828,240.352z M45.428,279.732l8.49-8.49l-21.17-21.17l-19.08,19.08L45.428,279.732z'/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3C/svg%3E%0A");
+ background-repeat: no-repeat;
+ background-position-x: 6px;
+ padding-right: 2px !important;
+ background-size: 18px;
+ background-position-y: center;
+}
\ No newline at end of file
diff --git a/.local/share/jupyter/nbextensions/highlighter/highlighter.js b/.local/share/jupyter/nbextensions/highlighter/highlighter.js
new file mode 100644
index 0000000000000000000000000000000000000000..c978275d007c01a5af3ebece563c1e0dc4139187
--- /dev/null
+++ b/.local/share/jupyter/nbextensions/highlighter/highlighter.js
@@ -0,0 +1,378 @@
+/*
+Three different highlighting schemes "mark"|"burk"|"girk"|"birk"|"pirk" are defined in the css highlighter.css
+The following functions highlight the selected text, according to the scheme chosen by a menu button. More precisely, they replace selected text, both in edit or command mode, by
+a span tag with a given class and the selected text as data.
+if no text is selected, then the whole cell is highlighted (using a div tag and a class corresponding to the chosen scheme). A function to remove all hihlightings is also provided.
+*/
+
+function removeFullCellHighlight(cell_text) {
+ cell_text = cell_text.replace(/\n([\s\S]*?)<\/div>
<\/i>/g, function (w, g) {
+ return g
+ })
+ return cell_text
+}
+
+function fullCellHighlight(cell_text, scheme) {
+ cell_text = removeFullCellHighlight(cell_text);
+ return ' \n' + cell_text + '
<\/i>'
+}
+
+function highlight(text, scheme) {
+ var scheme = scheme;
+ // replace by a span, wile preserving leading and trailing spaces
+ var rep = text.replace(/(\S[\S\s]*\S)/, function (w, internal_text) {
+ return '' + internal_text + ' '
+ })
+ return rep
+ //return ''+text+' '
+}
+
+
+function add_div(text) {
+ if (text.match(/^([\S\s]*)<\/div>$/) == null) {
+ return '
' + text + '
'
+ } else {
+ return text
+ }
+}
+
+function rem_div(text) {
+ return text.replace(/^
([\S\s]*)<\/div>$/, function (w, g) {
+ return g
+ })
+}
+
+function highlightInCmdMode(event, scheme) {
+ var cell = IPython.notebook.get_selected_cell()
+ var cm = IPython.notebook.get_selected_cell().code_mirror
+ var selectedText = window.getSelection().toString();
+ var cell_text = cell.get_text();
+ if (selectedText.length == 0) {
+ cell_text = fullCellHighlight(cell_text, scheme);
+ } else {
+ var identifiedText = align(selectedText, cell_text);
+ cell_text = cell_text.replace(identifiedText, highlight(identifiedText, scheme));
+ }
+ cell.set_text(cell_text);
+ cell.render();
+ return false;
+}
+
+function highlightInEditMode(event, scheme) {
+ var cell = IPython.notebook.get_selected_cell()
+ var cm = cell.code_mirror
+ var selectedText = cm.getSelection()
+ if (selectedText.length == 0) {
+ var cell_text = cell.get_text();
+ cell_text = fullCellHighlight(cell_text, scheme);
+ cell.set_text(cell_text);
+ } else {
+ cm.replaceSelection(highlight(selectedText, scheme))
+ }
+ return false;
+}
+
+function removeHighlights() {
+ var cell = IPython.notebook.get_selected_cell();
+ var cell_text = removeFullCellHighlight(cell.get_text());
+ cell_text = cell_text.replace(/
([\s\S]*?)<\/span>/g,
+ function (w, g) {
+ return g
+ }
+ )
+ cell.set_text(cell_text)
+ cell.render();
+}
+
+//*****************************************************************************************
+// Utilitary functions for finding a candidate corresponding text from an unformatted selection
+
+/* In case of text selection in rendered cells, the returned text retains no formatting
+therefore, when looking for this text in the actual formatted text, we need to do a
+kind of "fuzzy" alignment. Though there exists specialized libraries for such task,
+we have developed here a simple heuristics that should work 90% of the time,
+but the problem cannot get a perfect solution.
+A first point is to replace special characters that could be interpreded with
+a special meaning in regular expressions. Then the idea is to find the exact matches
+on the longest substring from the beginning of text, then the longest substring
+from the end of the text. Finally, given the locations of the two substring,
+we extract the corresponding global match in the original text.
+*/
+function escapeRegExp(str) {
+ return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "#");
+ // return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
+ return str
+}
+
+// Extract the longest matching substring from the beginning of the text
+function exsub_up(sub, text) {
+ for (k = 0; k <= sub.length; k++) {
+ if (text.match(sub.substr(0, k)) == null) {
+ k = k - 2
+ break
+ }
+ }
+ return text.match(sub.substr(0, k + 1))
+}
+
+// Extract the longest matching substring from the end of the text
+function exsub_down(sub, text) {
+ var L = sub.length
+ try {
+ for (k = 0; k <= sub.length; k++) {
+ tst = sub.substr(L - k - 1, L);
+ if (text.match(tst) == null) {
+ // console.log(tst)
+ k = k - 1
+ break
+ }
+ }
+ return text.match(sub.substr(L - k - 1, L))
+ } catch (e) {
+ console.log('Error', e)
+ return ""
+ }
+
+}
+
+// Function that tries to find the best match of the unformatted
+// text in the formatted one.
+
+function align(tofind, text) {
+
+ sub = escapeRegExp(tofind)
+ textModified = escapeRegExp(text)
+ //console.log(textModified.match(sub))
+ if (textModified.match(sub) == null) {
+ a = exsub_up(sub, textModified)
+ b = exsub_down(sub, textModified)
+ return text.substr(a.index, b.index + b[0].length - a.index)
+ } else {
+ var tmpMatch = textModified.match(sub)
+ return text.substr(tmpMatch.index, tmpMatch[0].length)
+ }
+}
+
+
+
+// ***************** Keyboard shortcuts ******************************
+
+var add_cmd_shortcuts = {
+ 'Alt-g': {
+ help: 'highlight selected text',
+ help_index: 'ht',
+ handler: function (event) {
+ highlightInCmdMode("", mark);
+ return false;
+ }
+ },
+ 'Alt-h': {
+ help: 'highlight selected text',
+ help_index: 'ht',
+ handler: function (event) {
+ highlightInCmdMode("", burk);
+ return false;
+ }
+ },
+};
+
+
+var add_edit_shortcuts = {
+ 'Alt-g': {
+ help: 'highlight selected text',
+ help_index: 'ht',
+ handler: function (event) {
+ var highlight = mark;
+ highlightInEditMode("", mark);
+ return false;
+ }
+ },
+ 'Alt-h': {
+ help: 'highlight selected text',
+ help_index: 'ht',
+ handler: function (event) {
+ var highlight = burk;
+ highlightInEditMode("", burk);
+ return false;
+ }
+ },
+};
+
+
+//******Toolbar buttons *************************************************
+
+function highlightText(scheme) {
+ var cell = IPython.notebook.get_selected_cell();
+ var rendered = cell.rendered;
+ if (rendered) highlightInCmdMode("", scheme);
+ else highlightInEditMode("", scheme);
+}
+
+
+function build_toolbar() {
+ var test = ' \
+\
+\
+
'
+
+
+ $("#maintoolbar-container").append(test);
+ $("#test").css({
+ 'padding': '5px'
+ });
+
+ $("#submenu").hide(); // initially hide the submenu
+
+ //buttons initial css -- shall check if this is really necessary
+ // $("#higlighter_menu").css({
+ // 'padding': '2px 8px',
+ // 'display': 'inline-block',
+ // 'border': '1px solid',
+ // 'border-color': '#cccccc',
+ // 'font-weight': 'bold',
+ // 'text-align': 'center',
+ // 'vertical-align': 'middle',
+ // 'margin-left': '0px',
+ // 'margin-right': '0px'
+ // })
+
+
+ //Actions
+
+
+ $("#higlighter_menu")
+ .on('click', function () {
+ $("#submenu").toggle();
+ $("#menu-hgl").toggleClass("fa-caret-right")
+ $("#menu-hgl").toggleClass("fa-caret-left")
+ })
+ .attr('title', 'Highlight Selected Text');
+
+
+ $("#b1")
+ .on('click', function () {
+ highlightText("burk")
+ })
+ .on('mouseover', function () {
+ $("#b1").removeClass("btn btn-default").addClass("btn burk")
+ //.addClass("burk");
+ }) //!!
+ .on('mouseout', function () {
+ $("#b1").addClass("btn btn-default")
+ })
+
+
+ $("#b2")
+ .on('click', function () {
+ highlightText("mark")
+ })
+ .on('mouseover', function () {
+ $("#b2").removeClass("btn btn-default").addClass("btn mark")
+ }) //!!
+ .on('mouseout', function () {
+ $("#b2").addClass("btn btn-default")
+ })
+
+ $("#b3")
+ .on('click', function () {
+ highlightText("girk")
+ })
+ .on('mouseover', function () {
+ $(this).removeClass("btn btn-default").addClass("btn girk")
+ }) //!!
+ .on('mouseout', function () {
+ $(this).addClass("btn btn-default")
+ })
+
+ $("#b4")
+ .on('click', function () {
+ highlightText("birk")
+ })
+ .on('mouseover', function () {
+ $(this).removeClass("btn btn-default").addClass("btn birk")
+ }) //!!
+ .on('mouseout', function () {
+ $(this).addClass("btn btn-default")
+ })
+
+ $("#b5")
+ .on('click', function () {
+ highlightText("pirk")
+ })
+ .on('mouseover', function () {
+ $(this).removeClass("btn btn-default").addClass("btn pirk")
+ }) //!!
+ .on('mouseout', function () {
+ $(this).addClass("btn btn-default")
+ })
+
+
+ $("#remove_highlights")
+ .on('click', function () {
+ removeHighlights()
+ })
+ .attr('title', 'Remove highlightings in selected cell');
+} // end build_toolbar
+
+//******************************* MAIN FUNCTION **************************
+
+define(["require",
+ 'base/js/namespace'
+], function (requirejs, Jupyter) {
+
+ var security = requirejs("base/js/security")
+
+ var load_css = function (name) {
+ var link = document.createElement("link");
+ link.type = "text/css";
+ link.rel = "stylesheet";
+ link.href = requirejs.toUrl(name);
+ document.getElementsByTagName("head")[0].appendChild(link);
+
+ };
+
+ //Load_ipython_extension
+ var load_ipython_extension = requirejs(['base/js/namespace'], function (Jupyter) {
+ "use strict";
+ if (Jupyter.version[0] < 3) {
+ console.log("This extension requires Jupyter or IPython >= 3.x")
+ return
+ }
+
+ console.log("[highlighter] Loading highlighter.css");
+ load_css('./highlighter.css')
+
+ IPython.keyboard_manager.edit_shortcuts.add_shortcuts(add_edit_shortcuts);
+ IPython.keyboard_manager.command_shortcuts.add_shortcuts(add_cmd_shortcuts);
+
+ build_toolbar();
+
+ var _on_reload = true; /* make sure cells render on reload */
+
+ //highlighter_init_cells(); /* initialize cells */
+
+
+ /* on reload */
+ $([Jupyter.events]).on('status_started.Kernel', function () {
+
+ //highlighter_init_cells();
+ console.log("[highlighter] reload...");
+ _on_reload = false;
+ })
+
+ }); //end of load_ipython_extension function
+
+ return {
+ load_ipython_extension: load_ipython_extension,
+ };
+}); //End of main function
+
+console.log("Loading ./highlighter.js");
\ No newline at end of file
diff --git a/.local/share/jupyter/nbextensions/highlighter/highlighter.yaml b/.local/share/jupyter/nbextensions/highlighter/highlighter.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..fdd56310dd6b6d692af154c09260af9fd853e6c8
--- /dev/null
+++ b/.local/share/jupyter/nbextensions/highlighter/highlighter.yaml
@@ -0,0 +1,7 @@
+Type: IPython Notebook Extension
+Name: highlighter
+Description: Enable to highlight select text in a markdown cell
+Link: readme.md
+Icon: icon.png
+Main: highlighter.js
+Compatibility: 3.x, 4.x, 5.x
diff --git a/.local/share/jupyter/nbextensions/highlighter/icon.png b/.local/share/jupyter/nbextensions/highlighter/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..7c47f176f09eb19ce6abd15748778d5544ab7bcc
Binary files /dev/null and b/.local/share/jupyter/nbextensions/highlighter/icon.png differ
diff --git a/.local/share/jupyter/nbextensions/highlighter/readme.md b/.local/share/jupyter/nbextensions/highlighter/readme.md
new file mode 100644
index 0000000000000000000000000000000000000000..cad658c52f415622620b37f4e5feb010e1937ccb
--- /dev/null
+++ b/.local/share/jupyter/nbextensions/highlighter/readme.md
@@ -0,0 +1,47 @@
+Highlighter
+===========
+
+- Firstable, the extension provides several toolbar buttons for highlighting a selected text _within a markdown cell_. Three different \`color schemes' are provided, which can be easily customized in the stylesheet `highlighter.css`. The last button enables to remove all highlightings in the current cell.
+- This works both when the cell is _rendered_ and when the cell is in edit mode ;
+- In both modes, it is possible to highlight formatted portions of text (In rendered mode, since the selected text loose its formatting, an heuristic is applied to find the best alignment with the actual text)
+- When no text is selected, the whole cell is highlighted;
+- The extension also provides two keyboard shortcuts (Alt-G and Alt-H) which fire the highlighting of the selected text.
+- Highlights can be preserved when exporting to html or to LaTeX -- details are provided in [export_highlights](https://rawgit.com/jfbercher/small_nbextensions/master/usability/highlighter/export_highlights.html)
+
+
+
+
+
+Installation
+------------
+
+The extension can be installed with the nice UI available on jupyter_nbextensions_configurator website, which also allows to enable/disable the extension.
+
+You may also install the extension from the original repo: issue
+
+```bash
+jupyter nbextension install https://rawgit.com/jfbercher/small_nbextensions/master/highlighter.zip --user
+```
+at the command line.
+
+
+Testing
+-------
+
+Use a code cell with
+
+```python
+%%javascript
+require("base/js/utils").load_extensions("highlighter/highlighter")
+```
+
+
+Automatic load
+--------------
+
+You may also automatically load the extension for any notebook via
+
+```bash
+jupyter nbextension enable highlighter/highlighter
+```
+
diff --git a/.local/share/jupyter/nbextensions/highlighter/tst_highlights.ipynb b/.local/share/jupyter/nbextensions/highlighter/tst_highlights.ipynb
new file mode 100644
index 0000000000000000000000000000000000000000..92394413443945d088b506a0b92f1f8c308a907c
--- /dev/null
+++ b/.local/share/jupyter/nbextensions/highlighter/tst_highlights.ipynb
@@ -0,0 +1,53 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# First cell\n",
+ "\n",
+ "In the first cell, we highlight *some words* using the different schemes provided. \n",
+ "\n",
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus id lacus mauris. Etiam in dictum mauris. Morbi pharetra, **mauris a feugiat consequat**, est purus vulputate mauris, quis feugiat leo metus eu risus. Sed non luctus arcu. Donec eu ipsum justo. Praesent sit amet euismod orci. Nam eu turpis quis enim pulvinar blandit in eu justo. Vivamus nec libero ipsum. Nunc tempus, mi at vestibulum congue, lacus ante faucibus dolor, quis varius elit felis id ipsum. Vivamus at mi lorem. Integer quam massa, viverra et fermentum et, cursus faucibus nisl. Vestibulum sed est lacus. Morbi sit amet laoreet odio.\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "\n",
+ "# Second cell\n",
+ "\n",
+ "The second cell is completely highlighted. \n",
+ "\n",
+ "\n",
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus id lacus mauris. Etiam in dictum mauris. Morbi pharetra, mauris a feugiat consequat, est purus vulputate mauris, quis feugiat leo metus eu risus. Sed non luctus arcu. Donec eu ipsum justo. Praesent sit amet euismod orci. Nam eu turpis quis enim pulvinar blandit in eu justo. Vivamus nec libero ipsum. Nunc tempus, mi at vestibulum congue, lacus ante faucibus dolor , quis varius elit felis id ipsum. Vivamus at mi lorem. Integer quam massa, viverra et fermentum et, cursus faucibus nisl. Vestibulum sed est lacus. Morbi sit amet laoreet odio.
"
+ ]
+ }
+ ],
+ "metadata": {
+ "interactive_sols": {
+ "cbx_id": 1
+ },
+ "kernelspec": {
+ "display_name": "Python 3",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.4.3+"
+ },
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/.local/share/jupyter/nbextensions/hinterland/README.md b/.local/share/jupyter/nbextensions/hinterland/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..5a33c75daaaa1f96dfd15e54289928f7400f4c9d
--- /dev/null
+++ b/.local/share/jupyter/nbextensions/hinterland/README.md
@@ -0,0 +1,49 @@
+Hinterland
+==========
+
+Enable code autocompletion menu for every keypress in a code cell, instead of
+only calling it with tab.
+
+The nbextension adds an item to the help menu to turn auto-hinting on and off,
+and offers some options for configuration:
+
+
+Options
+-------
+
+* `hinterland.hint_delay`:
+ delay in milliseconds between keypress & hint request. This is used to help
+ ensure that the character from the keypress is added to the CodeMirror editor
+ *before* the hint request checks the character preceding the cursor against
+ the regexes below.
+
+* `hinterland.enable_at_start`:
+ Whether to enable hinterland's continuous hinting when notebook is first
+ opened, or if false, only when selected from the help-menu item.
+
+* `hinterland.hint_inside_comments`:
+ Whether to request hints while typing code comments. Defaults to false.
+
+* `hinterland.exclude_regexp`:
+ A regular expression tested against the character before the cursor, which,
+ if a match occurs, prevents autocompletion from being triggered. This is
+ useful, for example, to prevent triggering autocomplete on a colon, which is
+ included by the default Completer.reinvoke pattern. If blank, no test is
+ performed. Note that the regex will be created without any flags, making it
+ case sensitive.
+
+* `hinterland.include_regexp`:
+ A regular expression tested against the character before the cursor, which
+ must match in order for autocompletion to be triggered. If left blank, the
+ value of the notebook's `Completer.reinvoke_re` parameter is used, which can
+ be modified by kernels, but defaults to `/[%0-9a-z._/\\:~-]/i`. Note that
+ although the `Completer.reinvoke_re` default is case insensitive by virtue of
+ its `/i` flag, any regex specified by the user will be created without any
+ flags, making it case sensitive.
+
+* `hinterland.tooltip_regexp`:
+ A regular expression tested against the character before the cursor, which if
+ it matches, causes a tooltip to be triggered, instead of regular
+ autocompletion. For python, this is useful for example for function calls, so
+ the default regex matches opening parentheses. Note that the regex will be
+ created without any flags, making it case sensitive.
diff --git a/.local/share/jupyter/nbextensions/hinterland/hinterland.yaml b/.local/share/jupyter/nbextensions/hinterland/hinterland.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..5e60c900e46481d72ef4a1766f396fc76dddd173
--- /dev/null
+++ b/.local/share/jupyter/nbextensions/hinterland/hinterland.yaml
@@ -0,0 +1,73 @@
+Type: Jupyter Notebook Extension
+Main: hinterland.js
+Name: Hinterland
+Link: README.md
+Description: |
+ Enable code autocompletion menu for every keypress in a code cell, instead of
+ only enabling it with tab
+Compatibility: 4.x, 5.x
+Parameters:
+- name: hinterland.hint_delay
+ description: |
+ delay in milliseconds between keypress & hint request. This is used to help
+ ensure that the character from the keypress is added to the CodeMirror
+ editor *before* the hint request checks the character preceding the cursor
+ against the regexes below.
+ input_type: number
+ min: 1
+ step: 1
+ default: 20
+- name: hinterland.enable_at_start
+ description: |
+ Enable hinterland's continuous hinting when notebook is first opened, or
+ if false, only when selected from the help-menu item.
+ input_type: checkbox
+ default: true
+- name: hinterland.hint_inside_comments
+ description: |
+ Whether to request hints while typing code comments.
+ input_type: checkbox
+ default: false
+- name: hinterland.exclude_regexp
+ description: |
+ exclude_regexp:
+ A regular expression tested against the character before the cursor, which,
+ if a match occurs, prevents autocompletion from being triggered.
+ This is useful, for example, to prevent triggering autocomplete on a colon,
+ which is included by the default Completer.reinvoke pattern.
+ If blank, no test is performed.
+ Note that the regex will be created without any flags, making it case
+ sensitive.
+ input_type: text
+ # note that the YAML single-quoted string allows us to use the \ character
+ # without escaping it, similar to python's raw string syntax
+ default: ':'
+- name: hinterland.include_regexp
+ description: |
+ include_regexp:
+ A regular expression tested against the character before the cursor, which
+ must match in order for autocompletion to be triggered.
+ If left blank, the value of the notebook's Completer.reinvoke_re parameter
+ is used, which can be modified by kernels, but defaults to
+ /[%0-9a-z._/\\:~-]/i.
+ Note that although the Completer.reinvoke_re default is case insensitive by
+ virtue of its /i flag, any regex specified by the user will be created
+ without any flags, making it case sensitive.
+ input_type: text
+ # note that the YAML single-quoted string allows us to use the \ character
+ # without escaping it, similar to python's raw string syntax
+ default: ''
+- name: hinterland.tooltip_regexp
+ description: |
+ tooltip_regexp:
+ A regular expression tested against the character before the cursor, which
+ if it matches, causes a tooltip to be triggered, instead of regular
+ autocompletion.
+ For python, this is useful for example for function calls, so the default
+ regex matches opening parentheses.
+ Note that the regex will be created without any flags, making it case
+ sensitive.
+ input_type: text
+ # note that the YAML single-quoted string allows us to use the \ character
+ # without escaping it, similar to python's raw string syntax
+ default: '\('
diff --git a/.local/share/jupyter/nbextensions/init_cell/README.md b/.local/share/jupyter/nbextensions/init_cell/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..d5b184f22742516397307b4d8cad408f5617d2f2
--- /dev/null
+++ b/.local/share/jupyter/nbextensions/init_cell/README.md
@@ -0,0 +1,44 @@
+init_cell
+=========
+
+Add a cell toolbar selector to mark cells as 'initialization' cells .
+Such initialization cells are run:
+
+ * on clicking the provided button in the main toolbar
+ 
+ * by default, on kernel ready notification for trusted notebooks.
+ This is configurable (see options section).
+ In untrusted notebooks, a warning is displayed if the cells would otherwise
+ have been run.
+
+
+Options
+-------
+
+This nbextension provides option configurable using the
+[jupyter_nbextensions_configurator](https://github.com/Jupyter-contrib/jupyter_nbextensions_configurator).
+
+Once the extension is enabled, turn on the cell toolbar within your Notebook using
+the "View > Cell Toolbar > Initialization Cell" menu
+
+
+
+The running of initialization cells on kernel ready notification can be
+frustrating if your kernel is attached to multiple frontends, or is persistent
+between frontend reloads (e.g. reloading the notebook browser page without
+killing the kernel).
+As such, the option `init_cell.run_on_kernel_ready` in the notebook config
+section controls whether this behaviour occurs.
+The server's config value can also be overridden on a per-notebook basis by
+setting `notebook.metadata.init_cell.run_on_kernel_ready`.
+
+
+Internals
+---------
+
+Cells are marked as initialization cells in their metadata, as
+
+ cell.metadata.init_cell = true
+
+The running of initialization cells on kernel ready is bound to the Jupyter
+event `kernel_ready.Kernel`.
diff --git a/.local/share/jupyter/nbextensions/init_cell/cell_toolbar_menu.png b/.local/share/jupyter/nbextensions/init_cell/cell_toolbar_menu.png
new file mode 100644
index 0000000000000000000000000000000000000000..0a2d2ad19f331d6c2a69971354780b84f11335cf
Binary files /dev/null and b/.local/share/jupyter/nbextensions/init_cell/cell_toolbar_menu.png differ
diff --git a/.local/share/jupyter/nbextensions/init_cell/icon.png b/.local/share/jupyter/nbextensions/init_cell/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..8e3ffdbb6b908019c55a3115f1546e998d731da8
Binary files /dev/null and b/.local/share/jupyter/nbextensions/init_cell/icon.png differ
diff --git a/.local/share/jupyter/nbextensions/init_cell/init_cell.yaml b/.local/share/jupyter/nbextensions/init_cell/init_cell.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..9409a0d4b29ef19faf33d37bb3a63c9355e52156
--- /dev/null
+++ b/.local/share/jupyter/nbextensions/init_cell/init_cell.yaml
@@ -0,0 +1,17 @@
+Type: Jupyter Notebook Extension
+Compatibility: 3.x, 4.x, 5.x
+Name: Initialization cells
+Main: main.js
+Icon: icon.png
+Link: README.md
+Description: |
+ Add a cell toolbar selector to mark cells as 'initialization' cells. Such
+ initialization cells can be run by on clicking the provided button in the
+ main toolbar, or configurably, run automatically on notebook load.
+Parameters:
+- name: init_cell.run_on_kernel_ready
+ description: |
+ Run input cells whenever a kernel_ready.Kernel event is fired. See readme
+ for further details.
+ input_type: checkbox
+ default: true
diff --git a/.local/share/jupyter/nbextensions/keyboard_shortcut_editor/README.md b/.local/share/jupyter/nbextensions/keyboard_shortcut_editor/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..c971675425c9af6bba280420dde706b6a5e43847
--- /dev/null
+++ b/.local/share/jupyter/nbextensions/keyboard_shortcut_editor/README.md
@@ -0,0 +1,130 @@
+Keyboard shortcut editor
+========================
+
+This extension allows you to edit or remove the default notebook keyboard
+shortcuts, or create your own new ones.
+
+Currently, this extension supports the editing of any shortcut provided by
+Jupyter, with the exception of those provided by the CodeMirror editors, since
+they use a different API.
+
+To edit your keyboard shortcuts, open the keyboard shortcuts help dialog,
+either by pressing h in command mode, or by selecting
+`help > keyboard shortcuts` from the menu:
+
+
+
+When the extension has been loaded, each shortcut in the dialog will show a
+small dropdown menu next to it, with items to remove or edit the shortcut:
+
+
+
+Clicking the edit item opens a second modal dialog, with a text input. While
+the input has focus, you can press keys to form your combination. The reset
+button (the curly arrow to the left hand side) allows you to clear any keys you
+may input accidentally.
+
+
+
+
+If you'd like to disable an existing shortcut, you can click the 'Disable'
+button on the dropdown. This will move the shortcut into a new section on the
+dialog headed 'disabled'. You can click the reset button next to disabled
+shortcuts to re-enable them:
+
+
+
+You can create new custom keyboard shortcuts using the link at the base of the
+shortcut list for each mode:
+
+
+
+This opens a dialog similar to the editor, with the addition of a select box
+from which you can select the action which will be called:
+
+
+
+
+Limitations: problem shortcuts
+------------------------------
+
+Since this editor uses the same key-identification method as the notebook,
+anything you can get it to recognise should (?!) work as a notebook shortcut,
+even if it gets represented by the editor differently to the letters on your
+actual, physical, keyboard. However, bear in mind that key identification is
+not perfect, (this is a problem on the web in general), so it's possible that
+some combinations may not be identified by Jupyter at all. In such cases, the
+editor should notify you:
+
+
+
+In addition, the handling of shortcuts including commas is currently
+compromised to the extent that they don't really work properly, so the editor
+also won't accept anything with a comma in it:
+
+
+
+The dialog will also not accept a shortcut that would conflict with one which
+already exists:
+
+
+
+If the conflicting shortcut is provided by Jupyter rather than CodeMirror, you
+can of course disable it to prevent the conflict occurring.
+
+
+Internals
+---------
+
+The extension stores a record of the edits in use in the config, as a list
+of objects for each mode. Those without a `to` key denote shortcuts to disable,
+while those without a `from` key denote new shortcuts. For example:
+
+```javascript
+// the config object with section name 'notebook' at the base URL
+{
+ "kse_rebinds": {
+ // command-mode rebindings
+ 'command': [
+ { // disable the default 'space' shortcut, which used to scroll the notebook down
+ from: "space",
+ action_name: "jupyter-notebook:scroll-notebook-down"
+ },
+ { // create a new shortcut 't,t' to trust the notebook
+ action_name: "jupyter-notebook:trust-notebook",
+ to: "t,t"
+ },
+ { // change the default save-notebook shortcut from 's' to 'shift-s'
+ action_name: "jupyter-notebook:save-notebook",
+ to: "shift-s",
+ from: "s"
+ }
+ ],
+ // edit-mode rebindings:
+ "edit": [
+ { // disable the default edit-mode binding which switches to command mode
+ action_name: "jupyter-notebook:enter-command-mode",
+ from: "ctrl-m"
+ }
+ ]
+ },
+ // other config keys may be present in this file!
+}
+```
+
+The extension applies the shortcut edits when it is loaded, and in addition to
+any shortcut registered subsequently, as detailed below.
+
+
+Patches
+-------
+
+The extension applies patches to two Jupyter class prototypes.
+The method `ShortcutManager.prototype.add_shortcut` from `base/js/keyboard`,
+is patched to ensure any appropriate edits are applied to any shortcuts which
+get registered after the extension is loaded, for example by other notebook
+extensions.
+
+The `QuickHelp.prototype.build_command_help` and
+`QuickHelp.prototype.build_edit_help` methods from `notebook/js/quickhelp`, are
+patched to insert the dropdown menus, disabled shortcuts and other links.
diff --git a/.local/share/jupyter/nbextensions/keyboard_shortcut_editor/icon.png b/.local/share/jupyter/nbextensions/keyboard_shortcut_editor/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..71bc1d36efda0fc2cdb8cb0a6064625c72bbce3f
Binary files /dev/null and b/.local/share/jupyter/nbextensions/keyboard_shortcut_editor/icon.png differ
diff --git a/.local/share/jupyter/nbextensions/keyboard_shortcut_editor/kse_components.js b/.local/share/jupyter/nbextensions/keyboard_shortcut_editor/kse_components.js
new file mode 100644
index 0000000000000000000000000000000000000000..30bb116e815be265098579ea428260b2d05acf03
--- /dev/null
+++ b/.local/share/jupyter/nbextensions/keyboard_shortcut_editor/kse_components.js
@@ -0,0 +1,364 @@
+define([
+ 'bootstrap', // for modals
+ 'jquery',
+ 'base/js/dialog',
+ 'base/js/utils',
+ 'base/js/keyboard',
+ 'notebook/js/quickhelp',
+ './quickhelp_shim'
+], function(
+ bs,
+ $,
+ dialog,
+ utils,
+ keyboard,
+ quickhelp,
+ quickhelp_shim
+){
+ "use strict";
+
+ function only_modifier_event (event) {
+ // adapted from base/js/keyboard
+ /**
+ * Return `true` if the event only contains modifiers keys, false
+ * otherwise
+ */
+ var key = keyboard.inv_keycodes[event.which];
+ return ((event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) &&
+ (key === 'alt'|| key === 'ctrl'|| key === 'meta'|| key === 'shift'));
+ }
+
+ function editor_build () {
+ var editor = $('#kse-editor');
+ if (editor.length > 0) {
+ return editor;
+ }
+
+ editor = $('
')
+ .addClass('kse-editor')
+ .attr('id', 'kse-editor')
+ .data({
+ 'kse_sequence': [],
+ 'kse_info': {},
+ 'kse_mode': 'command',
+ 'kse_undefined_key': false
+ });
+
+ var form = $('')
+ .addClass('form')
+ .appendTo(editor);
+
+ $('
')
+ .addClass('form-group')
+ .appendTo(form);
+
+ var form_group = $('
')
+ .addClass('form-group has-feedback')
+ .appendTo(form);
+
+ var input_group = $('
')
+ .addClass('input-group')
+ .addClass('kse-input-group')
+ .appendTo(form_group);
+
+ // reset button
+ var btn = $(' ')
+ .addClass('btn btn-default')
+ .addClass('kse-input-group-reset')
+ .attr({
+ 'title': 'Restart',
+ 'type': 'button'
+ })
+ .append(
+ $(' ')
+ .addClass('fa fa-repeat')
+ )
+ .on('click', function () {
+ editor.data({
+ 'kse_sequence': [],
+ 'kse_undefined_key': false
+ });
+ editor_update_input_group(editor);
+ $(this).blur();
+ textcontrol.focus();
+ });
+ $('
')
+ .addClass('input-group-btn')
+ .append(btn)
+ .appendTo(input_group);
+
+ // pretty-displayed shortcut
+ $('
')
+ .addClass('input-group-addon')
+ .addClass('kse-input-group-pretty')
+ .addClass('kse-editor-to')
+ .appendTo(input_group);
+
+ var textcontrol = $(' ')
+ .addClass('form-control')
+ .addClass('kse-input-group-input')
+ .attr({
+ 'type': 'text',
+ 'placeholder': 'click here to edit the shortcut'
+ })
+ .on('keydown', editor_handle_shortcut_keydown)
+ .on('focus', function (evt) {
+ $(this).attr('placeholder', 'press keys to add to the shortcut');
+ })
+ .on('blur', function (evt) {
+ $(this).attr('placeholder', 'click here to edit the shortcut');
+ })
+ .appendTo(input_group);
+
+ // feedback icon
+ var form_fdbck = $(' ')
+ .addClass('fa fa-lg');
+ $(' ')
+ .addClass('form-control-feedback')
+ .append(form_fdbck)
+ .appendTo(form_group);
+
+ // help for input group
+ $(' ')
+ .addClass('help-block')
+ .appendTo(form_group);
+
+ return editor;
+ }
+
+ function editor_update_input_group (editor, seq) {
+ seq = seq || editor.data('kse_sequence');
+ var shortcut = seq.join(',');
+ var mode = editor.data('kse_mode');
+ var have_seq = seq.length > 0;
+ var valid = have_seq;
+
+ // empty help block
+ var feedback = editor.find('.form-group.has-feedback:first');
+ var help_block = feedback.find('.help-block');
+ help_block.empty();
+
+ var ii;
+ var has_comma = false;
+ for (ii = 0; !has_comma && (ii < seq.length); ii++) {
+ has_comma = seq[ii].indexOf(',') >= 0;
+ }
+
+ if (has_comma) {
+ valid = false;
+ // use HTML Unicode escape for a comma, to get it to look right in the pretty version
+ shortcut = $.map(seq, function (elem, idx) {
+ return elem.replace(',', ',');
+ }).join(',');
+
+ $('
')
+ .html(
+ 'Unfortunately, Jupyter\'s handling of shortcuts containing ' +
+ 'commas (, ) is fundamentally flawed, ' +
+ 'as the comma is used as the key-separator character ☹. ' +
+ 'Please try something else for your rebind!'
+ )
+ .appendTo(help_block);
+ }
+ else if (have_seq) {
+ var conflicts = {};
+ var tree;
+
+ // get existing shortcuts
+ if (Jupyter.keyboard_manager !== undefined) {
+ var startkey = seq.slice(0, 1)[0];
+ if (mode === 'command') {
+ tree = Jupyter.keyboard_manager.command_shortcuts.get_shortcut(startkey);
+ }
+ else {
+ tree = Jupyter.keyboard_manager.edit_shortcuts.get_shortcut(startkey);
+ // deal with codemirror shortcuts specially, since they're not included in kbm
+ for (var jj = 0; jj < quickhelp.cm_shortcuts.length; jj++) {
+ var cm_shrt = quickhelp.cm_shortcuts[jj];
+ if (keyboard.normalize_shortcut(cm_shrt.shortcut) === startkey) {
+ tree = cm_shrt.help;
+ break;
+ }
+ }
+ }
+ }
+
+ // check for conflicting shortcuts.
+ // Start at 1 because we got tree from startkey
+ for (ii = 1; (ii < seq.length) && (tree !== undefined); ii++) {
+ // check for exsiting definitions at current specificity
+ if (typeof(tree) === 'string') {
+ valid = false;
+ conflicts[seq.slice(0, ii).join(',')] = tree;
+ break;
+ }
+ tree = tree[seq[ii]];
+ }
+
+ // check whether any more-specific shortcuts were defined
+ if ((ii === seq.length) && (tree !== undefined)) {
+ valid = false;
+ var flatten_conflict_tree = function flatten_conflict_tree (obj, key) {
+ if (typeof(obj) === 'string') {
+ conflicts[key] = obj;
+ }
+ else for (var subkey in obj) {
+ if (obj.hasOwnProperty(subkey)) {
+ flatten_conflict_tree(obj[key], [key, subkey].join(','));
+ }
+ }
+ };
+ flatten_conflict_tree(tree, seq.join(','));
+ }
+
+ if (!valid) {
+ var plural = Object.keys(conflicts).length != 1;
+ $('
')
+ .append(quickhelp.humanize_sequence(seq.join(',')))
+ .append(
+ ' conflicts with the' + (plural ? ' following' : '') +
+ ' existing shortcut' + (plural ? 's' : '') + ':'
+ )
+ .appendTo(help_block);
+
+ for (var conflicting_shortcut in conflicts) {
+ if (conflicts.hasOwnProperty(conflicting_shortcut)) {
+ $('
')
+ .append(quickhelp.humanize_sequence(conflicting_shortcut))
+ .append($('
').text(conflicts[conflicting_shortcut]))
+ .appendTo(help_block);
+ }
+ }
+ }
+ }
+
+ if (editor.data('kse_undefined_key')) {
+ var warning = $(' ')
+ .addClass('form-group has-feedback has-warning kse-undefined')
+ .append(
+ $(' ')
+ .addClass('help-block')
+ .append(
+ $('
').text('Unrecognised key! (code ' + editor.data('kse_undefined_key' ) + ')')
+ )
+ );
+
+ var existing = editor.find('.kse-undefined');
+ if (existing.length > 0) {
+ existing.replaceWith(warning);
+ }
+ else {
+ warning.insertAfter(feedback);
+ }
+ setTimeout(function () {
+ warning.remove();
+ }, 2000);
+ }
+
+ // disable reset button if no sequence
+ editor.find('.kse-input-group-reset')
+ .toggleClass('disabled', !have_seq);
+
+ editor.find('.kse-input-group-pretty')
+ .html(shortcut ? quickhelp.humanize_sequence(shortcut) : '<new shortcut>');
+
+ feedback
+ .toggleClass('has-error', !valid && have_seq)
+ .toggleClass('has-success', valid && have_seq)
+ .find('.form-control-feedback .fa')
+ .toggleClass('fa-remove', !valid && have_seq)
+ .toggleClass('fa-check', valid && have_seq);
+ }
+
+ function editor_handle_shortcut_keydown (evt) {
+ var elem = $(evt.delegateTarget);
+ if (!only_modifier_event(evt)) {
+ var shortcut = keyboard.normalize_shortcut(keyboard.event_to_shortcut(evt));
+ var editor = elem.closest('#kse-editor');
+ var seq = editor.data('kse_sequence');
+ var has_undefined_key = (shortcut.toLowerCase().indexOf('undefined') !== -1);
+ editor.data('kse_undefined_key', has_undefined_key);
+ if (has_undefined_key) {
+ // deal with things like ~ appearing on apple alt-n, or ¨ on alt-u
+ editor.find('.kse-input-group-input').val('');
+ editor.data('kse_undefined_key', evt.which || true);
+ }
+ else {
+ seq.push(shortcut);
+ }
+ editor_update_input_group(editor, seq);
+ }
+ }
+
+ function modal_build (editor, modal_options) {
+ var modal = $('#kse-editor-modal');
+ if (modal.length > 0) {
+ return modal;
+ }
+
+ var default_modal_options = {
+ 'destroy': false,
+ 'show': false,
+ 'title': 'Edit keyboard shortcut',
+ 'body': editor,
+ 'buttons': {
+ 'OK': {'class': 'btn-primary'},
+ 'Cancel': {}
+ },
+ 'open': function (evt) {
+ $(this).find('.kse-input-group-input').focus();
+ }
+ };
+ if (Jupyter.notebook !== undefined) {
+ default_modal_options.notebook = Jupyter.notebook;
+ }
+ if (Jupyter.keyboard_manager !== undefined) {
+ default_modal_options.keyboard_manager= Jupyter.keyboard_manager;
+ }
+ modal_options = $.extend({}, default_modal_options, modal_options);
+
+ modal = dialog.modal(modal_options);
+
+ modal
+ .addClass('modal_stretch')
+ .attr('id', 'kse-editor-modal');
+
+ // Add a data-target attribute to ensure buttons only target the editor modal
+ modal.find('.close,.modal-footer button')
+ .attr('data-target', '#kse-editor-modal');
+
+ return modal;
+ }
+
+ /**
+ * Pass it an option dictionary with any of the bootstrap or base/js/dialog
+ * modal options, plus the following optional properties:
+ * - description: html for the form group preceding the editor group,
+ * useful as a description
+ */
+ function KSE_modal (modal_options) {
+ var editor = editor_build();
+ editor.data({'kse_sequence': [], 'kse_undefined_key': false});
+ editor_update_input_group(editor);
+ var modal = modal_build(editor, modal_options);
+
+ editor.on('keydown', '.kse-input-group-input', function (evt) {
+ event.preventDefault();
+ event.stopPropagation();
+ return false;
+ });
+
+ if (modal_options.description) {
+ modal.find('.modal-body .form-group:first').html(modal_options.description);
+ }
+
+ return modal;
+ }
+
+ return {
+ editor_build : editor_build,
+ editor_update_input_group: editor_update_input_group,
+ modal_build : modal_build,
+ KSE_modal : KSE_modal
+ };
+});
diff --git a/.local/share/jupyter/nbextensions/keyboard_shortcut_editor/main.js b/.local/share/jupyter/nbextensions/keyboard_shortcut_editor/main.js
new file mode 100644
index 0000000000000000000000000000000000000000..736aa920ef057a60606bd8666ebd580bfdd68620
--- /dev/null
+++ b/.local/share/jupyter/nbextensions/keyboard_shortcut_editor/main.js
@@ -0,0 +1,778 @@
+define([
+ 'jquery',
+ 'require',
+ 'base/js/namespace',
+ 'base/js/dialog',
+ 'base/js/events',
+ 'base/js/keyboard',
+ 'notebook/js/quickhelp',
+ './quickhelp_shim',
+ './kse_components',
+], function (
+ $,
+ requirejs,
+ Jupyter,
+ dialog,
+ events,
+ keyboard,
+ quickhelp,
+ qh_shim,
+ kse_comp
+) {
+ "use strict";
+
+ var mod_name = 'keyboard_shortcut_editor';
+
+ // define default values for config parameters
+ var params = {
+ 'kse_show_rebinds': true,
+ // mode, action name, new combo
+ 'kse_rebinds': {
+ // command-mode rebindings
+ 'command': [
+ // { // disable the default 'space' shortcut, which used to scroll the notebook down
+ // from: "space",
+ // action_name: "jupyter-notebook:scroll-notebook-down"
+ // },
+ // { // create a new shortcut 't,t' to trust the notebook
+ // action_name: "jupyter-notebook:trust-notebook",
+ // to: "t,t"
+ // },
+ // { // change the default save-notebook shortcut from 's' to 'shift-s'
+ // action_name: "jupyter-notebook:save-notebook",
+ // to: "shift-s",
+ // from: "s"
+ // }
+ ],
+ // edit-mode rebindings:
+ "edit": [
+ // { // disable the default edit-mode binding which switches to command mode
+ // action_name: "jupyter-notebook:enter-command-mode",
+ // from: "ctrl-m"
+ // }
+ ]
+ }
+ };
+ // function to update params with any specified in the server's config file
+ function update_params () {
+ var config = Jupyter.notebook.config;
+ for (var key in params) {
+ if (config.data.hasOwnProperty(key)) {
+ params[key] = config.data[key];
+ }
+ }
+ }
+
+ function add_css (url) {
+ $(' ')
+ .attr({
+ 'rel': 'stylesheet',
+ 'type': 'text/css',
+ 'href': requirejs.toUrl(url)
+ })
+ .appendTo($('head'));
+ }
+
+ var kbm = Jupyter.keyboard_manager;
+ var deleted_shortcuts = {
+ 'command': new keyboard.ShortcutManager(undefined, kbm.command_shortcuts.events, kbm.actions, kbm.env),
+ 'edit': new keyboard.ShortcutManager(undefined, kbm.edit_shortcuts.events, kbm.actions, kbm.env)
+ };
+
+ var patched_quickhelp_prototype = false;
+ var patched_shortcut_manager_prototype = false;
+
+ function patch_shortcut_manager_prototype () {
+ if (!patched_shortcut_manager_prototype) {
+ var orig_add_shortcut = keyboard.ShortcutManager.prototype.add_shortcut;
+ keyboard.ShortcutManager.prototype.add_shortcut = function add_shortcut (shortcut, data, suppress_help_update, called_by_rebinder) {
+ if (!called_by_rebinder) {
+ var this_mode;
+ if (this === kbm.edit_shortcuts) {
+ this_mode = 'edit';
+ }
+ else if (this === kbm.command_shortcuts) {
+ this_mode = 'command';
+ }
+ if (this_mode) {
+ var rebind_specs = params.kse_rebinds[this_mode];
+ for (var ii = 0; ii < rebind_specs.length; ii++) {
+ var spec = rebind_specs[ii];
+ if (spec.from === shortcut) {
+ if (!spec.to) {
+ return;
+ }
+ shortcut = spec.to;
+ }
+ }
+ }
+ }
+ return orig_add_shortcut.call(this, shortcut, data, suppress_help_update);
+ };
+ console.log('[' + mod_name + '] patched ShortcutManager.prototype.add_shortcut');
+ patched_shortcut_manager_prototype = true;
+ }
+ }
+
+ function patch_quickhelp_prototype () {
+ if (!patched_quickhelp_prototype) {
+ var orig_build_command_help = quickhelp.QuickHelp.prototype.build_command_help;
+ quickhelp.QuickHelp.prototype.build_command_help = function () {
+ var div = orig_build_command_help.call(this);
+ return quickhelp_div_add_rebind_controls(div, 'command');
+ };
+ console.log('[' + mod_name + '] patched QuickHelp.prototype.build_command_help');
+
+ var orig_build_edit_help = quickhelp.QuickHelp.prototype.build_edit_help;
+ quickhelp.QuickHelp.prototype.build_edit_help = function (cm_shortcuts) {
+ var div = orig_build_edit_help.call(this, cm_shortcuts);
+ return quickhelp_div_add_rebind_controls(div, 'edit');
+ };
+ console.log('[' + mod_name + '] patched QuickHelp.prototype.build_edit_help');
+
+ patched_quickhelp_prototype = true;
+ }
+ }
+
+ function load_jupyter_extension () {
+ add_css('./main.css');
+ patch_shortcut_manager_prototype();
+ patch_quickhelp_prototype();
+ Jupyter.notebook.config.loaded.then(initialize);
+ }
+
+ function get_mode_shortcuts (mode, deleted) {
+ if (deleted) {
+ return deleted_shortcuts[mode];
+ }
+ else if (mode === 'command') {
+ return kbm.command_shortcuts;
+ }
+ else if (mode === 'edit') {
+ return kbm.edit_shortcuts;
+ }
+ return undefined;
+ }
+
+ function rebind (mode, spec, suppress_help_update) {
+ var shortcuts = get_mode_shortcuts(mode);
+ if (spec.action_name === undefined) {
+ spec.action_name = shortcuts.get_shortcut(spec.from);
+ }
+ if (!shortcuts.actions.exists(spec.action_name)) {
+ console.warn(
+ '[' + mod_name + '] ' +
+ 'rebind specified for unrecognised action "' +
+ spec.action_name + '"' +
+ (spec.from ? ' from ' + spec.from : '') +
+ (spec.to ? ' to ' + spec.to : '')
+ );
+ }
+ else {
+ console.log(
+ '[' + mod_name + '] ' +
+ (spec.from ? (spec.to ? 're' : 'un') : '') + 'bound ' +
+ spec.action_name +
+ (spec.from ? ' from ' + spec.from : '') +
+ (spec.to ? ' to ' + spec.to : '')
+ );
+
+ if (spec.from) {
+ if (!spec.to) {
+ deleted_shortcuts[mode].add_shortcut(spec.from, spec.action_name, true, true);
+ }
+ shortcuts.remove_shortcut(spec.from);
+ }
+ if (spec.to) {
+ return shortcuts.add_shortcut(spec.to, spec.action_name, suppress_help_update, true);
+ }
+ }
+ }
+
+ function apply_config_rebinds () {
+ var modes = ['command', 'edit'];
+ for (var mm = 0; mm < modes.length; mm++) {
+ var mode = modes[mm];
+ if (params.kse_rebinds.hasOwnProperty(mode)) {
+ var rebind_specs = params.kse_rebinds[mode];
+ for (var ii = 0; ii < rebind_specs.length; ii++) {
+ rebind(mode, rebind_specs[ii], true);
+ }
+ }
+ }
+ events.trigger('rebuild.QuickHelp');
+ }
+
+ var initialize = function () {
+ update_params();
+ apply_config_rebinds();
+ var title = $('#keyboard_shortcuts').attr('title');
+ $('#keyboard_shortcuts').attr('title', title + ' & controls to edit them');
+ };
+
+ function reverse_spec (spec) {
+ var new_spec = {action_name: spec.action_name};
+ if (spec.from) {
+ new_spec.to = spec.from;
+ }
+ if (spec.to) {
+ new_spec.from = spec.to;
+ }
+ return new_spec;
+ }
+
+ function find_rebinding (rebinds, partial_spec, index_only) {
+ for (var ii = 0; ii < rebinds.length; ii++) {
+ if (((partial_spec.to === undefined) ||
+ (partial_spec.to === rebinds[ii].to)) &&
+ ((partial_spec.from === undefined) ||
+ (partial_spec.from === rebinds[ii].from)) &&
+ ((partial_spec.action_name === undefined) ||
+ (partial_spec.action_name === rebinds[ii].action_name))) {
+ return index_only ? ii : rebinds[ii];
+ }
+ }
+ return undefined;
+ }
+
+ function register_rebinding (mode, spec) {
+ var rebinds = params.kse_rebinds[mode];
+ rebinds.push($.extend({}, spec));
+ // write our private copy to the config:
+ Jupyter.notebook.config.update(params);
+ console.log('[' + mod_name + '] rebinding added:', spec);
+ }
+
+ function deregister_rebinding (mode, partial_spec) {
+ var rebinds = params.kse_rebinds[mode];
+ var idx = find_rebinding(rebinds, partial_spec, true);
+ if (idx === undefined) {
+ console.warn('[' + mod_name + '] attempted to delete non-exsitent shortcut:', partial_spec);
+ return undefined;
+ }
+ var deleted = rebinds.splice(idx, 1)[0];
+ // write our private copy to the config:
+ Jupyter.notebook.config.update(params);
+ console.log('[' + mod_name + '] rebinding removed:', deleted);
+ return deleted;
+ }
+
+ function action_selector (default_pair) {
+ var select = $(' ')
+ .append(
+ $(' ')
+ .attr('value', '')
+ .text('select an action')
+ )
+ .addClass('form-control select-xs');
+
+ var action_names = [];
+ $.each(kbm.actions._actions, function (key, val) {
+ if (key !== 'ignore') {
+ action_names.push(key);
+ }
+ });
+ action_names.sort();
+
+ for (var ii = 0; ii < action_names.length; ii++) {
+ select.append(
+ $(' ')
+ .attr('value', action_names[ii])
+ .append(
+ $('
')
+ .text(action_names[ii])
+ )
+ // .text(kbm.actions.get(action_name).help)
+ );
+ }
+ return select;
+ }
+
+ function quickhelp_rebuild_mode_div (div) {
+ if ((div === undefined) || (div.data('kse_mode') === 'command')) {
+ div.replaceWith(Jupyter.quick_help.build_command_help());
+ }
+ if ((div === undefined) || (div.data('kse_mode') === 'edit')) {
+ div.replaceWith(Jupyter.quick_help.build_edit_help(quickhelp.cm_shortcuts));
+ }
+ return div;
+ }
+
+ function modal_update_ok_disable_status (evt) {
+ var editor = $(evt.delegateTarget);
+ if (!editor.is('#kse-editor')) {
+ editor = editor.closest('#kse-editor');
+ }
+ var feedback = editor.find('.has-feedback:first');
+ var valid = feedback.hasClass('has-success');
+ if (valid) {
+ valid = valid && editor.data('kse_sequence').length > 0;
+ }
+ var modal = editor.closest('#kse-editor-modal');
+ if (valid) {
+ var select = modal.find('select');
+ if (select.length > 0) {
+ valid = valid && select.val();
+ }
+ }
+ modal.find('.modal-footer button:first').prop('disabled', !valid);
+ }
+
+
+ function modal_ok_click_callback (evt) {
+ var editor = $('#kse-editor');
+ var new_shortcut = editor.data('kse_sequence').join(',');
+ var info = editor.data('kse_info');
+ var mode = editor.data('kse_mode');
+ var new_spec = {
+ 'action_name': info.action_name,
+ 'to': new_shortcut
+ };
+ if (info.rebound) {
+ // editing an existing rebinding
+ deregister_rebinding(mode, info.spec);
+ // rebind directly
+ rebind(mode, $.extend({'from': info.spec.to}, new_spec), true);
+ // get registration correct
+ new_spec.from = info.spec.from;
+ }
+ else {
+ if (info.spec.to) {
+ // editing an existing binding, so ensure there's a from
+ new_spec.from = info.spec.to;
+ }
+ rebind(mode, new_spec, true);
+ }
+ if (new_spec.from !== new_spec.to) {
+ register_rebinding(mode, new_spec);
+ }
+ quickhelp_rebuild_mode_div(info.div);
+ }
+
+ var modal_options_for_edit = {
+ backdrop: false,
+ buttons: {
+ OK: {
+ 'class':'btn-primary',
+ 'click': modal_ok_click_callback
+ },
+ Cancel: {}
+ }
+ };
+
+ function modal_prepare_editor(modal, editor, info) {
+ // ensure events are bound
+ if (!editor.data('kse_modal_events_bound')) {
+ editor.on('keydown', '.kse-input-group-input', function (evt) {
+ evt.preventDefault();
+ evt.stopPropagation();
+ modal_update_ok_disable_status(evt);
+ return false;
+ });
+ editor.on('click', '.kse-input-group-reset', modal_update_ok_disable_status);
+ editor.on('change', 'select', modal_update_ok_disable_status);
+ editor.data('kse_modal_events_bound', true);
+ }
+ // reset data
+ editor.data('kse_sequence', []);
+ editor.data('kse_info', info);
+ editor.data('kse_mode', info.mode);
+ editor.find('.kse-input-group-reset').click();
+
+ // add description
+ var descript_div = editor.find('.form-group:first').empty();
+ if (info.action_name) { // this is a rebind
+ descript_div
+ .append('Rebinding ')
+ .append(
+ $('
')
+ .addClass('kse-action')
+ .text(info.spec.action_name)
+ )
+ .append(' from ')
+ .append(
+ $(' ')
+ .addClass('kse-from')
+ .html(quickhelp.humanize_sequence(info.spec.to || ''))
+ )
+ .append(' to:');
+ }
+ else {
+ // this is a nubind
+ var select = action_selector();
+ select.on('change', function (event) {
+ var action_name = $(this).val();
+ $.extend(true, info, {'action_name': action_name, 'spec': {'action_name': action_name}});
+ });
+ descript_div
+ .append('Bind ')
+ .append(select)
+ .append(' to:');
+ }
+ kse_comp.editor_update_input_group(editor);
+ }
+
+ function modal_show_above_quickhelp_modal(modal) {
+ // add a custom backdrop which covers the quickhelp modal.
+ // We do this every time, as bootstrap destroys it every time.
+ var backdrop = modal.data('bs.modal').$backdrop = $('
')
+ .attr('id', 'kse-modal-backdrop')
+ .addClass('kse-modal-backdrop')
+ .addClass('modal-backdrop fade')
+ .appendTo(Jupyter.quick_help.shortcut_dialog.find('.modal-content'));
+
+ // get offsetWidth to force reflow, otherwise animation doesn't show
+ var tmp = backdrop[0].offsetWidth;
+ // now trigger animation by adding class
+ backdrop
+ .addClass('in');
+ // show the modal once the (backdrop) transition is complete
+ backdrop
+ .one('bsTransitionEnd', function () {
+ modal.modal('show');
+ })
+ .emulateTransitionEnd(150);
+ }
+
+ function build_rebind_rep_list (mode) {
+ var rep_list = $('
')
+ .addClass('kse-rep-list');
+
+ var shortcuts = get_mode_shortcuts(mode);
+ var rebind_specs = params.kse_rebinds[mode];
+
+ for (var ii = 0; ii < rebind_specs.length; ii++) {
+ var spec = rebind_specs[ii];
+ var verb = (spec.from ? (spec.to ? 're' : 'un') : '') + 'bound';
+ var rep = $('
')
+ .append(
+ $('
')
+ .text(spec.action_name)
+ )
+ .append(' ' + verb)
+ .appendTo(rep_list);
+ if (spec.from) {
+ rep.append(' from ' + quickhelp.humanize_sequence(spec.from));
+ }
+ if (spec.to) {
+ rep.append(' to ' + quickhelp.humanize_sequence(spec.to));
+ }
+ }
+
+ return rep_list;
+ }
+
+ function btn_get_info (btn) {
+ /**
+ * get the shortcut info associated with a quickhelp button element
+ */
+ var info = {};
+ btn = info.btn = $(btn);
+ var qh_div = info.qh_div = btn.closest('.quickhelp');
+ var div = info.div = qh_div.closest('.kse-div');
+
+ var mode = info.mode = div.data('kse_mode');
+ var unbound = info.unbound = qh_div.hasClass('kse-unbound');
+ var rebound = info.rebound = qh_div.hasClass('kse-rebound');
+ info.nubound = qh_div.hasClass('kse-nubound');
+
+ var shortcuts = info.shortcuts = get_mode_shortcuts(mode, unbound);
+ // Make sure we remove jupyter-notebook:ignore shortcuts.
+ var shortcut_help_arr = info.shortcut_help_arr = shortcuts.help().filter(
+ function (shortcut) {
+ return (shortcut.help !== 'ignore');
+ }
+ );
+
+ var idx = info.idx = div.find('.quickhelp:not(.kse-links,.kse-codemirror)')[unbound ? 'filter' : 'not']('.kse-unbound').index(qh_div);
+
+ var keycombo = info.keycombo = shortcut_help_arr[idx].shortcut;
+ var action_name = info.action_name = shortcuts.get_shortcut(keycombo);
+ var spec = info.spec = {
+ 'to': keycombo,
+ 'action_name': action_name
+ };
+ if (rebound) {
+ spec.from = find_rebinding(params.kse_rebinds[mode], spec).from;
+ }
+ return info;
+ }
+
+ function btn_del_callback (evt) {
+ evt.preventDefault(); // ignore #
+
+ var info = btn_get_info(evt.delegateTarget);
+ var spec = info.spec;
+ var rev_spec = reverse_spec(spec);
+ rebind(info.mode, rev_spec, true);
+
+ if (info.nubound) {
+ // don't want deleted new binds to show up in deleted shortcuts
+ deleted_shortcuts[info.mode].remove_shortcut(spec.to);
+ deregister_rebinding(info.mode, spec);
+ }
+ else if (info.rebound) {
+ // get rid of existing rebinding
+ deregister_rebinding(info.mode, spec);
+ // add a new rebinding for the deletion
+ delete spec.to;
+ rebind(info.mode, spec, true);
+ register_rebinding(info.mode, spec);
+ }
+ else {
+ register_rebinding(info.mode, rev_spec);
+ }
+ quickhelp_rebuild_mode_div(info.div);
+ }
+
+ function btn_rst_callback (evt) {
+ evt.preventDefault(); // ignore #
+
+ var info = btn_get_info(evt.delegateTarget);
+ var spec = info.spec;
+ if (info.unbound) {
+ spec = reverse_spec(spec);
+ deleted_shortcuts[info.mode].remove_shortcut(spec.from);
+ }
+ rebind(info.mode, reverse_spec(spec), true);
+ deregister_rebinding(info.mode, spec);
+
+ quickhelp_rebuild_mode_div(info.div);
+ }
+
+ function btn_edt_callback (evt) {
+ evt.preventDefault(); // ignore #
+
+ var info = btn_get_info(evt.delegateTarget);
+ var spec = reverse_spec(info.spec);
+ // see if the shortcut was already rebound...
+ var rebinds = params.kse_rebinds[info.mode];
+ for (var ii = 0; ii < rebinds.length; ii++) {
+ if (rebinds[ii].to === spec.from) {
+ spec = rebinds[ii];
+ break;
+ }
+ }
+
+ var editor = kse_comp.editor_build();
+ var modal = kse_comp.modal_build(editor, modal_options_for_edit);
+
+ modal_prepare_editor(modal, editor, info);
+ modal_show_above_quickhelp_modal(modal);
+ }
+
+ function btn_add_callback (evt) {
+ evt.preventDefault(); // don't use #
+
+ var div = $(evt.delegateTarget).closest('.kse-div');
+ var mode = div.data('kse_mode');
+ var info = {
+ 'div': div,
+ 'spec': {},
+ 'shortcuts': get_mode_shortcuts(mode),
+ 'keycombo': '',
+ 'action_name': '',
+ 'mode': mode
+ };
+
+ var editor = kse_comp.editor_build();
+ var modal = kse_comp.modal_build(editor, modal_options_for_edit);
+
+ modal_prepare_editor(modal, editor, info);
+ modal_show_above_quickhelp_modal(modal, editor, info);
+ }
+
+ function btn_view_callback (evt) {
+ evt.preventDefault(); // don't use #
+
+ var div = $(evt.delegateTarget).closest('.kse-div');
+ var mode = div.data('kse_mode');
+ var modal = dialog.modal({
+ backdrop: false, // a custom one gets added by modal_show_above_quickhelp_modal
+ show: false,
+ title : mode.substring(0, 1).toUpperCase() + mode.substring(1) + '-mode keyboard shortcut edits',
+ body : build_rebind_rep_list(mode),
+ buttons: {'OK': {}},
+ notebook: Jupyter.notebook,
+ keyboard_manager: Jupyter.keyboard_manager
+ });
+
+ modal
+ .addClass('modal_stretch')
+ .attr('id', 'kse-view-modal');
+
+ // Add a data-target attribute to ensure buttons only target this modal
+ modal.find('.close,.modal-footer button')
+ .attr('data-target', '#kse-view-modal');
+ modal_show_above_quickhelp_modal(modal);
+ }
+
+ function build_button_menu (idx, qh_div) {
+ qh_div = $(qh_div);
+
+ var grp = $('
')
+ .addClass('btn-group btn-group-xs')
+ .addClass('kse-dropdown')
+ .addClass('hidden-print')
+ .appendTo(qh_div);
+
+ var btn = $(' ')
+ .addClass('btn btn-default')
+ .attr('type', 'button')
+ .appendTo(grp);
+
+ if (qh_div.hasClass('kse-codemirror')) {
+ btn
+ .addClass('disabled')
+ .attr('title', 'Editing Codemirror shortcuts is not supported')
+ .html('cm ');
+ }
+ else if (qh_div.hasClass('kse-unbound')) {
+ btn
+ .on('click', btn_rst_callback)
+ .attr('title', 'Re-enable shortcut')
+ .html(' ');
+ }
+ else if (qh_div.hasClass('kse-nubound')) {
+ btn
+ .on('click', btn_del_callback)
+ .attr('title', 'Delete custom shortcut')
+ .html(' ');
+ }
+ else {
+ btn
+ .attr({
+ 'title': 'Edit',
+ 'data-toggle': 'dropdown',
+ 'aria-haspopup': 'true',
+ 'aria-expanded': 'false'
+ })
+ .addClass('dropdown-toggle')
+ .html(' ');
+
+ var mnu = $('')
+ .addClass('dropdown-menu dropdown-menu-right')
+ .appendTo(grp);
+ $(' ')
+ .html(' Edit ')
+ .on('click', btn_edt_callback)
+ .appendTo(mnu);
+ if (qh_div.hasClass('kse-rebound')) {
+ $(' ')
+ .on('click', btn_rst_callback)
+ .html(' Reset ')
+ .appendTo(mnu);
+ }
+ $(' ')
+ .on('click', btn_del_callback)
+ .html(' Disable ')
+ .appendTo(mnu);
+ }
+
+ return grp;
+ }
+
+ function quickhelp_div_add_rebind_controls (div, mode) {
+ if (!params.kse_show_rebinds) {
+ return div;
+ }
+
+ div
+ .data('kse_mode', mode)
+ .addClass('kse-div');
+
+ var nubound_shortcuts = [];
+ var rebound_shortcuts = [];
+ for (var ii = 0; ii < params.kse_rebinds[mode].length; ii++) {
+ var spec = params.kse_rebinds[mode][ii];
+ if (spec.to) {
+ (spec.from ? rebound_shortcuts : nubound_shortcuts).push(spec.to);
+ }
+ }
+
+ var shortcuts = get_mode_shortcuts(mode);
+ var shortcut_help_arr = shortcuts.help();
+ // add codemirror shortcuts in edit mode
+ if (mode === 'edit') {
+ shortcut_help_arr = $.merge($.merge([], quickhelp.cm_shortcuts), shortcut_help_arr);
+ }
+ // Remove jupyter-notebook:ignore shortcuts.
+ shortcut_help_arr = shortcut_help_arr.filter(function(shortcut) {
+ return (shortcut.help !== 'ignore');
+ });
+
+ // label quickhelp divs with classes
+ div.find('.quickhelp').each(function (idx, elem) {
+ var keycombo = shortcut_help_arr[idx].shortcut;
+ var action_name = shortcuts.get_shortcut(keycombo);
+ if (mode === 'edit' && action_name === undefined) {
+ $(elem).addClass('kse-codemirror');
+ }
+ else if (nubound_shortcuts.indexOf(keycombo) >= 0) {
+ $(elem).addClass('kse-nubound');
+ }
+ else if (rebound_shortcuts.indexOf(keycombo) >= 0) {
+ $(elem).addClass('kse-rebound');
+ }
+ });
+
+ // (maybe) add a set of rebinds and deleted shortcuts
+ div.find('.kse-rep-list').remove();
+ var cont = div.find('.container-fluid:first');
+
+ var del_div = quickhelp.build_div('Disabled: ', deleted_shortcuts[mode].help());
+ del_div
+ .addClass('hidden-print')
+ .addClass('text-danger hidden-print');
+ if (del_div.find('.quickhelp').addClass('kse-unbound').length > 0) {
+ del_div
+ .insertAfter(cont);
+ }
+
+ // add button menus
+ div.find('.quickhelp').each(build_button_menu);
+
+ var link_new = $(' ')
+ .attr('href', '#')
+ .on('click', btn_add_callback);
+
+ $(' ')
+ .addClass('shortcut_key')
+ .html(' ')
+ .appendTo(link_new);
+
+ $(' ')
+ .addClass('shortcut_descr')
+ .text(': Add a new ' + mode + '-mode shortcut')
+ .appendTo(link_new);
+
+ $('
')
+ .addClass('col-xs-12 hidden-print quickhelp kse-links')
+ .append(link_new)
+ .appendTo(cont);
+
+ // add the view-rebinds and add-a-new links
+ if (params.kse_rebinds[mode].length > 0) {
+ var link_view = link_new.clone()
+ .off('click')
+ .on('click', btn_view_callback)
+ .appendTo(cont);
+ link_view.find('.shortcut_key')
+ .html(' ');
+ link_view.find('.shortcut_descr')
+ .text(': View active ' + mode + '-mode shortcut edits');
+
+ $('
')
+ .addClass('col-xs-12 hidden-print quickhelp kse-links')
+ .append(link_view)
+ .appendTo(cont);
+ }
+
+ return div;
+ }
+
+ return {
+ 'load_jupyter_extension': load_jupyter_extension,
+ 'load_ipython_extension': load_jupyter_extension
+ };
+});
diff --git a/.local/share/jupyter/nbextensions/keyboard_shortcut_editor/quickhelp_shim.js b/.local/share/jupyter/nbextensions/keyboard_shortcut_editor/quickhelp_shim.js
new file mode 100644
index 0000000000000000000000000000000000000000..be921c63325934625368f0b00863b88dcc061fb6
--- /dev/null
+++ b/.local/share/jupyter/nbextensions/keyboard_shortcut_editor/quickhelp_shim.js
@@ -0,0 +1,207 @@
+define([
+ 'underscore',
+ 'jquery',
+ 'base/js/utils',
+ 'notebook/js/quickhelp',
+ 'codemirror/lib/codemirror'
+], function(
+ _,
+ $,
+ utils,
+ quickhelp,
+ CodeMirror
+){
+ "use strict";
+ // This is essentially a duplicate of the quickhelp module, used to
+ // patch the existing quickhelp with definitions which aren't exported.
+
+ var platform = utils.platform;
+
+ var cmd_ctrl = 'Ctrl-';
+ var platform_specific;
+
+ if (platform === 'MacOS') {
+ // Mac OS X specific
+ cmd_ctrl = 'Cmd-';
+ platform_specific = [
+ { shortcut: "Cmd-Up", help:"go to cell start" },
+ { shortcut: "Cmd-Down", help:"go to cell end" },
+ { shortcut: "Alt-Left", help:"go one word left" },
+ { shortcut: "Alt-Right", help:"go one word right" },
+ { shortcut: "Alt-Backspace", help:"delete word before" },
+ { shortcut: "Alt-Delete", help:"delete word after" },
+ ];
+ } else {
+ // PC specific
+ platform_specific = [
+ { shortcut: "Ctrl-Home", help:"go to cell start" },
+ { shortcut: "Ctrl-Up", help:"go to cell start" },
+ { shortcut: "Ctrl-End", help:"go to cell end" },
+ { shortcut: "Ctrl-Down", help:"go to cell end" },
+ { shortcut: "Ctrl-Left", help:"go one word left" },
+ { shortcut: "Ctrl-Right", help:"go one word right" },
+ { shortcut: "Ctrl-Backspace", help:"delete word before" },
+ { shortcut: "Ctrl-Delete", help:"delete word after" },
+ ];
+ }
+
+ var cm_shortcuts = [
+ { shortcut:"Tab", help:"code completion or indent" },
+ { shortcut:"Shift-Tab", help:"tooltip" },
+ { shortcut: cmd_ctrl + "]", help:"indent" },
+ { shortcut: cmd_ctrl + "[", help:"dedent" },
+ { shortcut: cmd_ctrl + "a", help:"select all" },
+ { shortcut: cmd_ctrl + "z", help:"undo" },
+ { shortcut: cmd_ctrl + "Shift-z", help:"redo" },
+ { shortcut: cmd_ctrl + "y", help:"redo" },
+ ].concat( platform_specific );
+
+ var mac_humanize_map = {
+ // all these are unicode, will probably display badly on anything except macs.
+ // these are the standard symbol that are used in MacOS native menus
+ // cf http://apple.stackexchange.com/questions/55727/
+ // for htmlentities and/or unicode value
+ 'cmd':'⌘',
+ 'shift':'⇧',
+ 'alt':'⌥',
+ 'up':'↑',
+ 'down':'↓',
+ 'left':'←',
+ 'right':'→',
+ 'eject':'⏏',
+ 'tab':'⇥',
+ 'backtab':'⇤',
+ 'capslock':'⇪',
+ 'esc':'esc',
+ 'ctrl':'⌃',
+ 'enter':'↩',
+ 'pageup':'⇞',
+ 'pagedown':'⇟',
+ 'home':'↖',
+ 'end':'↘',
+ 'altenter':'⌤',
+ 'space':'␣',
+ 'delete':'⌦',
+ 'backspace':'⌫',
+ 'apple':'',
+ };
+
+ var default_humanize_map = {
+ 'shift':'Shift',
+ 'alt':'Alt',
+ 'up':'Up',
+ 'down':'Down',
+ 'left':'Left',
+ 'right':'Right',
+ 'tab':'Tab',
+ 'capslock':'Caps Lock',
+ 'esc':'Esc',
+ 'ctrl':'Ctrl',
+ 'enter':'Enter',
+ 'pageup':'Page Up',
+ 'pagedown':'Page Down',
+ 'home':'Home',
+ 'end':'End',
+ 'space':'Space',
+ 'backspace':'Backspace',
+ };
+
+ var humanize_map;
+
+ if (platform === 'MacOS'){
+ humanize_map = mac_humanize_map;
+ } else {
+ humanize_map = default_humanize_map;
+ }
+
+ var special_case = { pageup: "PageUp", pagedown: "Page Down", 'minus': '-' };
+
+ function humanize_key(key){
+ if (key.length === 1){
+ return key.toUpperCase();
+ }
+
+ key = humanize_map[key.toLowerCase()]||key;
+
+ if (key.indexOf(',') === -1){
+ return ( special_case[key] ? special_case[key] : key.charAt(0).toUpperCase() + key.slice(1) );
+ }
+ }
+
+ // return an **html** string of the keyboard shortcut
+ // for human eyes consumption.
+ // the sequence is a string, comma sepparated linkt of shortcut,
+ // where the shortcut is a list of dash-joined keys.
+ // Each shortcut will be wrapped in tag, and joined by comma is in a
+ // sequence.
+ //
+ // Depending on the platform each shortcut will be normalized, with or without dashes.
+ // and replace with the corresponding unicode symbol for modifier if necessary.
+ function humanize_sequence(sequence){
+ var joinchar = ',';
+ var hum = _.map(sequence.replace(/meta/g, 'cmd').split(','), humanize_shortcut).join(joinchar);
+ return hum;
+ }
+
+ function humanize_shortcut(shortcut){
+ var joinchar = '-';
+ if (platform === 'MacOS'){
+ joinchar = '';
+ }
+ var sh = _.map(shortcut.split('-'), humanize_key ).join(joinchar);
+ return ''+sh+' ';
+ }
+
+ var build_one = function (s) {
+ var help = s.help;
+ var shortcut = '';
+ if(s.shortcut){
+ shortcut = humanize_sequence(s.shortcut);
+ }
+ return $('').addClass('quickhelp').
+ append($('
').addClass('shortcut_key').append($(shortcut))).
+ append($('
').addClass('shortcut_descr').text(' : ' + help));
+
+ };
+
+ var build_div = function (title, shortcuts) {
+
+ // Remove jupyter-notebook:ignore shortcuts.
+ shortcuts = shortcuts.filter(function(shortcut) {
+ if (shortcut.help === 'ignore') {
+ return false;
+ } else {
+ return true;
+ }
+ });
+
+ var i, half, n;
+ var div = $('
').append($(title));
+ var sub_div = $('
').addClass('container-fluid');
+ var col1 = $('
').addClass('col-md-6');
+ var col2 = $('
').addClass('col-md-6');
+ n = shortcuts.length;
+ half = ~~(n/2); // Truncate :)
+ for (i=0; i
limit_output extension: Maximum message size for {message_type} of {limit_output_length} exceeded with {output_length} characters'
diff --git a/.local/share/jupyter/nbextensions/load_tex_macros/icon.png b/.local/share/jupyter/nbextensions/load_tex_macros/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..a4526ed8d14620aa80e04014e1f4494c32a72d0f
Binary files /dev/null and b/.local/share/jupyter/nbextensions/load_tex_macros/icon.png differ
diff --git a/.local/share/jupyter/nbextensions/load_tex_macros/main.js b/.local/share/jupyter/nbextensions/load_tex_macros/main.js
new file mode 100644
index 0000000000000000000000000000000000000000..2a5ce60485e6b65b19e6b1d7d98e28db54bc38c4
--- /dev/null
+++ b/.local/share/jupyter/nbextensions/load_tex_macros/main.js
@@ -0,0 +1,39 @@
+define(function(require, exports, module) {
+ var Jupyter = require('base/js/namespace');
+
+ function loadLatexUserDefs() {
+ $.get('latexdefs.tex').done(function(data) {
+ data = data.replace(/^/gm, '\$\$\$').replace(/$/gm, '\$\$\$');
+ if ($('#latexdefs').length > 0) $('#latexdefs').remove();
+ $('body').append($('
').attr('id', 'latexdefs').text(data));
+ console.log('latex_envs: loaded user LaTeX definitions latexdefs.tex');
+ }).fail(function() {
+ console.log('load_tex_macros: failed to load user LaTeX definitions latexdefs.tex')
+ });
+ }
+
+ function rerenderMaths() { // probably something like that
+ MathJax.Hub.Queue(
+ ["resetEquationNumbers",MathJax.InputJax.TeX],
+ ["PreProcess", MathJax.Hub],
+ ["Reprocess", MathJax.Hub]
+ );
+ }
+
+ function load_ipython_extension() {
+ "use strict";
+
+ if (Jupyter.notebook._fully_loaded) {
+ loadLatexUserDefs();
+ rerenderMaths();
+ } else {
+ $([Jupyter.events]).on("notebook_loaded.Notebook", function() {
+ loadLatexUserDefs();
+ rerenderMaths();
+ })
+ }
+ }
+ return {
+ load_ipython_extension: load_ipython_extension,
+ };
+})
diff --git a/.local/share/jupyter/nbextensions/load_tex_macros/readme.md b/.local/share/jupyter/nbextensions/load_tex_macros/readme.md
new file mode 100644
index 0000000000000000000000000000000000000000..4582a3fd0cbd6a8d59bda8db033bd76939121d27
--- /dev/null
+++ b/.local/share/jupyter/nbextensions/load_tex_macros/readme.md
@@ -0,0 +1,17 @@
+
+Purpose
+=======
+This extension loads a tex file whenever a notebook is loaded, then re-runs
+mathjax. It's useful if you have several notebooks that use a common set of latex
+macros, so you don't have to copy the macros to each notebook.
+
+Usage
+=====
+
+Simply put your latex macros in a file named latexdefs.tex, in the same directory as your notebook.
+
+
+Credit
+======
+
+This is derived entirely from the nbextension `jupyter_latex_envs`, with help from its author @jfbercher.
diff --git a/.local/share/jupyter/nbextensions/navigation-hotkeys/hotkeys.yaml b/.local/share/jupyter/nbextensions/navigation-hotkeys/hotkeys.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..91ce9ee0511fc73b3dfa8bd4a8b5fb32616bb22f
--- /dev/null
+++ b/.local/share/jupyter/nbextensions/navigation-hotkeys/hotkeys.yaml
@@ -0,0 +1,25 @@
+Type: IPython Notebook Extension
+Name: Navigation-Hotkeys
+Description: Additional hotkeys for easier navigation in the notebook
+Link: readme.md
+Icon: icon.png
+Main: main.js
+Compatibility: 4.x, 5.x
+Parameters:
+- name: toggle_enable_edit_shortcuts
+ description: Enable all edit shortcuts
+ input_type: checkbox
+ default: true
+- name: toggle_enable_command_shortcuts
+ description: Enable all command shortcuts
+ input_type: checkbox
+ default: true
+- name: toggle_enable_esc_shortcut
+ description: Enable Esc to enter Edit mode (so Esc toggles Edit/Command mode)
+ input_type: checkbox
+ default: true
+- name: toggle_enable_enter_shortcuts
+ description: Enable Enter keys to remain in Edit mode when currently in Edit mode
+ input_type: checkbox
+ default: true
+
diff --git a/.local/share/jupyter/nbextensions/nbTranslate/nbTranslate.yaml b/.local/share/jupyter/nbextensions/nbTranslate/nbTranslate.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..3432c01bc0efddcaa152dfde64a0264b1cf4c792
--- /dev/null
+++ b/.local/share/jupyter/nbextensions/nbTranslate/nbTranslate.yaml
@@ -0,0 +1,41 @@
+Type: IPython Notebook Extension
+Name: nbTranslate
+Description: Helps translate a notebook and/or select the display language.
+Link: README.md
+Main: main.js
+Compatibility: 4.x, 5.x
+Parameters:
+- name: nbTranslate.hotkey
+ description: Converts current cell
+ input_type: hotkey
+ default: 'Alt-T'
+- name: nbTranslate.useGoogleTranslate
+ description: |
+ Use Google translate engine
+ (it is advised to check the result); otherwise conversion will simply copy the current cell contents.
+ input_type: checkbox
+ default: true
+- name: nbTranslate.sourceLang
+ description: Source language for conversion; see the list of available languages here.
+ input_type: text
+ default: 'en'
+- name: nbTranslate.targetLang
+ description: Target language for conversion; see the list of available languages here.
+ input_type: text
+ default: 'fr'
+- name: nbTranslate.displayLangs
+ description: Displayed language(s) in the notebook; a list of languages, e.g. ['en', 'fr'] or ['*'] for all
+ input_type: list
+ list_element:
+ input_type: text
+ description: Displayed language(s) in the notebook; a list of languages, e.g. ['en', 'fr'] or ['*'] for all
+ default: ["en", "fr"]
+- name: nbTranslate.langInMainMenu
+ description: |
+ Dispay a menu for selecting languages to display (otherwise provides this
+ menu in the configuration toolbar).
+ input_type: checkbox
+ default: true
+
+
+
diff --git a/.local/share/jupyter/nbextensions/runtools/annotations.odg b/.local/share/jupyter/nbextensions/runtools/annotations.odg
new file mode 100644
index 0000000000000000000000000000000000000000..ffa9b9b58fdfcff2682a09ac7500d614395e4d44
Binary files /dev/null and b/.local/share/jupyter/nbextensions/runtools/annotations.odg differ
diff --git a/.local/share/jupyter/nbextensions/runtools/runtools_execute.png b/.local/share/jupyter/nbextensions/runtools/runtools_execute.png
new file mode 100644
index 0000000000000000000000000000000000000000..ed8e96c1d3cf35acf07b2d6e58c5b9aceb0cef01
Binary files /dev/null and b/.local/share/jupyter/nbextensions/runtools/runtools_execute.png differ
diff --git a/.local/share/jupyter/nbextensions/select_keymap/select_keymap.png b/.local/share/jupyter/nbextensions/select_keymap/select_keymap.png
new file mode 100644
index 0000000000000000000000000000000000000000..58367a2eb9693c74f20ae08e3c240702097dce7f
Binary files /dev/null and b/.local/share/jupyter/nbextensions/select_keymap/select_keymap.png differ
diff --git a/.local/share/jupyter/nbextensions/skip-traceback/readme.md b/.local/share/jupyter/nbextensions/skip-traceback/readme.md
new file mode 100644
index 0000000000000000000000000000000000000000..a40f50c13ff7d71fb29ac9c559d4c399b7c96574
--- /dev/null
+++ b/.local/share/jupyter/nbextensions/skip-traceback/readme.md
@@ -0,0 +1,80 @@
+Skip traceback
+==============
+
+This nbextension hides error tracebacks, displaying instead a summary of the
+error name and type. Clicking the summary displays the whole traceback.
+
+
+Example
+-------
+
+With normal traceback:
+
+
+
+With nbextension enabled:
+
+
+
+
+
+Using the (optional) toolbar button, you can show or hide all tracebacks in the
+notebook at once.
+
+
+Options
+-------
+
+The nbextension provides a few options, the values of which are stored in the
+notebook section of the nbconfig. The easiest way to configure these is using
+the
+[jupyter_nbextensions_configurator](https://github.com/Jupyter-contrib/jupyter_nbextensions_configurator)
+serverextension, but you can also configure them directly with a few lines of
+python.
+
+The available options are:
+
+* `skip-traceback.animation_duration` - duration (in milliseconds) of the
+ show/hide traceback animations. Defaults to `100`.
+
+* `skip-traceback.button_icon` - a
+ [fontawesome](https://fontawesome.com/icons)
+ class name, used for the action and toolbar button.
+ Defaults to `fa-warning`.
+
+* `skip-traceback.show_copy_buttons` - add buttons to headings to copy the
+ full traceback to the clipboard. Defaults to `true`.
+
+* `skip-traceback.use_toolbar_button` - add a button to the toolbar which can
+ be used to toggle on or off the contracted display of all cells' tracebacks.
+ Defaults to `false`.
+
+* `skip-traceback.enable` - enable collapsing the tracebacks on loading the
+ nbextension. Defaults to `true`
+
+
+For example, to set the animation time to half a second, and enable adding the
+toolbar button, we can use the following python snippet:
+
+```python
+from notebook.services.config import ConfigManager
+cm = ConfigManager()
+cm.update("notebook", {"skip-traceback": {
+ "animation_duration": 500,
+ "use_toolbar_button": True,
+}})
+```
+
+
+Internals
+---------
+
+This extensions works by overriding the `OutputArea.prototype.append_error`
+function to add a header above the error text, which can be used to show or
+hide the traceback.
+
+On loading the extension, only outputs added to cells after the `append_error`
+method has been patched are initially affected. In order to apply the collapse
+to pre-existing outputs, the nbextension loops through existing uncollapsed
+tracebacks, storing them to json, clearing them, then restoring them from the
+saved json.
diff --git a/.local/share/jupyter/nbextensions/snippets_menu/snippets_submenus_python/astropy.js b/.local/share/jupyter/nbextensions/snippets_menu/snippets_submenus_python/astropy.js
new file mode 100644
index 0000000000000000000000000000000000000000..810cbc27819cf2389fc7e50b13088fb4ffba15ad
--- /dev/null
+++ b/.local/share/jupyter/nbextensions/snippets_menu/snippets_submenus_python/astropy.js
@@ -0,0 +1,164 @@
+define({
+ 'name' : 'Astropy',
+ 'sub-menu' : [
+ {
+ 'name' : 'Constants',
+ 'sub-menu' : [
+ {
+ 'name' : 'Setup',
+ 'snippet' : ['import astropy.constants'],
+ },
+ '---',
+ {
+ 'name' : 'Extracting value',
+ 'snippet' : ['astropy.constants.G.value'],
+ },
+ {
+ 'name' : 'Extracting units',
+ 'snippet' : ['astropy.constants.G.unit'],
+ },
+ {
+ 'name' : 'Extracting uncertainty',
+ 'snippet' : ['astropy.constants.G.uncertainty'],
+ },
+ {
+ 'name' : 'Converting to SI',
+ 'snippet' : ['astropy.constants.G.si'],
+ },
+ {
+ 'name' : 'Converting to cgs',
+ 'snippet' : ['astropy.constants.G.cgs'],
+ },
+ '---',
+ {
+ 'name' : 'Gravitational constant [\\(\\mathrm{m}^3 / (\\mathrm{kg}\\, \\mathrm{s}^2)\\)]',
+ 'snippet' : ['astropy.constants.G',],
+ },
+ {
+ 'name' : 'Solar luminosity [\\(\\mathrm{W}\\)]',
+ 'snippet' : ['astropy.constants.L_sun',],
+ },
+ {
+ 'name' : 'Earth mass [\\(\\mathrm{kg}\\)]',
+ 'snippet' : ['astropy.constants.M_earth',],
+ },
+ {
+ 'name' : 'Jupiter mass [\\(\\mathrm{kg}\\)]',
+ 'snippet' : ['astropy.constants.M_jup',],
+ },
+ {
+ 'name' : 'Solar mass [\\(\\mathrm{kg}\\)]',
+ 'snippet' : ['astropy.constants.M_sun',],
+ },
+ {
+ 'name' : 'Avogadro’s number [\\(1 / \\mathrm{mol}\\)]',
+ 'snippet' : ['astropy.constants.N_A',],
+ },
+ {
+ 'name' : 'Gas constant [\\(\\mathrm{J} / (\\mathrm{K}\\, \\mathrm{mol})\\)]',
+ 'snippet' : ['astropy.constants.R',],
+ },
+ {
+ 'name' : 'Earth equatorial radius [\\(\\mathrm{m}\\)]',
+ 'snippet' : ['astropy.constants.R_earth',],
+ },
+ {
+ 'name' : 'Jupiter equatorial radius [\\(\\mathrm{m}\\)]',
+ 'snippet' : ['astropy.constants.R_jup',],
+ },
+ {
+ 'name' : 'Solar radius [\\(\\mathrm{m}\\)]',
+ 'snippet' : ['astropy.constants.R_sun',],
+ },
+ {
+ 'name' : 'Rydberg constant [\\(1 / \\mathrm{m}\\)]',
+ 'snippet' : ['astropy.constants.Ryd',],
+ },
+ {
+ 'name' : 'Bohr radius [\\(\\mathrm{m}\\)]',
+ 'snippet' : ['astropy.constants.a0',],
+ },
+ {
+ 'name' : 'Fine-structure constant (dimensionless)',
+ 'snippet' : ['astropy.constants.alpha',],
+ },
+ {
+ 'name' : 'Atmosphere [\\(\\mathrm{Pa}\\)]',
+ 'snippet' : ['astropy.constants.atmosphere',],
+ },
+ {
+ 'name' : 'Astronomical Unit [\\(\\mathrm{m}\\)]',
+ 'snippet' : ['astropy.constants.au',],
+ },
+ {
+ 'name' : 'Wien wavelength displacement law constant [\\(\\mathrm{m}\\, \\mathrm{K}\\)]',
+ 'snippet' : ['astropy.constants.b_wien',],
+ },
+ {
+ 'name' : 'Speed of light in vacuum [\\(\\mathrm{m} / \\mathrm{s}\\)]',
+ 'snippet' : ['astropy.constants.c',],
+ },
+ {
+ 'name' : 'Electron charge [\\(\\mathrm{C}\\)]',
+ 'snippet' : ['astropy.constants.e',],
+ },
+ {
+ 'name' : 'Electric constant [\\(\\mathrm{F}/\\mathrm{m}\\)]',
+ 'snippet' : ['astropy.constants.eps0',],
+ },
+ {
+ 'name' : 'Standard acceleration of gravity [\\(\\mathrm{m} / \\mathrm{s}^2\\)]',
+ 'snippet' : ['astropy.constants.g0',],
+ },
+ {
+ 'name' : 'Planck constant [\\(\\mathrm{J}\\, \\mathrm{s}\\)]',
+ 'snippet' : ['astropy.constants.h',],
+ },
+ {
+ 'name' : 'Reduced Planck constant [\\(\\mathrm{J}\\, \\mathrm{s}\\)]',
+ 'snippet' : ['astropy.constants.hbar',],
+ },
+ {
+ 'name' : 'Boltzmann constant [\\(\\mathrm{J} / \\mathrm{K}\\)]',
+ 'snippet' : ['astropy.constants.k_B',],
+ },
+ {
+ 'name' : 'Kiloparsec [\\(\\mathrm{m}\\)]',
+ 'snippet' : ['astropy.constants.kpc',],
+ },
+ {
+ 'name' : 'Electron mass [\\(\\mathrm{kg}\\)]',
+ 'snippet' : ['astropy.constants.m_e',],
+ },
+ {
+ 'name' : 'Neutron mass [\\(\\mathrm{kg}\\)]',
+ 'snippet' : ['astropy.constants.m_n',],
+ },
+ {
+ 'name' : 'Proton mass [\\(\\mathrm{kg}\\)]',
+ 'snippet' : ['astropy.constants.m_p',],
+ },
+ {
+ 'name' : 'Magnetic constant [\\(\\mathrm{N}/\\mathrm{A}^2\\)]',
+ 'snippet' : ['astropy.constants.mu0',],
+ },
+ {
+ 'name' : 'Bohr magneton [\\(\\mathrm{J}/\\mathrm{T}\\)]',
+ 'snippet' : ['astropy.constants.muB',],
+ },
+ {
+ 'name' : 'Parsec [\\(\\mathrm{m}\\)]',
+ 'snippet' : ['astropy.constants.pc',],
+ },
+ {
+ 'name' : 'Stefan-Boltzmann constant [\\(\\mathrm{W} / (\\mathrm{K}^4\\, \\mathrm{m}^2)\\)]',
+ 'snippet' : ['astropy.constants.sigma_sb',],
+ },
+ {
+ 'name' : 'Atomic mass [\\(\\mathrm{kg}\\)]',
+ 'snippet' : ['astropy.constants.u',],
+ },
+ ],
+ },
+ ],
+});
diff --git a/.triton/dump/4a587ee49c44b4c47e51f28541749625/triton_.cubin b/.triton/dump/4a587ee49c44b4c47e51f28541749625/triton_.cubin
new file mode 100644
index 0000000000000000000000000000000000000000..d385114f5d46978ad1214efd356d52f20c686830
Binary files /dev/null and b/.triton/dump/4a587ee49c44b4c47e51f28541749625/triton_.cubin differ
diff --git a/.triton/dump/4a587ee49c44b4c47e51f28541749625/triton_.llir b/.triton/dump/4a587ee49c44b4c47e51f28541749625/triton_.llir
new file mode 100644
index 0000000000000000000000000000000000000000..9917c6d4a078a983b8356f1ab30ba05a8ca60554
--- /dev/null
+++ b/.triton/dump/4a587ee49c44b4c47e51f28541749625/triton_.llir
@@ -0,0 +1,213 @@
+; ModuleID = 'LLVMDialectModule'
+source_filename = "LLVMDialectModule"
+
+define void @triton__0d1d2d3d4de(ptr addrspace(1) %0, ptr addrspace(1) %1, ptr addrspace(1) %2, ptr addrspace(1) %3, i32 %4) local_unnamed_addr !dbg !5 {
+ %6 = tail call i32 @llvm.nvvm.read.ptx.sreg.tid.x(), !dbg !8
+ %7 = shl i32 %6, 3, !dbg !8
+ %8 = and i32 %7, 1016, !dbg !8
+ %9 = tail call i32 asm "mov.u32 $0, %ctaid.x;", "=r"() #1, !dbg !9
+ %10 = shl i32 %9, 10, !dbg !10
+ %11 = or i32 %10, %8, !dbg !11
+ %.frozen = freeze i32 %11
+ %12 = sdiv i32 %.frozen, 256, !dbg !12
+ %13 = srem i32 %12, 3, !dbg !13
+ %14 = mul i32 %12, 256
+ %.decomposed = sub i32 %.frozen, %14
+ %15 = sdiv i32 %11, 768, !dbg !14
+ %16 = shl nsw i32 %15, 8, !dbg !15
+ %17 = add nsw i32 %16, %.decomposed, !dbg !16
+ %18 = sext i32 %17 to i64, !dbg !17
+ %19 = getelementptr i16, ptr addrspace(1) %0, i64 %18, !dbg !17
+ %20 = tail call { i32, i32, i32, i32 } asm sideeffect "mov.u32 $0, 0x0;\0A\09mov.u32 $1, 0x0;\0A\09mov.u32 $2, 0x0;\0A\09mov.u32 $3, 0x0;\0A\09@$5 ld.global.L1::evict_last.v4.b32 { $0, $1, $2, $3 }, [ $4 + 0 ];", "=r,=r,=r,=r,l,b"(ptr addrspace(1) %19, i1 true) #1, !dbg !18
+ %21 = extractvalue { i32, i32, i32, i32 } %20, 0, !dbg !18
+ %22 = extractvalue { i32, i32, i32, i32 } %20, 1, !dbg !18
+ %23 = extractvalue { i32, i32, i32, i32 } %20, 2, !dbg !18
+ %24 = extractvalue { i32, i32, i32, i32 } %20, 3, !dbg !18
+ %25 = trunc i32 %21 to i16, !dbg !18
+ %extelt.offset = lshr i32 %21, 16, !dbg !18
+ %26 = trunc i32 %extelt.offset to i16, !dbg !18
+ %27 = trunc i32 %22 to i16, !dbg !18
+ %extelt.offset1 = lshr i32 %22, 16, !dbg !18
+ %28 = trunc i32 %extelt.offset1 to i16, !dbg !18
+ %29 = trunc i32 %23 to i16, !dbg !18
+ %extelt.offset2 = lshr i32 %23, 16, !dbg !18
+ %30 = trunc i32 %extelt.offset2 to i16, !dbg !18
+ %31 = trunc i32 %24 to i16, !dbg !18
+ %extelt.offset3 = lshr i32 %24, 16, !dbg !18
+ %32 = trunc i32 %extelt.offset3 to i16, !dbg !18
+ %33 = tail call float asm "cvt.f32.bf16 $0, $1;", "=r,h"(i16 %25) #1, !dbg !19
+ %34 = tail call float asm "cvt.f32.bf16 $0, $1;", "=r,h"(i16 %26) #1, !dbg !19
+ %35 = tail call float asm "cvt.f32.bf16 $0, $1;", "=r,h"(i16 %27) #1, !dbg !19
+ %36 = tail call float asm "cvt.f32.bf16 $0, $1;", "=r,h"(i16 %28) #1, !dbg !19
+ %37 = tail call float asm "cvt.f32.bf16 $0, $1;", "=r,h"(i16 %29) #1, !dbg !19
+ %38 = tail call float asm "cvt.f32.bf16 $0, $1;", "=r,h"(i16 %30) #1, !dbg !19
+ %39 = tail call float asm "cvt.f32.bf16 $0, $1;", "=r,h"(i16 %31) #1, !dbg !19
+ %40 = tail call float asm "cvt.f32.bf16 $0, $1;", "=r,h"(i16 %32) #1, !dbg !19
+ %41 = getelementptr i16, ptr addrspace(1) %1, i64 %18, !dbg !20
+ %42 = tail call { i32, i32, i32, i32 } asm sideeffect "mov.u32 $0, 0x0;\0A\09mov.u32 $1, 0x0;\0A\09mov.u32 $2, 0x0;\0A\09mov.u32 $3, 0x0;\0A\09@$5 ld.global.L1::evict_last.v4.b32 { $0, $1, $2, $3 }, [ $4 + 0 ];", "=r,=r,=r,=r,l,b"(ptr addrspace(1) %41, i1 true) #1, !dbg !21
+ %43 = extractvalue { i32, i32, i32, i32 } %42, 0, !dbg !21
+ %44 = extractvalue { i32, i32, i32, i32 } %42, 1, !dbg !21
+ %45 = extractvalue { i32, i32, i32, i32 } %42, 2, !dbg !21
+ %46 = extractvalue { i32, i32, i32, i32 } %42, 3, !dbg !21
+ %47 = trunc i32 %43 to i16, !dbg !21
+ %extelt.offset4 = lshr i32 %43, 16, !dbg !21
+ %48 = trunc i32 %extelt.offset4 to i16, !dbg !21
+ %49 = trunc i32 %44 to i16, !dbg !21
+ %extelt.offset5 = lshr i32 %44, 16, !dbg !21
+ %50 = trunc i32 %extelt.offset5 to i16, !dbg !21
+ %51 = trunc i32 %45 to i16, !dbg !21
+ %extelt.offset6 = lshr i32 %45, 16, !dbg !21
+ %52 = trunc i32 %extelt.offset6 to i16, !dbg !21
+ %53 = trunc i32 %46 to i16, !dbg !21
+ %extelt.offset7 = lshr i32 %46, 16, !dbg !21
+ %54 = trunc i32 %extelt.offset7 to i16, !dbg !21
+ %55 = tail call float asm "cvt.f32.bf16 $0, $1;", "=r,h"(i16 %47) #1, !dbg !22
+ %56 = tail call float asm "cvt.f32.bf16 $0, $1;", "=r,h"(i16 %48) #1, !dbg !22
+ %57 = tail call float asm "cvt.f32.bf16 $0, $1;", "=r,h"(i16 %49) #1, !dbg !22
+ %58 = tail call float asm "cvt.f32.bf16 $0, $1;", "=r,h"(i16 %50) #1, !dbg !22
+ %59 = tail call float asm "cvt.f32.bf16 $0, $1;", "=r,h"(i16 %51) #1, !dbg !22
+ %60 = tail call float asm "cvt.f32.bf16 $0, $1;", "=r,h"(i16 %52) #1, !dbg !22
+ %61 = tail call float asm "cvt.f32.bf16 $0, $1;", "=r,h"(i16 %53) #1, !dbg !22
+ %62 = tail call float asm "cvt.f32.bf16 $0, $1;", "=r,h"(i16 %54) #1, !dbg !22
+ %63 = getelementptr i16, ptr addrspace(1) %2, i64 %18, !dbg !23
+ %64 = tail call { i32, i32, i32, i32 } asm sideeffect "mov.u32 $0, 0x0;\0A\09mov.u32 $1, 0x0;\0A\09mov.u32 $2, 0x0;\0A\09mov.u32 $3, 0x0;\0A\09@$5 ld.global.L1::evict_last.v4.b32 { $0, $1, $2, $3 }, [ $4 + 0 ];", "=r,=r,=r,=r,l,b"(ptr addrspace(1) %63, i1 true) #1, !dbg !24
+ %65 = extractvalue { i32, i32, i32, i32 } %64, 0, !dbg !24
+ %66 = extractvalue { i32, i32, i32, i32 } %64, 1, !dbg !24
+ %67 = extractvalue { i32, i32, i32, i32 } %64, 2, !dbg !24
+ %68 = extractvalue { i32, i32, i32, i32 } %64, 3, !dbg !24
+ %69 = trunc i32 %65 to i16, !dbg !24
+ %extelt.offset8 = lshr i32 %65, 16, !dbg !24
+ %70 = trunc i32 %extelt.offset8 to i16, !dbg !24
+ %71 = trunc i32 %66 to i16, !dbg !24
+ %extelt.offset9 = lshr i32 %66, 16, !dbg !24
+ %72 = trunc i32 %extelt.offset9 to i16, !dbg !24
+ %73 = trunc i32 %67 to i16, !dbg !24
+ %extelt.offset10 = lshr i32 %67, 16, !dbg !24
+ %74 = trunc i32 %extelt.offset10 to i16, !dbg !24
+ %75 = trunc i32 %68 to i16, !dbg !24
+ %extelt.offset11 = lshr i32 %68, 16, !dbg !24
+ %76 = trunc i32 %extelt.offset11 to i16, !dbg !24
+ %77 = tail call float asm "cvt.f32.bf16 $0, $1;", "=r,h"(i16 %69) #1, !dbg !25
+ %78 = tail call float asm "cvt.f32.bf16 $0, $1;", "=r,h"(i16 %70) #1, !dbg !25
+ %79 = tail call float asm "cvt.f32.bf16 $0, $1;", "=r,h"(i16 %71) #1, !dbg !25
+ %80 = tail call float asm "cvt.f32.bf16 $0, $1;", "=r,h"(i16 %72) #1, !dbg !25
+ %81 = tail call float asm "cvt.f32.bf16 $0, $1;", "=r,h"(i16 %73) #1, !dbg !25
+ %82 = tail call float asm "cvt.f32.bf16 $0, $1;", "=r,h"(i16 %74) #1, !dbg !25
+ %83 = tail call float asm "cvt.f32.bf16 $0, $1;", "=r,h"(i16 %75) #1, !dbg !25
+ %84 = tail call float asm "cvt.f32.bf16 $0, $1;", "=r,h"(i16 %76) #1, !dbg !25
+ %85 = icmp eq i32 %13, 2, !dbg !26
+ %86 = select i1 %85, float %33, float 0.000000e+00, !dbg !27
+ %87 = select i1 %85, float %34, float 0.000000e+00, !dbg !27
+ %88 = select i1 %85, float %35, float 0.000000e+00, !dbg !27
+ %89 = select i1 %85, float %36, float 0.000000e+00, !dbg !27
+ %90 = select i1 %85, float %37, float 0.000000e+00, !dbg !27
+ %91 = select i1 %85, float %38, float 0.000000e+00, !dbg !27
+ %92 = select i1 %85, float %39, float 0.000000e+00, !dbg !27
+ %93 = select i1 %85, float %40, float 0.000000e+00, !dbg !27
+ %94 = icmp eq i32 %13, 1, !dbg !28
+ %95 = select i1 %94, float %55, float 0.000000e+00, !dbg !29
+ %96 = select i1 %94, float %56, float 0.000000e+00, !dbg !29
+ %97 = select i1 %94, float %57, float 0.000000e+00, !dbg !29
+ %98 = select i1 %94, float %58, float 0.000000e+00, !dbg !29
+ %99 = select i1 %94, float %59, float 0.000000e+00, !dbg !29
+ %100 = select i1 %94, float %60, float 0.000000e+00, !dbg !29
+ %101 = select i1 %94, float %61, float 0.000000e+00, !dbg !29
+ %102 = select i1 %94, float %62, float 0.000000e+00, !dbg !29
+ %103 = fadd float %86, %95, !dbg !30
+ %104 = fadd float %87, %96, !dbg !30
+ %105 = fadd float %88, %97, !dbg !30
+ %106 = fadd float %89, %98, !dbg !30
+ %107 = fadd float %90, %99, !dbg !30
+ %108 = fadd float %91, %100, !dbg !30
+ %109 = fadd float %92, %101, !dbg !30
+ %110 = fadd float %93, %102, !dbg !30
+ %111 = icmp eq i32 %13, 0, !dbg !31
+ %112 = select i1 %111, float %77, float 0.000000e+00, !dbg !32
+ %113 = select i1 %111, float %78, float 0.000000e+00, !dbg !32
+ %114 = select i1 %111, float %79, float 0.000000e+00, !dbg !32
+ %115 = select i1 %111, float %80, float 0.000000e+00, !dbg !32
+ %116 = select i1 %111, float %81, float 0.000000e+00, !dbg !32
+ %117 = select i1 %111, float %82, float 0.000000e+00, !dbg !32
+ %118 = select i1 %111, float %83, float 0.000000e+00, !dbg !32
+ %119 = select i1 %111, float %84, float 0.000000e+00, !dbg !32
+ %120 = fadd float %103, %112, !dbg !33
+ %121 = fadd float %104, %113, !dbg !33
+ %122 = fadd float %105, %114, !dbg !33
+ %123 = fadd float %106, %115, !dbg !33
+ %124 = fadd float %107, %116, !dbg !33
+ %125 = fadd float %108, %117, !dbg !33
+ %126 = fadd float %109, %118, !dbg !33
+ %127 = fadd float %110, %119, !dbg !33
+ %128 = sext i32 %11 to i64, !dbg !34
+ %129 = getelementptr i16, ptr addrspace(1) %3, i64 %128, !dbg !34
+ %130 = tail call i16 asm "cvt.rn.bf16.f32 $0, $1;", "=h,r"(float %120) #1, !dbg !35
+ %131 = tail call i16 asm "cvt.rn.bf16.f32 $0, $1;", "=h,r"(float %121) #1, !dbg !35
+ %132 = tail call i16 asm "cvt.rn.bf16.f32 $0, $1;", "=h,r"(float %122) #1, !dbg !35
+ %133 = tail call i16 asm "cvt.rn.bf16.f32 $0, $1;", "=h,r"(float %123) #1, !dbg !35
+ %134 = tail call i16 asm "cvt.rn.bf16.f32 $0, $1;", "=h,r"(float %124) #1, !dbg !35
+ %135 = tail call i16 asm "cvt.rn.bf16.f32 $0, $1;", "=h,r"(float %125) #1, !dbg !35
+ %136 = tail call i16 asm "cvt.rn.bf16.f32 $0, $1;", "=h,r"(float %126) #1, !dbg !35
+ %137 = tail call i16 asm "cvt.rn.bf16.f32 $0, $1;", "=h,r"(float %127) #1, !dbg !35
+ %138 = insertelement <2 x i16> undef, i16 %130, i64 0, !dbg !35
+ %139 = insertelement <2 x i16> %138, i16 %131, i64 1, !dbg !35
+ %140 = bitcast <2 x i16> %139 to i32, !dbg !35
+ %141 = insertelement <2 x i16> undef, i16 %132, i64 0, !dbg !35
+ %142 = insertelement <2 x i16> %141, i16 %133, i64 1, !dbg !35
+ %143 = bitcast <2 x i16> %142 to i32, !dbg !35
+ %144 = insertelement <2 x i16> undef, i16 %134, i64 0, !dbg !35
+ %145 = insertelement <2 x i16> %144, i16 %135, i64 1, !dbg !35
+ %146 = bitcast <2 x i16> %145 to i32, !dbg !35
+ %147 = insertelement <2 x i16> undef, i16 %136, i64 0, !dbg !35
+ %148 = insertelement <2 x i16> %147, i16 %137, i64 1, !dbg !35
+ %149 = bitcast <2 x i16> %148 to i32, !dbg !35
+ tail call void asm sideeffect "@$5 st.global.v4.b32 [ $4 + 0 ], { $0, $1, $2, $3 };", "r,r,r,r,l,b"(i32 %140, i32 %143, i32 %146, i32 %149, ptr addrspace(1) %129, i1 true) #1, !dbg !35
+ ret void, !dbg !36
+}
+
+; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
+declare noundef i32 @llvm.nvvm.read.ptx.sreg.tid.x() #0
+
+attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
+attributes #1 = { nounwind }
+
+!llvm.module.flags = !{!0}
+!llvm.dbg.cu = !{!1}
+!nvvm.annotations = !{!3, !4, !4, !3}
+
+!0 = !{i32 2, !"Debug Info Version", i32 3}
+!1 = distinct !DICompileUnit(language: DW_LANG_C, file: !2, producer: "triton", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug)
+!2 = !DIFile(filename: "c63r7iurwk5ydlswh7rvhcmlx2cfretlrewgw6tljlursshgtfpp.py", directory: "/tmp/torchinductor_root/63")
+!3 = !{ptr @triton__0d1d2d3d4de, !"kernel", i32 1}
+!4 = !{ptr @triton__0d1d2d3d4de, !"maxntidx", i32 128}
+!5 = distinct !DISubprogram(name: "triton__0d1d2d3d4de", linkageName: "triton__0d1d2d3d4de", scope: !2, file: !2, line: 18, type: !6, scopeLine: 18, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !1)
+!6 = !DISubroutineType(cc: DW_CC_normal, types: !7)
+!7 = !{}
+!8 = !DILocation(line: 21, column: 36, scope: !5)
+!9 = !DILocation(line: 20, column: 28, scope: !5)
+!10 = !DILocation(line: 20, column: 33, scope: !5)
+!11 = !DILocation(line: 21, column: 23, scope: !5)
+!12 = !DILocation(line: 23, column: 20, scope: !5)
+!13 = !DILocation(line: 23, column: 27, scope: !5)
+!14 = !DILocation(line: 25, column: 20, scope: !5)
+!15 = !DILocation(line: 27, column: 40, scope: !5)
+!16 = !DILocation(line: 27, column: 36, scope: !5)
+!17 = !DILocation(line: 27, column: 30, scope: !5)
+!18 = !DILocation(line: 27, column: 46, scope: !5)
+!19 = !DILocation(line: 27, column: 85, scope: !5)
+!20 = !DILocation(line: 28, column: 30, scope: !5)
+!21 = !DILocation(line: 28, column: 46, scope: !5)
+!22 = !DILocation(line: 28, column: 85, scope: !5)
+!23 = !DILocation(line: 29, column: 31, scope: !5)
+!24 = !DILocation(line: 29, column: 47, scope: !5)
+!25 = !DILocation(line: 29, column: 86, scope: !5)
+!26 = !DILocation(line: 32, column: 19, scope: !5)
+!27 = !DILocation(line: 34, column: 32, scope: !5)
+!28 = !DILocation(line: 36, column: 19, scope: !5)
+!29 = !DILocation(line: 37, column: 32, scope: !5)
+!30 = !DILocation(line: 38, column: 19, scope: !5)
+!31 = !DILocation(line: 40, column: 20, scope: !5)
+!32 = !DILocation(line: 41, column: 35, scope: !5)
+!33 = !DILocation(line: 42, column: 20, scope: !5)
+!34 = !DILocation(line: 43, column: 25, scope: !5)
+!35 = !DILocation(line: 43, column: 37, scope: !5)
+!36 = !DILocation(line: 43, column: 4, scope: !5)
diff --git a/.triton/dump/4a587ee49c44b4c47e51f28541749625/triton_.ttgir b/.triton/dump/4a587ee49c44b4c47e51f28541749625/triton_.ttgir
new file mode 100644
index 0000000000000000000000000000000000000000..3c8b2ef5c73c4e05f533c82569bbce567f1c8df6
--- /dev/null
+++ b/.triton/dump/4a587ee49c44b4c47e51f28541749625/triton_.ttgir
@@ -0,0 +1,49 @@
+#blocked = #triton_gpu.blocked<{sizePerThread = [8], threadsPerWarp = [32], warpsPerCTA = [4], order = [0], CTAsPerCGA = [1], CTASplitNum = [1], CTAOrder = [0]}>
+module attributes {"triton_gpu.compute-capability" = 89 : i32, "triton_gpu.num-ctas" = 1 : i32, "triton_gpu.num-warps" = 4 : i32, "triton_gpu.threads-per-warp" = 32 : i32} {
+ tt.func public @triton__0d1d2d3d4de(%arg0: !tt.ptr {tt.divisibility = 16 : i32}, %arg1: !tt.ptr {tt.divisibility = 16 : i32}, %arg2: !tt.ptr {tt.divisibility = 16 : i32}, %arg3: !tt.ptr {tt.divisibility = 16 : i32}, %arg4: i32 {tt.divisibility = 16 : i32, tt.max_divisibility = 16 : i32}) attributes {noinline = false} {
+ %cst = arith.constant dense<256> : tensor<1024xi32, #blocked>
+ %cst_0 = arith.constant dense<3> : tensor<1024xi32, #blocked>
+ %cst_1 = arith.constant dense<768> : tensor<1024xi32, #blocked>
+ %cst_2 = arith.constant dense<2> : tensor<1024xi32, #blocked>
+ %cst_3 = arith.constant dense<0> : tensor<1024xi32, #blocked>
+ %cst_4 = arith.constant dense<1> : tensor<1024xi32, #blocked>
+ %cst_5 = arith.constant dense<0.000000e+00> : tensor<1024xf32, #blocked>
+ %c1024_i32 = arith.constant 1024 : i32
+ %0 = tt.get_program_id x : i32
+ %1 = arith.muli %0, %c1024_i32 : i32
+ %2 = tt.make_range {end = 1024 : i32, start = 0 : i32} : tensor<1024xi32, #blocked>
+ %3 = tt.splat %1 : (i32) -> tensor<1024xi32, #blocked>
+ %4 = arith.addi %3, %2 : tensor<1024xi32, #blocked>
+ %5 = arith.divsi %4, %cst : tensor<1024xi32, #blocked>
+ %6 = arith.remsi %5, %cst_0 : tensor<1024xi32, #blocked>
+ %7 = arith.remsi %4, %cst : tensor<1024xi32, #blocked>
+ %8 = arith.divsi %4, %cst_1 : tensor<1024xi32, #blocked>
+ %9 = arith.muli %8, %cst : tensor<1024xi32, #blocked>
+ %10 = arith.addi %7, %9 : tensor<1024xi32, #blocked>
+ %11 = tt.splat %arg0 : (!tt.ptr) -> tensor<1024x!tt.ptr, #blocked>
+ %12 = tt.addptr %11, %10 : tensor<1024x!tt.ptr, #blocked>, tensor<1024xi32, #blocked>
+ %13 = tt.load %12 {cache = 1 : i32, evict = 3 : i32, isVolatile = false} : tensor<1024xbf16, #blocked>
+ %14 = arith.extf %13 : tensor<1024xbf16, #blocked> to tensor<1024xf32, #blocked>
+ %15 = tt.splat %arg1 : (!tt.ptr) -> tensor<1024x!tt.ptr, #blocked>
+ %16 = tt.addptr %15, %10 : tensor<1024x!tt.ptr, #blocked>, tensor<1024xi32, #blocked>
+ %17 = tt.load %16 {cache = 1 : i32, evict = 3 : i32, isVolatile = false} : tensor<1024xbf16, #blocked>
+ %18 = arith.extf %17 : tensor<1024xbf16, #blocked> to tensor<1024xf32, #blocked>
+ %19 = tt.splat %arg2 : (!tt.ptr) -> tensor<1024x!tt.ptr, #blocked>
+ %20 = tt.addptr %19, %10 : tensor<1024x!tt.ptr, #blocked>, tensor<1024xi32, #blocked>
+ %21 = tt.load %20 {cache = 1 : i32, evict = 3 : i32, isVolatile = false} : tensor<1024xbf16, #blocked>
+ %22 = arith.extf %21 : tensor<1024xbf16, #blocked> to tensor<1024xf32, #blocked>
+ %23 = arith.cmpi eq, %6, %cst_2 : tensor<1024xi32, #blocked>
+ %24 = arith.select %23, %14, %cst_5 : tensor<1024xi1, #blocked>, tensor<1024xf32, #blocked>
+ %25 = arith.cmpi eq, %6, %cst_4 : tensor<1024xi32, #blocked>
+ %26 = arith.select %25, %18, %cst_5 : tensor<1024xi1, #blocked>, tensor<1024xf32, #blocked>
+ %27 = arith.addf %24, %26 : tensor<1024xf32, #blocked>
+ %28 = arith.cmpi eq, %6, %cst_3 : tensor<1024xi32, #blocked>
+ %29 = arith.select %28, %22, %cst_5 : tensor<1024xi1, #blocked>, tensor<1024xf32, #blocked>
+ %30 = arith.addf %27, %29 : tensor<1024xf32, #blocked>
+ %31 = tt.splat %arg3 : (!tt.ptr) -> tensor<1024x!tt.ptr, #blocked>
+ %32 = tt.addptr %31, %4 : tensor<1024x!tt.ptr, #blocked>, tensor<1024xi32, #blocked>
+ %33 = arith.truncf %30 : tensor<1024xf32, #blocked> to tensor<1024xbf16, #blocked>
+ tt.store %32, %33 {cache = 1 : i32, evict = 1 : i32} : tensor<1024xbf16, #blocked>
+ tt.return
+ }
+}
diff --git a/.triton/dump/4a587ee49c44b4c47e51f28541749625/triton_.ttir b/.triton/dump/4a587ee49c44b4c47e51f28541749625/triton_.ttir
new file mode 100644
index 0000000000000000000000000000000000000000..18d33fd002d6b0713d3c72706db439971dc43086
--- /dev/null
+++ b/.triton/dump/4a587ee49c44b4c47e51f28541749625/triton_.ttir
@@ -0,0 +1,48 @@
+module {
+ tt.func public @triton__0d1d2d3d4de(%arg0: !tt.ptr {tt.divisibility = 16 : i32}, %arg1: !tt.ptr {tt.divisibility = 16 : i32}, %arg2: !tt.ptr {tt.divisibility = 16 : i32}, %arg3: !tt.ptr {tt.divisibility = 16 : i32}, %arg4: i32 {tt.divisibility = 16 : i32, tt.max_divisibility = 16 : i32}) attributes {noinline = false} {
+ %cst = arith.constant dense<0> : tensor<1024xi32>
+ %cst_0 = arith.constant dense<1> : tensor<1024xi32>
+ %cst_1 = arith.constant dense<0.000000e+00> : tensor<1024xf32>
+ %cst_2 = arith.constant dense<2> : tensor<1024xi32>
+ %cst_3 = arith.constant dense<768> : tensor<1024xi32>
+ %cst_4 = arith.constant dense<3> : tensor<1024xi32>
+ %cst_5 = arith.constant dense<256> : tensor<1024xi32>
+ %c1024_i32 = arith.constant 1024 : i32
+ %0 = tt.get_program_id x : i32
+ %1 = arith.muli %0, %c1024_i32 : i32
+ %2 = tt.make_range {end = 1024 : i32, start = 0 : i32} : tensor<1024xi32>
+ %3 = tt.splat %1 : (i32) -> tensor<1024xi32>
+ %4 = arith.addi %3, %2 : tensor<1024xi32>
+ %5 = arith.divsi %4, %cst_5 : tensor<1024xi32>
+ %6 = arith.remsi %5, %cst_4 : tensor<1024xi32>
+ %7 = arith.remsi %4, %cst_5 : tensor<1024xi32>
+ %8 = arith.divsi %4, %cst_3 : tensor<1024xi32>
+ %9 = arith.muli %8, %cst_5 : tensor<1024xi32>
+ %10 = arith.addi %7, %9 : tensor<1024xi32>
+ %11 = tt.splat %arg0 : (!tt.ptr) -> tensor<1024x!tt.ptr>
+ %12 = tt.addptr %11, %10 : tensor<1024x!tt.ptr>, tensor<1024xi32>
+ %13 = tt.load %12 {cache = 1 : i32, evict = 3 : i32, isVolatile = false} : tensor<1024xbf16>
+ %14 = arith.extf %13 : tensor<1024xbf16> to tensor<1024xf32>
+ %15 = tt.splat %arg1 : (!tt.ptr) -> tensor<1024x!tt.ptr>
+ %16 = tt.addptr %15, %10 : tensor<1024x!tt.ptr>, tensor<1024xi32>
+ %17 = tt.load %16 {cache = 1 : i32, evict = 3 : i32, isVolatile = false} : tensor<1024xbf16>
+ %18 = arith.extf %17 : tensor<1024xbf16> to tensor<1024xf32>
+ %19 = tt.splat %arg2 : (!tt.ptr) -> tensor<1024x!tt.ptr>
+ %20 = tt.addptr %19, %10 : tensor<1024x!tt.ptr>, tensor<1024xi32>
+ %21 = tt.load %20 {cache = 1 : i32, evict = 3 : i32, isVolatile = false} : tensor<1024xbf16>
+ %22 = arith.extf %21 : tensor<1024xbf16> to tensor<1024xf32>
+ %23 = arith.cmpi eq, %6, %cst_2 : tensor<1024xi32>
+ %24 = arith.select %23, %14, %cst_1 : tensor<1024xi1>, tensor<1024xf32>
+ %25 = arith.cmpi eq, %6, %cst_0 : tensor<1024xi32>
+ %26 = arith.select %25, %18, %cst_1 : tensor<1024xi1>, tensor<1024xf32>
+ %27 = arith.addf %24, %26 : tensor<1024xf32>
+ %28 = arith.cmpi eq, %6, %cst : tensor<1024xi32>
+ %29 = arith.select %28, %22, %cst_1 : tensor<1024xi1>, tensor<1024xf32>
+ %30 = arith.addf %27, %29 : tensor<1024xf32>
+ %31 = tt.splat %arg3 : (!tt.ptr) -> tensor<1024x!tt.ptr>
+ %32 = tt.addptr %31, %4 : tensor<1024x!tt.ptr>, tensor<1024xi32>
+ %33 = arith.truncf %30 : tensor<1024xf32> to tensor<1024xbf16>
+ tt.store %32, %33 {cache = 1 : i32, evict = 1 : i32} : tensor<1024xbf16>
+ tt.return
+ }
+}
diff --git a/.triton/dump/63ac7476060ddeef758fa13ad6ed58f5/triton_.cubin b/.triton/dump/63ac7476060ddeef758fa13ad6ed58f5/triton_.cubin
new file mode 100644
index 0000000000000000000000000000000000000000..4d65443f3ad878f42e8aa27de5dbeaafc39b78ed
Binary files /dev/null and b/.triton/dump/63ac7476060ddeef758fa13ad6ed58f5/triton_.cubin differ
diff --git a/.triton/dump/63ac7476060ddeef758fa13ad6ed58f5/triton_.ptx b/.triton/dump/63ac7476060ddeef758fa13ad6ed58f5/triton_.ptx
new file mode 100644
index 0000000000000000000000000000000000000000..ba059a54f10f929ebe91557a7994d0ecf5eced50
--- /dev/null
+++ b/.triton/dump/63ac7476060ddeef758fa13ad6ed58f5/triton_.ptx
@@ -0,0 +1,709 @@
+//
+// Generated by LLVM NVPTX Back-End
+//
+
+.version 8.2
+.target sm_89
+.address_size 64
+
+ // .globl triton__0d1d2d3d4d5d6de7de
+.extern .shared .align 1 .b8 global_smem[];
+
+.visible .entry triton__0d1d2d3d4d5d6de7de(
+ .param .u64 triton__0d1d2d3d4d5d6de7de_param_0,
+ .param .u64 triton__0d1d2d3d4d5d6de7de_param_1,
+ .param .u64 triton__0d1d2d3d4d5d6de7de_param_2,
+ .param .u64 triton__0d1d2d3d4d5d6de7de_param_3,
+ .param .u64 triton__0d1d2d3d4d5d6de7de_param_4,
+ .param .u64 triton__0d1d2d3d4d5d6de7de_param_5,
+ .param .u32 triton__0d1d2d3d4d5d6de7de_param_6,
+ .param .u32 triton__0d1d2d3d4d5d6de7de_param_7
+)
+.maxntid 64, 1, 1
+{
+ .reg .pred %p<33>;
+ .reg .b16 %rs<9>;
+ .reg .b32 %r<106>;
+ .reg .f32 %f<73>;
+ .reg .b64 %rd<21>;
+ .loc 1 18 0
+$L__func_begin0:
+ .loc 1 18 0
+
+ ld.param.u64 %rd11, [triton__0d1d2d3d4d5d6de7de_param_0];
+ ld.param.u64 %rd12, [triton__0d1d2d3d4d5d6de7de_param_1];
+$L__tmp0:
+ .loc 1 26 26
+ mov.u32 %r72, %tid.x;
+ and.b32 %r73, %r72, 31;
+ ld.param.u64 %rd13, [triton__0d1d2d3d4d5d6de7de_param_2];
+ ld.param.u64 %rd14, [triton__0d1d2d3d4d5d6de7de_param_3];
+ ld.param.u64 %rd15, [triton__0d1d2d3d4d5d6de7de_param_4];
+ shl.b32 %r74, %r72, 2;
+ ld.param.u64 %rd16, [triton__0d1d2d3d4d5d6de7de_param_5];
+ and.b32 %r75, %r74, 252;
+ .loc 1 23 28
+ mov.u32 %r1, %ctaid.x;
+ .loc 1 30 40
+ shl.b32 %r76, %r1, 8;
+ .loc 1 30 36
+ or.b32 %r77, %r76, %r75;
+ .loc 1 30 30
+ mul.wide.s32 %rd17, %r77, 2;
+ add.s64 %rd1, %rd12, %rd17;
+ mov.b32 %r4, 0;
+ mov.pred %p1, -1;
+ .loc 1 30 46
+ mov.u32 %r2, 0x0;
+ mov.u32 %r3, 0x0;
+ @%p1 ld.global.v2.b32 { %r2, %r3 }, [ %rd1 + 0 ];
+ @!%p1 mov.u32 %r2, %r4;
+ @!%p1 mov.u32 %r3, %r4;
+ cvt.u16.u32 %rs1, %r2;
+ { .reg .b16 tmp; mov.b32 {tmp, %rs2}, %r2; }
+ cvt.u16.u32 %rs3, %r3;
+ { .reg .b16 tmp; mov.b32 {tmp, %rs4}, %r3; }
+ .loc 1 30 67
+ cvt.f32.bf16 %r6, %rs1;
+ mov.b32 %f1, %r6;
+ cvt.f32.bf16 %r7, %rs2;
+ mov.b32 %f2, %r7;
+ cvt.f32.bf16 %r8, %rs3;
+ mov.b32 %f3, %r8;
+ cvt.f32.bf16 %r9, %rs4;
+ mov.b32 %f4, %r9;
+ .loc 1 31 30
+ mul.wide.u32 %rd18, %r75, 4;
+ add.s64 %rd2, %rd13, %rd18;
+ .loc 1 31 35
+ mov.u32 %r10, 0x0;
+ mov.u32 %r11, 0x0;
+ mov.u32 %r12, 0x0;
+ mov.u32 %r13, 0x0;
+ @%p1 ld.global.L1::evict_last.v4.b32 { %r10, %r11, %r12, %r13 }, [ %rd2 + 0 ];
+ @!%p1 mov.u32 %r10, %r4;
+ @!%p1 mov.u32 %r11, %r4;
+ @!%p1 mov.u32 %r12, %r4;
+ @!%p1 mov.u32 %r13, %r4;
+ mov.b32 %f5, %r10;
+ mov.b32 %f6, %r11;
+ mov.b32 %f7, %r12;
+ mov.b32 %f8, %r13;
+ .loc 1 32 30
+ mul.wide.s32 %rd19, %r77, 4;
+ add.s64 %rd3, %rd14, %rd19;
+ .loc 1 32 46
+ mov.u32 %r18, 0x0;
+ mov.u32 %r19, 0x0;
+ mov.u32 %r20, 0x0;
+ mov.u32 %r21, 0x0;
+ @%p1 ld.global.v4.b32 { %r18, %r19, %r20, %r21 }, [ %rd3 + 0 ];
+ @!%p1 mov.u32 %r18, %r4;
+ @!%p1 mov.u32 %r19, %r4;
+ @!%p1 mov.u32 %r20, %r4;
+ @!%p1 mov.u32 %r21, %r4;
+ mov.b32 %f9, %r18;
+ mov.b32 %f10, %r19;
+ mov.b32 %f11, %r20;
+ mov.b32 %f12, %r21;
+ .loc 1 33 35
+ add.s64 %rd4, %rd11, %rd19;
+ .loc 1 33 51
+ mov.u32 %r26, 0x0;
+ mov.u32 %r27, 0x0;
+ mov.u32 %r28, 0x0;
+ mov.u32 %r29, 0x0;
+ @%p1 ld.global.v4.b32 { %r26, %r27, %r28, %r29 }, [ %rd4 + 0 ];
+ @!%p1 mov.u32 %r26, %r4;
+ @!%p1 mov.u32 %r27, %r4;
+ @!%p1 mov.u32 %r28, %r4;
+ @!%p1 mov.u32 %r29, %r4;
+ mov.b32 %f13, %r26;
+ mov.b32 %f14, %r27;
+ mov.b32 %f15, %r28;
+ mov.b32 %f16, %r29;
+ .loc 1 34 31
+ mul.wide.s32 %rd20, %r1, 4;
+ add.s64 %rd5, %rd15, %rd20;
+ .loc 1 34 36
+ mov.u32 %r51, 0x0;
+ @%p1 ld.global.L1::evict_last.b32 { %r51 }, [ %rd5 + 0 ];
+ mov.u32 %r35, 0x0;
+ @%p1 ld.global.L1::evict_last.b32 { %r35 }, [ %rd5 + 0 ];
+ mov.u32 %r36, 0x0;
+ @%p1 ld.global.L1::evict_last.b32 { %r36 }, [ %rd5 + 0 ];
+ mov.u32 %r37, 0x0;
+ @%p1 ld.global.L1::evict_last.b32 { %r37 }, [ %rd5 + 0 ];
+ .loc 1 36 18
+ mul.f32 %f17, %f1, %f5;
+ mul.f32 %f18, %f2, %f6;
+ mul.f32 %f19, %f3, %f7;
+ mul.f32 %f20, %f4, %f8;
+$L__tmp1:
+ .loc 2 233 15
+ fma.rn.f32 %f21, %f1, %f5, %f18;
+ fma.rn.f32 %f22, %f3, %f7, %f21;
+ fma.rn.f32 %f23, %f4, %f8, %f22;
+$L__tmp2:
+ .loc 2 243 36
+ mov.b32 %r78, %f23;
+ shfl.sync.bfly.b32 %r79, %r78, 16, 31, -1;
+ mov.b32 %f24, %r79;
+$L__tmp3:
+ .loc 2 233 15
+ add.f32 %f25, %f23, %f24;
+$L__tmp4:
+ .loc 2 243 36
+ mov.b32 %r80, %f25;
+ shfl.sync.bfly.b32 %r81, %r80, 8, 31, -1;
+ mov.b32 %f26, %r81;
+$L__tmp5:
+ .loc 2 233 15
+ add.f32 %f27, %f25, %f26;
+$L__tmp6:
+ .loc 2 243 36
+ mov.b32 %r82, %f27;
+ shfl.sync.bfly.b32 %r83, %r82, 4, 31, -1;
+ mov.b32 %f28, %r83;
+$L__tmp7:
+ .loc 2 233 15
+ add.f32 %f29, %f27, %f28;
+$L__tmp8:
+ .loc 2 243 36
+ mov.b32 %r84, %f29;
+ shfl.sync.bfly.b32 %r85, %r84, 2, 31, -1;
+ mov.b32 %f30, %r85;
+$L__tmp9:
+ .loc 2 233 15
+ add.f32 %f31, %f29, %f30;
+$L__tmp10:
+ .loc 2 243 36
+ mov.b32 %r86, %f31;
+ shfl.sync.bfly.b32 %r87, %r86, 1, 31, -1;
+ mov.b32 %f32, %r87;
+$L__tmp11:
+ .loc 2 233 15
+ add.f32 %f33, %f31, %f32;
+$L__tmp12:
+ .loc 2 243 36
+ setp.eq.s32 %p23, %r73, 0;
+ shr.u32 %r88, %r72, 3;
+ and.b32 %r89, %r88, 4;
+ mov.u32 %r90, global_smem;
+ add.s32 %r38, %r90, %r89;
+ mov.b32 %r39, %f33;
+ @%p23 st.shared.b32 [ %r38 + 0 ], %r39;
+ bar.sync 0;
+ setp.lt.s32 %p24, %r72, 2;
+ add.s32 %r41, %r90, %r74;
+ @%p24 ld.shared.b32 %r40, [ %r41 + 0 ];
+ mov.b32 %f34, %r40;
+ shfl.sync.bfly.b32 %r91, %r40, 1, 31, -1;
+ mov.b32 %f35, %r91;
+$L__tmp13:
+ .loc 2 233 15
+ add.f32 %f36, %f34, %f35;
+$L__tmp14:
+ .loc 2 243 36
+ and.b32 %r92, %r72, 1;
+ setp.eq.b32 %p31, %r92, 1;
+ not.pred %p32, %p31;
+ and.pred %p25, %p24, %p32;
+ mov.b32 %r43, %f36;
+ @%p25 st.shared.b32 [ %r41 + 0 ], %r43;
+ bar.sync 0;
+ ld.shared.f32 %f37, [global_smem];
+$L__tmp15:
+ .loc 3 8 15
+ add.f32 %f38, %f37, 0f00000000;
+$L__tmp16:
+ .loc 1 40 18
+ mul.f32 %f39, %f18, %f10;
+$L__tmp17:
+ .loc 2 243 36
+ bar.sync 0;
+$L__tmp18:
+ .loc 2 233 15
+ fma.rn.f32 %f40, %f17, %f9, %f39;
+ fma.rn.f32 %f41, %f19, %f11, %f40;
+ fma.rn.f32 %f42, %f20, %f12, %f41;
+$L__tmp19:
+ .loc 2 243 36
+ mov.b32 %r93, %f42;
+ shfl.sync.bfly.b32 %r94, %r93, 16, 31, -1;
+ mov.b32 %f43, %r94;
+$L__tmp20:
+ .loc 2 233 15
+ add.f32 %f44, %f42, %f43;
+$L__tmp21:
+ .loc 2 243 36
+ mov.b32 %r95, %f44;
+ shfl.sync.bfly.b32 %r96, %r95, 8, 31, -1;
+ mov.b32 %f45, %r96;
+$L__tmp22:
+ .loc 2 233 15
+ add.f32 %f46, %f44, %f45;
+$L__tmp23:
+ .loc 2 243 36
+ mov.b32 %r97, %f46;
+ shfl.sync.bfly.b32 %r98, %r97, 4, 31, -1;
+ mov.b32 %f47, %r98;
+$L__tmp24:
+ .loc 2 233 15
+ add.f32 %f48, %f46, %f47;
+$L__tmp25:
+ .loc 2 243 36
+ mov.b32 %r99, %f48;
+ shfl.sync.bfly.b32 %r100, %r99, 2, 31, -1;
+ mov.b32 %f49, %r100;
+$L__tmp26:
+ .loc 2 233 15
+ add.f32 %f50, %f48, %f49;
+$L__tmp27:
+ .loc 2 243 36
+ mov.b32 %r101, %f50;
+ shfl.sync.bfly.b32 %r102, %r101, 1, 31, -1;
+ mov.b32 %f51, %r102;
+$L__tmp28:
+ .loc 2 233 15
+ add.f32 %f52, %f50, %f51;
+$L__tmp29:
+ .loc 2 243 36
+ mov.b32 %r45, %f52;
+ @%p23 st.shared.b32 [ %r38 + 0 ], %r45;
+ bar.sync 0;
+ @%p24 ld.shared.b32 %r46, [ %r41 + 0 ];
+ mov.b32 %f53, %r46;
+ shfl.sync.bfly.b32 %r103, %r46, 1, 31, -1;
+ mov.b32 %f54, %r103;
+$L__tmp30:
+ .loc 2 233 15
+ add.f32 %f55, %f53, %f54;
+$L__tmp31:
+ .loc 2 243 36
+ mov.b32 %r49, %f55;
+ @%p25 st.shared.b32 [ %r41 + 0 ], %r49;
+ bar.sync 0;
+ ld.shared.f32 %f56, [global_smem];
+$L__tmp32:
+ .loc 3 8 15
+ add.f32 %f57, %f56, 0f00000000;
+ mov.b32 %r52, 1132462080;
+$L__tmp33:
+ .loc 1 45 20
+ div.full.f32 %r50, %r51, %r52;
+ mov.b32 %f58, %r50;
+ .loc 1 47 20
+ neg.f32 %f59, %f38;
+ fma.rn.f32 %f60, %f17, 0f43800000, %f59;
+ fma.rn.f32 %f61, %f18, 0f43800000, %f59;
+ fma.rn.f32 %f62, %f19, 0f43800000, %f59;
+ fma.rn.f32 %f63, %f20, 0f43800000, %f59;
+ .loc 1 49 20
+ neg.f32 %f64, %f57;
+ fma.rn.f32 %f65, %f64, %f9, %f60;
+ fma.rn.f32 %f66, %f64, %f10, %f61;
+ fma.rn.f32 %f67, %f64, %f11, %f62;
+ fma.rn.f32 %f68, %f64, %f12, %f63;
+ .loc 1 51 20
+ fma.rn.f32 %f69, %f58, %f65, %f13;
+ fma.rn.f32 %f70, %f58, %f66, %f14;
+ fma.rn.f32 %f71, %f58, %f67, %f15;
+ fma.rn.f32 %f72, %f58, %f68, %f16;
+ .loc 1 53 51
+ mov.b32 %r62, %f69;
+ mov.b32 %r63, %f70;
+ mov.b32 %r64, %f71;
+ mov.b32 %r65, %f72;
+ @%p1 st.global.v4.b32 [ %rd4 + 0 ], { %r62, %r63, %r64, %r65 };
+ .loc 1 54 25
+ add.s64 %rd10, %rd16, %rd17;
+ .loc 1 54 48
+ cvt.rn.bf16.f32 %rs5, %r62;
+ cvt.rn.bf16.f32 %rs6, %r63;
+ cvt.rn.bf16.f32 %rs7, %r64;
+ cvt.rn.bf16.f32 %rs8, %r65;
+ mov.b32 %r104, {%rs5, %rs6};
+ mov.b32 %r105, {%rs7, %rs8};
+ @%p1 st.global.v2.b32 [ %rd10 + 0 ], { %r104, %r105 };
+ .loc 1 54 4
+ ret;
+$L__tmp34:
+$L__func_end0:
+
+}
+ .file 1 "/tmp/torchinductor_root/rn/crnynbmsd2yell2lpjymb46rttfaea2xjwsbxr75j54gctfgi457.py"
+ .file 2 "/usr/local/lib/python3.10/dist-packages/triton/language/standard.py"
+ .file 3 "/usr/local/lib/python3.10/dist-packages/torch/_inductor/triton_helpers.py"
+ .section .debug_abbrev
+ {
+.b8 1
+.b8 17
+.b8 1
+.b8 37
+.b8 8
+.b8 19
+.b8 5
+.b8 3
+.b8 8
+.b8 16
+.b8 6
+.b8 27
+.b8 8
+.b8 180
+.b8 66
+.b8 12
+.b8 17
+.b8 1
+.b8 18
+.b8 1
+.b8 0
+.b8 0
+.b8 2
+.b8 46
+.b8 0
+.b8 135
+.b8 64
+.b8 8
+.b8 3
+.b8 8
+.b8 58
+.b8 11
+.b8 59
+.b8 11
+.b8 63
+.b8 12
+.b8 32
+.b8 11
+.b8 0
+.b8 0
+.b8 3
+.b8 46
+.b8 1
+.b8 17
+.b8 1
+.b8 18
+.b8 1
+.b8 64
+.b8 10
+.b8 49
+.b8 19
+.b8 0
+.b8 0
+.b8 4
+.b8 29
+.b8 1
+.b8 49
+.b8 19
+.b8 17
+.b8 1
+.b8 18
+.b8 1
+.b8 88
+.b8 11
+.b8 89
+.b8 11
+.b8 87
+.b8 11
+.b8 0
+.b8 0
+.b8 5
+.b8 29
+.b8 0
+.b8 49
+.b8 19
+.b8 17
+.b8 1
+.b8 18
+.b8 1
+.b8 88
+.b8 11
+.b8 89
+.b8 11
+.b8 87
+.b8 11
+.b8 0
+.b8 0
+.b8 0
+ }
+ .section .debug_info
+ {
+.b32 399
+.b8 2
+.b8 0
+.b32 .debug_abbrev
+.b8 8
+.b8 1
+.b8 116
+.b8 114
+.b8 105
+.b8 116
+.b8 111
+.b8 110
+.b8 0
+.b8 2
+.b8 0
+.b8 99
+.b8 114
+.b8 110
+.b8 121
+.b8 110
+.b8 98
+.b8 109
+.b8 115
+.b8 100
+.b8 50
+.b8 121
+.b8 101
+.b8 108
+.b8 108
+.b8 50
+.b8 108
+.b8 112
+.b8 106
+.b8 121
+.b8 109
+.b8 98
+.b8 52
+.b8 54
+.b8 114
+.b8 116
+.b8 116
+.b8 102
+.b8 97
+.b8 101
+.b8 97
+.b8 50
+.b8 120
+.b8 106
+.b8 119
+.b8 115
+.b8 98
+.b8 120
+.b8 114
+.b8 55
+.b8 53
+.b8 106
+.b8 53
+.b8 52
+.b8 103
+.b8 99
+.b8 116
+.b8 102
+.b8 103
+.b8 105
+.b8 52
+.b8 53
+.b8 55
+.b8 46
+.b8 112
+.b8 121
+.b8 0
+.b32 .debug_line
+.b8 47
+.b8 116
+.b8 109
+.b8 112
+.b8 47
+.b8 116
+.b8 111
+.b8 114
+.b8 99
+.b8 104
+.b8 105
+.b8 110
+.b8 100
+.b8 117
+.b8 99
+.b8 116
+.b8 111
+.b8 114
+.b8 95
+.b8 114
+.b8 111
+.b8 111
+.b8 116
+.b8 47
+.b8 114
+.b8 110
+.b8 0
+.b8 1
+.b64 $L__func_begin0
+.b64 $L__func_end0
+.b8 2
+.b8 116
+.b8 114
+.b8 105
+.b8 116
+.b8 111
+.b8 110
+.b8 95
+.b8 95
+.b8 48
+.b8 100
+.b8 49
+.b8 100
+.b8 50
+.b8 100
+.b8 51
+.b8 100
+.b8 52
+.b8 100
+.b8 53
+.b8 100
+.b8 54
+.b8 100
+.b8 101
+.b8 55
+.b8 100
+.b8 101
+.b8 0
+.b8 116
+.b8 114
+.b8 105
+.b8 116
+.b8 111
+.b8 110
+.b8 95
+.b8 95
+.b8 48
+.b8 100
+.b8 49
+.b8 100
+.b8 50
+.b8 100
+.b8 51
+.b8 100
+.b8 52
+.b8 100
+.b8 53
+.b8 100
+.b8 54
+.b8 100
+.b8 101
+.b8 55
+.b8 100
+.b8 101
+.b8 0
+.b8 1
+.b8 18
+.b8 1
+.b8 1
+.b8 3
+.b64 $L__func_begin0
+.b64 $L__func_end0
+.b8 1
+.b8 156
+.b32 125
+.b8 4
+.b32 125
+.b64 $L__tmp1
+.b64 $L__tmp14
+.b8 2
+.b8 39
+.b8 57
+.b8 5
+.b32 125
+.b64 $L__tmp1
+.b64 $L__tmp14
+.b8 2
+.b8 243
+.b8 36
+.b8 0
+.b8 5
+.b32 125
+.b64 $L__tmp2
+.b64 $L__tmp15
+.b8 2
+.b8 39
+.b8 57
+.b8 5
+.b32 125
+.b64 $L__tmp15
+.b64 $L__tmp16
+.b8 3
+.b8 39
+.b8 44
+.b8 5
+.b32 125
+.b64 $L__tmp17
+.b64 $L__tmp32
+.b8 2
+.b8 43
+.b8 59
+.b8 4
+.b32 125
+.b64 $L__tmp18
+.b64 $L__tmp31
+.b8 2
+.b8 43
+.b8 59
+.b8 5
+.b32 125
+.b64 $L__tmp18
+.b64 $L__tmp31
+.b8 2
+.b8 243
+.b8 36
+.b8 0
+.b8 5
+.b32 125
+.b64 $L__tmp32
+.b64 $L__tmp33
+.b8 3
+.b8 43
+.b8 45
+.b8 0
+.b8 0
+ }
+ .section .debug_pubnames
+ {
+.b32 $L__pubNames_end0-$L__pubNames_start0
+$L__pubNames_start0:
+.b8 2
+.b8 0
+.b32 .debug_info
+.b32 403
+.b32 125
+.b8 116
+.b8 114
+.b8 105
+.b8 116
+.b8 111
+.b8 110
+.b8 95
+.b8 95
+.b8 48
+.b8 100
+.b8 49
+.b8 100
+.b8 50
+.b8 100
+.b8 51
+.b8 100
+.b8 52
+.b8 100
+.b8 53
+.b8 100
+.b8 54
+.b8 100
+.b8 101
+.b8 55
+.b8 100
+.b8 101
+.b8 0
+.b32 0
+$L__pubNames_end0:
+ }
+ .section .debug_pubtypes
+ {
+.b32 $L__pubTypes_end0-$L__pubTypes_start0
+$L__pubTypes_start0:
+.b8 2
+.b8 0
+.b32 .debug_info
+.b32 403
+.b32 0
+$L__pubTypes_end0:
+ }
+ .section .debug_loc { }
diff --git a/.triton/dump/63ac7476060ddeef758fa13ad6ed58f5/triton_.ttir b/.triton/dump/63ac7476060ddeef758fa13ad6ed58f5/triton_.ttir
new file mode 100644
index 0000000000000000000000000000000000000000..f7c974d1c8305cb943605f95fa2f8b4bdca4bfc9
--- /dev/null
+++ b/.triton/dump/63ac7476060ddeef758fa13ad6ed58f5/triton_.ttir
@@ -0,0 +1,65 @@
+module {
+ tt.func public @triton__0d1d2d3d4d5d6de7de(%arg0: !tt.ptr {tt.divisibility = 16 : i32}, %arg1: !tt.ptr {tt.divisibility = 16 : i32}, %arg2: !tt.ptr {tt.divisibility = 16 : i32}, %arg3: !tt.ptr {tt.divisibility = 16 : i32}, %arg4: !tt.ptr {tt.divisibility = 16 : i32}, %arg5: !tt.ptr {tt.divisibility = 16 : i32}, %arg6: i32 {tt.divisibility = 16 : i32, tt.max_divisibility = 16 : i32}, %arg7: i32 {tt.divisibility = 16 : i32, tt.max_divisibility = 16 : i32}) attributes {noinline = false} {
+ %c256_i32 = arith.constant 256 : i32
+ %cst = arith.constant dense<0.000000e+00> : tensor<256xbf16>
+ %cst_0 = arith.constant 0.000000e+00 : f32
+ %cst_1 = arith.constant dense<0.000000e+00> : tensor<256xf32>
+ %cst_2 = arith.constant dense<2.560000e+02> : tensor<256xf32>
+ %cst_3 = arith.constant dense<2.560000e+02> : tensor<1xf32>
+ %cst_4 = arith.constant dense<256> : tensor<256xi32>
+ %0 = tt.get_program_id x : i32
+ %1 = tt.make_range {end = 256 : i32, start = 0 : i32} : tensor<256xi32>
+ %2 = arith.cmpi slt, %1, %cst_4 : tensor<256xi32>
+ %3 = arith.muli %0, %c256_i32 : i32
+ %4 = tt.splat %3 : (i32) -> tensor<256xi32>
+ %5 = arith.addi %1, %4 : tensor<256xi32>
+ %6 = tt.splat %arg1 : (!tt.ptr) -> tensor<256x!tt.ptr>
+ %7 = tt.addptr %6, %5 : tensor<256x!tt.ptr>, tensor<256xi32>
+ %8 = tt.load %7, %2, %cst {cache = 1 : i32, evict = 1 : i32, isVolatile = false} : tensor<256xbf16>
+ %9 = arith.extf %8 : tensor<256xbf16> to tensor<256xf32>
+ %10 = tt.splat %arg2 : (!tt.ptr) -> tensor<256x!tt.ptr>
+ %11 = tt.addptr %10, %1 : tensor<256x!tt.ptr>, tensor<256xi32>
+ %12 = tt.load %11, %2, %cst_1 {cache = 1 : i32, evict = 3 : i32, isVolatile = false} : tensor<256xf32>
+ %13 = tt.splat %arg3 : (!tt.ptr) -> tensor<256x!tt.ptr>
+ %14 = tt.addptr %13, %5 : tensor<256x!tt.ptr>, tensor<256xi32>
+ %15 = tt.load %14, %2, %cst_1 {cache = 1 : i32, evict = 1 : i32, isVolatile = false} : tensor<256xf32>
+ %16 = tt.splat %arg0 : (!tt.ptr) -> tensor<256x!tt.ptr>
+ %17 = tt.addptr %16, %5 : tensor<256x!tt.ptr>, tensor<256xi32>
+ %18 = tt.load %17, %2, %cst_1 {cache = 1 : i32, evict = 1 : i32, isVolatile = false} : tensor<256xf32>
+ %19 = tt.addptr %arg4, %0 : !tt.ptr, i32
+ %20 = tt.splat %19 : (!tt.ptr) -> tensor<1x!tt.ptr>
+ %21 = tt.load %20 {cache = 1 : i32, evict = 3 : i32, isVolatile = false} : tensor<1xf32>
+ %22 = arith.mulf %9, %12 : tensor<256xf32>
+ %23 = arith.select %2, %22, %cst_1 : tensor<256xi1>, tensor<256xf32>
+ %24 = "tt.reduce"(%23) <{axis = 0 : i32}> ({
+ ^bb0(%arg8: f32, %arg9: f32):
+ %43 = arith.addf %arg8, %arg9 : f32
+ tt.reduce.return %43 : f32
+ }) : (tensor<256xf32>) -> f32
+ %25 = arith.addf %24, %cst_0 : f32
+ %26 = arith.mulf %22, %15 : tensor<256xf32>
+ %27 = arith.select %2, %26, %cst_1 : tensor<256xi1>, tensor<256xf32>
+ %28 = "tt.reduce"(%27) <{axis = 0 : i32}> ({
+ ^bb0(%arg8: f32, %arg9: f32):
+ %43 = arith.addf %arg8, %arg9 : f32
+ tt.reduce.return %43 : f32
+ }) : (tensor<256xf32>) -> f32
+ %29 = arith.addf %28, %cst_0 : f32
+ %30 = arith.divf %21, %cst_3 : tensor<1xf32>
+ %31 = arith.mulf %22, %cst_2 : tensor<256xf32>
+ %32 = tt.splat %25 : (f32) -> tensor<256xf32>
+ %33 = arith.subf %31, %32 : tensor<256xf32>
+ %34 = tt.splat %29 : (f32) -> tensor<256xf32>
+ %35 = arith.mulf %15, %34 : tensor<256xf32>
+ %36 = arith.subf %33, %35 : tensor<256xf32>
+ %37 = tt.broadcast %30 : (tensor<1xf32>) -> tensor<256xf32>
+ %38 = arith.mulf %37, %36 : tensor<256xf32>
+ %39 = arith.addf %18, %38 : tensor<256xf32>
+ tt.store %17, %39, %2 {cache = 1 : i32, evict = 1 : i32} : tensor<256xf32>
+ %40 = tt.splat %arg5 : (!tt.ptr) -> tensor<256x!tt.ptr>
+ %41 = tt.addptr %40, %5 : tensor<256x!tt.ptr>, tensor<256xi32>
+ %42 = arith.truncf %39 : tensor<256xf32> to tensor<256xbf16>
+ tt.store %41, %42, %2 {cache = 1 : i32, evict = 1 : i32} : tensor<256xbf16>
+ tt.return
+ }
+}
diff --git a/.triton/dump/9aec2dd769dc1991d76fa64c70ec0e92/triton_.llir b/.triton/dump/9aec2dd769dc1991d76fa64c70ec0e92/triton_.llir
new file mode 100644
index 0000000000000000000000000000000000000000..aab6e43e09a606798af3f019df529172c5e95a26
--- /dev/null
+++ b/.triton/dump/9aec2dd769dc1991d76fa64c70ec0e92/triton_.llir
@@ -0,0 +1,230 @@
+; ModuleID = 'LLVMDialectModule'
+source_filename = "LLVMDialectModule"
+
+@global_smem = external addrspace(3) global [0 x i8]
+
+define void @triton__0d1d2d3de4e(ptr addrspace(1) %0, ptr addrspace(1) %1, ptr addrspace(1) %2, i32 %3, i32 %4) local_unnamed_addr !dbg !5 {
+ %6 = tail call i32 @llvm.nvvm.read.ptx.sreg.tid.x(), !dbg !8
+ %7 = and i32 %6, 31, !dbg !8
+ %8 = lshr i32 %6, 5, !dbg !8
+ %9 = shl i32 %6, 2, !dbg !8
+ %10 = and i32 %9, 60, !dbg !8
+ %11 = and i32 %8, 3, !dbg !9
+ %12 = lshr i32 %7, 4, !dbg !9
+ %13 = shl nuw nsw i32 %11, 1, !dbg !9
+ %14 = or i32 %13, %12, !dbg !9
+ %15 = tail call i32 asm "mov.u32 $0, %ctaid.x;", "=r"() #3, !dbg !10
+ %16 = shl i32 %15, 6, !dbg !11
+ %17 = or i32 %16, %10, !dbg !12
+ br label %18, !dbg !13
+
+18: ; preds = %5, %18
+ %19 = phi i32 [ 0, %5 ], [ %37, %18 ]
+ %20 = phi <4 x float> [ zeroinitializer, %5 ], [ %36, %18 ]
+ %21 = or i32 %19, %14, !dbg !14
+ %22 = shl i32 %21, 17, !dbg !15
+ %23 = add i32 %17, %22, !dbg !16
+ %24 = sext i32 %23 to i64, !dbg !17
+ %25 = getelementptr float, ptr addrspace(1) %0, i64 %24, !dbg !17
+ %26 = tail call { i32, i32, i32, i32 } asm sideeffect "mov.u32 $0, 0x0;\0A\09mov.u32 $1, 0x0;\0A\09mov.u32 $2, 0x0;\0A\09mov.u32 $3, 0x0;\0A\09@$5 ld.global.L1::evict_first.v4.b32 { $0, $1, $2, $3 }, [ $4 + 0 ];\0A\09@!$7 mov.u32 $0, $6;\0A\09@!$9 mov.u32 $1, $8;\0A\09@!$11 mov.u32 $2, $10;\0A\09@!$13 mov.u32 $3, $12;", "=r,=r,=r,=r,l,b,r,b,r,b,r,b,r,b"(ptr addrspace(1) %25, i1 true, i32 0, i1 true, i32 0, i1 true, i32 0, i1 true, i32 0, i1 true) #3, !dbg !18
+ %27 = extractvalue { i32, i32, i32, i32 } %26, 0, !dbg !18
+ %28 = extractvalue { i32, i32, i32, i32 } %26, 1, !dbg !18
+ %29 = extractvalue { i32, i32, i32, i32 } %26, 2, !dbg !18
+ %30 = extractvalue { i32, i32, i32, i32 } %26, 3, !dbg !18
+ %31 = insertelement <4 x i32> poison, i32 %27, i64 0, !dbg !18
+ %32 = insertelement <4 x i32> %31, i32 %28, i64 1, !dbg !18
+ %33 = insertelement <4 x i32> %32, i32 %29, i64 2, !dbg !18
+ %34 = insertelement <4 x i32> %33, i32 %30, i64 3, !dbg !18
+ %35 = bitcast <4 x i32> %34 to <4 x float>, !dbg !18
+ %36 = fadd <4 x float> %20, %35, !dbg !19
+ %37 = add nuw nsw i32 %19, 8, !dbg !13
+ %38 = icmp ult i32 %19, 112, !dbg !13
+ br i1 %38, label %18, label %39, !dbg !13
+
+39: ; preds = %18
+ %40 = and i32 %6, 63, !dbg !8
+ %41 = or i32 %16, %40, !dbg !12
+ %42 = or i32 %10, 3, !dbg !20
+ %43 = or i32 %10, 2, !dbg !20
+ %44 = or i32 %10, 1, !dbg !20
+ %45 = extractelement <4 x float> %36, i64 0, !dbg !20
+ %46 = bitcast float %45 to i32, !dbg !20
+ %47 = tail call i32 @llvm.nvvm.shfl.sync.bfly.i32(i32 -1, i32 %46, i32 16, i32 31), !dbg !20
+ %48 = bitcast i32 %47 to float, !dbg !20
+ %49 = fadd float %45, %48, !dbg !24
+ %50 = extractelement <4 x float> %36, i64 1, !dbg !20
+ %51 = bitcast float %50 to i32, !dbg !20
+ %52 = tail call i32 @llvm.nvvm.shfl.sync.bfly.i32(i32 -1, i32 %51, i32 16, i32 31), !dbg !20
+ %53 = bitcast i32 %52 to float, !dbg !20
+ %54 = fadd float %50, %53, !dbg !24
+ %55 = extractelement <4 x float> %36, i64 2, !dbg !20
+ %56 = bitcast float %55 to i32, !dbg !20
+ %57 = tail call i32 @llvm.nvvm.shfl.sync.bfly.i32(i32 -1, i32 %56, i32 16, i32 31), !dbg !20
+ %58 = bitcast i32 %57 to float, !dbg !20
+ %59 = fadd float %55, %58, !dbg !24
+ %60 = extractelement <4 x float> %36, i64 3, !dbg !20
+ %61 = bitcast float %60 to i32, !dbg !20
+ %62 = tail call i32 @llvm.nvvm.shfl.sync.bfly.i32(i32 -1, i32 %61, i32 16, i32 31), !dbg !20
+ %63 = bitcast i32 %62 to float, !dbg !20
+ %64 = fadd float %60, %63, !dbg !24
+ %65 = icmp ult i32 %7, 16, !dbg !20
+ %66 = shl nuw nsw i32 %10, 2, !dbg !20
+ %67 = or i32 %66, %11, !dbg !20
+ %68 = zext nneg i32 %67 to i64, !dbg !20
+ %69 = getelementptr float, ptr addrspace(3) @global_smem, i64 %68, !dbg !20
+ tail call void asm sideeffect "@$2 st.shared.b32 [ $0 + 0 ], $1;", "r,r,b"(ptr addrspace(3) %69, float %49, i1 %65) #3, !dbg !20
+ %70 = shl nuw nsw i32 %44, 2, !dbg !20
+ %71 = or i32 %70, %11, !dbg !20
+ %72 = zext nneg i32 %71 to i64, !dbg !20
+ %73 = getelementptr float, ptr addrspace(3) @global_smem, i64 %72, !dbg !20
+ tail call void asm sideeffect "@$2 st.shared.b32 [ $0 + 0 ], $1;", "r,r,b"(ptr addrspace(3) %73, float %54, i1 %65) #3, !dbg !20
+ %74 = shl nuw nsw i32 %43, 2, !dbg !20
+ %75 = or i32 %74, %11, !dbg !20
+ %76 = zext nneg i32 %75 to i64, !dbg !20
+ %77 = getelementptr float, ptr addrspace(3) @global_smem, i64 %76, !dbg !20
+ tail call void asm sideeffect "@$2 st.shared.b32 [ $0 + 0 ], $1;", "r,r,b"(ptr addrspace(3) %77, float %59, i1 %65) #3, !dbg !20
+ %78 = shl nuw nsw i32 %42, 2, !dbg !20
+ %79 = or i32 %78, %11, !dbg !20
+ %80 = zext nneg i32 %79 to i64, !dbg !20
+ %81 = getelementptr float, ptr addrspace(3) @global_smem, i64 %80, !dbg !20
+ tail call void asm sideeffect "@$2 st.shared.b32 [ $0 + 0 ], $1;", "r,r,b"(ptr addrspace(3) %81, float %64, i1 %65) #3, !dbg !20
+ tail call void @llvm.nvvm.barrier0(), !dbg !20
+ %82 = icmp slt i32 %6, 256, !dbg !20
+ %83 = sext i32 %6 to i64, !dbg !20
+ %84 = getelementptr float, ptr addrspace(3) @global_smem, i64 %83, !dbg !20
+ %85 = tail call float asm sideeffect "@$2 ld.shared.b32 $0, [ $1 + 0 ];", "=r,r,b"(ptr addrspace(3) %84, i1 %82) #3, !dbg !20
+ %86 = bitcast float %85 to i32, !dbg !20
+ %87 = tail call i32 @llvm.nvvm.shfl.sync.bfly.i32(i32 -1, i32 %86, i32 2, i32 31), !dbg !20
+ %88 = bitcast i32 %87 to float, !dbg !20
+ %89 = fadd float %85, %88, !dbg !24
+ %90 = bitcast float %89 to i32, !dbg !20
+ %91 = tail call i32 @llvm.nvvm.shfl.sync.bfly.i32(i32 -1, i32 %90, i32 1, i32 31), !dbg !20
+ %92 = bitcast i32 %91 to float, !dbg !20
+ %93 = fadd float %89, %92, !dbg !24
+ %94 = and i32 %6, 3, !dbg !20
+ %95 = icmp eq i32 %94, 0, !dbg !20
+ %96 = and i1 %82, %95, !dbg !20
+ tail call void asm sideeffect "@$2 st.shared.b32 [ $0 + 0 ], $1;", "r,r,b"(ptr addrspace(3) %84, float %93, i1 %96) #3, !dbg !20
+ %97 = add i32 %6, 128, !dbg !20
+ %98 = sext i32 %97 to i64, !dbg !20
+ %99 = getelementptr float, ptr addrspace(3) @global_smem, i64 %98, !dbg !20
+ %100 = tail call float asm sideeffect "@$2 ld.shared.b32 $0, [ $1 + 0 ];", "=r,r,b"(ptr addrspace(3) %99, i1 %82) #3, !dbg !20
+ %101 = bitcast float %100 to i32, !dbg !20
+ %102 = tail call i32 @llvm.nvvm.shfl.sync.bfly.i32(i32 -1, i32 %101, i32 2, i32 31), !dbg !20
+ %103 = bitcast i32 %102 to float, !dbg !20
+ %104 = fadd float %100, %103, !dbg !24
+ %105 = bitcast float %104 to i32, !dbg !20
+ %106 = tail call i32 @llvm.nvvm.shfl.sync.bfly.i32(i32 -1, i32 %105, i32 1, i32 31), !dbg !20
+ %107 = bitcast i32 %106 to float, !dbg !20
+ %108 = fadd float %104, %107, !dbg !24
+ tail call void asm sideeffect "@$2 st.shared.b32 [ $0 + 0 ], $1;", "r,r,b"(ptr addrspace(3) %99, float %108, i1 %96) #3, !dbg !20
+ tail call void @llvm.nvvm.barrier0(), !dbg !20
+ %109 = zext nneg i32 %66 to i64, !dbg !20
+ %110 = getelementptr float, ptr addrspace(3) @global_smem, i64 %109, !dbg !20
+ %111 = load float, ptr addrspace(3) %110, align 4, !dbg !20
+ %112 = zext nneg i32 %70 to i64, !dbg !20
+ %113 = getelementptr float, ptr addrspace(3) @global_smem, i64 %112, !dbg !20
+ %114 = load float, ptr addrspace(3) %113, align 4, !dbg !20
+ %115 = zext nneg i32 %74 to i64, !dbg !20
+ %116 = getelementptr float, ptr addrspace(3) @global_smem, i64 %115, !dbg !20
+ %117 = load float, ptr addrspace(3) %116, align 4, !dbg !20
+ %118 = zext nneg i32 %78 to i64, !dbg !20
+ %119 = getelementptr float, ptr addrspace(3) @global_smem, i64 %118, !dbg !20
+ %120 = load float, ptr addrspace(3) %119, align 4, !dbg !20
+ tail call void @llvm.nvvm.barrier0(), !dbg !28
+ %121 = zext nneg i32 %10 to i64, !dbg !28
+ %122 = getelementptr float, ptr addrspace(3) @global_smem, i64 %121, !dbg !28
+ %123 = insertelement <1 x float> undef, float %111, i64 0, !dbg !28
+ store <1 x float> %123, ptr addrspace(3) %122, align 4, !dbg !28
+ %124 = zext nneg i32 %44 to i64, !dbg !28
+ %125 = getelementptr float, ptr addrspace(3) @global_smem, i64 %124, !dbg !28
+ %126 = insertelement <1 x float> undef, float %114, i64 0, !dbg !28
+ store <1 x float> %126, ptr addrspace(3) %125, align 4, !dbg !28
+ %127 = zext nneg i32 %43 to i64, !dbg !28
+ %128 = getelementptr float, ptr addrspace(3) @global_smem, i64 %127, !dbg !28
+ %129 = insertelement <1 x float> undef, float %117, i64 0, !dbg !28
+ store <1 x float> %129, ptr addrspace(3) %128, align 4, !dbg !28
+ %130 = zext nneg i32 %42 to i64, !dbg !28
+ %131 = getelementptr float, ptr addrspace(3) @global_smem, i64 %130, !dbg !28
+ %132 = insertelement <1 x float> undef, float %120, i64 0, !dbg !28
+ store <1 x float> %132, ptr addrspace(3) %131, align 4, !dbg !28
+ tail call void @llvm.nvvm.barrier0(), !dbg !28
+ %133 = zext nneg i32 %40 to i64, !dbg !28
+ %134 = getelementptr float, ptr addrspace(3) @global_smem, i64 %133, !dbg !28
+ %135 = load <1 x float>, ptr addrspace(3) %134, align 4, !dbg !28
+ %.frozen = freeze i32 %41
+ %136 = sdiv i32 %.frozen, 256, !dbg !29
+ %137 = mul i32 %136, 256
+ %.decomposed = sub i32 %.frozen, %137
+ %138 = sext i32 %136 to i64, !dbg !30
+ %139 = getelementptr i64, ptr addrspace(1) %1, i64 %138, !dbg !30
+ %140 = tail call i64 asm sideeffect "mov.u64 $0, 0x0;\0A\09@$2 ld.global.L1::evict_last.b64 { $0 }, [ $1 + 0 ];", "=l,l,b"(ptr addrspace(1) %139, i1 true) #3, !dbg !31
+ %141 = lshr i64 %140, 54, !dbg !32
+ %142 = and i64 %141, 512, !dbg !32
+ %143 = add i64 %142, %140, !dbg !32
+ %144 = shl i64 %143, 8, !dbg !33
+ %145 = sext i32 %.decomposed to i64, !dbg !34
+ %146 = getelementptr float, ptr addrspace(1) %2, i64 %144, !dbg !35
+ %147 = getelementptr float, ptr addrspace(1) %146, i64 %145, !dbg !35
+ %148 = and i32 %6, 64, !dbg !36
+ %149 = icmp eq i32 %148, 0, !dbg !36
+ %150 = tail call float asm sideeffect "mov.u32 $0, 0x0;\0A\09@$3 atom.global.gpu.acq_rel.add.f32 $0, [ $1 + 0 ], $2;", "=r,l,r,b"(ptr addrspace(1) %147, <1 x float> %135, i1 %149) #3, !dbg !36
+ ret void, !dbg !37
+}
+
+; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
+declare noundef i32 @llvm.nvvm.read.ptx.sreg.tid.x() #0
+
+; Function Attrs: convergent nocallback nounwind memory(inaccessiblemem: readwrite)
+declare i32 @llvm.nvvm.shfl.sync.bfly.i32(i32, i32, i32, i32) #1
+
+; Function Attrs: convergent nocallback nounwind
+declare void @llvm.nvvm.barrier0() #2
+
+attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
+attributes #1 = { convergent nocallback nounwind memory(inaccessiblemem: readwrite) }
+attributes #2 = { convergent nocallback nounwind }
+attributes #3 = { nounwind }
+
+!llvm.module.flags = !{!0}
+!llvm.dbg.cu = !{!1}
+!nvvm.annotations = !{!3, !4, !4, !3}
+
+!0 = !{i32 2, !"Debug Info Version", i32 3}
+!1 = distinct !DICompileUnit(language: DW_LANG_C, file: !2, producer: "triton", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug)
+!2 = !DIFile(filename: "c6ik5vx7p22fpk4dcvh55zimw4t5nr5zn2b7inujxjauxshljumm.py", directory: "/tmp/torchinductor_root/6i")
+!3 = !{ptr @triton__0d1d2d3de4e, !"kernel", i32 1}
+!4 = !{ptr @triton__0d1d2d3de4e, !"maxntidx", i32 128}
+!5 = distinct !DISubprogram(name: "triton__0d1d2d3de4e", linkageName: "triton__0d1d2d3de4e", scope: !2, file: !2, line: 18, type: !6, scopeLine: 18, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !1)
+!6 = !DISubroutineType(cc: DW_CC_normal, types: !7)
+!7 = !{}
+!8 = !DILocation(line: 22, column: 44, scope: !5)
+!9 = !DILocation(line: 24, column: 33, scope: !5)
+!10 = !DILocation(line: 21, column: 28, scope: !5)
+!11 = !DILocation(line: 21, column: 33, scope: !5)
+!12 = !DILocation(line: 22, column: 23, scope: !5)
+!13 = !DILocation(line: 27, column: 36, scope: !5)
+!14 = !DILocation(line: 28, column: 27, scope: !5)
+!15 = !DILocation(line: 31, column: 47, scope: !5)
+!16 = !DILocation(line: 31, column: 40, scope: !5)
+!17 = !DILocation(line: 31, column: 34, scope: !5)
+!18 = !DILocation(line: 31, column: 53, scope: !5)
+!19 = !DILocation(line: 34, column: 38, scope: !5)
+!20 = !DILocation(line: 243, column: 36, scope: !21, inlinedAt: !23)
+!21 = distinct !DILexicalBlockFile(scope: !5, file: !22, discriminator: 0)
+!22 = !DIFile(filename: "standard.py", directory: "/usr/local/lib/python3.10/dist-packages/triton/language")
+!23 = !DILocation(line: 35, column: 25, scope: !21)
+!24 = !DILocation(line: 233, column: 15, scope: !25, inlinedAt: !26)
+!25 = distinct !DILexicalBlockFile(scope: !21, file: !22, discriminator: 0)
+!26 = !DILocation(line: 243, column: 36, scope: !25, inlinedAt: !27)
+!27 = !DILocation(line: 35, column: 25, scope: !25)
+!28 = !DILocation(line: 35, column: 28, scope: !5)
+!29 = !DILocation(line: 36, column: 20, scope: !5)
+!30 = !DILocation(line: 38, column: 30, scope: !5)
+!31 = !DILocation(line: 38, column: 35, scope: !5)
+!32 = !DILocation(line: 41, column: 32, scope: !5)
+!33 = !DILocation(line: 45, column: 40, scope: !5)
+!34 = !DILocation(line: 45, column: 36, scope: !5)
+!35 = !DILocation(line: 45, column: 30, scope: !5)
+!36 = !DILocation(line: 45, column: 55, scope: !5)
+!37 = !DILocation(line: 45, column: 4, scope: !5)
diff --git a/.triton/dump/9aec2dd769dc1991d76fa64c70ec0e92/triton_.ttgir b/.triton/dump/9aec2dd769dc1991d76fa64c70ec0e92/triton_.ttgir
new file mode 100644
index 0000000000000000000000000000000000000000..65017a691185dde8ef22432b99308519b5bbeb63
--- /dev/null
+++ b/.triton/dump/9aec2dd769dc1991d76fa64c70ec0e92/triton_.ttgir
@@ -0,0 +1,68 @@
+#blocked = #triton_gpu.blocked<{sizePerThread = [1, 1], threadsPerWarp = [32, 1], warpsPerCTA = [2, 2], order = [0, 1], CTAsPerCGA = [1, 1], CTASplitNum = [1, 1], CTAOrder = [1, 0]}>
+#blocked1 = #triton_gpu.blocked<{sizePerThread = [4, 1], threadsPerWarp = [16, 2], warpsPerCTA = [1, 4], order = [0, 1], CTAsPerCGA = [1, 1], CTASplitNum = [1, 1], CTAOrder = [1, 0]}>
+module attributes {"triton_gpu.compute-capability" = 89 : i32, "triton_gpu.num-ctas" = 1 : i32, "triton_gpu.num-warps" = 4 : i32, "triton_gpu.threads-per-warp" = 32 : i32} {
+ tt.func public @triton__0d1d2d3de4e(%arg0: !tt.ptr {tt.divisibility = 16 : i32}, %arg1: !tt.ptr {tt.divisibility = 16 : i32}, %arg2: !tt.ptr {tt.divisibility = 16 : i32}, %arg3: i32 {tt.divisibility = 16 : i32, tt.max_divisibility = 16 : i32}, %arg4: i32 {tt.max_divisibility = 8 : i32}) attributes {noinline = false} {
+ %cst = arith.constant dense<256> : tensor<64x1xi64, #blocked>
+ %cst_0 = arith.constant dense<0> : tensor<64x1xi64, #blocked>
+ %cst_1 = arith.constant dense<512> : tensor<64x1xi64, #blocked>
+ %cst_2 = arith.constant dense<256> : tensor<64x1xi32, #blocked>
+ %cst_3 = arith.constant dense<131072> : tensor<1x8xi32, #blocked1>
+ %cst_4 = arith.constant dense<120> : tensor<1x8xi32, #blocked1>
+ %c0_i32 = arith.constant 0 : i32
+ %c120_i32 = arith.constant 120 : i32
+ %c8_i32 = arith.constant 8 : i32
+ %cst_5 = arith.constant dense<0.000000e+00> : tensor<64x8xf32, #blocked1>
+ %cst_6 = arith.constant dense : tensor<64x1xi1, #blocked>
+ %c64_i32 = arith.constant 64 : i32
+ %0 = tt.get_program_id x : i32
+ %1 = arith.muli %0, %c64_i32 : i32
+ %2 = tt.make_range {end = 64 : i32, start = 0 : i32} : tensor<64xi32, #triton_gpu.slice<{dim = 1, parent = #blocked1}>>
+ %3 = tt.make_range {end = 64 : i32, start = 0 : i32} : tensor<64xi32, #triton_gpu.slice<{dim = 1, parent = #blocked}>>
+ %4 = tt.expand_dims %2 {axis = 1 : i32} : (tensor<64xi32, #triton_gpu.slice<{dim = 1, parent = #blocked1}>>) -> tensor<64x1xi32, #blocked1>
+ %5 = tt.expand_dims %3 {axis = 1 : i32} : (tensor<64xi32, #triton_gpu.slice<{dim = 1, parent = #blocked}>>) -> tensor<64x1xi32, #blocked>
+ %6 = tt.splat %1 : (i32) -> tensor<64x1xi32, #blocked1>
+ %7 = tt.splat %1 : (i32) -> tensor<64x1xi32, #blocked>
+ %8 = arith.addi %6, %4 : tensor<64x1xi32, #blocked1>
+ %9 = arith.addi %7, %5 : tensor<64x1xi32, #blocked>
+ %10 = tt.make_range {end = 8 : i32, start = 0 : i32} : tensor<8xi32, #triton_gpu.slice<{dim = 0, parent = #blocked1}>>
+ %11 = tt.expand_dims %10 {axis = 0 : i32} : (tensor<8xi32, #triton_gpu.slice<{dim = 0, parent = #blocked1}>>) -> tensor<1x8xi32, #blocked1>
+ %12 = tt.broadcast %8 : (tensor<64x1xi32, #blocked1>) -> tensor<64x8xi32, #blocked1>
+ %13 = tt.splat %arg0 : (!tt.ptr) -> tensor<64x8x!tt.ptr, #blocked1>
+ %14 = scf.for %arg5 = %c0_i32 to %c120_i32 step %c8_i32 iter_args(%arg6 = %cst_5) -> (tensor<64x8xf32, #blocked1>) : i32 {
+ %32 = tt.splat %arg5 : (i32) -> tensor<1x8xi32, #blocked1>
+ %33 = arith.addi %32, %11 : tensor<1x8xi32, #blocked1>
+ %34 = arith.cmpi slt, %33, %cst_4 : tensor<1x8xi32, #blocked1>
+ %35 = arith.muli %33, %cst_3 : tensor<1x8xi32, #blocked1>
+ %36 = tt.broadcast %35 : (tensor<1x8xi32, #blocked1>) -> tensor<64x8xi32, #blocked1>
+ %37 = arith.addi %12, %36 : tensor<64x8xi32, #blocked1>
+ %38 = tt.addptr %13, %37 : tensor<64x8x!tt.ptr, #blocked1>, tensor<64x8xi32, #blocked1>
+ %39 = tt.broadcast %34 : (tensor<1x8xi1, #blocked1>) -> tensor<64x8xi1, #blocked1>
+ %40 = tt.load %38, %39, %cst_5 {cache = 1 : i32, evict = 2 : i32, isVolatile = false} : tensor<64x8xf32, #blocked1>
+ %41 = arith.addf %arg6, %40 : tensor<64x8xf32, #blocked1>
+ %42 = arith.select %39, %41, %arg6 : tensor<64x8xi1, #blocked1>, tensor<64x8xf32, #blocked1>
+ scf.yield %42 : tensor<64x8xf32, #blocked1>
+ }
+ %15 = "tt.reduce"(%14) <{axis = 1 : i32}> ({
+ ^bb0(%arg5: f32, %arg6: f32):
+ %32 = arith.addf %arg5, %arg6 : f32
+ tt.reduce.return %32 : f32
+ }) : (tensor<64x8xf32, #blocked1>) -> tensor<64xf32, #triton_gpu.slice<{dim = 1, parent = #blocked1}>>
+ %16 = triton_gpu.convert_layout %15 : (tensor<64xf32, #triton_gpu.slice<{dim = 1, parent = #blocked1}>>) -> tensor<64xf32, #triton_gpu.slice<{dim = 1, parent = #blocked}>>
+ %17 = tt.expand_dims %16 {axis = 1 : i32} : (tensor<64xf32, #triton_gpu.slice<{dim = 1, parent = #blocked}>>) -> tensor<64x1xf32, #blocked>
+ %18 = arith.divsi %9, %cst_2 : tensor<64x1xi32, #blocked>
+ %19 = arith.remsi %9, %cst_2 : tensor<64x1xi32, #blocked>
+ %20 = tt.splat %arg1 : (!tt.ptr) -> tensor<64x1x!tt.ptr, #blocked>
+ %21 = tt.addptr %20, %18 : tensor<64x1x!tt.ptr, #blocked>, tensor<64x1xi32, #blocked>
+ %22 = tt.load %21 {cache = 1 : i32, evict = 3 : i32, isVolatile = false} : tensor<64x1xi64, #blocked>
+ %23 = arith.addi %22, %cst_1 : tensor<64x1xi64, #blocked>
+ %24 = arith.cmpi slt, %22, %cst_0 : tensor<64x1xi64, #blocked>
+ %25 = arith.select %24, %23, %22 : tensor<64x1xi1, #blocked>, tensor<64x1xi64, #blocked>
+ %26 = arith.muli %25, %cst : tensor<64x1xi64, #blocked>
+ %27 = arith.extsi %19 : tensor<64x1xi32, #blocked> to tensor<64x1xi64, #blocked>
+ %28 = arith.addi %27, %26 : tensor<64x1xi64, #blocked>
+ %29 = tt.splat %arg2 : (!tt.ptr) -> tensor<64x1x!tt.ptr, #blocked>
+ %30 = tt.addptr %29, %28 : tensor<64x1x!tt.ptr, #blocked>, tensor<64x1xi64, #blocked>
+ %31 = "tt.atomic_rmw"(%30, %17, %cst_6) <{atomic_rmw_op = 5 : i32, scope = 1 : i32, sem = 4 : i32}> : (tensor<64x1x!tt.ptr, #blocked>, tensor<64x1xf32, #blocked>, tensor<64x1xi1, #blocked>) -> tensor<64x1xf32, #blocked>
+ tt.return
+ }
+}
diff --git a/.triton/dump/ac249789b41c99e39c165fc12afa9269/triton_.ttgir b/.triton/dump/ac249789b41c99e39c165fc12afa9269/triton_.ttgir
new file mode 100644
index 0000000000000000000000000000000000000000..552ef7804443cde50f69b432e0224d07e338ee3e
--- /dev/null
+++ b/.triton/dump/ac249789b41c99e39c165fc12afa9269/triton_.ttgir
@@ -0,0 +1,16 @@
+#blocked = #triton_gpu.blocked<{sizePerThread = [2], threadsPerWarp = [32], warpsPerCTA = [8], order = [0], CTAsPerCGA = [1], CTASplitNum = [1], CTAOrder = [0]}>
+module attributes {"triton_gpu.compute-capability" = 89 : i32, "triton_gpu.num-ctas" = 1 : i32, "triton_gpu.num-warps" = 8 : i32, "triton_gpu.threads-per-warp" = 32 : i32} {
+ tt.func public @triton__0d1de(%arg0: !tt.ptr {tt.divisibility = 16 : i32}, %arg1: i32 {tt.divisibility = 16 : i32, tt.max_divisibility = 16 : i32}) attributes {noinline = false} {
+ %cst = arith.constant dense<0.000000e+00> : tensor<512xf32, #blocked>
+ %c512_i32 = arith.constant 512 : i32
+ %0 = tt.get_program_id x : i32
+ %1 = arith.muli %0, %c512_i32 : i32
+ %2 = tt.make_range {end = 512 : i32, start = 0 : i32} : tensor<512xi32, #blocked>
+ %3 = tt.splat %1 : (i32) -> tensor<512xi32, #blocked>
+ %4 = arith.addi %3, %2 : tensor<512xi32, #blocked>
+ %5 = tt.splat %arg0 : (!tt.ptr) -> tensor<512x!tt.ptr, #blocked>
+ %6 = tt.addptr %5, %4 : tensor<512x!tt.ptr, #blocked>, tensor<512xi32, #blocked>
+ tt.store %6, %cst {cache = 1 : i32, evict = 1 : i32} : tensor<512xf32, #blocked>
+ tt.return
+ }
+}