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
simplecto/screenshots
https://github.com/simplecto/screenshots/blob/7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b/src/shots/migrations/0003_auto_20200127_2029.py
src/shots/migrations/0003_auto_20200127_2029.py
# Generated by Django 3.0.2 on 2020-01-27 20:29 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('shots', '0002_screenshot_is_fullpage'), ] operations = [ migrations.AddField( model_name='screenshot', name='height'...
python
MIT
7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b
2026-01-05T07:10:39.014827Z
false
simplecto/screenshots
https://github.com/simplecto/screenshots/blob/7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b/src/shots/migrations/0011_remove_screenshot_raw_html.py
src/shots/migrations/0011_remove_screenshot_raw_html.py
# Generated by Django 3.0.2 on 2020-02-09 22:19 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('shots', '0010_auto_20200209_2152'), ] operations = [ migrations.RemoveField( model_name='screenshot', name='raw_html', ...
python
MIT
7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b
2026-01-05T07:10:39.014827Z
false
simplecto/screenshots
https://github.com/simplecto/screenshots/blob/7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b/src/shots/migrations/0001_initial.py
src/shots/migrations/0001_initial.py
# Generated by Django 3.0.2 on 2020-01-27 14:07 from django.db import migrations, models import uuid class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='ScreenShot', fields=[ ('id', mo...
python
MIT
7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b
2026-01-05T07:10:39.014827Z
false
simplecto/screenshots
https://github.com/simplecto/screenshots/blob/7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b/src/shots/migrations/0016_auto_20200228_1053.py
src/shots/migrations/0016_auto_20200228_1053.py
# Generated by Django 3.0.3 on 2020-02-28 10:53 import django.core.validators from django.db import migrations, models import shots.validators class Migration(migrations.Migration): dependencies = [ ('shots', '0015_auto_20200213_1418'), ] operations = [ migrations.AddField( ...
python
MIT
7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b
2026-01-05T07:10:39.014827Z
false
simplecto/screenshots
https://github.com/simplecto/screenshots/blob/7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b/src/shots/migrations/0013_screenshot_image_binary.py
src/shots/migrations/0013_screenshot_image_binary.py
# Generated by Django 3.0.2 on 2020-02-10 08:35 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('shots', '0012_remove_screenshot_image'), ] operations = [ migrations.AddField( model_name='screenshot', name='image_...
python
MIT
7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b
2026-01-05T07:10:39.014827Z
false
simplecto/screenshots
https://github.com/simplecto/screenshots/blob/7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b/src/shots/migrations/0015_auto_20200213_1418.py
src/shots/migrations/0015_auto_20200213_1418.py
# Generated by Django 3.0.3 on 2020-02-13 14:18 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('shots', '0014_auto_20200211_1242'), ] operations = [ migrations.AddField( model_name='screenshot', ...
python
MIT
7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b
2026-01-05T07:10:39.014827Z
false
simplecto/screenshots
https://github.com/simplecto/screenshots/blob/7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b/src/shots/migrations/0012_remove_screenshot_image.py
src/shots/migrations/0012_remove_screenshot_image.py
# Generated by Django 3.0.2 on 2020-02-10 00:16 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('shots', '0011_remove_screenshot_raw_html'), ] operations = [ ]
python
MIT
7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b
2026-01-05T07:10:39.014827Z
false
simplecto/screenshots
https://github.com/simplecto/screenshots/blob/7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b/src/shots/migrations/0005_screenshot_raw_html.py
src/shots/migrations/0005_screenshot_raw_html.py
# Generated by Django 3.0.2 on 2020-01-31 09:40 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('shots', '0004_screenshot_keywords'), ] operations = [ migrations.AddField( model_name='screenshot', name='raw_html',...
python
MIT
7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b
2026-01-05T07:10:39.014827Z
false
simplecto/screenshots
https://github.com/simplecto/screenshots/blob/7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b/src/shots/migrations/0006_auto_20200204_1043.py
src/shots/migrations/0006_auto_20200204_1043.py
# Generated by Django 3.0.2 on 2020-02-04 10:43 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('shots', '0005_screenshot_raw_html'), ] operations = [ migrations.RemoveField( model_name='screenshot', name='is_full...
python
MIT
7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b
2026-01-05T07:10:39.014827Z
false
simplecto/screenshots
https://github.com/simplecto/screenshots/blob/7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b/src/shots/migrations/0023_auto_20201218_1646.py
src/shots/migrations/0023_auto_20201218_1646.py
# Generated by Django 3.1.4 on 2020-12-18 16:46 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('shots', '0022_remove_screenshot_image_binary'), ] operations = [ migrations.AlterField( model_name='screenshot', nam...
python
MIT
7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b
2026-01-05T07:10:39.014827Z
false
simplecto/screenshots
https://github.com/simplecto/screenshots/blob/7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b/src/shots/migrations/0007_screenshot_duration.py
src/shots/migrations/0007_screenshot_duration.py
# Generated by Django 3.0.2 on 2020-02-07 00:15 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('shots', '0006_auto_20200204_1043'), ] operations = [ migrations.AddField( model_name='screenshot', name='duration', ...
python
MIT
7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b
2026-01-05T07:10:39.014827Z
false
simplecto/screenshots
https://github.com/simplecto/screenshots/blob/7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b/src/shots/migrations/0021_screenshot_file.py
src/shots/migrations/0021_screenshot_file.py
# Generated by Django 3.0.3 on 2020-03-21 09:18 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('shots', '0020_auto_20200315_2020'), ] operations = [ migrations.AddField( model_name='screenshot', name='file', ...
python
MIT
7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b
2026-01-05T07:10:39.014827Z
false
simplecto/screenshots
https://github.com/simplecto/screenshots/blob/7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b/src/shots/migrations/0008_auto_20200207_1203.py
src/shots/migrations/0008_auto_20200207_1203.py
# Generated by Django 3.0.2 on 2020-02-07 12:03 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('shots', '0007_screenshot_duration'), ] operations = [ migrations.AlterField( model_name='screenshot', name='url', ...
python
MIT
7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b
2026-01-05T07:10:39.014827Z
false
simplecto/screenshots
https://github.com/simplecto/screenshots/blob/7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b/src/shots/migrations/__init__.py
src/shots/migrations/__init__.py
python
MIT
7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b
2026-01-05T07:10:39.014827Z
false
simplecto/screenshots
https://github.com/simplecto/screenshots/blob/7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b/src/shots/migrations/0002_screenshot_is_fullpage.py
src/shots/migrations/0002_screenshot_is_fullpage.py
# Generated by Django 3.0.2 on 2020-01-27 15:03 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('shots', '0001_initial'), ] operations = [ migrations.AddField( model_name='screenshot', name='is_fullpage', ...
python
MIT
7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b
2026-01-05T07:10:39.014827Z
false
simplecto/screenshots
https://github.com/simplecto/screenshots/blob/7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b/src/shots/migrations/0020_auto_20200315_2020.py
src/shots/migrations/0020_auto_20200315_2020.py
# Generated by Django 3.0.3 on 2020-03-15 20:20 import django.contrib.postgres.fields.jsonb from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('shots', '0019_auto_20200315_1818'), ] operations = [ migrations.RemoveField( model_name='scr...
python
MIT
7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b
2026-01-05T07:10:39.014827Z
false
simplecto/screenshots
https://github.com/simplecto/screenshots/blob/7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b/src/shots/migrations/0014_auto_20200211_1242.py
src/shots/migrations/0014_auto_20200211_1242.py
# Generated by Django 3.0.2 on 2020-02-11 12:42 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('shots', '0013_screenshot_image_binary'), ] operations = [ migrations.RemoveField( model_name='screenshot', name='bas...
python
MIT
7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b
2026-01-05T07:10:39.014827Z
false
simplecto/screenshots
https://github.com/simplecto/screenshots/blob/7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b/src/shots/migrations/0004_screenshot_keywords.py
src/shots/migrations/0004_screenshot_keywords.py
# Generated by Django 3.0.2 on 2020-01-27 21:29 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('shots', '0003_auto_20200127_2029'), ] operations = [ migrations.AddField( model_name='screenshot', name='keywords', ...
python
MIT
7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b
2026-01-05T07:10:39.014827Z
false
simplecto/screenshots
https://github.com/simplecto/screenshots/blob/7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b/src/shots/migrations/0009_auto_20200209_1605.py
src/shots/migrations/0009_auto_20200209_1605.py
# Generated by Django 3.0.2 on 2020-02-09 16:05 import django.core.validators from django.db import migrations, models import shots.models import shots.validators class Migration(migrations.Migration): dependencies = [ ('shots', '0008_auto_20200207_1203'), ] operations = [ migrations.Al...
python
MIT
7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b
2026-01-05T07:10:39.014827Z
false
simplecto/screenshots
https://github.com/simplecto/screenshots/blob/7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b/src/config/asgi.py
src/config/asgi.py
""" ASGI config for config project. It exposes the ASGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/ """ import os from django.core.asgi import get_asgi_application os.environ.setdefault('DJANGO_SETTIN...
python
MIT
7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b
2026-01-05T07:10:39.014827Z
false
simplecto/screenshots
https://github.com/simplecto/screenshots/blob/7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b/src/config/settings.py
src/config/settings.py
import os import sentry_sdk from sentry_sdk.integrations.django import DjangoIntegration import dj_database_url import dj_email_url from dotenv import load_dotenv, find_dotenv load_dotenv(find_dotenv(os.getenv('ENV_FILE', 'env'))) SECRET_KEY = os.environ['SECRET_KEY'] DEBUG = os.getenv('DEBUG') in ['true', 'y', 't'...
python
MIT
7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b
2026-01-05T07:10:39.014827Z
false
simplecto/screenshots
https://github.com/simplecto/screenshots/blob/7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b/src/config/__init__.py
src/config/__init__.py
python
MIT
7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b
2026-01-05T07:10:39.014827Z
false
simplecto/screenshots
https://github.com/simplecto/screenshots/blob/7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b/src/config/wsgi.py
src/config/wsgi.py
""" WSGI config for config project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJANGO_SETTIN...
python
MIT
7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b
2026-01-05T07:10:39.014827Z
false
simplecto/screenshots
https://github.com/simplecto/screenshots/blob/7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b/src/config/urls.py
src/config/urls.py
from django.contrib import admin from django.urls import path from shots import views from django.conf.urls.static import static from django.conf import settings urlpatterns = [ path('admin/', admin.site.urls), path('', views.index, name='home'), path('about', views.about, name='about'), path('screens...
python
MIT
7171ef6fbb9a67bc68a2cc5d70671fd7cc78415b
2026-01-05T07:10:39.014827Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/train.py
train.py
import sys sys.path.append('src/') import torch import argparse from transformers import TrainingArguments from transformers import LlamaForCausalLM, Qwen2ForCausalLM, MistralForCausalLM # from onegen import OneGenModel from onegen import Tokenizer, OneGenTrainer from onegen import create_onegen_model_class from oneg...
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/eval.py
eval.py
import sys sys.path.append('src/') import torch import argparse from transformers import TrainingArguments from onegen.config import parse_eval_config, TrainingConfig, DataConfig, PaddingConfig, SpecialTokenConfig, OneGenConfig from onegen.util import _print def get_parser(): parser = argparse.ArgumentParser(des...
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/scripts/entity_linking/eval_entity_disambiguation.py
scripts/entity_linking/eval_entity_disambiguation.py
import jsonlines import fire def main(file_path:str): total = 0 acc = 0 with jsonlines.open(file_path, 'r') as reader: for item in reader: gt_qid_list = item['gt_qid_list'] pred_qid_list = item['pred_qid_list'] assert len(gt_qid_list) == len(pred_qid_list) ...
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/scripts/entity_linking/eval_entity_linking.py
scripts/entity_linking/eval_entity_linking.py
import re import jsonlines import fire # Here we use the quadruple [doc_id, surface_form, qid, surface_form_rank] # as our basic unit. def my_f1(gt, pred): new_gt = [] gt_map = {} for item in gt: if item in gt_map: gt_map[item] += 1 else: gt_map[item] = 0 ne...
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/scripts/entity_linking/eval_mention_detection.py
scripts/entity_linking/eval_mention_detection.py
import re import jsonlines import fire # Here we use the quadruple [doc_id, surface_form, qid, surface_form_rank] # as our basic unit. def my_f1(gt, pred): new_gt = [] gt_map = {} for item in gt: if item in gt_map: gt_map[item] += 1 else: gt_map[item] = 0 ne...
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/scripts/multi_hop_qa/eval_hotpotqa.py
scripts/multi_hop_qa/eval_hotpotqa.py
# https://github.com/hotpotqa/hotpot/blob/master/hotpot_evaluate_v1.py import sys import ujson as json import re import string from collections import Counter import pickle import jsonlines def normalize_answer(s): def remove_articles(text): return re.sub(r'\b(a|an|the)\b', ' ', text) def white_spac...
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/scripts/multi_hop_qa/eval_2wiki.py
scripts/multi_hop_qa/eval_2wiki.py
""" 2Wiki-Multihop QA evaluation script Adapted from HotpotQA evaluation at https://github.com/hotpotqa/hotpot """ import sys import ujson as json import re import string import itertools from collections import Counter import pickle import os from eval_hotpotqa import convert2prediction_format def normalize_answer(s)...
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/scripts/self_rag/run_short_form.py
scripts/self_rag/run_short_form.py
#!/usr/bin/python # -*- coding: UTF-8 -*- import spacy import jsonlines from transformers import AutoTokenizer, AutoModelForCausalLM from vllm import LLM, SamplingParams import random import torch import os import numpy as np import openai from tqdm import tqdm import json import argparse import ast import re from tqdm...
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/scripts/self_rag/generate_score.py
scripts/self_rag/generate_score.py
# Here, we assume that expanded tokenizer is saved in the output_dir import sys sys.path.append('../../src') import jsonlines import json from tqdm import tqdm import torch import time import fire from transformers import MistralForCausalLM, LlamaForCausalLM from transformers import AutoTokenizer from onegen import On...
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/scripts/self_rag/self_rag/metrics.py
scripts/self_rag/self_rag/metrics.py
import numpy as np import string import re from collections import Counter import re def exact_match_score(prediction, ground_truth): return (normalize_answer(prediction) == normalize_answer(ground_truth)) def metric_max_over_ground_truths(metric_fn, prediction, ground_truths): scores_for_ground_truths = [] ...
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/scripts/self_rag/self_rag/utils.py
scripts/self_rag/self_rag/utils.py
import jsonlines import json import copy import re PROMPT_DICT = { "prompt_input": ( "### Instruction:\n{instruction}\n\n### Input:\n{input}\n\n### Response:\n" ), "prompt_no_input": ( "### Instruction:\n{instruction}\n\n### Response:\n" ), "prompt_no_input_retrieval": ( "Be...
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/src/onegen/__init__.py
src/onegen/__init__.py
# from .model import OneGenModel from .model import create_onegen_model_class from .tokenizer import Tokenizer from .trainer import OneGenTrainer
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/src/onegen/util/utils.py
src/onegen/util/utils.py
import time from typing import Any, List, Dict, Union import json import jsonlines import os import pickle from tqdm import tqdm import torch.distributed as dist import torch import faiss def _print(message:Any): print(f"[{time.ctime()}] {message}") def faiss_sim_matrix(query_embedding, doc_embedding): """ ...
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/src/onegen/util/loss.py
src/onegen/util/loss.py
# contrastive loss import torch import torch.nn as nn from typing import List, Tuple import torch.nn.functional as F def sim_matrix(a, b, eps=1e-8): """ added eps for numerical stability """ a_n, b_n = a.norm(dim=1)[:, None], b.norm(dim=1)[:, None] a_norm = a / torch.max(a_n, eps * torch.ones_like(...
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/src/onegen/util/__init__.py
src/onegen/util/__init__.py
from .constant import EnumContrastiveLoss, EnumTokenRole from .constant import IGNORE_LABEL_ID from .constant import MAX_NEW_TOKENS, DEFAULT_GENERATION_CONFIG, MAX_RETRIEVAL_CNT from .loss import info_nce_loss, bpr_loss, sim_matrix from .utils import _print from .uitls import faiss_sim_matrix from .utils import FileR...
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/src/onegen/util/constant.py
src/onegen/util/constant.py
from enum import Enum, unique from .loss import bpr_loss, info_nce_loss from transformers import GenerationConfig # for padding IGNORE_LABEL_ID = -100 # for generation MAX_NEW_TOKENS:int = 2048 DEFAULT_GENERATION_CONFIG = GenerationConfig( num_beams=1, do_sample=False, temperature=1, output_hidden_states=True ) M...
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/src/onegen/model/model.py
src/onegen/model/model.py
import sys sys.path.append('../') from typing import List, Dict, Any, Union, Tuple, Optional import torch import torch.nn as nn from transformers import AutoModelForCausalLM, AutoTokenizer from transformers import LlamaForCausalLM, Qwen2ForCausalLM, MistralForCausalLM from dataclasses import dataclass from onegen.co...
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/src/onegen/model/__init__.py
src/onegen/model/__init__.py
# from .model import OneGenModel from .model import create_onegen_model_class
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/src/onegen/tokenizer/__init__.py
src/onegen/tokenizer/__init__.py
from .tokenizer import Tokenizer
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/src/onegen/tokenizer/tokenizer.py
src/onegen/tokenizer/tokenizer.py
import sys sys.path.append('../') from transformers import AutoTokenizer from typing import List, Dict from onegen.util import _print from onegen.util.constant import IGNORE_LABEL_ID from copy import deepcopy import torch.distributed as dist class Tokenizer: """ method: - add_special_token - co...
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/src/onegen/evaluator/evaluator.py
src/onegen/evaluator/evaluator.py
from .config import ComponentConfig from typing import Dict, List, Tuple, Union from tqdm import tqdm from dataclasses import dataclass from transformers import AutoModel, AutoModelForCausalLM, AutoTokenizer from transformers import GenerationConfig import torch from transformers.generation.logits_process import Logits...
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
true
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/src/onegen/evaluator/config.py
src/onegen/evaluator/config.py
import sys sys.path.append('../') from onegen.templator import Templator from onegen.util import FileReader, _print, sim_matrix, FileWriter from onegen.util import DEFAULT_GENERATION_CONFIG, MAX_NEW_TOKENS, MAX_RETRIEVAL_CNT from onegen.dataset import padding_input_ids from dataclasses import dataclass from typing imp...
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/src/onegen/evaluator/__init__.py
src/onegen/evaluator/__init__.py
from .adapter import EntityLinkingAdapter, MultiHopQAAdapter from .evaluator import RAGEvaluator, EntityLinkingEvaluator from .config import FileConfig, ComponentConfig, InferenceConfig
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/src/onegen/evaluator/adapter.py
src/onegen/evaluator/adapter.py
from .config import FileConfig, InferenceConfig import sys sys.path.append('../') from onegen.util import FileReader, _print from onegen.templator import Templator, DocumentTemplator from dataclasses import dataclass from typing import List, Dict, Any, Tuple, Union from tqdm import tqdm from transformers import Generat...
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/src/onegen/trainer/onegen_trainer.py
src/onegen/trainer/onegen_trainer.py
# Part of the code was referenced from https://github.com/ContextualAI/gritlm/ from transformers.trainer_pt_utils import distributed_concat from transformers.integrations import TensorBoardCallback, rewrite_logs from transformers import Trainer import torch.nn as nn from typing import * import torch class OneGenTenso...
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/src/onegen/trainer/__init__.py
src/onegen/trainer/__init__.py
from .onegen_trainer import OneGenTensorBoardCallback, OneGenTrainer
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/src/onegen/dataset/dataset.py
src/onegen/dataset/dataset.py
import sys sys.path.append('../') import torch from onegen.config import DataConfig, SpecialTokenConfig from onegen.tokenizer import Tokenizer from onegen.util import FileReader, FileWriter from onegen.util import _print from tqdm import tqdm import jsonlines from onegen.templator import DocumentTemplator import random...
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/src/onegen/dataset/dataset_utils.py
src/onegen/dataset/dataset_utils.py
from typing import Dict, List from copy import deepcopy def padding_input_ids(item:Dict, padding_side:str, input_padding_id:int, max_length:int) -> Dict: for key in ['input_ids']: assert key in item assert padding_side in ['left', 'right'], \ f"Current padding_side `{padding_side}` is invalid."...
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/src/onegen/dataset/__init__.py
src/onegen/dataset/__init__.py
from .data_collator import AutoDataCollator from .dataset_utils import padding_item, padding_input_ids from .dataset import AutoDataset
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/src/onegen/dataset/data_collator.py
src/onegen/dataset/data_collator.py
from .dataset import AutoDataset from .dataset_utils import padding_item from onegen.config import OneGenConfig, PaddingConfig from typing import Tuple, Dict, List import random import torch class AutoDataCollator: def __init__( self, dataset:AutoDataset, onegen_config: OneGenConfig, ...
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/src/onegen/config/config.py
src/onegen/config/config.py
import sys sys.path.append('../') from dataclasses import dataclass, field from typing import List from onegen.util import EnumContrastiveLoss, _print, FileReader from onegen.tokenizer import Tokenizer from onegen.templator import * from typing import List, Dict, Tuple, Any @dataclass class TrainingConfig: gradien...
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/src/onegen/config/__init__.py
src/onegen/config/__init__.py
from .config import TrainingConfig, DataConfig, OneGenConfig, SpecialTokenConfig, PaddingConfig from .config import parse_workflow from .eval_config import parse_eval_config
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/src/onegen/config/eval_config.py
src/onegen/config/eval_config.py
import sys sys.path.append('../') from onegen.templator import * from onegen.util import FileReader, _print, sim_matrix, FileWriter from onegen.util import DEFAULT_GENERATION_CONFIG, MAX_NEW_TOKENS, MAX_RETRIEVAL_CNT from onegen.dataset import padding_input_ids from onegen.evaluator import FileConfig, InferenceConfig, ...
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/src/onegen/templator/templator.py
src/onegen/templator/templator.py
# model template import sys sys.path.append('../') from typing import List, Tuple, Any, Dict from dataclasses import dataclass import warnings class Templator: @classmethod def wrap(self, messages:List, **kwargs) -> str: raise NotImplementedError("Please implement the function `wrap` for the class Te...
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
zjunlp/OneGen
https://github.com/zjunlp/OneGen/blob/ad628f7d5759ced7c4075685bd62d915bed4b1f6/src/onegen/templator/__init__.py
src/onegen/templator/__init__.py
from .templator import *
python
MIT
ad628f7d5759ced7c4075685bd62d915bed4b1f6
2026-01-05T07:10:39.553873Z
false
loisaidasam/pyslack
https://github.com/loisaidasam/pyslack/blob/bce0dcbe830b95ba548b58c7ceea07923589a8ec/setup.py
setup.py
from setuptools import setup setup( author="@LoisaidaSam", author_email="sam.sandberg@gmail.com", description="A Python wrapper for Slack's API", install_requires=["requests"], keywords="slack api wrapper", license="MIT", name="pyslack-real", packages=["pyslack"], test_suite="test...
python
MIT
bce0dcbe830b95ba548b58c7ceea07923589a8ec
2026-01-05T07:10:42.481542Z
false
loisaidasam/pyslack
https://github.com/loisaidasam/pyslack/blob/bce0dcbe830b95ba548b58c7ceea07923589a8ec/pyslack/__init__.py
pyslack/__init__.py
import datetime import logging import requests class SlackError(Exception): pass class SlackClient(object): BASE_URL = 'https://slack.com/api' def __init__(self, token, verify=False): self.token = token self.verify = verify self.blocked_until = None self.channel_name_id...
python
MIT
bce0dcbe830b95ba548b58c7ceea07923589a8ec
2026-01-05T07:10:42.481542Z
false
loisaidasam/pyslack
https://github.com/loisaidasam/pyslack/blob/bce0dcbe830b95ba548b58c7ceea07923589a8ec/tests/client.py
tests/client.py
# coding: utf-8 import datetime import unittest from mock import Mock, patch import pyslack class ClientTest(unittest.TestCase): token = "my token" @patch('requests.post') def test_post_message(self, r_post): """A message can be posted to a channel""" client = pyslack.SlackClient(self....
python
MIT
bce0dcbe830b95ba548b58c7ceea07923589a8ec
2026-01-05T07:10:42.481542Z
false
loisaidasam/pyslack
https://github.com/loisaidasam/pyslack/blob/bce0dcbe830b95ba548b58c7ceea07923589a8ec/tests/handler.py
tests/handler.py
# coding: utf-8 import unittest import logging from mock import Mock, patch, ANY import pyslack class ClientTest(unittest.TestCase): token = "my token" @patch('pyslack.SlackClient.chat_post_message') def test_post_message(self, client_chatpostmessage): """Python log messages can be posted to a...
python
MIT
bce0dcbe830b95ba548b58c7ceea07923589a8ec
2026-01-05T07:10:42.481542Z
false
loisaidasam/pyslack
https://github.com/loisaidasam/pyslack/blob/bce0dcbe830b95ba548b58c7ceea07923589a8ec/tests/__init__.py
tests/__init__.py
python
MIT
bce0dcbe830b95ba548b58c7ceea07923589a8ec
2026-01-05T07:10:42.481542Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/fix_transcript_enhanced.py
transcript-fixer/scripts/fix_transcript_enhanced.py
#!/usr/bin/env python3 """ Enhanced transcript fixer wrapper with improved user experience. Features: - Custom output directory support - Automatic HTML diff opening in browser - Smart API key detection from shell config files - Progress feedback CRITICAL FIX: Now uses secure API key handling (Critical-2) """ import...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/ensure_deps.py
transcript-fixer/scripts/ensure_deps.py
#!/usr/bin/env python3 """Initialize shared virtual environment for transcript-fixer. Handles errors explicitly rather than letting Claude guess (per best practices). Creates a shared venv at ~/.transcript-fixer/.venv that can be reused across different working directories. """ import subprocess import sys from pathli...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/fix_transcription.py
transcript-fixer/scripts/fix_transcription.py
#!/usr/bin/env python3 """ Transcript Fixer - Main Entry Point SINGLE RESPONSIBILITY: Route CLI commands to handlers This is the main entry point for the transcript-fixer tool. It parses arguments and dispatches to appropriate command handlers. Usage: # Setup python fix_transcription.py --init # Correct...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/generate_word_diff.py
transcript-fixer/scripts/generate_word_diff.py
#!/usr/bin/env python3 """ Generate Word-Level Diff HTML Comparison Creates an HTML file showing word-by-word differences between original and corrected transcripts. This helps users review corrections more easily than character-level or line-level diffs. Usage: python scripts/generate_word_diff.py <original_file...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/__init__.py
transcript-fixer/scripts/__init__.py
""" Transcript Fixer - Modular Script Package Package structure: - core/: Business logic and data access layer - cli/: Command-line interface handlers - utils/: Utility functions and tools """ __version__ = "1.0.0"
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/check_type_hints.py
transcript-fixer/scripts/check_type_hints.py
#!/usr/bin/env python3 """ Type Hints Coverage Checker (P1-12) Analyzes Python files for type hint coverage and identifies missing annotations. Author: Chief Engineer (ISTJ, 20 years experience) Date: 2025-10-29 """ from __future__ import annotations import ast import sys from pathlib import Path from typing import...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/tests/test_path_validator.py
transcript-fixer/scripts/tests/test_path_validator.py
#!/usr/bin/env python3 """ Test Suite for Path Validator CRITICAL FIX VERIFICATION: Tests for Critical-5 Purpose: Verify path traversal and symlink attack prevention Test Coverage: 1. Path traversal prevention (../) 2. Symlink attack detection 3. Directory whitelist enforcement 4. File extension validation 5. Null by...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/tests/test_error_recovery.py
transcript-fixer/scripts/tests/test_error_recovery.py
#!/usr/bin/env python3 """ Error Recovery Testing Module CRITICAL FIX (P1-10): Comprehensive error recovery testing This module tests the system's ability to recover from various failure scenarios: - Database failures and transaction rollbacks - Network failures and retries - File system errors - Concurrent access co...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/tests/__init__.py
transcript-fixer/scripts/tests/__init__.py
""" Test suite for transcript-fixer """
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/tests/test_correction_service.py
transcript-fixer/scripts/tests/test_correction_service.py
#!/usr/bin/env python3 """ Unit Tests for Correction Service Tests business logic, validation, and service layer functionality. """ import unittest import tempfile import shutil from pathlib import Path import sys # Add parent directory to path sys.path.insert(0, str(Path(__file__).parent.parent)) from core.correct...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/tests/test_learning_engine.py
transcript-fixer/scripts/tests/test_learning_engine.py
#!/usr/bin/env python3 """ Test suite for LearningEngine thread-safety. CRITICAL FIX (P1-1): Tests for race condition prevention - Concurrent writes to pending suggestions - Concurrent writes to rejected patterns - Concurrent writes to auto-approved patterns - Lock acquisition and release - Deadlock prevention """ im...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/tests/test_audit_log_retention.py
transcript-fixer/scripts/tests/test_audit_log_retention.py
#!/usr/bin/env python3 """ Comprehensive tests for Audit Log Retention Management (P1-11) Test Coverage: 1. Retention policy enforcement 2. Cleanup strategies (DELETE, ARCHIVE, ANONYMIZE) 3. Critical action extended retention 4. Compliance reporting 5. Archive creation and restoration 6. Dry-run mode 7. Transaction sa...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/tests/test_domain_validator.py
transcript-fixer/scripts/tests/test_domain_validator.py
#!/usr/bin/env python3 """ Test Suite for Domain Validator CRITICAL FIX VERIFICATION: Tests for Critical-3 Purpose: Verify SQL injection prevention and input validation Test Coverage: 1. Domain whitelist validation 2. Source whitelist validation 3. Text sanitization 4. Confidence validation 5. SQL injection attack pr...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/tests/test_connection_pool.py
transcript-fixer/scripts/tests/test_connection_pool.py
#!/usr/bin/env python3 """ Test Suite for Thread-Safe Connection Pool CRITICAL FIX VERIFICATION: Tests for Critical-1 Purpose: Verify thread-safe connection pool prevents data corruption Test Coverage: 1. Basic pool operations 2. Concurrent access (race conditions) 3. Pool exhaustion handling 4. Connection cleanup 5....
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/utils/metrics.py
transcript-fixer/scripts/utils/metrics.py
#!/usr/bin/env python3 """ Metrics Collection and Monitoring CRITICAL FIX (P1-7): Production-grade metrics and observability Features: - Real-time metrics collection - Time-series data storage (in-memory) - Prometheus-compatible export format - Common metrics: requests, errors, latency, throughput - Custom metric sup...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/utils/rate_limiter.py
transcript-fixer/scripts/utils/rate_limiter.py
#!/usr/bin/env python3 """ Rate Limiting Module CRITICAL FIX (P1-8): Production-grade rate limiting for API protection Features: - Token Bucket algorithm (smooth rate limiting) - Sliding Window algorithm (precise rate limiting) - Fixed Window algorithm (simple, memory-efficient) - Thread-safe operations - Burst suppo...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/utils/security.py
transcript-fixer/scripts/utils/security.py
#!/usr/bin/env python3 """ Security Utilities CRITICAL FIX: Secure handling of sensitive data ISSUE: Critical-2 in Engineering Excellence Plan This module provides: 1. Secret masking for logs 2. Secure memory handling 3. API key validation 4. Input sanitization Author: Chief Engineer Date: 2025-10-28 Priority: P0 - ...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/utils/domain_validator.py
transcript-fixer/scripts/utils/domain_validator.py
#!/usr/bin/env python3 """ Domain Validation and Input Sanitization CRITICAL FIX: Prevents SQL injection via domain parameter ISSUE: Critical-3 in Engineering Excellence Plan This module provides: 1. Domain whitelist validation 2. Input sanitization for text fields 3. SQL injection prevention helpers Author: Chief E...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/utils/logging_config.py
transcript-fixer/scripts/utils/logging_config.py
#!/usr/bin/env python3 """ Logging Configuration for Transcript Fixer CRITICAL FIX: Enhanced with structured logging and error tracking ISSUE: Critical-4 in Engineering Excellence Plan Provides structured logging with rotation, levels, and audit trails. Added: Error rate monitoring, performance tracking, context enri...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/utils/retry_logic.py
transcript-fixer/scripts/utils/retry_logic.py
#!/usr/bin/env python3 """ Retry Logic with Exponential Backoff CRITICAL FIX: Implements retry for transient failures ISSUE: Critical-4 in Engineering Excellence Plan This module provides: 1. Exponential backoff retry logic 2. Error categorization (transient vs permanent) 3. Configurable retry strategies 4. Async ret...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/utils/health_check.py
transcript-fixer/scripts/utils/health_check.py
#!/usr/bin/env python3 """ Health Check Module - System Health Monitoring CRITICAL FIX (P1-4): Production-grade health checks for monitoring Features: - Database connectivity and schema validation - File system access checks - Configuration validation - Dependency verification - Resource availability checks Health C...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/utils/audit_log_retention.py
transcript-fixer/scripts/utils/audit_log_retention.py
#!/usr/bin/env python3 """ Audit Log Retention Management Module CRITICAL FIX (P1-11): Production-grade audit log retention and compliance Features: - Configurable retention policies per entity type - Automatic cleanup of expired logs - Archive capability for long-term storage - Compliance reporting (GDPR, SOX, etc.)...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/utils/path_validator.py
transcript-fixer/scripts/utils/path_validator.py
#!/usr/bin/env python3 """ Path Validation and Security CRITICAL FIX: Prevents path traversal and symlink attacks ISSUE: Critical-5 in Engineering Excellence Plan This module provides: 1. Path whitelist validation 2. Path traversal prevention (../) 3. Symlink attack detection 4. File extension validation 5. Directory...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/utils/migrations.py
transcript-fixer/scripts/utils/migrations.py
#!/usr/bin/env python3 """ Migration Definitions - Database Schema Migrations This module contains all database migrations for the transcript-fixer system. Migrations are defined here to ensure version control and proper migration ordering. Each migration has: - Unique version number - Forward SQL - Optional backward...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/utils/validation.py
transcript-fixer/scripts/utils/validation.py
#!/usr/bin/env python3 """ Validation Utility - Configuration Health Checker SINGLE RESPONSIBILITY: Validate transcript-fixer configuration and JSON files Features: - Check directory structure - Validate JSON syntax in all config files - Check environment variables - Report statistics and health status """ from __fu...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/utils/db_migrations_cli.py
transcript-fixer/scripts/utils/db_migrations_cli.py
#!/usr/bin/env python3 """ Database Migration CLI - Migration Management Commands CRITICAL FIX (P1-6): Production database migration CLI commands Features: - Run migrations with dry-run support - Migration status and history - Rollback capability - Migration validation - Migration planning """ from __future__ import...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/utils/config.py
transcript-fixer/scripts/utils/config.py
#!/usr/bin/env python3 """ Configuration Management Module CRITICAL FIX (P1-5): Production-grade configuration management Features: - Centralized configuration (single source of truth) - Environment-based config (dev/staging/prod) - Type-safe access with validation - Multiple config sources (env vars, files, defaults...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/utils/diff_generator.py
transcript-fixer/scripts/utils/diff_generator.py
#!/usr/bin/env python3 """ Generate word-level correction comparison reports Orchestrates multiple diff formats for visualization SINGLE RESPONSIBILITY: Coordinate diff generation workflow """ from __future__ import annotations import sys from pathlib import Path from .diff_formats import ( generate_unified_dif...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/utils/__init__.py
transcript-fixer/scripts/utils/__init__.py
""" Utils Module - Utility Functions and Tools This module contains utility functions: - diff_generator: Multi-format diff report generation - validation: Configuration validation - health_check: System health monitoring (P1-4 fix) - metrics: Metrics collection and monitoring (P1-7 fix) - rate_limiter: Production-grad...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/utils/concurrency_manager.py
transcript-fixer/scripts/utils/concurrency_manager.py
#!/usr/bin/env python3 """ Concurrency Management Module - Production-Grade Concurrent Request Handling CRITICAL FIX (P1-9): Tune concurrent request handling for optimal performance Features: - Semaphore-based request limiting - Circuit breaker pattern for fault tolerance - Backpressure handling - Request queue manag...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/utils/database_migration.py
transcript-fixer/scripts/utils/database_migration.py
#!/usr/bin/env python3 """ Database Migration Module - Production-Grade Migration Strategy CRITICAL FIX (P1-6): Production database migration system Features: - Versioned migrations with forward and rollback capability - Migration history tracking - Atomic transactions with rollback support - Dry-run mode for testing...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/utils/diff_formats/inline_format.py
transcript-fixer/scripts/utils/diff_formats/inline_format.py
#!/usr/bin/env python3 """ Inline diff format generator SINGLE RESPONSIBILITY: Generate inline diff with change markers """ from __future__ import annotations import difflib from .text_splitter import split_into_words def generate_inline_diff(original: str, fixed: str) -> str: """ Generate inline diff mar...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/utils/diff_formats/unified_format.py
transcript-fixer/scripts/utils/diff_formats/unified_format.py
#!/usr/bin/env python3 """ Unified diff format generator SINGLE RESPONSIBILITY: Generate unified diff format output """ from __future__ import annotations import difflib from .text_splitter import split_into_words def generate_unified_diff( original: str, fixed: str, original_label: str = "原始版本", ...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/utils/diff_formats/html_format.py
transcript-fixer/scripts/utils/diff_formats/html_format.py
#!/usr/bin/env python3 """ HTML diff format generator SINGLE RESPONSIBILITY: Generate HTML side-by-side comparison """ from __future__ import annotations import difflib def generate_html_diff(original: str, fixed: str) -> str: """ Generate HTML format comparison report (side-by-side) Args: ori...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/utils/diff_formats/text_splitter.py
transcript-fixer/scripts/utils/diff_formats/text_splitter.py
#!/usr/bin/env python3 """ Text splitter utility for word-level diff generation SINGLE RESPONSIBILITY: Split text into words while preserving structure """ from __future__ import annotations import re def split_into_words(text: str) -> list[str]: """ Split text into words, preserving whitespace and punctua...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false
daymade/claude-code-skills
https://github.com/daymade/claude-code-skills/blob/8b4a2ce8dc007cdd222a6fcde73338b82ea32459/transcript-fixer/scripts/utils/diff_formats/__init__.py
transcript-fixer/scripts/utils/diff_formats/__init__.py
""" Diff format generators for transcript comparison """ from .unified_format import generate_unified_diff from .html_format import generate_html_diff from .inline_format import generate_inline_diff from .markdown_format import generate_markdown_report from .change_extractor import extract_changes, generate_change_sum...
python
MIT
8b4a2ce8dc007cdd222a6fcde73338b82ea32459
2026-01-05T07:10:41.501036Z
false