repo
stringlengths
7
90
file_url
stringlengths
81
315
file_path
stringlengths
4
228
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:38:15
2026-01-05 02:33:18
truncated
bool
2 classes
openvpi/SingingVocoders
https://github.com/openvpi/SingingVocoders/blob/dbc848fa4de79a9181d359d4656b3634bc79d415/modules/lvc_ddsp/pcmer.py
modules/lvc_ddsp/pcmer.py
import torch from torch import nn import math from functools import partial from einops import rearrange, repeat # from local_attention import LocalAttention import torch.nn.functional as F #import fast_transformers.causal_product.causal_product_cuda class PCmer(nn.Module): """The encoder that is used in ...
python
MIT
dbc848fa4de79a9181d359d4656b3634bc79d415
2026-01-05T07:10:51.192436Z
false
openvpi/SingingVocoders
https://github.com/openvpi/SingingVocoders/blob/dbc848fa4de79a9181d359d4656b3634bc79d415/modules/lvc_ddsp/loss.py
modules/lvc_ddsp/loss.py
import numpy as np import torch import torch.nn as nn import torchaudio from torch.nn import functional as F from .core import upsample class HybridLoss(nn.Module): def __init__(self, block_size, fft_min, fft_max, n_scale, lambda_uv, device): super().__init__() self.loss_rss_func = RSSLoss(fft_min...
python
MIT
dbc848fa4de79a9181d359d4656b3634bc79d415
2026-01-05T07:10:51.192436Z
false
openvpi/SingingVocoders
https://github.com/openvpi/SingingVocoders/blob/dbc848fa4de79a9181d359d4656b3634bc79d415/modules/lvc_ddsp/__init__.py
modules/lvc_ddsp/__init__.py
python
MIT
dbc848fa4de79a9181d359d4656b3634bc79d415
2026-01-05T07:10:51.192436Z
false
openvpi/SingingVocoders
https://github.com/openvpi/SingingVocoders/blob/dbc848fa4de79a9181d359d4656b3634bc79d415/modules/lvc_ddsp/vocoder.py
modules/lvc_ddsp/vocoder.py
import os import numpy as np import yaml import torch import torch.nn.functional as F from librosa.filters import mel as librosa_mel_fn from .mel2control import Mel2Control from .core import frequency_filter, upsample, remove_above_fmax from ..lvc.lvcnet import LVCNetGenerator class DotDict(dict): def __getattr__...
python
MIT
dbc848fa4de79a9181d359d4656b3634bc79d415
2026-01-05T07:10:51.192436Z
false
openvpi/SingingVocoders
https://github.com/openvpi/SingingVocoders/blob/dbc848fa4de79a9181d359d4656b3634bc79d415/modules/optimizer/muon.py
modules/optimizer/muon.py
import torch import torch.nn as nn import torch.nn.functional as F from torch import Tensor from torch.nn import Module, Parameter, Embedding from typing import List from itertools import repeat from .chained_optimizer import ChainedOptimizer, OptimizerSpec coeffs_list = [ (8.28721201814563, -23.595886519098837, 1...
python
MIT
dbc848fa4de79a9181d359d4656b3634bc79d415
2026-01-05T07:10:51.192436Z
false
openvpi/SingingVocoders
https://github.com/openvpi/SingingVocoders/blob/dbc848fa4de79a9181d359d4656b3634bc79d415/modules/optimizer/chained_optimizer.py
modules/optimizer/chained_optimizer.py
import torch from torch import Tensor from torch.optim import Optimizer from dataclasses import dataclass from typing import Any, Dict, List, Type, Callable, Optional, Iterable @dataclass class OptimizerSpec: """Spec for creating an optimizer that is part of a `ChainedOptimizer`.""" class_type: Type[Optimize...
python
MIT
dbc848fa4de79a9181d359d4656b3634bc79d415
2026-01-05T07:10:51.192436Z
false
sanand0/tools-in-data-science-public
https://github.com/sanand0/tools-in-data-science-public/blob/5dc00954854ff600b0f003df2486a8775a91e5d2/llm-cmd-agent.py
llm-cmd-agent.py
#!/usr/bin/env python3 # /// script # requires-python = ">=3.9" # dependencies = ["requests"] # /// import requests import os import subprocess import sys import re from typing import Dict, List, Optional, Tuple # Get API key from environment variable OPENAI_API_KEY = os.getenv("OPENAI_API_KEY") if not OPENAI_API_KEY...
python
MIT
5dc00954854ff600b0f003df2486a8775a91e5d2
2026-01-05T07:10:51.078938Z
false
sanand0/tools-in-data-science-public
https://github.com/sanand0/tools-in-data-science-public/blob/5dc00954854ff600b0f003df2486a8775a91e5d2/project-1/datagen.py
project-1/datagen.py
# DISCLAIMER: THIS SCRIPT WILL CHANGE BEFORE THE EVALUATION. TREAT THIS AS A GUIDE. # Usage: uv run datagen.py <email> # /// script # requires-python = ">=3.13" # dependencies = [ # "faker", # "pillow", # ] # /// import datetime import hashlib import json import os import random import sqlite3 import time fr...
python
MIT
5dc00954854ff600b0f003df2486a8775a91e5d2
2026-01-05T07:10:51.078938Z
false
sanand0/tools-in-data-science-public
https://github.com/sanand0/tools-in-data-science-public/blob/5dc00954854ff600b0f003df2486a8775a91e5d2/project-1/similarity.py
project-1/similarity.py
# /// script # requires-python = ">=3.12" # dependencies = [ # "datasketch", # "pandas", # "platformdirs", # "python-dotenv", # ] # /// import ast import os import pandas as pd import tokenize from datasketch import MinHash from io import BytesIO class RemoveDocstrings(ast.NodeTransformer): def v...
python
MIT
5dc00954854ff600b0f003df2486a8775a91e5d2
2026-01-05T07:10:51.078938Z
false
sanand0/tools-in-data-science-public
https://github.com/sanand0/tools-in-data-science-public/blob/5dc00954854ff600b0f003df2486a8775a91e5d2/project-1/evaluate.py
project-1/evaluate.py
# /// script # requires-python = ">=3.13" # dependencies = [ # "faker", # "httpx", # "lxml", # "numpy", # "pillow", # "python-dateutil", # ] # /// import hashlib import httpx import io import json import logging import numpy as np import os import random import re import subprocess from dateutil...
python
MIT
5dc00954854ff600b0f003df2486a8775a91e5d2
2026-01-05T07:10:51.078938Z
false
sanand0/tools-in-data-science-public
https://github.com/sanand0/tools-in-data-science-public/blob/5dc00954854ff600b0f003df2486a8775a91e5d2/project-llm-analysis-quiz/promptfight.py
project-llm-analysis-quiz/promptfight.py
# /// script # requires-python = ">=3.12" # dependencies = [ # "httpx", # "pandas", # "tenacity", # ] # /// import asyncio import os import pandas as pd import httpx from collections import Counter from tenacity import ( AsyncRetrying, retry_if_exception_type, stop_after_attempt, wait_expon...
python
MIT
5dc00954854ff600b0f003df2486a8775a91e5d2
2026-01-05T07:10:51.078938Z
false
sanand0/tools-in-data-science-public
https://github.com/sanand0/tools-in-data-science-public/blob/5dc00954854ff600b0f003df2486a8775a91e5d2/project-llm-analysis-quiz/evaluation.py
project-llm-analysis-quiz/evaluation.py
""" We need scoring that is fair, easy to explain, and robust to uneven match counts. Below are four complementary mechanisms grounded in common education/assessment practices (simple points, normalized rates, and difficulty-adjusted credit). ## 1) Simple Win Points (baseline, “1 point per win”) - Each duel yields exa...
python
MIT
5dc00954854ff600b0f003df2486a8775a91e5d2
2026-01-05T07:10:51.078938Z
false
sanand0/tools-in-data-science-public
https://github.com/sanand0/tools-in-data-science-public/blob/5dc00954854ff600b0f003df2486a8775a91e5d2/live-sessions/update.py
live-sessions/update.py
#!/usr/bin/env -S uv run from pathlib import Path def update() -> None: """Run the updater.""" ROOT = Path(__file__).resolve().parent playlist = [line.split("\t", 2) for line in (ROOT / "playlist.tsv").read_text().splitlines()] faqs = {path.stem.split("-", 1)[-1]: path.name for path in ROOT.glob("*-*....
python
MIT
5dc00954854ff600b0f003df2486a8775a91e5d2
2026-01-05T07:10:51.078938Z
false
clearhanhui/LearnLibTorch
https://github.com/clearhanhui/LearnLibTorch/blob/305d571da3cf71119811c94f4e060ec51c37ebcf/chap2/python/TensorBasics.py
chap2/python/TensorBasics.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' @File : CreateTensor.py @Time : 2022/07/06 @Author : Han Hui @Contact : clearhanhui@gmail.com ''' import torch # 创建张量 def tensor_init(): a = torch.zeros((2,3)) b = torch.ones((2,3)) c = torch.eye(4) d = torch.full_like(a, 10) e = t...
python
MIT
305d571da3cf71119811c94f4e060ec51c37ebcf
2026-01-05T07:10:52.390633Z
false
clearhanhui/LearnLibTorch
https://github.com/clearhanhui/LearnLibTorch/blob/305d571da3cf71119811c94f4e060ec51c37ebcf/chap5/python/PracticeModels.py
chap5/python/PracticeModels.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' @File : Lenet5MNIST.py @Time : 2022/07/13 @Author : Han Hui @Contact : clearhanhui@gmail.com ''' import sys import math import torch import torch.nn as nn import torch.nn.functional as F import torchvision import torchvision.transforms as transforms fr...
python
MIT
305d571da3cf71119811c94f4e060ec51c37ebcf
2026-01-05T07:10:52.390633Z
false
clearhanhui/LearnLibTorch
https://github.com/clearhanhui/LearnLibTorch/blob/305d571da3cf71119811c94f4e060ec51c37ebcf/chap5/python/utils.py
chap5/python/utils.py
# This utils script is from [pygcn](https://github.com/tkipf/pygcn) import numpy as np import scipy.sparse as sp import torch def encode_onehot(labels): classes = set(labels) classes_dict = {c: np.identity(len(classes))[i, :] for i, c in enumerate(classes)} labels_onehot = np.array(li...
python
MIT
305d571da3cf71119811c94f4e060ec51c37ebcf
2026-01-05T07:10:52.390633Z
false
clearhanhui/LearnLibTorch
https://github.com/clearhanhui/LearnLibTorch/blob/305d571da3cf71119811c94f4e060ec51c37ebcf/chap1/python/HelloWorld.py
chap1/python/HelloWorld.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' @File : HelloWorld.py @Time : 2022/07/06 16:15:32 @Author : Han Hui @Contact : clearhanhui@gmail.com ''' import torch tensor = torch.zeros((2, 3)) print(tensor) print("\nWelcome to LibTorch!")
python
MIT
305d571da3cf71119811c94f4e060ec51c37ebcf
2026-01-05T07:10:52.390633Z
false
clearhanhui/LearnLibTorch
https://github.com/clearhanhui/LearnLibTorch/blob/305d571da3cf71119811c94f4e060ec51c37ebcf/chap7/check_profile.py
chap7/check_profile.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' @File : check_profile.py @Time : 2022/07/28 @Author : Han Hui @Contact : clearhanhui@gmail.com ''' import time import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import gradcheck from python.extend import GCNLayerFun...
python
MIT
305d571da3cf71119811c94f4e060ec51c37ebcf
2026-01-05T07:10:52.390633Z
false
clearhanhui/LearnLibTorch
https://github.com/clearhanhui/LearnLibTorch/blob/305d571da3cf71119811c94f4e060ec51c37ebcf/chap7/python/extend.py
chap7/python/extend.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' @File : extend.py @Time : 2022/07/21 @Author : Han Hui @Contact : clearhanhui@gmail.com ''' import torch import torch.nn as nn from torch.autograd.function import Function try: import gc_cpp # must after `import torch` except: print("\nModule g...
python
MIT
305d571da3cf71119811c94f4e060ec51c37ebcf
2026-01-05T07:10:52.390633Z
false
clearhanhui/LearnLibTorch
https://github.com/clearhanhui/LearnLibTorch/blob/305d571da3cf71119811c94f4e060ec51c37ebcf/chap7/python/__init__.py
chap7/python/__init__.py
python
MIT
305d571da3cf71119811c94f4e060ec51c37ebcf
2026-01-05T07:10:52.390633Z
false
clearhanhui/LearnLibTorch
https://github.com/clearhanhui/LearnLibTorch/blob/305d571da3cf71119811c94f4e060ec51c37ebcf/chap7/csrc/setup.py
chap7/csrc/setup.py
from setuptools import Extension, setup from torch.utils.cpp_extension import BuildExtension, CppExtension, include_paths, library_paths # libraries = ['c10', 'torch', 'torch_cpu', 'torch_python'] # modules = [Extension( # name='gc_cpp', # package name # sources=['gc_layer.cpp'], # include_dirs=include_paths...
python
MIT
305d571da3cf71119811c94f4e060ec51c37ebcf
2026-01-05T07:10:52.390633Z
false
clearhanhui/LearnLibTorch
https://github.com/clearhanhui/LearnLibTorch/blob/305d571da3cf71119811c94f4e060ec51c37ebcf/chap4/python/BasicModels.py
chap4/python/BasicModels.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' @File : BasicModels.py @Time : 2022/07/07 @Author : Han Hui @Contact : clearhanhui@gmail.com ''' import torch # 生成线性数据 w = torch.tensor([[1.0, 2.0]]) x = torch.rand((20, 2)) b = torch.randn((20, 1)) + 3 y = x.mm(w.t()) + b # 生成图像数据 img0 = torch.randn(...
python
MIT
305d571da3cf71119811c94f4e060ec51c37ebcf
2026-01-05T07:10:52.390633Z
false
clearhanhui/LearnLibTorch
https://github.com/clearhanhui/LearnLibTorch/blob/305d571da3cf71119811c94f4e060ec51c37ebcf/chap6/python/export_model.py
chap6/python/export_model.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' @File : train_export_model.py @Time : 2022/07/18 @Author : Han Hui @Contact : clearhanhui@gmail.com ''' import sys import torch import torch.nn as nn import torch.nn.functional as F class LeNet5(nn.Module): def __init__(self): super().__in...
python
MIT
305d571da3cf71119811c94f4e060ec51c37ebcf
2026-01-05T07:10:52.390633Z
false
clearhanhui/LearnLibTorch
https://github.com/clearhanhui/LearnLibTorch/blob/305d571da3cf71119811c94f4e060ec51c37ebcf/chap3/python/AutoGrad.py
chap3/python/AutoGrad.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' @File : AutoGrad.py @Time : 2022/07/07 @Author : Han Hui @Contact : clearhanhui@gmail.com ''' import torch x = torch.tensor(2.0) w = torch.tensor(3.0, requires_grad=True) b = torch.tensor(4.0, requires_grad=True) y = w * x + b y.backward(retain_graph=...
python
MIT
305d571da3cf71119811c94f4e060ec51c37ebcf
2026-01-05T07:10:52.390633Z
false
clearhanhui/LearnLibTorch
https://github.com/clearhanhui/LearnLibTorch/blob/305d571da3cf71119811c94f4e060ec51c37ebcf/chap8/check.py
chap8/check.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' @File : check.py @Time : 2022/07/28 @Author : Han Hui @Contact : clearhanhui@gmail.com ''' import torch import numpy as np from python.AutoGrad import make_array, mm, mul, add, BackwardEngine a = make_array(np.random.randn(2,2), requires_grad=True) b...
python
MIT
305d571da3cf71119811c94f4e060ec51c37ebcf
2026-01-05T07:10:52.390633Z
false
clearhanhui/LearnLibTorch
https://github.com/clearhanhui/LearnLibTorch/blob/305d571da3cf71119811c94f4e060ec51c37ebcf/chap8/python/AutoGrad.py
chap8/python/AutoGrad.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' @File : AutoGrad.py @Time : 2022/07/27 @Author : Han Hui @Contact : clearhanhui@gmail.com ''' import numpy as np class MyArray(np.ndarray): """ Same with `np.ndarray` but `__setattr__` fucntion. """ def __setattr__(self, __name, __val...
python
MIT
305d571da3cf71119811c94f4e060ec51c37ebcf
2026-01-05T07:10:52.390633Z
false
clearhanhui/LearnLibTorch
https://github.com/clearhanhui/LearnLibTorch/blob/305d571da3cf71119811c94f4e060ec51c37ebcf/chap8/python/__init__.py
chap8/python/__init__.py
python
MIT
305d571da3cf71119811c94f4e060ec51c37ebcf
2026-01-05T07:10:52.390633Z
false
mustafamerttunali/deep-learning-training-gui
https://github.com/mustafamerttunali/deep-learning-training-gui/blob/218f2c48ce7e70fc6a1b7cfbcd982c353bb864ec/config.py
config.py
# # # # # # # # # # # # # # # # Author: Mustafa Mert Tunalı # --------------------------- # --------------------------- # Deep Learning Training GUI - Config Page # --------------------------- # --------------------------- # # # # # # # # # # # # # # # import numpy as np # In Development For Object Detection clas...
python
MIT
218f2c48ce7e70fc6a1b7cfbcd982c353bb864ec
2026-01-05T07:08:45.881834Z
false
mustafamerttunali/deep-learning-training-gui
https://github.com/mustafamerttunali/deep-learning-training-gui/blob/218f2c48ce7e70fc6a1b7cfbcd982c353bb864ec/app.py
app.py
# # # # # # # # # # # # # # # # Author: Mustafa Mert Tunalı # --------------------------- # --------------------------- # Deep Learning Training GUI - Backend Side # --------------------------- # --------------------------- # # # # # # # # # # # # # # # import numpy as np from multiprocessing import Process import t...
python
MIT
218f2c48ce7e70fc6a1b7cfbcd982c353bb864ec
2026-01-05T07:08:45.881834Z
false
mustafamerttunali/deep-learning-training-gui
https://github.com/mustafamerttunali/deep-learning-training-gui/blob/218f2c48ce7e70fc6a1b7cfbcd982c353bb864ec/dltgui/dlgui.py
dltgui/dlgui.py
# # # # # # # # # # # # # # # # Author: Mustafa Mert Tunalı # --------------------------- # --------------------------- # Deep Learning Training GUI - Class Page # --------------------------- # --------------------------- # # # # # # # # # # # # # # # # Libraries import tensorflow as tf from tensorflow.keras.models...
python
MIT
218f2c48ce7e70fc6a1b7cfbcd982c353bb864ec
2026-01-05T07:08:45.881834Z
false
mustafamerttunali/deep-learning-training-gui
https://github.com/mustafamerttunali/deep-learning-training-gui/blob/218f2c48ce7e70fc6a1b7cfbcd982c353bb864ec/tests/visualize_heatmap.py
tests/visualize_heatmap.py
import tensorflow as tf import numpy as np from matplotlib import pyplot as plt import cv2 %matplotlib inline from tf_explain.core.activations import ExtractActivations def apply_grey_patch(image, top_left_x, top_left_y, patch_size): patched_image = np.array(image, copy=True) patched_image[top_left_y:top_lef...
python
MIT
218f2c48ce7e70fc6a1b7cfbcd982c353bb864ec
2026-01-05T07:08:45.881834Z
false
mustafamerttunali/deep-learning-training-gui
https://github.com/mustafamerttunali/deep-learning-training-gui/blob/218f2c48ce7e70fc6a1b7cfbcd982c353bb864ec/tests/show_heatmap.py
tests/show_heatmap.py
### Not working. import tensorflow as tf import numpy as np from matplotlib import pyplot as plt import cv2 tf.compat.v1.disable_eager_execution() def prepare_image(img): img = tf.keras.preprocessing.image.load_img(img, target_size=(224, 224)) img_array = tf.keras.preprocessing.image.img_to_array(img)...
python
MIT
218f2c48ce7e70fc6a1b7cfbcd982c353bb864ec
2026-01-05T07:08:45.881834Z
false
mustafamerttunali/deep-learning-training-gui
https://github.com/mustafamerttunali/deep-learning-training-gui/blob/218f2c48ce7e70fc6a1b7cfbcd982c353bb864ec/tests/img2array.py
tests/img2array.py
import tensorflow as tf from keras.preprocessing import image import numpy as np def prepare_image(file): img_path = '' img = tf.keras.preprocessing.image.load_img(img_path + file, target_size=(224, 224)) img_array = tf.keras.preprocessing.image.img_to_array(img) img_array_expanded_dims = np.expand_di...
python
MIT
218f2c48ce7e70fc6a1b7cfbcd982c353bb864ec
2026-01-05T07:08:45.881834Z
false
mustafamerttunali/deep-learning-training-gui
https://github.com/mustafamerttunali/deep-learning-training-gui/blob/218f2c48ce7e70fc6a1b7cfbcd982c353bb864ec/tests/dataaug.py
tests/dataaug.py
import Augmentor test = "True" test2 = "True" test3 = "True" imgaug = "True" if imgaug == "True": p = Augmentor.Pipeline("images/", output_directory="") if test == "True": print("Rotate kismindayim") p.rotate(probability=0.7, max_left_rotation=10, max_right_rotation=10) if test2 == "...
python
MIT
218f2c48ce7e70fc6a1b7cfbcd982c353bb864ec
2026-01-05T07:08:45.881834Z
false
mustafamerttunali/deep-learning-training-gui
https://github.com/mustafamerttunali/deep-learning-training-gui/blob/218f2c48ce7e70fc6a1b7cfbcd982c353bb864ec/tests/keras_engine.py
tests/keras_engine.py
import tensorflow as tf mobilenet = tf.keras.applications.MobileNetV2(input_shape = (224,224,3), include_top=False, weights='imagenet') average_pooling = tf.keras.layers.GlobalAveragePool...
python
MIT
218f2c48ce7e70fc6a1b7cfbcd982c353bb864ec
2026-01-05T07:08:45.881834Z
false
mustafamerttunali/deep-learning-training-gui
https://github.com/mustafamerttunali/deep-learning-training-gui/blob/218f2c48ce7e70fc6a1b7cfbcd982c353bb864ec/tests/test_basic.py
tests/test_basic.py
import os import numpy as np from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense from multiprocessing import Process def startTensorboard(logdir): # Start tensorboard with system call os.system("tensorboard --logdir {}".format(logdir)) def fitModel(): # Create your m...
python
MIT
218f2c48ce7e70fc6a1b7cfbcd982c353bb864ec
2026-01-05T07:08:45.881834Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/IP Revealer/main_with_ipify.py
IP Revealer/main_with_ipify.py
import time import flet as ft import requests def main(page: ft.Page): page.title = "IP Revealer" page.window_center() page.window_always_on_top = True page.vertical_alignment = page.horizontal_alignment = "center" page.window_min_width, page.window_min_height = 312, 124 page.window_width, pag...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/IP Revealer/main.py
IP Revealer/main.py
import time import flet as ft def main(page: ft.Page): page.title = "IP Revealer" page.theme_mode = ft.ThemeMode.LIGHT page.vertical_alignment = page.horizontal_alignment = "center" page.fonts = { "PJS": "/fonts/Plus_Jakarta_Sans/PlusJakartaSans-VariableFont_wght.ttf", "Stick": "/fonts...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/Random Image Viewer/main.py
Random Image Viewer/main.py
import flet as ft from utils import ImageCard def main(page: ft.Page): # little configurations page.title = "Random Image Generator" page.horizontal_alignment = "center" # center the controls in the page - just for a beautiful UI page.theme_mode = "light" page.img_id_counter = 1 # some custo...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/Random Image Viewer/utils.py
Random Image Viewer/utils.py
import random import flet as ft # todo: add grayscale and blur class ImageCard(ft.Card): # elevation when this card is not hovered NORMAL_ELEVATION = 3 # elevation when this card is hovered HOVERED_ELEVATION = 7 def __init__(self, img_id: int): super(ImageCard, self).__init__(elevation=s...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/StartUp Name Generator/main.py
StartUp Name Generator/main.py
# made by @ndonkoHenri aka TheEthicalBoy import flet as ft import utils def main(page: ft.Page): def tile_clicked(e): """ When a tile is clicked, if it's not a favorite, add it to the favorites page, otherwise remove it from the favorites page. """ # tile item added to th...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/StartUp Name Generator/utils.py
StartUp Name Generator/utils.py
# I pushed some stuffs into here to make th main.py file cleaner import flet as ft # the list view for the main page main_listview = ft.ListView( expand=True, spacing=1, divider_thickness=0.2, first_item_prototype=True ) # the appbar to be shown on the main/entry page main_appbar = ft.AppBar( tit...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/Short Jokes/joke.py
Short Jokes/joke.py
import json from typing import Optional import urllib3 # documentation available here : https://v2.jokeapi.dev/ JOKE_URL = 'https://v2.jokeapi.dev/joke/Programming,Christmas?blacklistFlags=nsfw,racist,sexist,explicit&safe-mode' def fetch_joke() -> Optional[dict]: """ We fetch the joke, while taking into conside...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/Short Jokes/main.py
Short Jokes/main.py
import flet as ft from utils import JokeCard, ethical_signature from joke import return_joke def main(page: ft.Page): page.title = "Short Jokes" page.theme_mode = "light" # page.window_always_on_top = True page.jokes_id_counter = 0 page.splash = ft.ProgressBar(visible=False) page.fonts = { ...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/Short Jokes/utils.py
Short Jokes/utils.py
import flet as ft class JokeCard(ft.Card): # elevation when this card is not hovered NORMAL_ELEVATION = 3 # elevation when this card is hovered HOVERED_ELEVATION = 7 def __init__(self, joke_id: int, joke: str = "This is a Joke bro. Haha!"): super(JokeCard, self).__init__(elevation=self.NO...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/Forms/login_utils.py
Forms/login_utils.py
import base64 import os import random import string from typing import Callable import flet as ft from captcha.audio import AudioCaptcha from captcha.image import ImageCaptcha class LoginWithCaptcha(ft.Column): def __init__(self, on_success: Callable = None, on_error: Callable = None, width=500): """ ...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/Forms/login_with_captcha.py
Forms/login_with_captcha.py
import flet as ft from login_utils import LoginWithCaptcha def main(page: ft.Page): page.title = "Forms" # page.window_always_on_top = True page.theme_mode = "light" page.horizontal_alignment = page.vertical_alignment = "center" page.window_width, page.window_height = 425, 700 page.window_cent...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/Flet-Utils/main.py
Flet-Utils/main.py
import flet as ft from utils.padding_utils import TabContentPadding from utils.alignment_utils import TabContentAlignment from utils.border_utils import TabContentBorder from utils.border_radius_utils import TabContentBorderRadius from utils.colors_utils import TabContentColors1, TabContentColors2 from utils.icons_brow...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/Flet-Utils/utils/border_radius_utils.py
Flet-Utils/utils/border_radius_utils.py
import flet as ft # the content of the border radius tab class TabContentBorderRadius(ft.UserControl): def __init__(self): super().__init__() # text field for topLeft(tl) property of the BorderRadius object self.field_tl = ft.TextField( label="topLeft", value="", ...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/Flet-Utils/utils/alignment_utils.py
Flet-Utils/utils/alignment_utils.py
import flet as ft # the content of the alignment tab class TabContentAlignment(ft.UserControl): def __init__(self): super().__init__() # slider for x parameter of the Alignment object self.slider_x = ft.Slider( label="x", value=0, on_change=self.update_a...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/Flet-Utils/utils/divider_utils.py
Flet-Utils/utils/divider_utils.py
from flet import * import flet as ft # the content of the divider tab class TabContentDivider(ft.UserControl): def __init__(self): super().__init__() self.divider_color = "green" self.divider_tooltip = None self.divider_thickness = 4 self.divider_height = None sel...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/Flet-Utils/utils/tooltip_utils.py
Flet-Utils/utils/tooltip_utils.py
import math import flet as ft from flet import * from flet import border_radius, border, padding, margin, alignment # the content of the tooltip tab class TabContentTooltip(ft.UserControl): def __init__(self): super().__init__() self.vertical_offset = None self.wait_duration = None ...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/Flet-Utils/utils/circle_avatar_utils.py
Flet-Utils/utils/circle_avatar_utils.py
from flet import * import flet as ft # todo: "rotate" from icon_utils # the content of the circle avatar tab class TabContentCircleAvatar(ft.UserControl): def __init__(self): super().__init__() self.avatar_background_image_url = None self.avatar_foreground_image_url = None self....
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/Flet-Utils/utils/progress_bar_utils.py
Flet-Utils/utils/progress_bar_utils.py
from flet import * import flet as ft # the content of the progress bar tab class TabContentProgressBar(ft.UserControl): def __init__(self): super().__init__() self.bar_color = "green" self.bar_bgcolor = None self.bar_bar_height = None self.bar_tooltip = None self.b...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/Flet-Utils/utils/shadow_utils.py
Flet-Utils/utils/shadow_utils.py
from flet import * import flet as ft # todo: change link to docs # the content of the shadow tab class TabContentShadow(ft.UserControl): def __init__(self): super().__init__() self.shadow_color = None self.shadow_offset = None self.shadow_blur_radius = None self.shadow_s...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/Flet-Utils/utils/shadermask_utils.py
Flet-Utils/utils/shadermask_utils.py
# import all the controls: if the shader mask requires controls which are not imported, an error is raised from flet import * import flet as ft # the content of the ShaderMask tab class TabContentShaderMask(ft.UserControl): def __init__(self): super().__init__() self.shader_mask_obj = ft.Ref[ft.Sh...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/Flet-Utils/utils/gradient_utils.py
Flet-Utils/utils/gradient_utils.py
import math from flet import * import flet as ft # the content of the LinearGradient tab class TabContentLinearGradient(ft.UserControl): def __init__(self): super().__init__() self.container_obj = ft.Ref[ft.Container]() # field for begin parameter of the LinearGradient object self...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
true
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/Flet-Utils/utils/progress_ring_utils.py
Flet-Utils/utils/progress_ring_utils.py
from flet import * import flet as ft # todo: width, height # the content of the progress ring tab class TabContentProgressRing(ft.UserControl): def __init__(self): super().__init__() self.ring_color = None self.ring_bgcolor = None self.ring_stroke_width = None self.ring_t...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/Flet-Utils/utils/blur_utils.py
Flet-Utils/utils/blur_utils.py
import random from flet import * import flet as ft # todo: change link to docs # the content of the blur tab class TabContentBlur(ft.UserControl): def __init__(self): super().__init__() self.blur_sigma_y = None self.blur_sigma_x = None self.blur_tile_mode = None self.b...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/Flet-Utils/utils/icon_utils.py
Flet-Utils/utils/icon_utils.py
import math from flet import * import flet as ft # the content of the icon tab class TabContentIcon(ft.UserControl): def __init__(self): super().__init__() self.icon_color = "red900" self.icon_name = "cake_rounded" self.icon_size = 65 self.icon_tooltip = None self....
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/Flet-Utils/utils/padding_utils.py
Flet-Utils/utils/padding_utils.py
import flet as ft from flet import padding # the content of the padding tab class TabContentPadding(ft.UserControl): def __init__(self): super().__init__() self.container_front = ft.Ref[ft.Container]() self.container_back = ft.Ref[ft.Container]() self.container_text = ft.Ref[ft.Tex...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/Flet-Utils/utils/colors_utils.py
Flet-Utils/utils/colors_utils.py
import flet as ft from itertools import islice # the content of the ColorV1 tab class TabContentColors1(ft.UserControl): # all this below was obtained from https://github.com/ndonkoHenri/Flet-Color-Browser def __init__(self, expand=True): """ If the expand parameter is set to True, then the e...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/Flet-Utils/utils/border_utils.py
Flet-Utils/utils/border_utils.py
import flet as ft # todo: add respective colors to each # the content of the border tab class TabContentBorder(ft.UserControl): # border = border.only(BorderSide(2, "blue"), BorderSide(2, "blue"), BorderSide(2, "blue"), BorderSide(2, "blue"),) def __init__(self): super().__init__() self.conta...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/Flet-Utils/utils/icons_browser_utils.py
Flet-Utils/utils/icons_browser_utils.py
from itertools import islice import flet as ft # the content of the Icons tab class TabContentIconsBrowser(ft.UserControl): # all this below was obtained from https://github.com/flet-dev/examples/tree/main/python/apps/icons-browser def __init__(self): super().__init__() def build(self): ...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/Flet-Utils/utils/vertical_divider_utils.py
Flet-Utils/utils/vertical_divider_utils.py
from flet import * import flet as ft # the content of the vertical_divider tab class TabContentVerticalDivider(ft.UserControl): def __init__(self): super().__init__() self.vertical_divider_color = "green" self.vertical_divider_tooltip = None self.vertical_divider_thickness = 4 ...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/Flet-Utils/utils/shape_utils.py
Flet-Utils/utils/shape_utils.py
import flet as ft # the content of the Shape tab class TabContentShape(ft.UserControl): def __init__(self): super().__init__() self.container_obj = ft.Ref[ft.Container]() self.radios = ft.RadioGroup( ft.Row( [ ft.Radio(value="rectangle", lab...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/URL shortener/main.py
URL shortener/main.py
import flet as ft import pyshorteners # pip install pyshorteners shortener = pyshorteners.Shortener() class ShortLinkRow(ft.Row): # a row containing the shortened url, and two buttons ('copy', and 'open in browser') def __init__(self, shortened_link, link_source): """ We create a new class ...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/QR Code Generator/main.py
QR Code Generator/main.py
import os import flet as ft import pyqrcode # todo: add filepicker for image save on desktop def main(page: ft.Page): page.title = "QRcode Generator" page.theme_mode = "light" # page.window_always_on_top = True page.splash = ft.ProgressBar(visible=False) page.horizontal_alignment = "center" p...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/Markdown Editor/main.py
Markdown Editor/main.py
import flet as ft import utils # todo: output as pdf | add error dialog to handle errors def main(page: ft.Page): """ App's entry point. :param page: The page object :type page: Page """ page.title = "Markdown Editor" # page.window_always_on_top = True page.theme_mode = "dark" #...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
ndonkoHenri/Flet-Samples
https://github.com/ndonkoHenri/Flet-Samples/blob/a25c6aefa01e567fe25f2f29829625006bb925a3/Markdown Editor/utils.py
Markdown Editor/utils.py
import flet as ft file_path = None error_code = None # dialog def close_dialog(e): """Closes the Alert Dialog.""" e.page.dialog.open = False e.page.update() # dialog def open_dialog(e): """Opens the Alert Dialog.""" e.page.dialog.open = True e.page.update() # progress bar / page.splash de...
python
MIT
a25c6aefa01e567fe25f2f29829625006bb925a3
2026-01-05T07:10:51.971331Z
false
AdrianVollmer/htun
https://github.com/AdrianVollmer/htun/blob/1591333d28637b0581226c58a17d27fb0296fc82/htun.py
htun.py
#!/usr/bin/env python3 # Adrian Vollmer 2018 from htun.main import main if __name__ == '__main__': main()
python
MIT
1591333d28637b0581226c58a17d27fb0296fc82
2026-01-05T07:10:54.310749Z
false
AdrianVollmer/htun
https://github.com/AdrianVollmer/htun/blob/1591333d28637b0581226c58a17d27fb0296fc82/htun/tcp_server.py
htun/tcp_server.py
import logging import socket from htun.args import args def create_socket(): logging.info("Waiting for connection... ") _sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) _sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) _sock.bind((args.bindip, args.lport)) _sock.listen(1) se...
python
MIT
1591333d28637b0581226c58a17d27fb0296fc82
2026-01-05T07:10:54.310749Z
false
AdrianVollmer/htun
https://github.com/AdrianVollmer/htun/blob/1591333d28637b0581226c58a17d27fb0296fc82/htun/tools.py
htun/tools.py
import logging from htun.args import args import subprocess import random import datetime if args.debug: try: import hexdump except ImportError: logging.error( "Debug mode impossible without the python module 'hexdump'. " "Install it first.") args.debug = False ...
python
MIT
1591333d28637b0581226c58a17d27fb0296fc82
2026-01-05T07:10:54.310749Z
false
AdrianVollmer/htun
https://github.com/AdrianVollmer/htun/blob/1591333d28637b0581226c58a17d27fb0296fc82/htun/http_client.py
htun/http_client.py
import logging import urllib3 import socket import select import threading import os from htun.args import args from htun.tools import dump, temp_filename, is_running from urllib3.contrib.socks import SOCKSProxyManager SOCK_FILE_SERVER = temp_filename("/tmp/htun_s_") SOCK_FILE_CLIENT = temp_filename("/tmp/htun_c_") ...
python
MIT
1591333d28637b0581226c58a17d27fb0296fc82
2026-01-05T07:10:54.310749Z
false
AdrianVollmer/htun
https://github.com/AdrianVollmer/htun/blob/1591333d28637b0581226c58a17d27fb0296fc82/htun/udp_iface.py
htun/udp_iface.py
import select import time from htun.tools import dump, is_running from htun.args import args class TunnelServer(object): def __init__(self, sock, addr, dstaddr): self._rsock = sock self._lsock = None def run(self): r = w = [self._lsock, self._rsock] to_lsock = to_rsock = b'' ...
python
MIT
1591333d28637b0581226c58a17d27fb0296fc82
2026-01-05T07:10:54.310749Z
false
AdrianVollmer/htun
https://github.com/AdrianVollmer/htun/blob/1591333d28637b0581226c58a17d27fb0296fc82/htun/main.py
htun/main.py
from htun.args import args from htun.tools import stop_running, create_iptables_rules, \ delete_ip_tables_rules from htun.http_server import run_server from htun.tun_iface import TunnelServer import logging logging.basicConfig(level=logging.DEBUG) logger = logging.getLogger(__name__) if args.uri: is_serve...
python
MIT
1591333d28637b0581226c58a17d27fb0296fc82
2026-01-05T07:10:54.310749Z
false
AdrianVollmer/htun
https://github.com/AdrianVollmer/htun/blob/1591333d28637b0581226c58a17d27fb0296fc82/htun/args.py
htun/args.py
import argparse import socket parser = argparse.ArgumentParser( description="htun tunnels IP traffic transparently over HTTP or TCP " "(author: Adrian Vollmer)", formatter_class=argparse.ArgumentDefaultsHelpFormatter ) parser.add_argument('--debug', '-d', dest='debug', default=False, ...
python
MIT
1591333d28637b0581226c58a17d27fb0296fc82
2026-01-05T07:10:54.310749Z
false
AdrianVollmer/htun
https://github.com/AdrianVollmer/htun/blob/1591333d28637b0581226c58a17d27fb0296fc82/htun/__init__.py
htun/__init__.py
python
MIT
1591333d28637b0581226c58a17d27fb0296fc82
2026-01-05T07:10:54.310749Z
false
AdrianVollmer/htun
https://github.com/AdrianVollmer/htun/blob/1591333d28637b0581226c58a17d27fb0296fc82/htun/http_server.py
htun/http_server.py
import threading import socket import select import os from http.server import BaseHTTPRequestHandler, HTTPServer # import SocketServer from htun.tools import dump, temp_filename from htun.args import args SOCK_FILE_SERVER = temp_filename("/tmp/htun_s_") SOCK_FILE_CLIENT = temp_filename("/tmp/htun_c_") # data from...
python
MIT
1591333d28637b0581226c58a17d27fb0296fc82
2026-01-05T07:10:54.310749Z
false
AdrianVollmer/htun
https://github.com/AdrianVollmer/htun/blob/1591333d28637b0581226c58a17d27fb0296fc82/htun/tcp_client.py
htun/tcp_client.py
import socket import socks from htun.args import args def create_socket(): if args.proxy: server_socket = socks.socksocket() proto, rest = args.proxy.split('://') host, port = rest.split(':') port = int(port) if proto == "socks4": server_socket.set_proxy(socks.S...
python
MIT
1591333d28637b0581226c58a17d27fb0296fc82
2026-01-05T07:10:54.310749Z
false
AdrianVollmer/htun
https://github.com/AdrianVollmer/htun/blob/1591333d28637b0581226c58a17d27fb0296fc82/htun/tun_iface.py
htun/tun_iface.py
import logging import select import socket import pytun import errno import time # import base64 from htun.tools import dump, add_route, is_running, print_stats from htun.args import args class TunnelServer(object): def __init__(self, sock, addr, dstaddr, create_socket=None): logging.debug("Initiate Tun...
python
MIT
1591333d28637b0581226c58a17d27fb0296fc82
2026-01-05T07:10:54.310749Z
false
Net-ng/kansha
https://github.com/Net-ng/kansha/blob/85b5816da126b1c7098707c98f217d8b2e524ff2/setup.py
setup.py
# -*- coding:utf-8 -*- #-- # Copyright (c) 2012-2015 Net-ng. # All rights reserved. # # This software is licensed under the BSD License, as described in # the file LICENSE.txt, which you should have received as part of # this distribution. #-- from setuptools import setup, find_packages from codecs import open # To u...
python
BSD-3-Clause
85b5816da126b1c7098707c98f217d8b2e524ff2
2026-01-05T07:10:52.983810Z
false
Net-ng/kansha
https://github.com/Net-ng/kansha/blob/85b5816da126b1c7098707c98f217d8b2e524ff2/static/__init__.py
static/__init__.py
#-- # Copyright (c) 2012-2014 Net-ng. # All rights reserved. # # This software is licensed under the BSD License, as described in # the file LICENSE.txt, which you should have received as part of # this distribution. #--
python
BSD-3-Clause
85b5816da126b1c7098707c98f217d8b2e524ff2
2026-01-05T07:10:52.983810Z
false
Net-ng/kansha
https://github.com/Net-ng/kansha/blob/85b5816da126b1c7098707c98f217d8b2e524ff2/kansha/populate.py
kansha/populate.py
# -*- coding:utf-8 -*- #-- # Copyright (c) 2012-2014 Net-ng. # All rights reserved. # # This software is licensed under the BSD License, as described in # the file LICENSE.txt, which you should have received as part of # this distribution. #-- from .board.models import create_template_empty, create_template_todo def...
python
BSD-3-Clause
85b5816da126b1c7098707c98f217d8b2e524ff2
2026-01-05T07:10:52.983810Z
false
Net-ng/kansha
https://github.com/Net-ng/kansha/blob/85b5816da126b1c7098707c98f217d8b2e524ff2/kansha/security.py
kansha/security.py
# -*- coding:utf-8 -*- #-- # Copyright (c) 2012-2014 Net-ng. # All rights reserved. # # This software is licensed under the BSD License, as described in # the file LICENSE.txt, which you should have received as part of # this distribution. #-- from base64 import b64encode, b64decode from Crypto import Random from peak...
python
BSD-3-Clause
85b5816da126b1c7098707c98f217d8b2e524ff2
2026-01-05T07:10:52.983810Z
false
Net-ng/kansha
https://github.com/Net-ng/kansha/blob/85b5816da126b1c7098707c98f217d8b2e524ff2/kansha/models.py
kansha/models.py
# -*- coding:utf-8 -*- #-- # Copyright (c) 2012-2014 Net-ng. # All rights reserved. # # This software is licensed under the BSD License, as described in # the file LICENSE.txt, which you should have received as part of # this distribution. #-- from __future__ import absolute_import from elixir import EntityBase from ...
python
BSD-3-Clause
85b5816da126b1c7098707c98f217d8b2e524ff2
2026-01-05T07:10:52.983810Z
false
Net-ng/kansha
https://github.com/Net-ng/kansha/blob/85b5816da126b1c7098707c98f217d8b2e524ff2/kansha/validator.py
kansha/validator.py
# -*- coding:utf-8 -*- #-- # Copyright (c) 2012-2014 Net-ng. # All rights reserved. # # This software is licensed under the BSD License, as described in # the file LICENSE.txt, which you should have received as part of # this distribution. #-- import re import string import ntpath from lxml import html from nagare im...
python
BSD-3-Clause
85b5816da126b1c7098707c98f217d8b2e524ff2
2026-01-05T07:10:52.983810Z
false
Net-ng/kansha
https://github.com/Net-ng/kansha/blob/85b5816da126b1c7098707c98f217d8b2e524ff2/kansha/exceptions.py
kansha/exceptions.py
# -*- coding:utf-8 -*- #-- # Copyright (c) 2012-2014 Net-ng. # All rights reserved. # # This software is licensed under the BSD License, as described in # the file LICENSE.txt, which you should have received as part of # this distribution. #-- class NotFound(Exception): pass class BoardNotFound(Exception): ...
python
BSD-3-Clause
85b5816da126b1c7098707c98f217d8b2e524ff2
2026-01-05T07:10:52.983810Z
false
Net-ng/kansha
https://github.com/Net-ng/kansha/blob/85b5816da126b1c7098707c98f217d8b2e524ff2/kansha/menu.py
kansha/menu.py
# -*- coding:utf-8 -*- #-- # Copyright (c) 2012-2014 Net-ng. # All rights reserved. # # This software is licensed under the BSD License, as described in # the file LICENSE.txt, which you should have received as part of # this distribution. #-- from collections import namedtuple MenuEntry = namedtuple('MenuEntry', 'la...
python
BSD-3-Clause
85b5816da126b1c7098707c98f217d8b2e524ff2
2026-01-05T07:10:52.983810Z
false
Net-ng/kansha
https://github.com/Net-ng/kansha/blob/85b5816da126b1c7098707c98f217d8b2e524ff2/kansha/events.py
kansha/events.py
# -*- coding:utf-8 -*- # -- # Copyright (c) 2012-2014 Net-ng. # All rights reserved. # # This software is licensed under the BSD License, as described in # the file LICENSE.txt, which you should have received as part of # this distribution. # -- class EventHandlerMixIn(object): """ Mix-in that implements: ...
python
BSD-3-Clause
85b5816da126b1c7098707c98f217d8b2e524ff2
2026-01-05T07:10:52.983810Z
false
Net-ng/kansha
https://github.com/Net-ng/kansha/blob/85b5816da126b1c7098707c98f217d8b2e524ff2/kansha/helpers.py
kansha/helpers.py
#-*- coding: utf-8 -*- #-- # Copyright (c) 2012-2014 Net-ng. # All rights reserved. # # This software is licensed under the BSD License, as described in # the file LICENSE.txt, which you should have received as part of # this distribution. #-- #=- # (C)opyright PagesJaunes 2011 # # This is Pagesjaunes proprietary sour...
python
BSD-3-Clause
85b5816da126b1c7098707c98f217d8b2e524ff2
2026-01-05T07:10:52.983810Z
false
Net-ng/kansha
https://github.com/Net-ng/kansha/blob/85b5816da126b1c7098707c98f217d8b2e524ff2/kansha/__init__.py
kansha/__init__.py
#-- # Copyright (c) 2012-2014 Net-ng. # All rights reserved. # # This software is licensed under the BSD License, as described in # the file LICENSE.txt, which you should have received as part of # this distribution. #-- import pkg_resources VERSION = pkg_resources.get_distribution('kansha').version
python
BSD-3-Clause
85b5816da126b1c7098707c98f217d8b2e524ff2
2026-01-05T07:10:52.983810Z
false
Net-ng/kansha
https://github.com/Net-ng/kansha/blob/85b5816da126b1c7098707c98f217d8b2e524ff2/kansha/pickle.py
kansha/pickle.py
#-- # Copyright (c) 2012-2014 Net-ng. # All rights reserved. # # This software is licensed under the BSD License, as described in # the file LICENSE.txt, which you should have received as part of # this distribution. #-- from __future__ import absolute_import import pickle from nagare import database # if objgraph ...
python
BSD-3-Clause
85b5816da126b1c7098707c98f217d8b2e524ff2
2026-01-05T07:10:52.983810Z
false
Net-ng/kansha
https://github.com/Net-ng/kansha/blob/85b5816da126b1c7098707c98f217d8b2e524ff2/kansha/notifications.py
kansha/notifications.py
# -*- coding:utf-8 -*- # -- # Copyright (c) 2012-2014 Net-ng. # All rights reserved. # # This software is licensed under the BSD License, as described in # the file LICENSE.txt, which you should have received as part of # this distribution. # -- #FIXME: this should be a board extension from __future__ import absolute...
python
BSD-3-Clause
85b5816da126b1c7098707c98f217d8b2e524ff2
2026-01-05T07:10:52.983810Z
false
Net-ng/kansha
https://github.com/Net-ng/kansha/blob/85b5816da126b1c7098707c98f217d8b2e524ff2/kansha/card_addons/__init__.py
kansha/card_addons/__init__.py
#-- # Copyright (c) 2012-2014 Net-ng. # All rights reserved. # # This software is licensed under the BSD License, as described in # the file LICENSE.txt, which you should have received as part of # this distribution. #--
python
BSD-3-Clause
85b5816da126b1c7098707c98f217d8b2e524ff2
2026-01-05T07:10:52.983810Z
false
Net-ng/kansha
https://github.com/Net-ng/kansha/blob/85b5816da126b1c7098707c98f217d8b2e524ff2/kansha/card_addons/vote/comp.py
kansha/card_addons/vote/comp.py
# -*- coding:utf-8 -*- #-- # Copyright (c) 2012-2014 Net-ng. # All rights reserved. # # This software is licensed under the BSD License, as described in # the file LICENSE.txt, which you should have received as part of # this distribution. #-- from nagare import security from peak.rules import when from nagare.securit...
python
BSD-3-Clause
85b5816da126b1c7098707c98f217d8b2e524ff2
2026-01-05T07:10:52.983810Z
false
Net-ng/kansha
https://github.com/Net-ng/kansha/blob/85b5816da126b1c7098707c98f217d8b2e524ff2/kansha/card_addons/vote/view.py
kansha/card_addons/vote/view.py
# -*- coding:utf-8 -*- #-- # Copyright (c) 2012-2014 Net-ng. # All rights reserved. # # This software is licensed under the BSD License, as described in # the file LICENSE.txt, which you should have received as part of # this distribution. #-- from nagare.i18n import _ from nagare import presentation, security from ....
python
BSD-3-Clause
85b5816da126b1c7098707c98f217d8b2e524ff2
2026-01-05T07:10:52.983810Z
false
Net-ng/kansha
https://github.com/Net-ng/kansha/blob/85b5816da126b1c7098707c98f217d8b2e524ff2/kansha/card_addons/vote/models.py
kansha/card_addons/vote/models.py
# -*- coding:utf-8 -*- #-- # Copyright (c) 2012-2014 Net-ng. # All rights reserved. # # This software is licensed under the BSD License, as described in # the file LICENSE.txt, which you should have received as part of # this distribution. #-- from sqlalchemy import func from elixir import ManyToOne from elixir import...
python
BSD-3-Clause
85b5816da126b1c7098707c98f217d8b2e524ff2
2026-01-05T07:10:52.983810Z
false
Net-ng/kansha
https://github.com/Net-ng/kansha/blob/85b5816da126b1c7098707c98f217d8b2e524ff2/kansha/card_addons/vote/__init__.py
kansha/card_addons/vote/__init__.py
#-- # Copyright (c) 2012-2014 Net-ng. # All rights reserved. # # This software is licensed under the BSD License, as described in # the file LICENSE.txt, which you should have received as part of # this distribution. #-- from . import view from .models import DataVote
python
BSD-3-Clause
85b5816da126b1c7098707c98f217d8b2e524ff2
2026-01-05T07:10:52.983810Z
false
Net-ng/kansha
https://github.com/Net-ng/kansha/blob/85b5816da126b1c7098707c98f217d8b2e524ff2/kansha/card_addons/vote/tests.py
kansha/card_addons/vote/tests.py
# -*- coding:utf-8 -*- #-- # Copyright (c) 2012-2014 Net-ng. # All rights reserved. # # This software is licensed under the BSD License, as described in # the file LICENSE.txt, which you should have received as part of # this distribution. #-- from kansha.cardextension.tests import CardExtensionTestCase from .comp im...
python
BSD-3-Clause
85b5816da126b1c7098707c98f217d8b2e524ff2
2026-01-05T07:10:52.983810Z
false