file_path
stringlengths
3
280
file_language
stringclasses
66 values
content
stringlengths
1
1.04M
repo_name
stringlengths
5
92
repo_stars
int64
0
154k
repo_description
stringlengths
0
402
repo_primary_language
stringclasses
108 values
developer_username
stringlengths
1
25
developer_name
stringlengths
0
30
developer_company
stringlengths
0
82
next-app/src/components/sidebar/labelDropdown.tsx
TypeScript (TSX)
import { Card, CardContent, Grid, Typography } from "@mui/material"; export const LabelDropdown = (props: any) => ( <Card {...props}> <CardContent> <Grid container spacing={3}> <Grid item> <Typography variant="h5">Label Dropdown</Typography> </Grid> </Grid> </CardContent...
yurijmikhalevich/lightning-pod-vision
0
An End to End ML Product Example
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
next-app/src/components/sidebar/modelCard.tsx
TypeScript (TSX)
import { Card, CardContent, Grid, Typography } from "@mui/material"; export const ModelCard = (props: any) => ( <Card {...props}> <CardContent> <Grid container spacing={3}> <Grid item> <Typography variant="h5">Model Card</Typography> </Grid> </Grid> </CardContent> </Ca...
yurijmikhalevich/lightning-pod-vision
0
An End to End ML Product Example
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
next-app/src/components/sidebar/sidebarGrid.tsx
TypeScript (TSX)
import { Container, Grid } from "@mui/material"; import { LabelDropdown } from "./labelDropdown"; import { ModelCard } from "./modelCard"; export const SideBarGrid = () => ( <Grid container lg={3} sm={6} xl={3} xs={12} direction={"column"}> <Grid> <LabelDropdown /> </Grid> <br /> <Grid> ...
yurijmikhalevich/lightning-pod-vision
0
An End to End ML Product Example
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
next-app/src/pages/_app.tsx
TypeScript (TSX)
import "@/styles/globals.css"; import { Container, Grid } from "@mui/material"; import NavBar from "../components/mainPage/navBar"; import { MetricsGrid } from "../components/metrics/metricsGrid"; import { SideBarGrid } from "../components/sidebar/sidebarGrid"; import { ImageGrid } from "../components/graphs/imageGrid"...
yurijmikhalevich/lightning-pod-vision
0
An End to End ML Product Example
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
next-app/src/pages/index.tsx
TypeScript (TSX)
import React from "react"; import App from "./_app"; export default function Home() { return <App />; }
yurijmikhalevich/lightning-pod-vision
0
An End to End ML Product Example
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
next-app/src/styles/globals.css
CSS
/* # Copyright Justin R. Goheen. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
yurijmikhalevich/lightning-pod-vision
0
An End to End ML Product Example
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
setup.py
Python
# Copyright Justin R. Goheen. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
yurijmikhalevich/lightning-pod-vision
0
An End to End ML Product Example
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
tests/test_datamodule.py
Python
# Copyright Justin R. Goheen. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
yurijmikhalevich/lightning-pod-vision
0
An End to End ML Product Example
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
tests/test_network_module.py
Python
# Copyright Justin R. Goheen. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
yurijmikhalevich/lightning-pod-vision
0
An End to End ML Product Example
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
visionpod/__init__.py
Python
# Copyright Justin R. Goheen. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
yurijmikhalevich/lightning-pod-vision
0
An End to End ML Product Example
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
visionpod/cli/__init__.py
Python
# Copyright Justin R. Goheen. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
yurijmikhalevich/lightning-pod-vision
0
An End to End ML Product Example
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
visionpod/cli/console.py
Python
# Copyright Justin R. Goheen. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
yurijmikhalevich/lightning-pod-vision
0
An End to End ML Product Example
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
visionpod/cli/utils.py
Python
# Copyright Justin R. Goheen. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
yurijmikhalevich/lightning-pod-vision
0
An End to End ML Product Example
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
visionpod/components/__init__.py
Python
# Copyright Justin R. Goheen. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
yurijmikhalevich/lightning-pod-vision
0
An End to End ML Product Example
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
visionpod/components/hpo/__init__.py
Python
# Copyright Justin R. Goheen. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
yurijmikhalevich/lightning-pod-vision
0
An End to End ML Product Example
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
visionpod/components/hpo/sweep.py
Python
# Copyright Justin R. Goheen. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
yurijmikhalevich/lightning-pod-vision
0
An End to End ML Product Example
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
visionpod/conf.py
Python
# Copyright Justin R. Goheen. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
yurijmikhalevich/lightning-pod-vision
0
An End to End ML Product Example
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
visionpod/core/__init__.py
Python
# Copyright Justin R. Goheen. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
yurijmikhalevich/lightning-pod-vision
0
An End to End ML Product Example
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
visionpod/core/module.py
Python
# Copyright Justin R. Goheen. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
yurijmikhalevich/lightning-pod-vision
0
An End to End ML Product Example
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
visionpod/core/trainer.py
Python
# Copyright Justin R. Goheen. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
yurijmikhalevich/lightning-pod-vision
0
An End to End ML Product Example
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
visionpod/fabric/bugreport/bugreport.py
Python
# Copyright The PyTorch Lightning team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
yurijmikhalevich/lightning-pod-vision
0
An End to End ML Product Example
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
visionpod/fabric/bugreport/trainer.py
Python
# Copyright Justin R. Goheen. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
yurijmikhalevich/lightning-pod-vision
0
An End to End ML Product Example
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
visionpod/pipeline/__init__.py
Python
# Copyright Justin R. Goheen. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
yurijmikhalevich/lightning-pod-vision
0
An End to End ML Product Example
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
visionpod/pipeline/datamodule.py
Python
# Copyright Justin R. Goheen. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
yurijmikhalevich/lightning-pod-vision
0
An End to End ML Product Example
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
visionpod/pipeline/dataset.py
Python
# Copyright Justin R. Goheen. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
yurijmikhalevich/lightning-pod-vision
0
An End to End ML Product Example
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
visionpod/pipeline/preprocess.py
Python
# Copyright Justin R. Goheen. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
yurijmikhalevich/lightning-pod-vision
0
An End to End ML Product Example
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
benchmarks/benchmark-cifar.py
Python
import os from typing import Iterable, List, Tuple, cast from PIL import Image import numpy as np from tqdm import tqdm from benchmarks.config import DATASET_DIR, BATCH_SIZE from rclip import model from torchvision.datasets import CIFAR100 def main(): cifar100 = CIFAR100(root=os.path.join(DATASET_DIR, "cifar100")...
yurijmikhalevich/rclip
900
AI-Powered Command-Line Photo Search Tool
Python
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
benchmarks/benchmark-imagenet.py
Python
import os import tempfile import numpy as np from tqdm import tqdm from benchmarks.config import BATCH_SIZE, DATASET_DIR from benchmarks.datasets.imagenet_1k.classes import IMAGENET2012_CLASSES # type: ignore from rclip import model, db from rclip.main import RClip # To run this benchmark, clone imagenet-1k datase...
yurijmikhalevich/rclip
900
AI-Powered Command-Line Photo Search Tool
Python
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
benchmarks/config.py
Python
import os DATASET_DIR = os.getenv("BENCHMARK_DATASET_DIR", os.path.join(os.path.dirname(__file__), "datasets")) BATCH_SIZE = int(os.getenv("BENCHMARK_BATCH_SIZE", 256))
yurijmikhalevich/rclip
900
AI-Powered Command-Line Photo Search Tool
Python
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
benchmarks/similarity_search.py
Python
import os import tempfile import numpy as np from tqdm import tqdm from benchmarks.config import BATCH_SIZE, DATASET_DIR from benchmarks.datasets.imagenet_1k.classes import IMAGENET2012_CLASSES # type: ignore from rclip import model, db from rclip.main import RClip # To run this benchmark, clone imagenet-1k datase...
yurijmikhalevich/rclip
900
AI-Powered Command-Line Photo Search Tool
Python
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
rclip/const.py
Python
import sys IS_MACOS = sys.platform == "darwin" IS_LINUX = sys.platform.startswith("linux") IS_WINDOWS = sys.platform == "win32" or sys.platform == "cygwin" # these images are always processed IMAGE_EXT = ["jpg", "jpeg", "png", "webp", "heic"] # RAW images are processed only if there is no processed image alongside i...
yurijmikhalevich/rclip
900
AI-Powered Command-Line Photo Search Tool
Python
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
rclip/db.py
Python
import os.path import pathlib import sqlite3 from typing import Any, Optional, TypedDict, Union class ImageOmittable(TypedDict, total=False): deleted: bool class NewImage(ImageOmittable): filepath: str modified_at: float size: int vector: bytes class Image(NewImage): id: int class DB: VERSION = 2 ...
yurijmikhalevich/rclip
900
AI-Powered Command-Line Photo Search Tool
Python
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
rclip/fs.py
Python
import os from typing import Callable, Pattern COUNT_FILES_UPDATE_EVERY = 10_000 def count_files( directory: str, exclude_dir_re: Pattern[str], file_re: Pattern[str], on_change: Callable[[int], None] ) -> None: prev_update_count = 0 count = 0 for _ in walk(directory, exclude_dir_re, file_re): count += 1 ...
yurijmikhalevich/rclip
900
AI-Powered Command-Line Photo Search Tool
Python
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
rclip/main.py
Python
import itertools import os import re import sys import threading from typing import Iterable, List, NamedTuple, Optional, Tuple, TypedDict, cast import numpy as np from tqdm import tqdm import PIL from PIL import Image, ImageFile from pillow_heif import register_heif_opener from rclip import db, fs, model from rclip....
yurijmikhalevich/rclip
900
AI-Powered Command-Line Photo Search Tool
Python
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
rclip/model.py
Python
import re from typing import List, Tuple, Optional, cast import sys import numpy as np import numpy.typing as npt from PIL import Image, UnidentifiedImageError from rclip.utils import helpers from importlib.metadata import version import open_clip QUERY_WITH_MULTIPLIER_RE = re.compile(r"^(?P<multiplier>(\d+(\.\d+)?|\...
yurijmikhalevich/rclip
900
AI-Powered Command-Line Photo Search Tool
Python
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
rclip/utils/helpers.py
Python
import argparse import os import pathlib import textwrap from typing import IO, cast from PIL import Image, UnidentifiedImageError import re import numpy as np import rawpy import requests import sys from importlib.metadata import version from rclip.const import IMAGE_RAW_EXT, IS_LINUX, IS_MACOS, IS_WINDOWS MAX_DOWN...
yurijmikhalevich/rclip
900
AI-Powered Command-Line Photo Search Tool
Python
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
rclip/utils/preview.py
Python
import base64 from io import BytesIO import os from PIL import Image from rclip.utils.helpers import read_image def _get_start_sequence(): term_env_var = os.getenv("TERM") if term_env_var and (term_env_var.startswith("screen") or term_env_var.startswith("tmux")): return "\033Ptmux;\033\033]" return "\033]"...
yurijmikhalevich/rclip
900
AI-Powered Command-Line Photo Search Tool
Python
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
rclip/utils/snap.py
Python
import os import sys def is_snap(): return bool(os.getenv("SNAP")) def get_snap_permission_error( directory: str, symlink_path: str | None, is_current_directory: bool = False, ) -> str: homedir = os.getenv("SNAP_REAL_HOME") if not homedir: return ( "SNAP_REAL_HOME environment variable is not s...
yurijmikhalevich/rclip
900
AI-Powered Command-Line Photo Search Tool
Python
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
release-utils/appimage/appimage_after_bundle.sh
Shell
#!/usr/bin/env bash set -e PYTHONHOME=$APPDIR/usr \ PYTHONPATH=$APPDIR/usr/lib/python3/dist-packages:$APPDIR/usr/lib/python3.10 \ LD_LIBRARY_PATH=$APPDIR/usr/lib/x86_64-linux-gnu \ which python3.10 && python3.10 -m pip install poetry==1.8.4 && python3.10 -m pip install --upgrade --isolated --no-input --ignore-install...
yurijmikhalevich/rclip
900
AI-Powered Command-Line Photo Search Tool
Python
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
release-utils/homebrew/generate_formula.py
Python
import hashlib from time import sleep import jinja2 import poet import requests import sys env = jinja2.Environment(trim_blocks=True) TEMPLATE = env.from_string("""class Rclip < Formula include Language::Python::Virtualenv desc "AI-Powered Command-Line Photo Search Tool" homepage "https://github.com/yurijmikh...
yurijmikhalevich/rclip
900
AI-Powered Command-Line Photo Search Tool
Python
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
release-utils/homebrew/release.sh
Shell
#!/bin/bash set -e # the script requires gh cli and git to be installed and configured # and push permissions to https://github.com/yurijmikhalevich/homebrew-tap ORIG_PWD=$(pwd) VERSION=$(poetry version -s) TMP_DIR=$(mktemp -d -t release-rclip-brew-XXXXXXXXXX) cd $TMP_DIR echo "Working in $TMP_DIR" function handle_...
yurijmikhalevich/rclip
900
AI-Powered Command-Line Photo Search Tool
Python
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
release-utils/windows/build-msi.ps1
PowerShell
param ( [string]$Version ) if (-not $Version) { throw "Version is not specified" } Set-StrictMode -Version Latest $ErrorActionPreference = "Stop" $currentDir = Get-Location $templatePath = Join-Path -Path $currentDir -ChildPath "release-utils\windows\template.aip" $advinst = New-Object -ComObject AdvancedIns...
yurijmikhalevich/rclip
900
AI-Powered Command-Line Photo Search Tool
Python
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
tests/e2e/test_rclip.py
Python
from pathlib import Path import os import subprocess import sys import tempfile import pytest def set_argv(*args: str): script_name = sys.argv[0] sys.argv.clear() sys.argv.append(script_name) sys.argv.extend(args) @pytest.fixture def test_images_dir(): return Path(__file__).parent / "images" @pytest.fi...
yurijmikhalevich/rclip
900
AI-Powered Command-Line Photo Search Tool
Python
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
tests/unit/test_model.py
Python
import tempfile from typing import List, cast import open_clip import pytest import torch from rclip.model import Model def test_extract_query_multiplier(): assert Model._extract_query_multiplier("1.5:cat") == (1.5, "cat") # type: ignore assert Model._extract_query_multiplier("cat") == (1.0, "cat") # type: ign...
yurijmikhalevich/rclip
900
AI-Powered Command-Line Photo Search Tool
Python
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
benchmarks/objectnet.py
Python
# This is an image tagging benchmark run against the ObjectNet dataset https://objectnet.dev/ # The ObjectNet dataset is used because it was collected to intentionally show objects from # new viewpoints on new backgrounds. And the results obtained on the ObjectNet dataset are # more representative of the performance yo...
yurijmikhalevich/rtag
12
AI-Powered Command-Line Photo Tagging Tool
Python
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
rtag/main.py
Python
import os from rtag import utils from rclip.main import init_rclip from iptcinfo3 import IPTCInfo import numpy as np import textwrap import sys from tqdm import tqdm def get_imagenet_tags_filepath(): return os.path.join(os.path.dirname(__file__), 'data', 'imagenet-labels.txt') def load_tags_from_file(path: str): ...
yurijmikhalevich/rtag
12
AI-Powered Command-Line Photo Tagging Tool
Python
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
rtag/utils.py
Python
import argparse import os from importlib.metadata import version from rclip.const import IS_MACOS from rclip.utils.helpers import is_mps_available def positive_int_arg_type(arg: str) -> int: arg_int = int(arg) if arg_int < 1: raise argparse.ArgumentTypeError('should be >0') return arg_int def get_terminal...
yurijmikhalevich/rtag
12
AI-Powered Command-Line Photo Tagging Tool
Python
yurijmikhalevich
Yurij Mikhalevich
Makes magic at QAWolf 🐺
jupyter_sshd_proxy/__init__.py
Python
import os import shutil import shlex import subprocess from typing import Any, Dict HOSTKEY_PATH = os.path.expanduser('~/.ssh/jupyter_sshd_hostkey') AUTHORIZED_KEYS_PATH = os.environ.get('JUPYTER_SSHD_PROXY_AUTHORIZED_KEYS_PATH', '.ssh/authorized_keys .ssh/authorized_keys2') SSHD_LOG_LEVEL = os.environ.get('JUPYTER_S...
yuvipanda/jupyter-sshd-proxy
15
Run sshd under Jupyter
Python
yuvipanda
Yuvi
2i2c-org
setup.py
Python
import setuptools from os import path HERE = path.abspath(path.dirname(__file__)) with open(path.join(HERE, 'README.md'), encoding='utf-8') as f: long_description = f.read() setuptools.setup( name="jupyter-sshd-proxy", version='0.3.0', url="https://github.com/yuvipanda/jupyter-sshd-proxy", author=...
yuvipanda/jupyter-sshd-proxy
15
Run sshd under Jupyter
Python
yuvipanda
Yuvi
2i2c-org
tests/test_ssh.py
Python
import tempfile import pexpect import os import shlex import pytest import subprocess import secrets import getpass import time import socket from urllib.request import urlopen, Request from urllib.error import URLError @pytest.fixture def random_port(): """Get a single random port.""" # You aren't supposed to...
yuvipanda/jupyter-sshd-proxy
15
Run sshd under Jupyter
Python
yuvipanda
Yuvi
2i2c-org
dokku.bash
Shell
#!/bin/bash set -euo pipefail # Dokku entrypoint, to make life easier exec python3 -m jupyterbook_pub.app \ --JupyterBookPubApp.debug=true \ --JupyterBookPubApp.port=${PORT} \ --JupyterBookPubApp.built_sites_root=/opt/persistent/sites \ --JupyterBookPubApp.repo_checkout_root=/opt/persistent/repos
yuvipanda/jupyterbook.pub
0
Python
yuvipanda
Yuvi
2i2c-org
js/.sassrc.js
JavaScript
module.exports = { silenceDeprecations: ['import', 'mixed-decls', 'color-functions', 'global-builtin'] }
yuvipanda/jupyterbook.pub
0
Python
yuvipanda
Yuvi
2i2c-org
js/src/App.tsx
TypeScript (TSX)
import './App.css'; import { LinkGenerator } from './LinkGenerator'; export function App() { return ( <> <div className='container'> <div className='mx-auto col-8'> <div className='text-center mt-4'> <h1>JupyterBook.pub</h1> <h5>Instantly build and share your Jupyt...
yuvipanda/jupyterbook.pub
0
Python
yuvipanda
Yuvi
2i2c-org
js/src/LinkGenerator.tsx
TypeScript (TSX)
import { useEffect, useState } from "react"; import copy from "copy-to-clipboard"; import { Answer, resolve } from "./resolver"; import { useDebounce } from 'use-debounce'; function makeShareableLink(repoUrl: string) { // FIXME: I am committing a cardinal sin here that makes it difficult to host this under subpath...
yuvipanda/jupyterbook.pub
0
Python
yuvipanda
Yuvi
2i2c-org
js/src/index.html
HTML
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>JupyterBook.pub</title> <link href="./index.scss" rel="stylesheet" /> </head> <body> <div id="root"></div> </body> <script src="./index.js" type="module"></script> </ht...
yuvipanda/jupyterbook.pub
0
Python
yuvipanda
Yuvi
2i2c-org
js/src/index.js
JavaScript
import { createRoot } from "react-dom/client"; import { App } from "./App"; const container = document.getElementById("root"); const root = createRoot(container) root.render(<App />);
yuvipanda/jupyterbook.pub
0
Python
yuvipanda
Yuvi
2i2c-org
js/src/index.scss
SCSS
@import "bootstrap/scss/bootstrap"; // Update the import directory to point to it‘s location within node_modules $bootstrap-icons-font-dir: "../node_modules/bootstrap-icons/font/fonts"; // Import the Sass files as usual @import "bootstrap-icons/font/bootstrap-icons";
yuvipanda/jupyterbook.pub
0
Python
yuvipanda
Yuvi
2i2c-org
js/src/index.tsx
TypeScript (TSX)
import { createRoot } from 'react-dom/client'; import { StrictMode } from 'react'; import { App } from './App'; let container = document.getElementById("app")!; let root = createRoot(container) root.render( <StrictMode> <App /> </StrictMode> );
yuvipanda/jupyterbook.pub
0
Python
yuvipanda
Yuvi
2i2c-org
js/src/resolver.ts
TypeScript
export interface Answer { certainity: "Exists" | "MaybeExists" | "DoesNotExist" kind: string data: object } export async function resolve(question: string) : Promise<Answer | null> { // FIXME: BaseURL support plz const queryUrl = new URL("api/v1/resolve", window.location.origin); queryUrl.searc...
yuvipanda/jupyterbook.pub
0
Python
yuvipanda
Yuvi
2i2c-org
src/jupyterbook_pub/__init__.py
Python
# Copyright (c) 2026 Yuvi # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # ...
yuvipanda/jupyterbook.pub
0
Python
yuvipanda
Yuvi
2i2c-org
src/jupyterbook_pub/app.py
Python
from __future__ import annotations import asyncio import logging import mimetypes import os import shutil import socket import sys from pathlib import Path from typing import Optional, override import tornado from cachetools import TTLCache from jinja2 import Environment, FileSystemLoader from repoproviders import fe...
yuvipanda/jupyterbook.pub
0
Python
yuvipanda
Yuvi
2i2c-org
src/jupyterbook_pub/cache.py
Python
""" Various caching utilities. Since we serve a lot of static files, we will rely heavily on caching to make sure we can serve a ton of users very cheaply. """ import hashlib import json from base64 import urlsafe_b64encode from repoproviders.resolvers.base import MaybeExists, Repo from repoproviders.resolvers.seria...
yuvipanda/jupyterbook.pub
0
Python
yuvipanda
Yuvi
2i2c-org
src/jupyterbook_pub/templates/home.html
HTML
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>JupyterBook.pub</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-sRIl4kxILFvY47J16cr9ZwB0...
yuvipanda/jupyterbook.pub
0
Python
yuvipanda
Yuvi
2i2c-org
src/repoproviders/__init__.py
Python
# Copyright (c) 2024 Yuvi Panda # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaime...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
src/repoproviders/__main__.py
Python
import argparse import asyncio import logging import sys from pathlib import Path from repoproviders.resolvers.base import DoesNotExist, Exists, MaybeExists from .fetchers import fetch from .resolvers import resolve async def main(): argparser = argparse.ArgumentParser() argparser.add_argument( "--l...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
src/repoproviders/fetchers/__init__.py
Python
from .fetcher import fetch # noqa: F401
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
src/repoproviders/fetchers/base.py
Python
from logging import Logger from pathlib import Path from typing import Any, Protocol class SupportsFetch(Protocol): async def fetch(self, repo: Any, output_dir: Path, log: Logger): pass
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
src/repoproviders/fetchers/ckan.py
Python
from logging import Logger from pathlib import Path import aiohttp from yarl import URL from ..resolvers.repos import CKANDataset from ..utils import download_file class CKANFetcher: async def fetch(self, repo: CKANDataset, output_dir: Path, log: Logger): api_url = (repo.installationUrl / "api/3/action/...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
src/repoproviders/fetchers/dataverse.py
Python
import os from logging import Logger from pathlib import Path import aiohttp from ..resolvers.doi import DataverseDataset from ..utils import download_file class DataverseFetcher: async def fetch(self, repo: DataverseDataset, output_dir: Path, log: Logger): files_url = repo.installationUrl / "api/datase...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
src/repoproviders/fetchers/fetcher.py
Python
import inspect import types import typing from logging import Logger, getLogger from pathlib import Path from typing import Optional from repoproviders.fetchers.ckan import CKANFetcher from repoproviders.fetchers.hydroshare import HydroshareFetcher from repoproviders.fetchers.rclone import GoogleDriveFolderFetcher fro...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
src/repoproviders/fetchers/figshare.py
Python
from logging import Logger from pathlib import Path from tempfile import NamedTemporaryFile from zipfile import ZipFile import aiohttp from ..resolvers.doi import ImmutableFigshareDataset from ..utils import FIGSHARE_PUBLIC_TOKEN, download_file class FigshareFetcher: async def fetch( self, repo: Immutab...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
src/repoproviders/fetchers/git.py
Python
from logging import Logger from pathlib import Path from subprocess import CalledProcessError from tempfile import NamedTemporaryFile from zipfile import ZipFile import aiohttp from yarl import URL from repoproviders.resolvers.repos import GitHubActionArtifact from ..resolvers.git import ImmutableGit from ..utils im...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
src/repoproviders/fetchers/hydroshare.py
Python
from logging import Logger from pathlib import Path from tempfile import NamedTemporaryFile from zipfile import ZipFile import aiohttp from yarl import URL from ..resolvers.repos import HydroshareDataset from ..utils import download_file class HydroshareFetcher: async def fetch(self, repo: HydroshareDataset, ou...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
src/repoproviders/fetchers/rclone.py
Python
import json import subprocess from logging import Logger from pathlib import Path from shutil import which from tempfile import NamedTemporaryFile from repoproviders.resolvers.rclone import GoogleDriveFolder, ImmutableGoogleDriveFolder from ..utils import GCP_PUBLIC_SERVICE_ACCOUNT_KEY class GoogleDriveFolderFetche...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
src/repoproviders/fetchers/zenodo.py
Python
import os import shutil from logging import Logger from pathlib import Path from tempfile import NamedTemporaryFile from zipfile import ZipFile import aiohttp from ..resolvers.doi import ZenodoDataset from ..utils import download_file class ZenodoFetcher: async def fetch(self, repo: ZenodoDataset, output_dir: P...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
src/repoproviders/resolvers/__init__.py
Python
from .resolver import resolve # noqa: F401 from .serialize import to_json # noqa: F401
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
src/repoproviders/resolvers/base.py
Python
from dataclasses import Field, dataclass from logging import Logger from typing import Any, ClassVar, Protocol, runtime_checkable @dataclass(frozen=True) class DoesNotExist[T: Repo]: """ Resolver recognizes this question, but while resolving determined it does not exist """ # womp womp, we can't real...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
src/repoproviders/resolvers/doi.py
Python
import os from logging import Logger import aiohttp from yarl import URL from ..utils import FIGSHARE_PUBLIC_TOKEN from .base import DoesNotExist, Exists, MaybeExists from .repos import ( DataverseDataset, DataverseURL, Doi, FigshareDataset, FigshareURL, ImmutableFigshareDataset, ZenodoDat...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
src/repoproviders/resolvers/feature_detect.py
Python
from json import JSONDecodeError from logging import Logger import aiohttp from yarl import URL from .base import Exists, MaybeExists from .repos import CKANDataset, DataverseURL, Git, GitLabURL class FeatureDetectResolver: """ Use external network calls to detect what kinda URL this is. Resolver of la...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
src/repoproviders/resolvers/git.py
Python
import re from logging import Logger from aiohttp import ClientSession from yarl import URL from repoproviders.utils import exec_process from .base import DoesNotExist, Exists, MaybeExists from .repos import ( GistURL, Git, GitHubActionArtifact, GitHubPR, GitHubURL, GitLabURL, ImmutableGi...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
src/repoproviders/resolvers/rclone.py
Python
import json from dataclasses import dataclass from logging import Logger from shutil import which from tempfile import NamedTemporaryFile from repoproviders.resolvers.base import DoesNotExist, Exists from ..utils import GCP_PUBLIC_SERVICE_ACCOUNT_KEY, exec_process, make_dir_hash @dataclass(frozen=True) class Google...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
src/repoproviders/resolvers/repos.py
Python
from dataclasses import dataclass from yarl import URL @dataclass(frozen=True) class Git: repo: str ref: str immutable = False @dataclass(frozen=True) class ImmutableGit: """ Same as Git, but marked to be fully resolved. This implies: 1. The repository exists, and can be contacted 2. ...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
src/repoproviders/resolvers/resolver.py
Python
import inspect import types import typing from logging import Logger, getLogger from typing import Any, Optional from yarl import URL from repoproviders.resolvers.feature_detect import FeatureDetectResolver from .base import DoesNotExist, Exists, MaybeExists, SupportsResolve from .doi import ( DataverseResolver,...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
src/repoproviders/resolvers/serialize.py
Python
import dataclasses import json from typing import Any from yarl import URL from repoproviders.resolvers.base import DoesNotExist, Exists, MaybeExists from .base import Repo class JSONEncoder(json.JSONEncoder): def default(self, o: URL | Any | type) -> str | Any: if isinstance(o, URL): retur...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
src/repoproviders/resolvers/wellknown.py
Python
import json from logging import Logger from pathlib import Path from typing import Callable from yarl import URL from repoproviders.resolvers.rclone import GoogleDriveFolder from .base import MaybeExists, Repo from .repos import ( DataverseURL, Doi, FigshareInstallation, FigshareURL, GistURL, ...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
src/repoproviders/utils.py
Python
import asyncio import binascii import hashlib import json import time from base64 import standard_b64decode, urlsafe_b64encode from logging import Logger from pathlib import Path from typing import Optional import aiohttp from yarl import URL # A public service account JSON key, used to make API requests for Google D...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
tests/conftest.py
Python
import logging import pytest @pytest.fixture() def log() -> logging.Logger: return logging.getLogger()
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
tests/fetchers/test_ckan.py
Python
import hashlib from logging import Logger from pathlib import Path from tempfile import TemporaryDirectory import pytest from repoproviders.fetchers import fetch from repoproviders.resolvers import resolve from repoproviders.resolvers.base import DoesNotExist @pytest.mark.parametrize( ("questions", "md5tree"), ...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
tests/fetchers/test_dataverse.py
Python
import hashlib from logging import Logger from pathlib import Path from tempfile import TemporaryDirectory import pytest from repoproviders.fetchers import fetch from repoproviders.resolvers import resolve from repoproviders.resolvers.base import Exists @pytest.mark.parametrize( ("questions", "md5tree"), [ ...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
tests/fetchers/test_figshare.py
Python
import hashlib from logging import Logger from pathlib import Path from tempfile import TemporaryDirectory import pytest from repoproviders.fetchers import fetch from repoproviders.resolvers import resolve from repoproviders.resolvers.base import DoesNotExist @pytest.mark.parametrize( ("questions", "md5tree"), ...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
tests/fetchers/test_github_actions_artifacts.py
Python
import hashlib from logging import Logger from pathlib import Path from tempfile import TemporaryDirectory import pytest from repoproviders.fetchers import fetch from repoproviders.resolvers import resolve from repoproviders.resolvers.base import DoesNotExist @pytest.mark.parametrize( ("questions", "md5tree"), ...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
tests/fetchers/test_google_drive.py
Python
import hashlib from logging import Logger from pathlib import Path from tempfile import TemporaryDirectory import pytest from repoproviders.fetchers import fetch from repoproviders.resolvers import resolve from repoproviders.resolvers.base import DoesNotExist @pytest.mark.parametrize( ("questions", "md5tree"), ...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
tests/fetchers/test_hydroshare.py
Python
import hashlib from logging import Logger from pathlib import Path from tempfile import TemporaryDirectory import pytest from repoproviders.fetchers import fetch from repoproviders.resolvers import resolve from repoproviders.resolvers.base import DoesNotExist @pytest.mark.parametrize( ("questions", "md5tree"), ...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
tests/fetchers/test_zenodo.py
Python
import hashlib from logging import Logger from pathlib import Path from tempfile import TemporaryDirectory import pytest from repoproviders.fetchers import fetch from repoproviders.resolvers import resolve from repoproviders.resolvers.base import DoesNotExist @pytest.mark.parametrize( ("questions", "md5tree"), ...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
tests/resolvers/test_dataverse.py
Python
import pytest from yarl import URL from repoproviders.resolvers.base import DoesNotExist, Exists from repoproviders.resolvers.doi import DataverseResolver from repoproviders.resolvers.repos import DataverseDataset, DataverseURL @pytest.mark.parametrize( ("url", "expected"), ( # A dataset citation ret...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
tests/resolvers/test_doi.py
Python
import pytest from yarl import URL from repoproviders.resolvers.base import Exists from repoproviders.resolvers.doi import Doi, DoiResolver @pytest.mark.parametrize( ("url", "expected"), ( ("https://example.com/something", None), # doi schema'd URI ( "doi:10.7910/DVN/6ZXAG...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
tests/resolvers/test_feature_detect.py
Python
import pytest from yarl import URL from repoproviders.resolvers.base import Exists, MaybeExists from repoproviders.resolvers.feature_detect import FeatureDetectResolver from repoproviders.resolvers.git import Git from repoproviders.resolvers.repos import CKANDataset, DataverseURL @pytest.mark.parametrize( ("url"...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
tests/resolvers/test_figshare.py
Python
import pytest from yarl import URL from repoproviders.resolvers.base import DoesNotExist, Exists, MaybeExists from repoproviders.resolvers.doi import FigshareResolver, ImmutableFigshareResolver from repoproviders.resolvers.repos import ( FigshareDataset, FigshareInstallation, FigshareURL, ImmutableFigs...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
tests/resolvers/test_gist.py
Python
import pytest from yarl import URL from repoproviders.resolvers.base import MaybeExists from repoproviders.resolvers.git import GistResolver, Git from repoproviders.resolvers.repos import GistURL @pytest.mark.parametrize( ("url", "expected"), ( # Gist URLs that aren't gists ( Gist...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org
tests/resolvers/test_github.py
Python
import pytest from yarl import URL from repoproviders.resolvers.base import DoesNotExist, MaybeExists from repoproviders.resolvers.git import Git, GitHubPRResolver, GitHubResolver from repoproviders.resolvers.repos import GitHubActionArtifact, GitHubPR, GitHubURL @pytest.mark.parametrize( ("url", "expected"), ...
yuvipanda/repoproviders
1
Detect, resolve and fetch repositories of content
Python
yuvipanda
Yuvi
2i2c-org