text stringlengths 185 73.3k | repo stringlengths 7 100 | path stringlengths 4 146 | language stringclasses 7
values | hash stringlengths 16 16 | score float64 7 8.5 | stars int64 0 237k |
|---|---|---|---|---|---|---|
#!/usr/bin/env python3
"""瞬态罚接触的金标生成器——**闭式,不跑引擎**。
三条闭式全部来自同一个事实:**罚接触期间的运动是简谐半周期**。
无重力、无阻尼时,接触段满足`m·ẍ = −1000·k·x`(x是穿透量,mm),
故角频率`ω = sqrt(1000k/m)`,而:
* 接触时长 `t_c = π/ω` —— 半个周期,与入射速度**无关**;
* 最大穿透 `δ_max = v_in/ω` —— 简谐运动的振幅;
* 恢复系数 `e = 1` —— 保守力场,出射速率等于入射速率。
**那个1000是单位制的必然,不是凑的**:`k`是N/mm、`g`是mm,故力是N;
质量是kg... | Rtiming/physics-engine | cases/bouncing_ball_restitution/generate_oracle.py | .py | d2e15daaa3cd1615 | 7 | 0 |
#!/usr/bin/env python3
"""翻倒阈值的金标——**几何阈值`tanθ ≤ w/h`自己推一遍,不抄**。
plans/16的M4。0081第四节写着"没有裁翻倒那一支的判据……等实现到那一步再裁",
本脚本与`case.md`第二节就是那一次裁。
## 一、几何阈值:两条独立的推法,同一个数
**推法甲(力矩平衡)**:斜面倾角`θ`、底面半宽`w`(沿坡向)、重心高`h`(垂直底面)。
取下坡侧底棱为支点,重心相对支点的位置在斜面标架里是`(−w, h)`,
重力是`m·g·(sinθ, −cosθ)`。绕支点的力矩(取`t̂ × n̂`方向为正)
τ = (−w)·(−mg cosθ) −... | Rtiming/physics-engine | cases/box_tipping_threshold/generate_oracle.py | .py | 8bc2309844f153bb | 7 | 0 |
#!/usr/bin/env python3
"""绞盘张力比的金标生成器——**闭式解,独立于被验内核**。
绕在固定圆柱上的柔性带材,全段滑移时张紧端与松弛端的张力比是
Euler-Eytelwein(绞盘)公式:
T2 / T1 = exp(mu * theta)
它是连续极限。本仓的杆是**离散**的,所以真正该判的是离散关系,
而连续式只作为离散式的极限:
## 一、单节点的精确关系(本案例判据强度最高的两条)
一个接触节点两侧各有一段带材,张力分别是``T⁻``、``T⁺``,
两段各偏离节点处切线``Δφ/2``。对该节点做力平衡:
法向 N = (T⁻ + T⁺) · sin(Δφ/... | Rtiming/physics-engine | cases/capstan_tension_ratio/generate_oracle.py | .py | 5266b3a763629fc9 | 7 | 0 |
#!/usr/bin/env python3
"""FTS仪器线型与切趾的金标生成器——**独立算法,不调被验内核**。
被验内核走两条闭式:ILS的半高全宽是一个**写死的常量**
`UNAPODISED_FWHM_IN_SINC_UNITS`,切趾的通量代价是一个**求和闭式**
``sum_i C_i 2^(2i) (i!)^2 / (2i+1)!``。本生成器两条都不走:
* 半高全宽**直接对``sin(pi z) / (pi z) = 1/2``二分求根**——
于是"那个常量是不是1.2067091288"变成一条真判据,而不是抄写核对;
* 通量代价**用复合Simpson数值积分**切趾窗——于是那个求和闭... | Rtiming/physics-engine | cases/fts_instrument_line_shape/generate_oracle.py | .py | 28ebc24316f98b5a | 7 | 0 |
#!/usr/bin/env python3
"""参数化生成器的金标生成器——**闭式解与手推常数,独立于被验内核**。
本脚本**不import`physics_engine.modelgen`,也不import`physics_engine.geometry`**。
它写三样东西:
1. **确定性/一位变化/齐次性的判据**,全是布尔与计数——它们是关系型判据
("两次调用的字节相等"、"22条扰动全部改变声明"),不冻结任何一份具体字节。
这是有意的:声明指纹的形制**不是已登记的面**,把它的哈希冻进金标等于让
一个未登记的字节形制长出依赖者。
2. **质量属性的教科书闭式解**:实心圆柱与胶囊的... | Rtiming/physics-engine | cases/generator_determinism/generate_oracle.py | .py | e92013ed4ddf9688 | 7 | 0 |
#!/usr/bin/env python3
"""外倾锥面槽壁 vs 平面环带——**闭式静力学,独立于被验内核**。
本脚本一行都不import`physics_engine.contact`。它解的是同一道题的手推答案,
conformance测试再拿内核去撞它。
## 一、几何与三条闭式
截面里记``u``(横向)、``v``(深度)。第σ侧壁的间隙
g_σ(u, v) = w/2 + v·tanα − (σ·u + r)
罚势``U = ½k g²``(``g < 0``),故接触力``F = −k·g·∇g``、``∇g = tanα·n − σ·s``。
拆到两个轴上:
F_横向 = k·|... | Rtiming/physics-engine | cases/groove_sweep_wall/generate_oracle.py | .py | 08c8b3930ec4207b | 7 | 0 |
#!/usr/bin/env python3
"""生成`tetra.stl`——本仓自带的合成网格资产(Chrono形制:生成脚本一并入库)。
为什么要合成资产:`examples/`那个KUKA连杆的STL在WII仓、不在本仓,
包盒保守性判据没有字节可查。所以仓内自带一个几百字节的确定性资产。
三条硬性质:
1. **纯标准库**,零依赖(本仓`dependencies = []`是承诺,案例侧也不破例);
2. **确定性输出**:头部是固定ASCII、无时间戳、无路径、无随机数——
同一份脚本在任何机器上产出逐字节相同的284字节;
3. **顶点全部是二进制小数**(±0.25的整数倍),float32存储无... | Rtiming/physics-engine | cases/mesh_asset_integrity/assets/generate_tetra.py | .py | 5b8e960e12127951 | 7 | 0 |
#!/usr/bin/env python3
"""生成`cases/mesh_asset_integrity/`的场景语料与清单——资产完整性与包盒保守性。
**这是今天就必红的一条**:引擎至今没有任何门能发现"声明的SHA对得上、
声明的包盒却与资产真值在某个轴上完全不相交"这类错误(decisions/0017第四条
记的正是这个真实缺陷)。本案例建的就是那道门。
两条判据,都零容差:
1. `sha256(资产字节) == 场景里声明的sha256`;
2. `direction="envelope"`时,逐轴`declared_min ≤ true_min` 且 `declared_max ≥ true_max`。... | Rtiming/physics-engine | cases/mesh_asset_integrity/generate_oracle.py | .py | f7ad587a1b1ea6a0 | 7 | 0 |
#!/usr/bin/env python3
"""从Wiscombe MIEV0发行包的`MVTstNew.f`里抽`BLOCK DATA CHEKMI`那19条测试问题。
python cases/mie_wiscombe_reference/extract_reference.py <MVTstNew.f> > reference.json
## 它为什么存在
`reference.json`里的数字**不是本仓算出来的**,是**抄同行的**。
案例页必填字段第二条("无闭式解则生成脚本入库并给SHA")在这一条上的
诚实答案就是本文件:**"抄"这个动作要有一个可复读的形态**,
否则半年后没人能回答"这个数... | Rtiming/physics-engine | cases/mie_wiscombe_reference/extract_reference.py | .py | 6b2c92683c391ca5 | 7 | 0 |
#!/usr/bin/env python3
"""窄相的判据——**全部闭式,且一行都不import`physics_engine.collision`**。
本脚本解的是同一道题的手推答案,conformance测试再拿内核去撞它。
**实测数不作金标**(spec/08规则1):内核的数拿来撞这里的数,不是反过来。
## 一、五族判据各自的闭式
### 1. 球-球
d = |c₂ − c₁| − (r₁ + r₂)
初等。**分离支与穿透支是同一条式子**——这正是本仓既有窄相"一个数两用"的
形制,也是EPA那条路给不了的(它只答穿透那一半,见决策0090第2.1节)。
### 2. 球-半空间
... | Rtiming/physics-engine | cases/narrow_phase_signed_distance/generate_oracle.py | .py | 6e78cd24447c675b | 7 | 0 |
#!/usr/bin/env python3
"""Batch collect drug bundles (without LLM calls).
This script collects drug bundles including DDI data for multiple drugs.
It does NOT require an API key since it only collects data, no LLM generation.
Usage:
# Collect top 10 drugs by prediction count
python scripts/batch_colle... | yao-care/NOTxGNN | scripts/batch_collect_bundles.py | .py | a7bdaefa66077c26 | 7.15 | 1 |
#!/usr/bin/env python3
"""Batch generate Evidence Packs and Notes for all collected bundles.
This script processes all drug bundles and generates:
1. Evidence Pack (LLM analysis)
2. Pharmacist Notes (LLM report)
Usage:
# Generate reports for all bundles
python scripts/batch_generate_reports.py --all
# Ge... | yao-care/NOTxGNN | scripts/batch_generate_reports.py | .py | cc7623e772b76f08 | 7.15 | 1 |
#!/usr/bin/env python3
"""
Check ClinicalTrials.gov for new clinical trials related to our drug list.
Creates GitHub Issues when new trials are found.
"""
import json
import os
import time
from datetime import datetime, timedelta
from pathlib import Path
import requests
from github_utils import create_issue, issue_e... | yao-care/NOTxGNN | scripts/check_clinicaltrials.py | .py | 3197fe96f928d6fe | 7.15 | 1 |
#!/usr/bin/env python3
"""
Check PubMed for new publications related to our drug list.
Creates GitHub Issues when new papers are found.
"""
import json
import os
import time
from datetime import datetime
from pathlib import Path
import requests
from github_utils import create_issue, issue_exists, close_older_pubmed_... | yao-care/NOTxGNN | scripts/check_pubmed.py | .py | da8f3de94c007b01 | 7.15 | 1 |
#!/usr/bin/env python3
"""
Generate individual drug pages for Jekyll from repurposing predictions.
Creates markdown pages for each drug with predicted indications.
Output: docs/_drugs/{drug-slug}.md
"""
import pandas as pd
from datetime import datetime
from pathlib import Path
# Project configuration
... | yao-care/NOTxGNN | scripts/generate_drug_pages.py | .py | ed8c5957096a0e3e | 7.15 | 1 |
#!/usr/bin/env python3
"""生成 FHIR R4 資源
從預測結果生成 FHIR 格式的資源檔案。
使用方法:
uv run python scripts/generate_fhir_resources.py
前置條件:
已執行 run_kg_prediction.py
產生檔案:
docs/fhir/metadata
docs/fhir/MedicationKnowledge/*.json
docs/fhir/ClinicalUseDefinition/*.json
"""
import json
from pathlib import Path
from... | yao-care/NOTxGNN | scripts/generate_fhir_resources.py | .py | 7349c43dd596fd34 | 7.15 | 1 |
#!/usr/bin/env python3
"""
產生新聞監測用的關鍵字清單
從現有資料提取:
- 191 個藥物名稱(英文 + 中文商品名)
- 原始適應症(中文)
- 預測適應症(英文)
輸出:data/news/keywords.json
"""
import json
import re
from datetime import datetime
from pathlib import Path
# 專案根目錄
PROJECT_ROOT = Path(__file__).parent.parent
DATA_DIR = PROJECT_ROOT / "data"
DOCS_DATA_DIR = PROJECT_R... | yao-care/NOTxGNN | scripts/generate_news_keywords.py | .py | dc29cc8c392e5963 | 7.15 | 1 |
#!/usr/bin/env python3
"""
Generate unified search index for drug lookup feature.
This script creates a JSON index file that supports:
1. Drug name search (English INN + Chinese brand names)
2. Indication/disease search
3. Bidirectional lookup (drug → indications, indication → drugs)
"""
import json
import re
from pa... | yao-care/NOTxGNN | scripts/generate_search_index.py | .py | 2261d997448e9dee | 7.15 | 1 |
#!/usr/bin/env python3
"""處理挪威 DMP / EMA 藥品資料
由於 FEST (Forskrivnings- og ekspedisjonsstøtte) 僅提供 SOAP/WCF web service,
無穩定的批量靜態檔案下載,改用 EMA Medicines Report 作為資料來源。
挪威為 EEA 成員國,EMA 集中授權藥品在挪威有效。
使用方法:
uv run python scripts/process_fda_data.py
資料來源:
主要: EMA Medicines Report (集中授權藥品,含挪威)
https://www.em... | yao-care/NOTxGNN | scripts/process_fda_data.py | .py | 9e57feab068d8f99 | 7.15 | 1 |
#!/usr/bin/env python3
"""
新聞處理腳本
功能:
1. 讀取所有 data/news/*.json 來源檔案
2. 載入 keywords.json 進行關鍵字匹配
3. 跨站去重(相似標題合併來源)
4. 輸出 matched_news.json
5. 產生 docs/_news/*.md 頁面
"""
import json
import re
from datetime import datetime, timezone, timedelta
from difflib import SequenceMatcher
from pathlib import Path
# 專案根目錄
PROJECT_... | yao-care/NOTxGNN | scripts/process_news.py | .py | 51f73c9cb23b1e78 | 7.15 | 1 |
"""DDInter DDI collector - reads local CSV files."""
import csv
from pathlib import Path
from .base import BaseCollector, CollectorResult
class DDInterCollector(BaseCollector):
"""Collector for DDInter drug-drug interaction data.
Reads from local CSV files in data/external/ddi/ddinter/.
Fil... | yao-care/NOTxGNN | src/notxgnn/collectors/ddinter.py | .py | fa50601bcb3646e5 | 7.15 | 1 |
"""PubMed collector - fetches literature data via NCBI E-utilities API."""
import os
import requests
import time
from typing import Any
from xml.etree import ElementTree
from .base import BaseCollector, CollectorResult
class PubMedCollector(BaseCollector):
"""Collector for PubMed literature data.
Uses NCBI... | yao-care/NOTxGNN | src/notxgnn/collectors/pubmed.py | .py | ef00f05c7a44eccb | 7.15 | 1 |
"""TFDA collector - fetches Taiwan FDA drug data."""
import json
from pathlib import Path
from typing import Any
from .base import BaseCollector, CollectorResult
class TFDACollector(BaseCollector):
"""Collector for Taiwan FDA (TFDA) drug data.
Reads from local tw_fda_drugs.json file that was processed
... | yao-care/NOTxGNN | src/notxgnn/collectors/tfda.py | .py | 88def1e130e280c4 | 7.15 | 1 |
"""Enhanced TFDA collector with package insert parsing."""
import json
import re
import time
from pathlib import Path
from typing import Any
from urllib.parse import quote
import httpx
from .base import BaseCollector, CollectorResult
from .tfda import TFDACollector
class TFDAPackageInsertCollector(BaseCollector):
... | yao-care/NOTxGNN | src/notxgnn/collectors/tfda_package_insert.py | .py | 249adb1dc56bef4f | 7.15 | 1 |
"""DMP 藥品資料載入與過濾
載入挪威 DMP/FEST 藥品註冊資料。
"""
import json
from pathlib import Path
from typing import Optional
import pandas as pd
import yaml
def load_config() -> dict:
"""載入欄位映射設定
Returns:
設定字典
"""
config_path = Path(__file__).parent.parent.parent.parent / "config" / "fields.yaml"
with ... | yao-care/NOTxGNN | src/notxgnn/data/loader.py | .py | c0f67e3d05f743a9 | 7.15 | 1 |
#!/usr/bin/env python3
"""ChEMBL 橋接模組
使用 ChEMBL API 或本地 SQLite 資料庫補充藥物映射。
ChEMBL 包含核准藥物的生物活性資料。
API 文件:https://www.ebi.ac.uk/chembl/api/data/docs
"""
import json
import logging
import sqlite3
import time
from pathlib import Path
from typing import Dict, List, Optional, Set
import requests
logger ... | yao-care/NOTxGNN | src/notxgnn/mapping/chembl_bridge.py | .py | 54dcdb2d8437536b | 7.15 | 1 |
"""疾病映射模組 - 葡萄牙語適應症/治療類別映射至 TxGNN 疾病本體"""
import re
from pathlib import Path
from typing import Dict, List, Optional, Tuple
import pandas as pd
# 葡萄牙語-英語疾病/症狀對照表
DISEASE_DICT = {
# === Hjerte og kar (Cardiovascular) ===
"høyt blodtrykk": "hypertension",
"hypertensjon": "hypertension",
"lavt blodtryk... | yao-care/NOTxGNN | src/notxgnn/mapping/disease_mapper.py | .py | d0e5198b7d851de1 | 7.15 | 1 |
#!/usr/bin/env python3
"""中草藥映射模組
由於 TCMSP 沒有公開 API,此模組提供:
1. 常見中草藥的靜態映射表
2. 中草藥主要活性成分對照
3. 可映射到 DrugBank 的已知成分
資料來源:
- TCMSP (https://tcmsp-e.com/tcmsp.php)
- 中藥大辭典
- 相關學術文獻
"""
import logging
from typing import Dict, Optional, Set
logger = logging.getLogger(__name__)
# 中草藥到主要活性成分的映射
# 格式:{FDA... | yao-care/NOTxGNN | src/notxgnn/mapping/herbal_mapper.py | .py | 9ed0ac54f61de85f | 7.15 | 1 |
#!/usr/bin/env python3
"""多來源藥物映射整合模組
整合 DrugBank、RxNorm、PubChem、ChEMBL 和 TCMSP 的映射能力,
提供統一的映射介面。
映射優先順序:
1. DrugBank 直接映射(最可靠)
2. DrugBank 同義詞映射
3. 中草藥映射表(TCMSP 靜態資料)
4. RxNorm API 橋接
5. PubChem API 橋接
6. ChEMBL API 橋接
"""
import logging
from pathlib import Path
from typing import Dict, List, Optio... | yao-care/NOTxGNN | src/notxgnn/mapping/multi_source_mapper.py | .py | e21bc7cadece596c | 7.15 | 1 |
#!/usr/bin/env python3
"""PubChem 橋接模組
使用 PubChem API 補充 DrugBank 不存在的藥物映射。
PubChem 涵蓋範圍更廣,包含營養補充品、草藥成分等。
API 文件:https://pubchem.ncbi.nlm.nih.gov/docs/pug-rest
"""
import json
import logging
import time
from pathlib import Path
from typing import Dict, List, Optional, Set
import pubchempy as pcp
l... | yao-care/NOTxGNN | src/notxgnn/mapping/pubchem_bridge.py | .py | ba36373808e8953c | 7.15 | 1 |
"""打包统计脚本:输出构建产物的大小与构成。"""
from __future__ import annotations
from pathlib import Path
_UNITS = ("B", "KB", "MB", "GB")
def get_dir_size(path: Path) -> int:
"""计算目录总大小(字节)。."""
return sum(f.stat().st_size for f in path.rglob("*") if f.is_file())
def format_size(size: float) -> str:
"""格式化文件大小。."""
... | gookeryoung/finaldb | scripts/build_stats.py | .py | e5c60ec8cbf79387 | 7 | 0 |
"""finaldb GUI 应用入口:构造 QApplication(Widgets)与主窗口。
仅支持 PySide2(Win7 发布目标),运行时环境为 Python 3.10。
"""
from __future__ import annotations
import sys
from PySide2.QtCore import QObject
from PySide2.QtGui import QFont, QGuiApplication
from PySide2.QtWidgets import QApplication, QMainWindow
from finaldb.app_controllers imp... | gookeryoung/finaldb | src/finaldb/app.py | .py | 87c42f0f0fd94183 | 7 | 0 |
"""清洗引擎:把规则流式应用到行迭代器,报告随行消费累积。."""
from __future__ import annotations
from collections.abc import Iterable, Iterator, Sequence
from dataclasses import dataclass, field
from finaldb.core.cleaning.rules import CaseMode, CleanRule, RuleKind
from finaldb.core.exceptions import CleanError
__all__ = ["CleanReport", "appl... | gookeryoung/finaldb | src/finaldb/core/cleaning/engine.py | .py | 7c81029e45fc65ad | 7 | 0 |
"""清洗规则定义:规则种类/大小写模式枚举 + 规则数据类。."""
from __future__ import annotations
from dataclasses import dataclass
from enum import Enum
__all__ = ["CaseMode", "CleanRule", "RuleKind"]
class RuleKind(Enum):
"""清洗规则种类。."""
TRIM = "trim" # 去除首尾空白
CASE = "case" # 大小写标准化
REPLACE = "replace" # 文本替换
TO_NUM... | gookeryoung/finaldb | src/finaldb/core/cleaning/rules.py | .py | d8a75d341f123341 | 7 | 0 |
"""清洗服务:从表读取全量数据 → 应用规则 → 写入新表。."""
from __future__ import annotations
import sqlite3
from collections.abc import Sequence
from dataclasses import dataclass
from itertools import chain, islice
from finaldb.core.cleaning.engine import CleanReport, apply_rules
from finaldb.core.cleaning.rules import CleanRule
from fin... | gookeryoung/finaldb | src/finaldb/core/cleaning/service.py | .py | 298c9770213ec650 | 7 | 0 |
"""编辑服务:命令化即时落库 + 多级撤销/重做。
每条编辑命令立即写库,同时记录正向参数(重做用)与逆操作参数(撤销用);
撤销/重做同样即时落库,配合快照(versioning)提供整体回滚兜底。
行级操作以 rowid 定位;删行的撤销按原 rowid 复活,删列的撤销恢复整列数据。
"""
from __future__ import annotations
import sqlite3
from collections.abc import Iterator, Sequence
from contextlib import contextmanager
from dataclasses import datacla... | gookeryoung/finaldb | src/finaldb/core/editing/service.py | .py | 829fc56865a3ce5a | 7 | 0 |
"""core 层统一异常体系:公共基类 + 按场景分类。."""
from __future__ import annotations
__all__ = [
"CleanError",
"FinaldbError",
"InvalidDataError",
"MergeError",
"TableExistsError",
"UnsupportedFormatError",
"VersionError",
"WorkspaceError",
]
class FinaldbError(Exception):
"""finaldb 所有业务异常的公共基类... | gookeryoung/finaldb | src/finaldb/core/exceptions.py | .py | d99aef944dde2e02 | 7 | 0 |
"""CSV/TSV 导入器:编码探测 + 分隔符按扩展名选择。."""
from __future__ import annotations
import csv
from collections.abc import Iterator
from pathlib import Path
from finaldb.core.exceptions import InvalidDataError
from finaldb.core.importers.base import TableData
from finaldb.core.importers.naming import sanitize_identifier
__all_... | gookeryoung/finaldb | src/finaldb/core/importers/csv_reader.py | .py | 722cf7bef5f7b6e9 | 7 | 0 |
"""Excel 导入器:openpyxl 只读流式解析(x.xlsx/xlsm)。."""
from __future__ import annotations
import datetime as _dt
import decimal
from collections.abc import Iterator
from pathlib import Path
from finaldb.core.exceptions import InvalidDataError, UnsupportedFormatError
from finaldb.core.importers.base import TableData
from fin... | gookeryoung/finaldb | src/finaldb/core/importers/excel_reader.py | .py | 8a4a80122d3cd6f4 | 7 | 0 |
"""JSON 导入器:数组/对象数组/NDJSON/多表字典。."""
from __future__ import annotations
import json
from collections.abc import Iterator
from pathlib import Path
from typing import Any
from finaldb.core.exceptions import InvalidDataError
from finaldb.core.importers.base import TableData
from finaldb.core.importers.naming import san... | gookeryoung/finaldb | src/finaldb/core/importers/json_reader.py | .py | 4ab80e67612569bf | 7 | 0 |
"""导入服务:按扩展名分发解析器,并把 TableData 落库。."""
from __future__ import annotations
import sqlite3
from collections.abc import Iterable, Iterator
from dataclasses import dataclass
from itertools import islice
from pathlib import Path
from finaldb.core.exceptions import UnsupportedFormatError
from finaldb.core.importers.base i... | gookeryoung/finaldb | src/finaldb/core/importers/service.py | .py | 914fea5b25ee99e5 | 7 | 0 |
"""合并服务:union(纵向堆叠)、dedup(去重)、join(按键连接)。
三种操作都保留源表不动,结果写入新表;类型按结果样本推断。
"""
from __future__ import annotations
import sqlite3
from collections.abc import Callable, Iterable, Iterator, Sequence
from dataclasses import dataclass
from itertools import chain, islice
from finaldb.core.exceptions import MergeError
from f... | gookeryoung/finaldb | src/finaldb/core/merge/service.py | .py | 5219ea3ccd2e8c50 | 7 | 0 |
"""工作区统计分析:表级概览与列级统计(纯 Python,不依赖 GUI)。
面向统计页的数据源:工作区整体规模(表数/行数/列数/库体积)与
单表每列的质量画像(空值/唯一值/最值/均值),全部走 SQLite 聚合查询。
"""
from __future__ import annotations
import sqlite3
from dataclasses import dataclass
from pathlib import Path
from typing import Optional
from finaldb.core.storage.database import (
column_infos,... | gookeryoung/finaldb | src/finaldb/core/stats.py | .py | f89e68e3de2b74e1 | 7 | 0 |
"""SQLite 存储层:连接管理、建表、批量写入与元数据查询。
全部使用参数化 SQL;表名/列名等标识符经 :func:`validate_identifier`
白名单校验(``[A-Za-z_][A-Za-z0-9_]*``)后再拼接,杜绝注入。
"""
from __future__ import annotations
import re
import sqlite3
from collections.abc import Iterable, Sequence
from pathlib import Path
from finaldb.core.exceptions import TableExistsErro... | gookeryoung/finaldb | src/finaldb/core/storage/database.py | .py | 38745460481c966d | 7 | 0 |
"""数据编辑存储层:行级 CRUD 与列结构操作。
与 :mod:`finaldb.core.storage.database` 的只读/批量导入职责互补,
本模块面向交互式编辑:单元格修改、行增删、列增删改。
列结构操作的兼容策略:RENAME COLUMN 需 SQLite 3.25+、DROP COLUMN 需 3.35+,
低于该版本时自动走重建表路径(显式携带 rowid 复制,保持行标识稳定,
撤销栈的 rowid 引用在列操作前后仍然有效)。
"""
from __future__ import annotations
import sqlite3
from collections.abc import Se... | gookeryoung/finaldb | src/finaldb/core/storage/editing.py | .py | 23a81b96c0867763 | 7 | 0 |
"""版本控制:基于 dulwich 的快照级提交与变更检测。
快照语义:每次提交把工作区的 ``data.db`` 整体存为一个 git blob;
不做行级 merge。当前仅保留提交与变更检测(导入自动快照),
历史列表/对比/回滚等 GUI 入口已随版本页移除。
"""
from __future__ import annotations
from dataclasses import dataclass
from pathlib import Path
from typing import cast
from dulwich import porcelain
from dulwich.errors import N... | gookeryoung/finaldb | src/finaldb/core/versioning.py | .py | ce32064d4011a24a | 7 | 0 |
"""工作区生命周期管理:创建 / 打开 / 列举 / 删除。
一个工作区 = 一个目录,包含:
- ``data.db``:SQLite 运行库
- ``finaldb.json``:工作区标记文件(名称、版本、创建时间)
工作区根目录默认 ``~/.finaldb/workspaces``,可注入自定义路径用于测试。
"""
from __future__ import annotations
import json
import re
import shutil
import sqlite3
import time
from operator import attrgetter
from pathlib import... | gookeryoung/finaldb | src/finaldb/core/workspace.py | .py | bac31128a419cd6f | 7 | 0 |
"""关于控制器:暴露应用版本与环境信息给关于页。."""
from __future__ import annotations
import sys
import dulwich
import PySide2
from PySide2.QtCore import QObject, qVersion
import finaldb
__all__ = ["AboutController"]
# 开源许可文案(MIT)
_LICENSE = "MIT License"
class AboutController(QObject):
"""关于页控制器。."""
def version(self) -> ... | gookeryoung/finaldb | src/finaldb/gui/controllers/about_controller.py | .py | 1a6d78da6ca7f956 | 7 | 0 |
"""清洗控制器:桥接 core 清洗引擎与 Widgets 数据整理页。
职责:表/列加载、规则增删管理、预览(含统计报告)、后台清洗落库。
界面只连接本控制器的信号与调用其方法,不直接触碰 core。
"""
from __future__ import annotations
from pathlib import Path
from PySide2.QtCore import QObject, QThread, Signal
from finaldb.core.cleaning.engine import apply_rules
from finaldb.core.cleaning.rules import Cas... | gookeryoung/finaldb | src/finaldb/gui/controllers/clean_controller.py | .py | 612d698ecbef732d | 7 | 0 |
"""合并控制器:桥接 core 合并服务与 Widgets 合并去重页。
职责:表/列加载、union/dedup/join 三种合并模式的后台调度。
界面侧多值(表列表、键列列表)用单元分隔符拼接的字符串传递。
"""
from __future__ import annotations
from pathlib import Path
from PySide2.QtCore import QObject, QThread, Signal
from finaldb.core.merge import JoinSpec, MergeJob
from finaldb.core.storage.database import... | gookeryoung/finaldb | src/finaldb/gui/controllers/merge_controller.py | .py | c8ee644f891eab91 | 7 | 0 |
"""统计控制器:桥接 core 统计分析与 Widgets 统计页。
职责:工作区表分布概览(表数/行数/列数/体积)与单表列级统计加载。
界面只连接本控制器的信号与调用其方法。
"""
from __future__ import annotations
import sqlite3
from pathlib import Path
from PySide2.QtCore import QObject, Signal
from finaldb.core.stats import column_stats as _column_stats
from finaldb.core.stats import format_siz... | gookeryoung/finaldb | src/finaldb/gui/controllers/stats_controller.py | .py | 82fdce2ca0361dfa | 7 | 0 |
"""工作区控制器:桥接 core 工作区服务与 Widgets 界面。
职责:工作区增删查、当前工作区选择、数据导入调度(QThread Worker)。
界面只连接本控制器的信号与调用其方法,不直接触碰 core。
"""
from __future__ import annotations
import time
from pathlib import Path
from PySide2.QtCore import QObject, QThread, Signal
from finaldb.core.exceptions import WorkspaceError
from finaldb.core.storage.... | gookeryoung/finaldb | src/finaldb/gui/controllers/workspace_controller.py | .py | 8f667c727bdaaa02 | 7 | 0 |
"""清洗模型:规则列表、列名列表与清洗预览(TableModel)。."""
from __future__ import annotations
from typing import Any
from PySide2.QtCore import QAbstractListModel, QAbstractTableModel, QByteArray, QModelIndex, Qt
from finaldb.core.cleaning.rules import CleanRule
__all__ = ["CleanPreviewModel", "CleanRuleListModel", "StringListModel"... | gookeryoung/finaldb | src/finaldb/gui/models/clean_models.py | .py | 62473fe6ad3b5e92 | 7 | 0 |
"""列统计表模型:单表每列画像的二维表展示(嵌入统计页)。."""
from __future__ import annotations
from typing import Any
from PySide2.QtCore import QAbstractTableModel, QModelIndex, Qt
from finaldb.core.stats import ColumnStat
__all__ = ["ColumnStatModel"]
_NO_PARENT = QModelIndex()
# 表头:与 ColumnStat 字段一一对应(均值仅数值列有值)
_HEADERS = ("列名", "类型"... | gookeryoung/finaldb | src/finaldb/gui/models/column_stat_model.py | .py | f871a54cfc3ad06e | 7 | 0 |
"""可编辑表格模型:rowid 定位的双向绑定(显示 + 单元格编辑)。."""
from __future__ import annotations
from typing import Any
from PySide2.QtCore import QAbstractTableModel, QModelIndex, Qt
__all__ = ["EditableTableModel"]
# QModelIndex 为不可值类型,作默认参数的模块级单例(B008 规避)
_NO_PARENT = QModelIndex()
class EditableTableModel(QAbstractTableModel):
... | gookeryoung/finaldb | src/finaldb/gui/models/edit_model.py | .py | d3bd9288532b82e7 | 7 | 0 |
"""统计条目模型:QML 统计页的表分布展示。."""
from __future__ import annotations
from typing import Any
from PySide2.QtCore import QAbstractListModel, QByteArray, QModelIndex, Qt
from finaldb.core.storage.database import TableInfo
__all__ = ["TableStatModel"]
_NO_PARENT = QModelIndex()
# 角色名(QML delegate 通过 model.角色名 取值)
_ROLE_N... | gookeryoung/finaldb | src/finaldb/gui/models/stats_model.py | .py | 53261945003e2723 | 7 | 0 |
"""表模型:工作区表列表(ListModel)。."""
from __future__ import annotations
from typing import Any
from PySide2.QtCore import QAbstractListModel, QByteArray, QModelIndex, Qt
__all__ = ["TableListModel"]
_ROLE_TABLE_NAME = QByteArray(b"name")
_ROLE_TABLE_ROWS = QByteArray(b"rows")
# QModelIndex 为不可值类型,作默认参数的模块级单例(B008 规避)
_N... | gookeryoung/finaldb | src/finaldb/gui/models/table_model.py | .py | 19a0ff1663b80a58 | 7 | 0 |
"""工作区列表模型:WorkspaceMeta → QAbstractListModel。."""
from __future__ import annotations
import time
from typing import Any
from PySide2.QtCore import QAbstractListModel, QByteArray, QModelIndex, Qt
from finaldb.core.workspace import WorkspaceMeta
__all__ = ["WorkspaceListModel"]
# 角色名 → QML 侧通过 model.name / model.t... | gookeryoung/finaldb | src/finaldb/gui/models/workspace_model.py | .py | 6e6d48f4e8a669f6 | 7 | 0 |
"""界面设置持久化:QSettings 读写主题暗色模式与基准字号。
ThemeManager 自身保持纯内存状态(便于测试),持久化由应用装配层
(app.create_app)在启动恢复与主题变化时调用本模块完成。
"""
from __future__ import annotations
from PySide2.QtCore import QSettings
__all__ = ["clear_theme_settings", "load_theme_settings", "save_theme_settings"]
_ORG = "finaldb"
_APP = "gui"
# 基准字号范围与默认值(与 T... | gookeryoung/finaldb | src/finaldb/gui/settings.py | .py | 06bb73a0492e7317 | 7 | 0 |
"""主题管理器:设计令牌 + QSS 生成(Widgets 版)。
色值沿用 fuscan 风格:GitHub Desktop(浅色)+ Tokyo Night(深色)。
所有色值/字号通过 :class:`ThemeManager` 的方法获取,界面代码禁止硬编码色值。
暗色模式由 ``is_dark`` 状态驱动,切换时 emit ``theme_changed``,
应用层收到后用 :func:`build_qss` 重新生成样式表并整体重设。
"""
from __future__ import annotations
import sys
from PySide2.QtCore import QObject, S... | gookeryoung/finaldb | src/finaldb/gui/theme.py | .py | e49d963b6e0db280 | 7 | 0 |
"""页面通用部件工厂:标题/说明标签、卡片容器、忙指示条、工作区提示。."""
from __future__ import annotations
from PySide2.QtWidgets import QFrame, QLabel, QProgressBar
from finaldb.gui.theme import ThemeManager
__all__ = [
"busy_bar",
"caption_label",
"card",
"page_title",
"secondary_label",
"workspace_hint",
]
def page_t... | gookeryoung/finaldb | src/finaldb/gui/widgets/common.py | .py | 546f8683b95ca89e | 7 | 0 |
"""矢量图标工厂:QPainter 自绘 + assets/icons SVG 资产加载,随主题色重建。
自绘图标(分页/预览/刷新等通用操作)在 24x24 网格内以 2px 圆头笔画绘制;
SVG 资产图标按 ``assets/icons/*.svg`` 加载:读取 path 数据做单色化替换
(fill 统一为主题色)后经 QSvgRenderer 渲染,支持高 DPI。
两者统一经 :func:`build_icon` 出口,主题切换时以新色值整体重建。
"""
from __future__ import annotations
import re
from collections.abc import Calla... | gookeryoung/finaldb | src/finaldb/gui/widgets/icons.py | .py | 4528f0b9a1d46c82 | 7 | 0 |
"""主窗口:侧边栏 + 页面栈(QStackedWidget),全局快捷键。."""
from __future__ import annotations
from PySide2.QtGui import QKeySequence
from PySide2.QtWidgets import QHBoxLayout, QMainWindow, QShortcut, QStackedWidget, QWidget
from finaldb.app_controllers import Controllers
from finaldb.gui.theme import ThemeManager
from finaldb.gui.... | gookeryoung/finaldb | src/finaldb/gui/widgets/main_window.py | .py | a0caf817b52d0185 | 7 | 0 |
"""
Helpers for various likelihood-based losses. These are ported from the original
Ho et al. diffusion models codebase:
https://github.com/hojonathanho/diffusion/blob/1e0dceb3b3495bbe19116a5e1b3596cd0706c543/diffusion_tf/utils.py
"""
import numpy as np
import torch as th
def normal_kl(mean1, logvar1, mean2, logvar... | tyrion1999/ProDiff | networks/guided_diffusion/losses.py | .py | 0b0f5a5532910fbc | 7 | 0 |
"""
Various utilities for neural networks.
"""
import math
import torch as th
import torch.nn as nn
# PyTorch 1.7 has SiLU, but we support PyTorch 1.5.
class SiLU(nn.Module):
def forward(self, x):
return x * th.sigmoid(x)
class GroupNorm32(nn.GroupNorm):
def forward(self, x):
return super(... | tyrion1999/ProDiff | networks/guided_diffusion/nn.py | .py | d9547fb22b421a16 | 7 | 0 |
from abc import ABC, abstractmethod
import numpy as np
import torch as th
import torch.distributed as dist
def create_named_schedule_sampler(name, diffusion):
"""
Create a ScheduleSampler from a library of pre-defined samplers.
:param name: the name of the sampler.
:param diffusion: the diffusion ob... | tyrion1999/ProDiff | networks/guided_diffusion/resample.py | .py | 26a8023d2d4421d3 | 7 | 0 |
import argparse
import os
import shutil
import h5py
import numpy as np
import SimpleITK as sitk
import torch
from medpy import metric
from scipy.ndimage import zoom
from scipy.ndimage.interpolation import zoom
from tqdm import tqdm
from dataloaders.dataset import MRSEG19Normalization
from networks.net_factory import ... | tyrion1999/ProDiff | test_2D_ACDC.py | .py | aa0588b07dd7d86e | 7.5 | 0 |
import argparse
import os
import shutil
import h5py
import numpy as np
import SimpleITK as sitk
import torch
from medpy import metric
from scipy.ndimage import zoom
from scipy.ndimage.interpolation import zoom
from tqdm import tqdm
from dataloaders.dataset import MRSEG19Normalization
from networks.net_factory import ... | tyrion1999/ProDiff | test_2D_MSCMRSEG.py | .py | 58aed511f14056cb | 7.5 | 0 |
import argparse
import os
import shutil
import h5py
import numpy as np
import SimpleITK as sitk
import torch
from medpy import metric
from scipy.ndimage import zoom
from scipy.ndimage.interpolation import zoom
from tqdm import tqdm
from dataloaders.dataset import MRSEG19Normalization
from networks.net_factory import ... | tyrion1999/ProDiff | test_2D_Prostate.py | .py | fd6eb24dfb994c50 | 7.5 | 0 |
import torch
from torch.nn import functional as F
import numpy as np
import torch.nn as nn
from torch.autograd import Variable
def dice_loss(score, target):
target = target.float()
smooth = 1e-5
intersect = torch.sum(score * target)
y_sum = torch.sum(target * target)
z_sum = torch.sum(score * scor... | tyrion1999/ProDiff | utils/losses.py | .py | e33a8ef2d40f3f70 | 7 | 0 |
# Copyright (c) 2018, Curious AI Ltd. All rights reserved.
#
# This work is licensed under the Creative Commons Attribution-NonCommercial
# 4.0 International License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to
# Creative Commons, PO Box 1866, Mountain View... | tyrion1999/ProDiff | utils/ramps.py | .py | 272621382935891d | 7 | 0 |
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import os
import pickle
import numpy as np
import re
from scipy.ndimage import distance_transform_edt as distance
from skimage i... | tyrion1999/ProDiff | utils/util.py | .py | c3d586b5df85192e | 7 | 0 |
#!/usr/bin/env python3
"""
update_readme.py
Updates the healthyinc GitHub profile README with live statistics.
Supports in-memory aggregation of private repository activity to protect IP.
Automatically falls back to local simulation mode if no API token is provided.
"""
import os
import sys
import json
import urllib.r... | healthyinc/.github | .github/scripts/update_readme.py | .py | 6e881cc3e0f5d674 | 7 | 0 |
#!/usr/bin/env python3
"""
Extract inner-most spans and their bounding boxes, and the MathML output,
from rendered LaTeX equations using Playwright and KaTeX.
Caching is maintained via a SHA1-based hash stored in a sqlite database.
Requirements:
pip install playwright
python -m playwright install chromium
... | rajath-raman/olmocr | olmocr/bench/katex/render.py | .py | 7e0e2badb37a811f | 7 | 0 |
import argparse
import json
import os
from typing import Any, Dict
from openai import OpenAI
from olmocr.data.renderpdf import render_pdf_to_base64png
def verify_header_footer_match(
pdf_path: str,
page_num: int,
hea_foo_text: str,
model: str,
temperature: float = 0.1,
target_longest_image_d... | rajath-raman/olmocr | olmocr/bench/miners/check_headers_footers.py | .py | 4feb07741bea0d79 | 7 | 0 |
#!/usr/bin/env python3
import argparse
import json
import os
from concurrent.futures import ThreadPoolExecutor, as_completed
from typing import Any, Dict
import openai
from tqdm import tqdm
from olmocr.data.renderpdf import render_pdf_to_base64png
def process_test_case(case: Dict[str, Any], client, pdf_dir: str, mo... | rajath-raman/olmocr | olmocr/bench/miners/check_multicolumn.py | .py | bf8bdf9632dbad25 | 7 | 0 |
#!/usr/bin/env python
import argparse
import json
import os
from collections import defaultdict
from pypdf import PdfReader, PdfWriter
def get_pdf_page_refs(dataset_jsonl):
"""
Parse dataset.jsonl to extract all PDF page references.
Returns a dict mapping (pdf_name, page_num) to a list of test IDs refere... | rajath-raman/olmocr | olmocr/bench/miners/cleanup_data.py | .py | 8856adf066f37002 | 7 | 0 |
#!/usr/bin/env python
import argparse
import glob
import json
import os
import sys
from collections import defaultdict
def get_rejected_tests(dataset_jsonl):
"""
Parse dataset.jsonl to identify rejected tests.
Returns:
- rejected_tests: Set of test IDs that were marked as rejected
- pdf_tests: Dic... | rajath-raman/olmocr | olmocr/bench/miners/delete_rejected.py | .py | d352b59aea672138 | 7 | 0 |
import argparse
import base64
import os
import re
import time
from collections import Counter
from difflib import SequenceMatcher
import syntok.segmenter as segmenter
from google import genai
from google.genai import types
from olmocr.bench.tests import TextPresenceTest, save_tests
from olmocr.data.renderpdf import r... | rajath-raman/olmocr | olmocr/bench/miners/mine_diffs.py | .py | a2ffa69efd172866 | 7 | 0 |
#!/usr/bin/env python3
"""
mine_headers_footers.py - Extract headers and footers from PDF documents.
This script:
1. Takes a file containing S3 paths to PDF documents as input
2. For each PDF, extracts a random page and renders it to an image
3. Uses Gemini to identify headers and footers in the rendered image
4. Crea... | rajath-raman/olmocr | olmocr/bench/miners/mine_headers_footers.py | .py | 65855f4bd67b661c | 7 | 0 |
#!/usr/bin/env python3
"""
mine_long_tiny_text.py - Extract long text from PDF documents.
This script:
1. Takes a folder containing PDF documents as input
2. For each PDF, extracts random pages and renders them to images
3. Uses Gemini to identify text in the rendered images
4. Creates test files asserting that the te... | rajath-raman/olmocr | olmocr/bench/miners/mine_long_tiny_text.py | .py | 55d76622445ca468 | 7 | 0 |
#!/usr/bin/env python3
"""
mine_math.py - Extract and validate math equations from candidate files and TeX bases.
This upgraded version:
• Uses the Python logging module for cleaner logging.
• Uses tqdm to display a progress bar.
• Uses ProcessPoolExecutor to process TeX file groups in parallel.
• For each TeX... | rajath-raman/olmocr | olmocr/bench/miners/mine_math.py | .py | 6ecf93fce83feed2 | 7 | 0 |
#!/usr/bin/env python3
"""
mine_old_scans_math.py - Extract mathematical equations from PDF documents.
This script:
1. Takes a folder containing PDF documents as input
2. For each PDF, extracts a random page and renders it to an image
3. Uses Gemini to identify mathematical equations in the rendered image
4. Creates a... | rajath-raman/olmocr | olmocr/bench/miners/mine_old_scans_math.py | .py | 0f1b48af75a6aefd | 7 | 0 |
#!/usr/bin/env python3
"""
analyze_documents.py - Analyze document layout and extract content from PDF documents.
This script:
1. Takes a file containing S3 paths to PDF documents as input
2. For each PDF, extracts a random page and renders it to an image
3. Uses Gemini to analyze document layout features (columns, ar... | rajath-raman/olmocr | olmocr/bench/miners/mine_reading_order.py | .py | 510354715e47b9cb | 7 | 0 |
#!/usr/bin/env python3
"""
pick_mediod.py - Identify representative examples from repeated OCR outputs
This code will take as arguments two directories:
--input and --output
Each of those is going to be a directory that was generated by convert.py and is a candidate to be evaluated as part of benchmark.py
What it will... | rajath-raman/olmocr | olmocr/bench/miners/pick_mediod.py | .py | fd0937158babd88e | 7 | 0 |
#!/usr/bin/env python3
import argparse
import json
import os
import shutil
import sys
import tempfile
from collections import defaultdict
from typing import Dict, List, Optional, Tuple
from flask import Flask, jsonify, redirect, render_template, request, send_file, url_for
app = Flask(__name__)
# Add static folder fo... | rajath-raman/olmocr | olmocr/bench/review_app.py | .py | 85fe70b4c32682a4 | 7 | 0 |
import base64
import os
import tempfile
import torch
from transformers import AutoModel, AutoTokenizer
from olmocr.data.renderpdf import render_pdf_to_base64png
# Global cache for the model and tokenizer.
_device = "cuda" if torch.cuda.is_available() else "cpu"
_model = None
_tokenizer = None
def load_model():
... | rajath-raman/olmocr | olmocr/bench/runners/run_gotocr.py | .py | f24b50910de38bbf | 7 | 0 |
import inspect
from .sync import iscoroutinefunction
def is_double_callable(application):
"""
Tests to see if an application is a legacy-style (double-callable) application.
"""
# Look for a hint on the object first
if getattr(application, "_asgi_single_callable", False):
return False
... | Judiciousmurich/full-stack-data-connector-platform | backend/.venv/lib/python3.9/site-packages/asgiref/compatibility.py | .py | 0e163548ea4ebcec | 7 | 0 |
import sys
import threading
from collections import deque
from concurrent.futures import Executor, Future
from typing import Any, Callable, TypeVar
if sys.version_info >= (3, 10):
from typing import ParamSpec
else:
from typing_extensions import ParamSpec
_T = TypeVar("_T")
_P = ParamSpec("_P")
_R = TypeVar("_... | Judiciousmurich/full-stack-data-connector-platform | backend/.venv/lib/python3.9/site-packages/asgiref/current_thread_executor.py | .py | e36094d553832d39 | 7 | 0 |
import asyncio
import contextlib
import contextvars
import threading
from typing import Any, Dict, Union
class _CVar:
"""Storage utility for Local."""
def __init__(self) -> None:
self._data: "contextvars.ContextVar[Dict[str, Any]]" = contextvars.ContextVar(
"asgiref.local"
)
... | Judiciousmurich/full-stack-data-connector-platform | backend/.venv/lib/python3.9/site-packages/asgiref/local.py | .py | 6597965885e9b555 | 7 | 0 |
import asyncio
import logging
import time
import traceback
from .compatibility import guarantee_single_callable
logger = logging.getLogger(__name__)
class StatelessServer:
"""
Base server class that handles basic concepts like application instance
creation/pooling, exception handling, and similar, for s... | Judiciousmurich/full-stack-data-connector-platform | backend/.venv/lib/python3.9/site-packages/asgiref/server.py | .py | dc0ebcd7af4dba1d | 7 | 0 |
import asyncio
import contextvars
import time
from .compatibility import guarantee_single_callable
from .timeout import timeout as async_timeout
class ApplicationCommunicator:
"""
Runs an ASGI application in a test mode, allowing sending of
messages to it and retrieval of messages it sends.
"""
... | Judiciousmurich/full-stack-data-connector-platform | backend/.venv/lib/python3.9/site-packages/asgiref/testing.py | .py | 539c1cb3ff996133 | 7.5 | 0 |
# This code is originally sourced from the aio-libs project "async_timeout",
# under the Apache 2.0 license. You may see the original project at
# https://github.com/aio-libs/async-timeout
# It is vendored here to reduce chain-dependencies on this library, and
# modified slightly to remove some features we don't use.
... | Judiciousmurich/full-stack-data-connector-platform | backend/.venv/lib/python3.9/site-packages/asgiref/timeout.py | .py | 2ed18bfb14291bc2 | 7 | 0 |
import sys
from collections import defaultdict
from tempfile import SpooledTemporaryFile
from asgiref.sync import AsyncToSync, sync_to_async
class WsgiToAsgi:
"""
Wraps a WSGI application to make it into an ASGI application.
"""
def __init__(self, wsgi_application, duplicate_header_limit=100):
... | Judiciousmurich/full-stack-data-connector-platform | backend/.venv/lib/python3.9/site-packages/asgiref/wsgi.py | .py | 392c5a9e6e507fe5 | 7 | 0 |
# Copyright 2021-present MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | Judiciousmurich/full-stack-data-connector-platform | backend/.venv/lib/python3.9/site-packages/bson/_helpers.py | .py | 0fc7498fc2e8adf1 | 7 | 0 |
# Copyright 2009-present MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | Judiciousmurich/full-stack-data-connector-platform | backend/.venv/lib/python3.9/site-packages/bson/code.py | .py | ca235ae69e99a5d9 | 7 | 0 |
# Copyright 2022-present MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
# may not use this file except in compliance with the License. You
# may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | Judiciousmurich/full-stack-data-connector-platform | backend/.venv/lib/python3.9/site-packages/bson/datetime_ms.py | .py | 156da034a4a7fe8d | 7 | 0 |
# Copyright 2009-2015 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | Judiciousmurich/full-stack-data-connector-platform | backend/.venv/lib/python3.9/site-packages/bson/dbref.py | .py | d3ff029834b6d8e0 | 7 | 0 |
# Copyright 2016-present MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | Judiciousmurich/full-stack-data-connector-platform | backend/.venv/lib/python3.9/site-packages/bson/decimal128.py | .py | 33d52d6286e26a8d | 7 | 0 |
# Copyright 2010-present MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | Judiciousmurich/full-stack-data-connector-platform | backend/.venv/lib/python3.9/site-packages/bson/max_key.py | .py | 6649bc9f2f2d798a | 7 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.