Skip to content

Instantly share code, notes, and snippets.

@costrouc
costrouc / schema.json
Last active October 6, 2023 14:15
nebari schema
{"title": "ConfigSchema", "type": "object", "properties": {"helm_extensions": {"title": "Helm Extensions", "default": [], "type": "array", "items": {"$ref": "#/definitions/HelmExtension"}}, "tf_extensions": {"title": "Tf Extensions", "default": [], "type": "array", "items": {"$ref": "#/definitions/NebariExtension"}}, "prefect": {"title": "Prefect", "default": {"enabled": false, "image": null, "overrides": {}, "token": null}, "allOf": [{"$ref": "#/definitions/Prefect"}]}, "default_images": {"title": "Default Images", "default": {"jupyterhub": "quay.io/nebari/nebari-jupyterhub:2023.7.2", "jupyterlab": "quay.io/nebari/nebari-jupyterlab:2023.7.2", "dask_worker": "quay.io/nebari/nebari-dask-worker:2023.7.2"}, "allOf": [{"$ref": "#/definitions/DefaultImages"}]}, "storage": {"title": "Storage", "default": {"conda_store": "200Gi", "shared_filesystem": "200Gi"}, "allOf": [{"$ref": "#/definitions/Storage"}]}, "theme": {"title": "Theme", "default": {"jupyterhub": {"hub_title": "Nebari", "hub_subtitle": "Your open source
from rq import Queue
from redis import Redis
import tasks
import time
import contextlib
@contextlib.contextmanager
def timer(message: str):
start_time = time.time()
  graph TD;
      A-->B;
      A-->C;
      B-->D;
      C-->D;
{"title": "Nebari Schema", "$ref": "#/definitions/ConfigSchema", "definitions": {"Prefect": {"title": "Prefect", "type": "object", "properties": {"enabled": {"title": "Enabled", "default": false, "type": "boolean"}, "image": {"title": "Image", "type": "string"}, "overrides": {"title": "Overrides", "default": {}, "type": "object"}, "token": {"title": "Token", "type": "string"}}, "additionalProperties": false}, "CDSDashboards": {"title": "CDSDashboards", "type": "object", "properties": {"enabled": {"title": "Enabled", "default": true, "type": "boolean"}, "cds_hide_user_named_servers": {"title": "Cds Hide User Named Servers", "default": true, "type": "boolean"}, "cds_hide_user_dashboard_servers": {"title": "Cds Hide User Dashboard Servers", "default": false, "type": "boolean"}}, "additionalProperties": false}, "DefaultImages": {"title": "DefaultImages", "type": "object", "properties": {"jupyterhub": {"title": "Jupyterhub", "default": "quay.io/nebari/nebari-jupyterhub:2023.5.1", "type": "string"}, "jupyterlab": {
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import re
import dataclasses
@dataclasses.dataclass
class Token:
type: str
value: str
def tokenize(tokens, text):
regex = '|'.join([f'(?P<{name}>{pattern})' for name, pattern in tokens.items()])
### Keybase proof
I hereby claim:
* I am costrouc on github.
* I am costrouc (https://keybase.io/costrouc) on keybase.
* I have a public key whose fingerprint is C2C0 41F0 21CB F58E 9BEB 3ED9 9ED5 9B0A B1EA F573
To claim this, I am signing this object:
{ pkgs ? import <nixpkgs> { }, pythonPackages ? pkgs.python3Packages }:
let pythonEnv = pythonPackages.python.withPackages
(ps: with ps; [ numpy jupyterlab ]);
in {
shell = pkgs.mkShell {
buildInputs = [ pythonEnv ];
};
@costrouc
costrouc / shell.nix
Created July 17, 2019 18:12
Typical shell recipe
{ pkgs ? import <nixpkgs> { }, pythonPackages ? pkgs.python3Packages }:
let
pkgs = import (builtins.fetchTarball {
url = "https://github.com/costrouc/nixpkgs/archive/46976eff15c48713f2aa99bdbafa8229cb031262.tar.gz";
sha256 = "1q32jjv87n4dqchi00bj11bmy99pp72qdy3wy4c4fqxxchh63y38";
}) { };
pythonPackages = pkgs.python3Packages;
$ nix-shell -p nix-review --run "nix-review pr 64952"
$ git fetch --force https://github.com/NixOS/nixpkgs python-unstable:refs/nix-review/0 pu
ll/64952/head:refs/nix-review/1
From https://github.com/NixOS/nixpkgs
+ b8f84b24dee...e87daaa520e python-unstable -> refs/nix-review/0 (forced update)
+ 75bba3db2a5...1659822cd41 refs/pull/64952/head -> refs/nix-review/1 (forced update)
$ git worktree add /home/costrouc/.cache/nix-review/pr-64952/nixpkgs e87daaa520e086aafc48
9ed047f54712a1281a00
Preparing worktree (detached HEAD e87daaa520e)
HEAD is now at e87daaa520e python: scikit-learn: 0.20.3 -> 0.21.2