diff --git a/.bashrc b/.bashrc new file mode 100644 index 0000000000000000000000000000000000000000..bf0ec4d57f0590809e0cead0f960b8611153b834 --- /dev/null +++ b/.bashrc @@ -0,0 +1,107 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. +# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) +# for examples + +# If not running interactively, don't do anything +[ -z "$PS1" ] && return + +# don't put duplicate lines in the history. See bash(1) for more options +# ... or force ignoredups and ignorespace +HISTCONTROL=ignoredups:ignorespace + +# append to the history file, don't overwrite it +shopt -s histappend + +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) +HISTSIZE=1000 +HISTFILESIZE=2000 + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# make less more friendly for non-text input files, see lesspipe(1) +[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" + +# set variable identifying the chroot you work in (used in the prompt below) +if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +# set a fancy prompt (non-color, unless we know we "want" color) +case "$TERM" in + xterm-color) color_prompt=yes;; +esac + +# uncomment for a colored prompt, if the terminal has the capability; turned +# off by default to not distract the user: the focus in a terminal window +# should be on the output of commands, not on the prompt +#force_color_prompt=yes + +if [ -n "$force_color_prompt" ]; then + if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + color_prompt=yes + else + color_prompt= + fi +fi + +if [ "$color_prompt" = yes ]; then + PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' +else + PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' +fi +unset color_prompt force_color_prompt + +# If this is an xterm set the title to user@host:dir +case "$TERM" in +xterm*|rxvt*) + PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" + ;; +*) + ;; +esac + +# enable color support of ls and also add handy aliases +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto' + #alias dir='dir --color=auto' + #alias vdir='vdir --color=auto' + + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' +fi + +# some more ls aliases +alias ll='ls -alF' +alias la='ls -A' +alias l='ls -CF' + +# Alias definitions. +# You may want to put all your additions into a separate file like +# ~/.bash_aliases, instead of adding them here directly. +# See /usr/share/doc/bash-doc/examples in the bash-doc package. + +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi + +# enable programmable completion features (you don't need to enable +# this, if it's already enabled in /etc/bash.bashrc and /etc/profile +# sources /etc/bash.bashrc). +#if [ -f /etc/bash_completion ] && ! shopt -oq posix; then +# . /etc/bash_completion +#fi +cat /etc/runpod.txt +echo -e "\nFor detailed documentation and guides, please visit:\n\033[1;34mhttps://docs.runpod.io/\033[0m and \033[1;34mhttps://blog.runpod.io/\033[0m\n\n" +PATH='/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' +VAST_CONTAINERLABEL="$(cat ~/.vast_containerlabel)" +PS1="\[\e]0;\u@$VAST_CONTAINERLABEL: \w\a\]\[\e[01;34m\]\u\[\e[m\e[01m\]@\[\e[01;36m\]$VAST_CONTAINERLABEL\[\e[m\e[01m\]:\[\e[01;37m\]\w\$\[\e[m\] " ; if [ ! -e "$HOME/.no_auto_tmux" ] && [[ -z "$TMUX" ]] && [ "$SSH_CONNECTION" != "" ] && [ "$TMUX_STARTED" = "" ]; then tmux attach-session -t ssh_tmux || tmux new-session -s ssh_tmux; exit; elif ! [[ -z "$TMUX" ]]; then echo 'Welcome to your vast.ai container! This session is running in `tmux`.'; echo 'To disconnect without closing your processes, press ctrl+b, release, then d.'; echo 'To disable auto-tmux, run `touch ~/.no_auto_tmux` and reconnect. See also https://tmuxcheatsheet.com/'; fi; +DIRECT_PORT_START=0 +DIRECT_PORT_END=0 +VAST_CONTAINERLABEL=C.12728823 diff --git a/.cache/pip/http-v2/0/1/f/2/0/01f2082df50502ba9492d64e69db99d1fdb5730707a16c6264b355b8 b/.cache/pip/http-v2/0/1/f/2/0/01f2082df50502ba9492d64e69db99d1fdb5730707a16c6264b355b8 new file mode 100644 index 0000000000000000000000000000000000000000..9e71a650d2dbcb4deb927a52995c77b09d8799c9 Binary files /dev/null and b/.cache/pip/http-v2/0/1/f/2/0/01f2082df50502ba9492d64e69db99d1fdb5730707a16c6264b355b8 differ diff --git a/.cache/pip/http-v2/0/2/f/8/e/02f8e820ca8231526982c4a2b93baef519d0948ff85c925acd226f06 b/.cache/pip/http-v2/0/2/f/8/e/02f8e820ca8231526982c4a2b93baef519d0948ff85c925acd226f06 new file mode 100644 index 0000000000000000000000000000000000000000..7218128f3a0ad2f2bc34eb16d59a482c58f0d247 Binary files /dev/null and b/.cache/pip/http-v2/0/2/f/8/e/02f8e820ca8231526982c4a2b93baef519d0948ff85c925acd226f06 differ diff --git a/.cache/pip/http-v2/0/5/8/9/6/0589682f53f4c502330bc0fa01138806ce0467c549c2af469b6afb31.body b/.cache/pip/http-v2/0/5/8/9/6/0589682f53f4c502330bc0fa01138806ce0467c549c2af469b6afb31.body new file mode 100644 index 0000000000000000000000000000000000000000..23662ce7ee5c52367ac94a50e4d94c6b39645938 Binary files /dev/null and b/.cache/pip/http-v2/0/5/8/9/6/0589682f53f4c502330bc0fa01138806ce0467c549c2af469b6afb31.body differ diff --git a/.cache/pip/http-v2/0/5/e/2/2/05e22b8b3169eed822187b7e670f3dc47b0666b777d95f87de8fb5e9 b/.cache/pip/http-v2/0/5/e/2/2/05e22b8b3169eed822187b7e670f3dc47b0666b777d95f87de8fb5e9 new file mode 100644 index 0000000000000000000000000000000000000000..139b4e616abfb19b0b6dc31e6be8b46c8783737e Binary files /dev/null and b/.cache/pip/http-v2/0/5/e/2/2/05e22b8b3169eed822187b7e670f3dc47b0666b777d95f87de8fb5e9 differ diff --git a/.cache/pip/http-v2/0/5/e/2/2/05e22b8b3169eed822187b7e670f3dc47b0666b777d95f87de8fb5e9.body b/.cache/pip/http-v2/0/5/e/2/2/05e22b8b3169eed822187b7e670f3dc47b0666b777d95f87de8fb5e9.body new file mode 100644 index 0000000000000000000000000000000000000000..2d625b1103171bf5397fd7ba37963210a8e6f6e9 Binary files /dev/null and b/.cache/pip/http-v2/0/5/e/2/2/05e22b8b3169eed822187b7e670f3dc47b0666b777d95f87de8fb5e9.body differ diff --git a/.cache/pip/http-v2/0/6/7/2/6/06726d442b7e33afe35f1740674b6dee72357a95eef3aca0ef7abf21.body b/.cache/pip/http-v2/0/6/7/2/6/06726d442b7e33afe35f1740674b6dee72357a95eef3aca0ef7abf21.body new file mode 100644 index 0000000000000000000000000000000000000000..9f0e284a0eccae8fb6dc5ab447fb27e0e8e93f73 Binary files /dev/null and b/.cache/pip/http-v2/0/6/7/2/6/06726d442b7e33afe35f1740674b6dee72357a95eef3aca0ef7abf21.body differ diff --git a/.cache/pip/http-v2/0/e/a/4/f/0ea4f1b2570ca3d64073f1277e4faa435bd7c7cbadafd80723949de4 b/.cache/pip/http-v2/0/e/a/4/f/0ea4f1b2570ca3d64073f1277e4faa435bd7c7cbadafd80723949de4 new file mode 100644 index 0000000000000000000000000000000000000000..abb0c0f67bab26f399acdeeccdd14ee65d8b01ab Binary files /dev/null and b/.cache/pip/http-v2/0/e/a/4/f/0ea4f1b2570ca3d64073f1277e4faa435bd7c7cbadafd80723949de4 differ diff --git a/.cache/pip/http-v2/0/e/a/4/f/0ea4f1b2570ca3d64073f1277e4faa435bd7c7cbadafd80723949de4.body b/.cache/pip/http-v2/0/e/a/4/f/0ea4f1b2570ca3d64073f1277e4faa435bd7c7cbadafd80723949de4.body new file mode 100644 index 0000000000000000000000000000000000000000..364212e23299a0667b2b7aa4d55882c745f0835b Binary files /dev/null and b/.cache/pip/http-v2/0/e/a/4/f/0ea4f1b2570ca3d64073f1277e4faa435bd7c7cbadafd80723949de4.body differ diff --git a/.cache/pip/http-v2/1/0/e/d/c/10edc2fedb88f9a82f91dc7f8666c74a4e7067dbd945b9923a040482.body b/.cache/pip/http-v2/1/0/e/d/c/10edc2fedb88f9a82f91dc7f8666c74a4e7067dbd945b9923a040482.body new file mode 100644 index 0000000000000000000000000000000000000000..dce5ab9707eb8600653f03c5b5bcacca7e2e8908 Binary files /dev/null and b/.cache/pip/http-v2/1/0/e/d/c/10edc2fedb88f9a82f91dc7f8666c74a4e7067dbd945b9923a040482.body differ diff --git a/.cache/pip/http-v2/1/6/9/3/2/1693297fb9daf7bfe370bf51d371acfeb8ff40759bf8650dfd404ba4.body b/.cache/pip/http-v2/1/6/9/3/2/1693297fb9daf7bfe370bf51d371acfeb8ff40759bf8650dfd404ba4.body new file mode 100644 index 0000000000000000000000000000000000000000..70638873c71135267bf1d09a94c52ff2df54b115 Binary files /dev/null and b/.cache/pip/http-v2/1/6/9/3/2/1693297fb9daf7bfe370bf51d371acfeb8ff40759bf8650dfd404ba4.body differ diff --git a/.cache/pip/http-v2/1/8/e/e/a/18eea207de73c88bb45229bed4bcc74fbcbddadf2aa9f49e4df1f66a b/.cache/pip/http-v2/1/8/e/e/a/18eea207de73c88bb45229bed4bcc74fbcbddadf2aa9f49e4df1f66a new file mode 100644 index 0000000000000000000000000000000000000000..1677ef4808d820976e251bbca3c765f631bc3a2f Binary files /dev/null and b/.cache/pip/http-v2/1/8/e/e/a/18eea207de73c88bb45229bed4bcc74fbcbddadf2aa9f49e4df1f66a differ diff --git a/.cache/pip/http-v2/1/a/9/9/5/1a995e0685d0b5c5a3f3321cda9ebcbc376a9137828d1c100a493532 b/.cache/pip/http-v2/1/a/9/9/5/1a995e0685d0b5c5a3f3321cda9ebcbc376a9137828d1c100a493532 new file mode 100644 index 0000000000000000000000000000000000000000..0ba594b53a730c09180e74b85c6c40912e24c0bf Binary files /dev/null and b/.cache/pip/http-v2/1/a/9/9/5/1a995e0685d0b5c5a3f3321cda9ebcbc376a9137828d1c100a493532 differ diff --git a/.cache/pip/http-v2/1/d/5/8/0/1d580297aa71908bf0d94823d03615447cfaaf5e778d47640756ae80 b/.cache/pip/http-v2/1/d/5/8/0/1d580297aa71908bf0d94823d03615447cfaaf5e778d47640756ae80 new file mode 100644 index 0000000000000000000000000000000000000000..77f0ca9989823698c49bdfe17fbb4534b4ae4d2a Binary files /dev/null and b/.cache/pip/http-v2/1/d/5/8/0/1d580297aa71908bf0d94823d03615447cfaaf5e778d47640756ae80 differ diff --git a/.cache/pip/http-v2/1/d/5/8/0/1d580297aa71908bf0d94823d03615447cfaaf5e778d47640756ae80.body b/.cache/pip/http-v2/1/d/5/8/0/1d580297aa71908bf0d94823d03615447cfaaf5e778d47640756ae80.body new file mode 100644 index 0000000000000000000000000000000000000000..8b01673fc8e1390d5b97d742bd8bdd8616bcbd6a Binary files /dev/null and b/.cache/pip/http-v2/1/d/5/8/0/1d580297aa71908bf0d94823d03615447cfaaf5e778d47640756ae80.body differ diff --git a/.cache/pip/http-v2/1/d/8/a/2/1d8a24cdff71edbc3f733b6b4d52640c1c1129289938aa4d1c7adcf5 b/.cache/pip/http-v2/1/d/8/a/2/1d8a24cdff71edbc3f733b6b4d52640c1c1129289938aa4d1c7adcf5 new file mode 100644 index 0000000000000000000000000000000000000000..a6ea6e68215f50545bac81c60535489a90cad0d9 Binary files /dev/null and b/.cache/pip/http-v2/1/d/8/a/2/1d8a24cdff71edbc3f733b6b4d52640c1c1129289938aa4d1c7adcf5 differ diff --git a/.cache/pip/http-v2/1/e/2/b/1/1e2b1734fc3c57a4733131da81a6167573fc77057172172ceee83a22 b/.cache/pip/http-v2/1/e/2/b/1/1e2b1734fc3c57a4733131da81a6167573fc77057172172ceee83a22 new file mode 100644 index 0000000000000000000000000000000000000000..2ca60cff4e68b9fd771d38eb44c54f559d9a564a Binary files /dev/null and b/.cache/pip/http-v2/1/e/2/b/1/1e2b1734fc3c57a4733131da81a6167573fc77057172172ceee83a22 differ diff --git a/.cache/pip/http-v2/1/e/2/b/1/1e2b1734fc3c57a4733131da81a6167573fc77057172172ceee83a22.body b/.cache/pip/http-v2/1/e/2/b/1/1e2b1734fc3c57a4733131da81a6167573fc77057172172ceee83a22.body new file mode 100644 index 0000000000000000000000000000000000000000..302f95a3887d56584030c86ab04acce169505a97 Binary files /dev/null and b/.cache/pip/http-v2/1/e/2/b/1/1e2b1734fc3c57a4733131da81a6167573fc77057172172ceee83a22.body differ diff --git a/.cache/pip/http-v2/4/2/f/8/a/42f8a0202dbbd3a131c6443d28a5b01775c53d41dec7e7928a8b5a4c.body b/.cache/pip/http-v2/4/2/f/8/a/42f8a0202dbbd3a131c6443d28a5b01775c53d41dec7e7928a8b5a4c.body new file mode 100644 index 0000000000000000000000000000000000000000..93f85177b97ec6be66b1ed74fc74cac756d1f72f --- /dev/null +++ b/.cache/pip/http-v2/4/2/f/8/a/42f8a0202dbbd3a131c6443d28a5b01775c53d41dec7e7928a8b5a4c.body @@ -0,0 +1,140 @@ +Metadata-Version: 2.1 +Name: multidict +Version: 6.1.0 +Summary: multidict implementation +Home-page: https://github.com/aio-libs/multidict +Author: Andrew Svetlov +Author-email: andrew.svetlov@gmail.com +License: Apache 2 +Project-URL: Chat: Matrix, https://matrix.to/#/#aio-libs:matrix.org +Project-URL: Chat: Matrix Space, https://matrix.to/#/#aio-libs-space:matrix.org +Project-URL: CI: GitHub, https://github.com/aio-libs/multidict/actions +Project-URL: Code of Conduct, https://github.com/aio-libs/.github/blob/master/CODE_OF_CONDUCT.md +Project-URL: Coverage: codecov, https://codecov.io/github/aio-libs/multidict +Project-URL: Docs: Changelog, https://multidict.aio-libs.org/en/latest/changes/ +Project-URL: Docs: RTD, https://multidict.aio-libs.org +Project-URL: GitHub: issues, https://github.com/aio-libs/multidict/issues +Project-URL: GitHub: repo, https://github.com/aio-libs/multidict +Classifier: Development Status :: 5 - Production/Stable +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: Apache Software License +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: 3.13 +Requires-Python: >=3.8 +Description-Content-Type: text/x-rst +License-File: LICENSE +Requires-Dist: typing-extensions >=4.1.0 ; python_version < "3.11" + +========= +multidict +========= + +.. image:: https://github.com/aio-libs/multidict/actions/workflows/ci-cd.yml/badge.svg + :target: https://github.com/aio-libs/multidict/actions + :alt: GitHub status for master branch + +.. image:: https://codecov.io/gh/aio-libs/multidict/branch/master/graph/badge.svg + :target: https://codecov.io/gh/aio-libs/multidict + :alt: Coverage metrics + +.. image:: https://img.shields.io/pypi/v/multidict.svg + :target: https://pypi.org/project/multidict + :alt: PyPI + +.. image:: https://readthedocs.org/projects/multidict/badge/?version=latest + :target: https://multidict.aio-libs.org + :alt: Read The Docs build status badge + +.. image:: https://img.shields.io/pypi/pyversions/multidict.svg + :target: https://pypi.org/project/multidict + :alt: Python versions + +.. image:: https://img.shields.io/matrix/aio-libs:matrix.org?label=Discuss%20on%20Matrix%20at%20%23aio-libs%3Amatrix.org&logo=matrix&server_fqdn=matrix.org&style=flat + :target: https://matrix.to/#/%23aio-libs:matrix.org + :alt: Matrix Room — #aio-libs:matrix.org + +.. image:: https://img.shields.io/matrix/aio-libs-space:matrix.org?label=Discuss%20on%20Matrix%20at%20%23aio-libs-space%3Amatrix.org&logo=matrix&server_fqdn=matrix.org&style=flat + :target: https://matrix.to/#/%23aio-libs-space:matrix.org + :alt: Matrix Space — #aio-libs-space:matrix.org + +Multidict is dict-like collection of *key-value pairs* where key +might occur more than once in the container. + +Introduction +------------ + +*HTTP Headers* and *URL query string* require specific data structure: +*multidict*. It behaves mostly like a regular ``dict`` but it may have +several *values* for the same *key* and *preserves insertion ordering*. + +The *key* is ``str`` (or ``istr`` for case-insensitive dictionaries). + +``multidict`` has four multidict classes: +``MultiDict``, ``MultiDictProxy``, ``CIMultiDict`` +and ``CIMultiDictProxy``. + +Immutable proxies (``MultiDictProxy`` and +``CIMultiDictProxy``) provide a dynamic view for the +proxied multidict, the view reflects underlying collection changes. They +implement the ``collections.abc.Mapping`` interface. + +Regular mutable (``MultiDict`` and ``CIMultiDict``) classes +implement ``collections.abc.MutableMapping`` and allows them to change +their own content. + + +*Case insensitive* (``CIMultiDict`` and +``CIMultiDictProxy``) assume the *keys* are case +insensitive, e.g.:: + + >>> dct = CIMultiDict(key='val') + >>> 'Key' in dct + True + >>> dct['Key'] + 'val' + +*Keys* should be ``str`` or ``istr`` instances. + +The library has optional C Extensions for speed. + + +License +------- + +Apache 2 + +Library Installation +-------------------- + +.. code-block:: bash + + $ pip install multidict + +The library is Python 3 only! + +PyPI contains binary wheels for Linux, Windows and MacOS. If you want to install +``multidict`` on another operating system (or *Alpine Linux* inside a Docker) the +tarball will be used to compile the library from source. It requires a C compiler and +Python headers to be installed. + +To skip the compilation, please use the `MULTIDICT_NO_EXTENSIONS` environment variable, +e.g.: + +.. code-block:: bash + + $ MULTIDICT_NO_EXTENSIONS=1 pip install multidict + +Please note, the pure Python (uncompiled) version is about 20-50 times slower depending on +the usage scenario!!! + + + +Changelog +--------- +See `RTD page `_. diff --git a/.cache/pip/http-v2/4/5/9/c/7/459c78bacdedb04c7e03d152081522ecf0ff46e1d14e7503997ea6c8.body b/.cache/pip/http-v2/4/5/9/c/7/459c78bacdedb04c7e03d152081522ecf0ff46e1d14e7503997ea6c8.body new file mode 100644 index 0000000000000000000000000000000000000000..b4644561e87eae1092218f778e679e0b3eb49e0e Binary files /dev/null and b/.cache/pip/http-v2/4/5/9/c/7/459c78bacdedb04c7e03d152081522ecf0ff46e1d14e7503997ea6c8.body differ diff --git a/.cache/pip/http-v2/4/a/7/8/1/4a7814588b6ac1f8145ad3d5ec0e03ad23d92f14a1ce01843a6998d7 b/.cache/pip/http-v2/4/a/7/8/1/4a7814588b6ac1f8145ad3d5ec0e03ad23d92f14a1ce01843a6998d7 new file mode 100644 index 0000000000000000000000000000000000000000..6b62f489484542322d3a5e84b9d97a1b26b853d2 Binary files /dev/null and b/.cache/pip/http-v2/4/a/7/8/1/4a7814588b6ac1f8145ad3d5ec0e03ad23d92f14a1ce01843a6998d7 differ diff --git a/.cache/pip/http-v2/4/a/7/8/1/4a7814588b6ac1f8145ad3d5ec0e03ad23d92f14a1ce01843a6998d7.body b/.cache/pip/http-v2/4/a/7/8/1/4a7814588b6ac1f8145ad3d5ec0e03ad23d92f14a1ce01843a6998d7.body new file mode 100644 index 0000000000000000000000000000000000000000..d26ba41e53abe7cf2372492a8f776394d878f269 Binary files /dev/null and b/.cache/pip/http-v2/4/a/7/8/1/4a7814588b6ac1f8145ad3d5ec0e03ad23d92f14a1ce01843a6998d7.body differ diff --git a/.cache/pip/http-v2/4/d/2/7/2/4d272e6453941ce8b0a37a02cdb1685fc612c33441fa74691fb40656 b/.cache/pip/http-v2/4/d/2/7/2/4d272e6453941ce8b0a37a02cdb1685fc612c33441fa74691fb40656 new file mode 100644 index 0000000000000000000000000000000000000000..1344053c6db690abeef4d8a25e3a1377526aa972 Binary files /dev/null and b/.cache/pip/http-v2/4/d/2/7/2/4d272e6453941ce8b0a37a02cdb1685fc612c33441fa74691fb40656 differ diff --git a/.cache/pip/http-v2/7/1/b/9/d/71b9df22187d5c54f1147d4ac0849d1438ec19aedc20363a3478b854 b/.cache/pip/http-v2/7/1/b/9/d/71b9df22187d5c54f1147d4ac0849d1438ec19aedc20363a3478b854 new file mode 100644 index 0000000000000000000000000000000000000000..378b3796ef0238f93ee960f2d9d531c888827245 Binary files /dev/null and b/.cache/pip/http-v2/7/1/b/9/d/71b9df22187d5c54f1147d4ac0849d1438ec19aedc20363a3478b854 differ diff --git a/.cache/pip/http-v2/7/2/2/9/f/7229fb50bdca3f16cb03ca953b540cb67fb07fb971b675db32ae3239 b/.cache/pip/http-v2/7/2/2/9/f/7229fb50bdca3f16cb03ca953b540cb67fb07fb971b675db32ae3239 new file mode 100644 index 0000000000000000000000000000000000000000..86e31e49db4f6f87a9bdd5ab37c30e91640a4694 Binary files /dev/null and b/.cache/pip/http-v2/7/2/2/9/f/7229fb50bdca3f16cb03ca953b540cb67fb07fb971b675db32ae3239 differ diff --git a/.cache/pip/http-v2/7/3/5/4/e/7354e15b7a2b590d713d4782bd16917fac9db3c087fa80d4d8dc0db5 b/.cache/pip/http-v2/7/3/5/4/e/7354e15b7a2b590d713d4782bd16917fac9db3c087fa80d4d8dc0db5 new file mode 100644 index 0000000000000000000000000000000000000000..311b804cea47dd3a6acd721b4b8ba1afa0df52f5 Binary files /dev/null and b/.cache/pip/http-v2/7/3/5/4/e/7354e15b7a2b590d713d4782bd16917fac9db3c087fa80d4d8dc0db5 differ diff --git a/.cache/pip/http-v2/7/3/5/4/e/7354e15b7a2b590d713d4782bd16917fac9db3c087fa80d4d8dc0db5.body b/.cache/pip/http-v2/7/3/5/4/e/7354e15b7a2b590d713d4782bd16917fac9db3c087fa80d4d8dc0db5.body new file mode 100644 index 0000000000000000000000000000000000000000..b693d7fbe074534658f95f66b015b75b785023c9 --- /dev/null +++ b/.cache/pip/http-v2/7/3/5/4/e/7354e15b7a2b590d713d4782bd16917fac9db3c087fa80d4d8dc0db5.body @@ -0,0 +1,212 @@ +Metadata-Version: 2.1 +Name: pytest +Version: 8.3.3 +Summary: pytest: simple powerful testing with Python +Author: Holger Krekel, Bruno Oliveira, Ronny Pfannschmidt, Floris Bruynooghe, Brianna Laugher, Florian Bruhin, Others (See AUTHORS) +License: MIT +Project-URL: Changelog, https://docs.pytest.org/en/stable/changelog.html +Project-URL: Homepage, https://docs.pytest.org/en/latest/ +Project-URL: Source, https://github.com/pytest-dev/pytest +Project-URL: Tracker, https://github.com/pytest-dev/pytest/issues +Project-URL: Twitter, https://twitter.com/pytestdotorg +Keywords: test,unittest +Classifier: Development Status :: 6 - Mature +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: MIT License +Classifier: Operating System :: MacOS +Classifier: Operating System :: Microsoft :: Windows +Classifier: Operating System :: POSIX +Classifier: Operating System :: Unix +Classifier: Programming Language :: Python :: 3 :: Only +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Topic :: Software Development :: Libraries +Classifier: Topic :: Software Development :: Testing +Classifier: Topic :: Utilities +Requires-Python: >=3.8 +Description-Content-Type: text/x-rst +License-File: LICENSE +License-File: AUTHORS +Requires-Dist: iniconfig +Requires-Dist: packaging +Requires-Dist: pluggy <2,>=1.5 +Requires-Dist: exceptiongroup >=1.0.0rc8 ; python_version < "3.11" +Requires-Dist: tomli >=1 ; python_version < "3.11" +Requires-Dist: colorama ; sys_platform == "win32" +Provides-Extra: dev +Requires-Dist: argcomplete ; extra == 'dev' +Requires-Dist: attrs >=19.2 ; extra == 'dev' +Requires-Dist: hypothesis >=3.56 ; extra == 'dev' +Requires-Dist: mock ; extra == 'dev' +Requires-Dist: pygments >=2.7.2 ; extra == 'dev' +Requires-Dist: requests ; extra == 'dev' +Requires-Dist: setuptools ; extra == 'dev' +Requires-Dist: xmlschema ; extra == 'dev' + +.. image:: https://github.com/pytest-dev/pytest/raw/main/doc/en/img/pytest_logo_curves.svg + :target: https://docs.pytest.org/en/stable/ + :align: center + :height: 200 + :alt: pytest + + +------ + +.. image:: https://img.shields.io/pypi/v/pytest.svg + :target: https://pypi.org/project/pytest/ + +.. image:: https://img.shields.io/conda/vn/conda-forge/pytest.svg + :target: https://anaconda.org/conda-forge/pytest + +.. image:: https://img.shields.io/pypi/pyversions/pytest.svg + :target: https://pypi.org/project/pytest/ + +.. image:: https://codecov.io/gh/pytest-dev/pytest/branch/main/graph/badge.svg + :target: https://codecov.io/gh/pytest-dev/pytest + :alt: Code coverage Status + +.. image:: https://github.com/pytest-dev/pytest/actions/workflows/test.yml/badge.svg + :target: https://github.com/pytest-dev/pytest/actions?query=workflow%3Atest + +.. image:: https://results.pre-commit.ci/badge/github/pytest-dev/pytest/main.svg + :target: https://results.pre-commit.ci/latest/github/pytest-dev/pytest/main + :alt: pre-commit.ci status + +.. image:: https://www.codetriage.com/pytest-dev/pytest/badges/users.svg + :target: https://www.codetriage.com/pytest-dev/pytest + +.. image:: https://readthedocs.org/projects/pytest/badge/?version=latest + :target: https://pytest.readthedocs.io/en/latest/?badge=latest + :alt: Documentation Status + +.. image:: https://img.shields.io/badge/Discord-pytest--dev-blue + :target: https://discord.com/invite/pytest-dev + :alt: Discord + +.. image:: https://img.shields.io/badge/Libera%20chat-%23pytest-orange + :target: https://web.libera.chat/#pytest + :alt: Libera chat + + +The ``pytest`` framework makes it easy to write small tests, yet +scales to support complex functional testing for applications and libraries. + +An example of a simple test: + +.. code-block:: python + + # content of test_sample.py + def inc(x): + return x + 1 + + + def test_answer(): + assert inc(3) == 5 + + +To execute it:: + + $ pytest + ============================= test session starts ============================= + collected 1 items + + test_sample.py F + + ================================== FAILURES =================================== + _________________________________ test_answer _________________________________ + + def test_answer(): + > assert inc(3) == 5 + E assert 4 == 5 + E + where 4 = inc(3) + + test_sample.py:5: AssertionError + ========================== 1 failed in 0.04 seconds =========================== + + +Due to ``pytest``'s detailed assertion introspection, only plain ``assert`` statements are used. See `getting-started `_ for more examples. + + +Features +-------- + +- Detailed info on failing `assert statements `_ (no need to remember ``self.assert*`` names) + +- `Auto-discovery + `_ + of test modules and functions + +- `Modular fixtures `_ for + managing small or parametrized long-lived test resources + +- Can run `unittest `_ (or trial) + test suites out of the box + +- Python 3.8+ or PyPy3 + +- Rich plugin architecture, with over 1300+ `external plugins `_ and thriving community + + +Documentation +------------- + +For full documentation, including installation, tutorials and PDF documents, please see https://docs.pytest.org/en/stable/. + + +Bugs/Requests +------------- + +Please use the `GitHub issue tracker `_ to submit bugs or request features. + + +Changelog +--------- + +Consult the `Changelog `__ page for fixes and enhancements of each version. + + +Support pytest +-------------- + +`Open Collective`_ is an online funding platform for open and transparent communities. +It provides tools to raise money and share your finances in full transparency. + +It is the platform of choice for individuals and companies that want to make one-time or +monthly donations directly to the project. + +See more details in the `pytest collective`_. + +.. _Open Collective: https://opencollective.com +.. _pytest collective: https://opencollective.com/pytest + + +pytest for enterprise +--------------------- + +Available as part of the Tidelift Subscription. + +The maintainers of pytest and thousands of other packages are working with Tidelift to deliver commercial support and +maintenance for the open source dependencies you use to build your applications. +Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. + +`Learn more. `_ + +Security +^^^^^^^^ + +pytest has never been associated with a security vulnerability, but in any case, to report a +security vulnerability please use the `Tidelift security contact `_. +Tidelift will coordinate the fix and disclosure. + + +License +------- + +Copyright Holger Krekel and others, 2004. + +Distributed under the terms of the `MIT`_ license, pytest is free and open source software. + +.. _`MIT`: https://github.com/pytest-dev/pytest/blob/main/LICENSE diff --git a/.cache/pip/http-v2/7/7/6/7/2/7767287c95ec4491394e4204f2ba3be9eb9e3ed9ca0ffd45d421b772.body b/.cache/pip/http-v2/7/7/6/7/2/7767287c95ec4491394e4204f2ba3be9eb9e3ed9ca0ffd45d421b772.body new file mode 100644 index 0000000000000000000000000000000000000000..38ed885c6d92ad5564a56fa0612b41be6897009e Binary files /dev/null and b/.cache/pip/http-v2/7/7/6/7/2/7767287c95ec4491394e4204f2ba3be9eb9e3ed9ca0ffd45d421b772.body differ diff --git a/.cache/pip/http-v2/7/c/4/b/8/7c4b8a19f4f69494c22868b76649cd91120de17447e4ff71fb7a7f10.body b/.cache/pip/http-v2/7/c/4/b/8/7c4b8a19f4f69494c22868b76649cd91120de17447e4ff71fb7a7f10.body new file mode 100644 index 0000000000000000000000000000000000000000..e1214ba35fd7c27198b64e78f8a7d6f43eef55c6 Binary files /dev/null and b/.cache/pip/http-v2/7/c/4/b/8/7c4b8a19f4f69494c22868b76649cd91120de17447e4ff71fb7a7f10.body differ diff --git a/.cache/pip/http-v2/7/e/1/d/d/7e1dd8fd372b5a4d9dab3a30df124fb3e1f8789a9ab79f867640876a.body b/.cache/pip/http-v2/7/e/1/d/d/7e1dd8fd372b5a4d9dab3a30df124fb3e1f8789a9ab79f867640876a.body new file mode 100644 index 0000000000000000000000000000000000000000..8044b1982dc1f7d49e59be149de34b4d983456cd Binary files /dev/null and b/.cache/pip/http-v2/7/e/1/d/d/7e1dd8fd372b5a4d9dab3a30df124fb3e1f8789a9ab79f867640876a.body differ diff --git a/.cache/pip/http-v2/a/6/6/7/4/a6674e44f8dbb270324765d1fb568b86858877aed299a2428f81e802 b/.cache/pip/http-v2/a/6/6/7/4/a6674e44f8dbb270324765d1fb568b86858877aed299a2428f81e802 new file mode 100644 index 0000000000000000000000000000000000000000..143f25f95455c0a9a62fdd14c0c5d8c988c0e61e Binary files /dev/null and b/.cache/pip/http-v2/a/6/6/7/4/a6674e44f8dbb270324765d1fb568b86858877aed299a2428f81e802 differ diff --git a/.cache/pip/http-v2/a/b/7/2/8/ab7286aff652f0ea3cc68322991122267ea675cbb86a9b1ccfe4ace3 b/.cache/pip/http-v2/a/b/7/2/8/ab7286aff652f0ea3cc68322991122267ea675cbb86a9b1ccfe4ace3 new file mode 100644 index 0000000000000000000000000000000000000000..2eaa507e1cbb217030e3b9447c1429551db66151 Binary files /dev/null and b/.cache/pip/http-v2/a/b/7/2/8/ab7286aff652f0ea3cc68322991122267ea675cbb86a9b1ccfe4ace3 differ diff --git a/.cache/pip/http-v2/a/d/e/c/9/adec97b9b98035179c2f2a0370fc49fcf626678705d2f38c1dcdafa7 b/.cache/pip/http-v2/a/d/e/c/9/adec97b9b98035179c2f2a0370fc49fcf626678705d2f38c1dcdafa7 new file mode 100644 index 0000000000000000000000000000000000000000..eeef5b22d4dfab8747e6960954a804788ebc63fd Binary files /dev/null and b/.cache/pip/http-v2/a/d/e/c/9/adec97b9b98035179c2f2a0370fc49fcf626678705d2f38c1dcdafa7 differ diff --git a/.cache/pip/http-v2/b/6/8/7/d/b687d90e2a44328db9c9ecd9af0a9c577a4e68f9d239bbb73aebc319.body b/.cache/pip/http-v2/b/6/8/7/d/b687d90e2a44328db9c9ecd9af0a9c577a4e68f9d239bbb73aebc319.body new file mode 100644 index 0000000000000000000000000000000000000000..d73e4958d741d6d243f093e3ad16927530159d03 --- /dev/null +++ b/.cache/pip/http-v2/b/6/8/7/d/b687d90e2a44328db9c9ecd9af0a9c577a4e68f9d239bbb73aebc319.body @@ -0,0 +1,62 @@ +Metadata-Version: 2.1 +Name: wheel +Version: 0.42.0 +Summary: A built-package format for Python +Keywords: wheel,packaging +Author-email: Daniel Holth +Maintainer-email: Alex Grönholm +Requires-Python: >=3.7 +Description-Content-Type: text/x-rst +Classifier: Development Status :: 5 - Production/Stable +Classifier: Intended Audience :: Developers +Classifier: Topic :: System :: Archiving :: Packaging +Classifier: License :: OSI Approved :: MIT License +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 3 :: Only +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Requires-Dist: pytest >= 6.0.0 ; extra == "test" +Requires-Dist: setuptools >= 65 ; extra == "test" +Project-URL: Changelog, https://wheel.readthedocs.io/en/stable/news.html +Project-URL: Documentation, https://wheel.readthedocs.io/ +Project-URL: Issue Tracker, https://github.com/pypa/wheel/issues +Project-URL: Source, https://github.com/pypa/wheel +Provides-Extra: test + +wheel +===== + +This library is the reference implementation of the Python wheel packaging +standard, as defined in `PEP 427`_. + +It has two different roles: + +#. A setuptools_ extension for building wheels that provides the + ``bdist_wheel`` setuptools command +#. A command line tool for working with wheel files + +It should be noted that wheel is **not** intended to be used as a library, and +as such there is no stable, public API. + +.. _PEP 427: https://www.python.org/dev/peps/pep-0427/ +.. _setuptools: https://pypi.org/project/setuptools/ + +Documentation +------------- + +The documentation_ can be found on Read The Docs. + +.. _documentation: https://wheel.readthedocs.io/ + +Code of Conduct +--------------- + +Everyone interacting in the wheel project's codebases, issue trackers, chat +rooms, and mailing lists is expected to follow the `PSF Code of Conduct`_. + +.. _PSF Code of Conduct: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md + diff --git a/.cache/pip/http-v2/b/8/b/f/4/b8bf4a44dbb1c5e59b2500975b68a4301d11f85878b612151a649c3d b/.cache/pip/http-v2/b/8/b/f/4/b8bf4a44dbb1c5e59b2500975b68a4301d11f85878b612151a649c3d new file mode 100644 index 0000000000000000000000000000000000000000..b6b3cc4ee4c46dae70393a9bb6b3ca7e42414027 Binary files /dev/null and b/.cache/pip/http-v2/b/8/b/f/4/b8bf4a44dbb1c5e59b2500975b68a4301d11f85878b612151a649c3d differ diff --git a/.cache/pip/http-v2/b/f/c/a/5/bfca522eaf7404612287f82a4ec69fbc52a846f5a5757f91528163da b/.cache/pip/http-v2/b/f/c/a/5/bfca522eaf7404612287f82a4ec69fbc52a846f5a5757f91528163da new file mode 100644 index 0000000000000000000000000000000000000000..cdd32f5ab18149aef9cafb48467d3ba958a4d80a Binary files /dev/null and b/.cache/pip/http-v2/b/f/c/a/5/bfca522eaf7404612287f82a4ec69fbc52a846f5a5757f91528163da differ diff --git a/.cache/pip/http-v2/b/f/d/6/3/bfd6322b8f4c82d6b7ed54608512187e126478b3b0851b74973f4adc.body b/.cache/pip/http-v2/b/f/d/6/3/bfd6322b8f4c82d6b7ed54608512187e126478b3b0851b74973f4adc.body new file mode 100644 index 0000000000000000000000000000000000000000..e4bc5215c98e475d1e8dbf4b6e09ee381819062e Binary files /dev/null and b/.cache/pip/http-v2/b/f/d/6/3/bfd6322b8f4c82d6b7ed54608512187e126478b3b0851b74973f4adc.body differ diff --git a/.launchpadlib/api.launchpad.net/cache/api.launchpad.net,devel,-application,json,fc4e1e3a03117146fb1e9d492ab76690 b/.launchpadlib/api.launchpad.net/cache/api.launchpad.net,devel,-application,json,fc4e1e3a03117146fb1e9d492ab76690 new file mode 100644 index 0000000000000000000000000000000000000000..e64ef2b4339e2e9a4cc3e55bb5dd3eab678a342a --- /dev/null +++ b/.launchpadlib/api.launchpad.net/cache/api.launchpad.net,devel,-application,json,fc4e1e3a03117146fb1e9d492ab76690 @@ -0,0 +1,19 @@ +status: 200 +date: Mon, 05 Feb 2024 23:25:35 GMT +server: Apache/2.4.41 (Ubuntu) +content-location: index.json +vary: negotiate,accept,Accept-Encoding +tcn: choice +last-modified: Wed, 31 Jan 2024 08:46:52 GMT +etag: "8fa-61039eb973700-gzip" +accept-ranges: bytes +content-type: application/json; qs=0.9 +x-cache: MISS from juju-98d295-prod-launchpad-30 +x-cache-lookup: MISS from juju-98d295-prod-launchpad-30:3128 +via: 1.1 juju-98d295-prod-launchpad-30 (squid/4.10) +content-length: 2298 +-content-encoding: gzip +-varied-accept: application/json +-varied-accept-encoding: gzip, deflate + +{"resource_type_link": "https://api.launchpad.net/devel/#service-root", "temporary_blobs_collection_link": "https://api.launchpad.net/devel/temporary-blobs", "countries_collection_link": "https://api.launchpad.net/devel/+countries", "languages_collection_link": "https://api.launchpad.net/devel/+languages", "questions_collection_link": "https://api.launchpad.net/devel/questions", "specifications_collection_link": "https://api.launchpad.net/devel/", "bug_trackers_collection_link": "https://api.launchpad.net/devel/bugs/bugtrackers", "cves_collection_link": "https://api.launchpad.net/devel/bugs/cve", "bugs_collection_link": "https://api.launchpad.net/devel/bugs", "builders_collection_link": "https://api.launchpad.net/devel/builders", "processors_collection_link": "https://api.launchpad.net/devel/+processors", "charm_bases_collection_link": "https://api.launchpad.net/devel/+charm-bases", "charm_recipes_collection_link": "https://api.launchpad.net/devel/+charm-recipes", "branches_collection_link": "https://api.launchpad.net/devel/branches", "git_repositories_collection_link": "https://api.launchpad.net/devel/+git", "snap_bases_collection_link": "https://api.launchpad.net/devel/+snap-bases", "snaps_collection_link": "https://api.launchpad.net/devel/+snaps", "snappy_serieses_collection_link": "https://api.launchpad.net/devel/+snappy-series", "archives_collection_link": "https://api.launchpad.net/devel/archives", "livefses_collection_link": "https://api.launchpad.net/devel/livefses", "packagesets_collection_link": "https://api.launchpad.net/devel/package-sets", "translation_groups_collection_link": "https://api.launchpad.net/devel/+groups", "translation_import_queue_entries_collection_link": "https://api.launchpad.net/devel/+imports", "distributions_collection_link": "https://api.launchpad.net/devel/distros", "people_collection_link": "https://api.launchpad.net/devel/people", "polls_collection_link": "https://api.launchpad.net/devel/+polls", "projects_collection_link": "https://api.launchpad.net/devel/projects", "project_groups_collection_link": "https://api.launchpad.net/devel/projectgroups", "services_link": "https://api.launchpad.net/devel/services", "pillars_link": "https://api.launchpad.net/devel/pillars", "me_link": "https://api.launchpad.net/devel/people/+me"} \ No newline at end of file diff --git a/.local/share/Trash/info/train_001.bin.trashinfo b/.local/share/Trash/info/train_001.bin.trashinfo new file mode 100644 index 0000000000000000000000000000000000000000..d0f9b6ad7194c791ebd1dad3f000b121e357397e --- /dev/null +++ b/.local/share/Trash/info/train_001.bin.trashinfo @@ -0,0 +1,3 @@ +[Trash Info] +Path=/root/data/fineweb/train_001.bin +DeletionDate=2024-09-26T05:50:34 diff --git a/.local/share/Trash/info/train_003.bin.trashinfo b/.local/share/Trash/info/train_003.bin.trashinfo new file mode 100644 index 0000000000000000000000000000000000000000..2a3f66fff4b1c43a67cc42523ff88d3e41e08604 --- /dev/null +++ b/.local/share/Trash/info/train_003.bin.trashinfo @@ -0,0 +1,3 @@ +[Trash Info] +Path=/root/data/fineweb/train_003.bin +DeletionDate=2024-09-26T05:50:34 diff --git a/.local/share/Trash/info/train_006.bin.trashinfo b/.local/share/Trash/info/train_006.bin.trashinfo new file mode 100644 index 0000000000000000000000000000000000000000..ce6fdadd29fd3f8a6477891a6d77a958379ce53b --- /dev/null +++ b/.local/share/Trash/info/train_006.bin.trashinfo @@ -0,0 +1,3 @@ +[Trash Info] +Path=/root/data/fineweb/train_006.bin +DeletionDate=2024-09-26T05:50:34 diff --git a/.local/share/Trash/info/train_007.bin.trashinfo b/.local/share/Trash/info/train_007.bin.trashinfo new file mode 100644 index 0000000000000000000000000000000000000000..6da1623e2c2a299758365054b15ce9127ffd5fd7 --- /dev/null +++ b/.local/share/Trash/info/train_007.bin.trashinfo @@ -0,0 +1,3 @@ +[Trash Info] +Path=/root/data/fineweb/train_007.bin +DeletionDate=2024-09-26T05:50:34 diff --git a/.local/share/jupyter/nbextensions/skip-traceback/icon.png b/.local/share/jupyter/nbextensions/skip-traceback/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..e1626da84d72f7cc5b6032b8de503b2bc540204d Binary files /dev/null and b/.local/share/jupyter/nbextensions/skip-traceback/icon.png differ diff --git a/.local/share/jupyter/nbextensions/skip-traceback/skip-traceback.png b/.local/share/jupyter/nbextensions/skip-traceback/skip-traceback.png new file mode 100644 index 0000000000000000000000000000000000000000..6138c6234f65bedeab6af03a86d64aabe5c07300 Binary files /dev/null and b/.local/share/jupyter/nbextensions/skip-traceback/skip-traceback.png differ diff --git a/.local/share/jupyter/nbextensions/snippets_menu/main.js b/.local/share/jupyter/nbextensions/snippets_menu/main.js new file mode 100644 index 0000000000000000000000000000000000000000..0dc0b30b4d433b3b28b8378a814800815a55bf1e --- /dev/null +++ b/.local/share/jupyter/nbextensions/snippets_menu/main.js @@ -0,0 +1,292 @@ +define([ + "require", + "jquery", + "base/js/namespace", + "./snippets_submenu_python", + "./snippets_submenu_markdown", +], function (requirejs, $, Jupyter, python, markdown) { + "use strict"; + + var mod_name = 'snippets_menu'; + var mod_log_prefix = mod_name + '[' + mod_name + ']'; + + var python_menus = [ + python.numpy, + python.scipy, + python.matplotlib, + python.sympy, + python.pandas, + python.astropy, + python.h5py, + python.numba, + python.python, + ]; + + var default_menus = [ + { + 'name' : 'Snippets', + 'sub-menu-direction' : 'left', + 'sub-menu' : python_menus.concat([markdown]), + }, + ]; + var options = { + sibling: undefined, // if undefined, set by cfg.sibling_selector + menus : [], + hooks: { + pre_config: undefined, + post_config: undefined, + } + }; + + var includable_submenu_keys = [ + "numpy", + "scipy", + "matplotlib", + "sympy", + "pandas", + "astropy", + "h5py", + "numba", + "python", + "markdown", + ]; + // default parameters + var cfg = { + insert_as_new_cell: false, + insert_before_sibling: false, + include_custom_menu: false, + include_submenu: {}, // default set after this definition + sibling_selector: '#help_menu', + top_level_submenu_goes_left: true, + // The default has to be included here as well as config.yaml + // because the configurator will not store the default given + // in config.yaml unless it is changed. That means that this + // should be kept up-to-date with whatever goes in + // config.yaml. + custom_menu_content: JSON.stringify({ + "name" : "My favorites", + "sub-menu" : [{ + "name" : "Menu item text", + "snippet" : [ + "import something", + "", + "new_command(3.14)", + "other_new_code_on_new_line('with a string!')", + "stringy(\"if you need them, escape double quotes with a single backslash\")", + "backslashy('This \\ appears as just one backslash in the output')", + "backslashy2('Here \\\\ are two backslashes')" + ]}, { + "name" : "TeX can be written in menu labels $\\alpha_W e\\int_0 \\mu \\epsilon$", + "snippet" : [ + "another_new_command(2.78)" + ] + } + ] + }) + }; + for (var ii=0; ii< includable_submenu_keys.length; ii++) { + cfg.include_submenu[includable_submenu_keys[ii]] = true; + } + + function config_loaded_callback () { + if (options['pre_config_hook'] !== undefined) { + options['pre_config_hook'](); + } + + // true => deep + cfg = $.extend(true, cfg, Jupyter.notebook.config.data.snippets); + + if (cfg.insert_as_new_cell) { + console.log(mod_log_prefix, "Insertions will insert new cell"); + } + + // If `options.menus` had elements added in custom.js, skip all of this and ignore all remaining options + if (options.menus.length > 0) { + console.log(mod_log_prefix, '`options.menus` was created in custom.js; skipping all other configuration.'); + } + else { + options.menus = [ + { + 'name' : 'Snippets', + 'sub-menu-direction' : cfg.top_level_submenu_goes_left ? 'left' : 'right', + 'sub-menu' : [], + }, + ]; + + if (cfg.include_custom_menu) { + var custom_menu_content = JSON.parse(cfg.custom_menu_content); + console.log(mod_log_prefix, + "Inserting custom", custom_menu_content.name, "sub-menu"); + options.menus[0]['sub-menu'].push(custom_menu_content); + } + + for (var ii=0; ii < includable_submenu_keys.length; ii++) { + var key = includable_submenu_keys[ii]; + if (cfg.include_submenu[key]) { + console.log(mod_log_prefix, + "Inserting default", key, "sub-menu"); + options.menus[0]['sub-menu'].push(key === "markdown" ? markdown : python[key]); + } + } + } + + if (options.hooks.post_config !== undefined) { + options.hooks.post_config(); + } + + // select correct sibling + if (options.sibling === undefined) { + options.sibling = $(cfg.sibling_selector).parent(); + if (options.sibling.length < 1) { + options.sibling = $("#help_menu").parent(); + } + } + } + + function insert_snippet_code (snippet_code) { + if (cfg.insert_as_new_cell) { + var new_cell = Jupyter.notebook.insert_cell_above('code'); + new_cell.set_text(snippet_code); + new_cell.focus_cell(); + } + else { + var selected_cell = Jupyter.notebook.get_selected_cell(); + Jupyter.notebook.edit_mode(); + selected_cell.code_mirror.replaceSelection(snippet_code, 'around'); + } + } + + function callback_insert_snippet (evt) { + // this (or event.currentTarget, see below) always refers to the DOM + // element the listener was attached to - see + // http://stackoverflow.com/questions/12077859 + insert_snippet_code($(evt.currentTarget).data('snippet-code')); + } + + function build_menu_element (menu_item_spec, direction) { + // Create the menu item html element + var element = $('
  • '); + + if (typeof menu_item_spec == 'string') { + if (menu_item_spec != '---') { + console.log(mod_log_prefix, + 'Don\'t understand sub-menu string "' + menu_item_spec + '"'); + return null; + } + return element.addClass('divider'); + } + + var a = $('') + .attr('href', '#') + .html(menu_item_spec.name) + .appendTo(element); + if (menu_item_spec.hasOwnProperty('snippet')) { + var snippet = menu_item_spec.snippet; + if (typeof snippet == 'string' || snippet instanceof String) { + snippet = [snippet]; + } + a.attr({ + 'title' : "", // Do not remove this, even though it's empty! + 'data-snippet-code' : snippet.join('\n'), + }) + .on('click', callback_insert_snippet) + .addClass('snippet'); + } + else if (menu_item_spec.hasOwnProperty('internal-link')) { + a.attr('href', menu_item_spec['internal-link']); + } + else if (menu_item_spec.hasOwnProperty('external-link')) { + a.empty(); + a.attr({ + 'target' : '_blank', + 'title' : 'Opens in a new window', + 'href' : menu_item_spec['external-link'], + }); + $('').appendTo(a); + $('').html(menu_item_spec.name).appendTo(a); + } + + if (menu_item_spec.hasOwnProperty('sub-menu')) { + element + .addClass('dropdown-submenu') + .toggleClass('dropdown-submenu-left', direction === 'left'); + var sub_element = $('