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 |
|---|---|---|---|---|---|---|
"""
Matrix/table-level split helpers for machine-learning evaluation.
These helpers operate on metadata tables and split indices only. They do not
touch AnnData or perform any file I/O.
"""
from __future__ import annotations
from collections.abc import Sequence
import numpy as np
import pandas as pd
from smftools.... | jkmckenna/smftools | src/smftools/analysis/compute/ml_splits.py | .py | d6a6b52d36999590 | 7.3 | 3 |
"""
NaN-aware position × position Pearson correlation matrices.
Key functions: :func:`nan_pearson_matrix`, :func:`make_ticks`.
"""
from __future__ import annotations
import numpy as np
def nan_pearson_matrix(X: np.ndarray) -> np.ndarray:
"""
NaN-aware position × position Pearson correlation.
Parameter... | jkmckenna/smftools | src/smftools/analysis/compute/pearson.py | .py | fe10c0f94d261056 | 7.3 | 3 |
"""
Composable obs-level filters for AnnData.
Key functions: :func:`max_cigar_deletion`, :func:`build_obs_mask`.
Example::
from smftools.analysis.filters.obs_filters import build_obs_mask
mask = build_obs_mask(
adata.obs,
barcode="NB01",
ref_strand="6B6_top",
demux_type="doub... | jkmckenna/smftools | src/smftools/analysis/filters/obs_filters.py | .py | 61ebc29f2e6e9839 | 7.3 | 3 |
"""CLI logic for `smftools data`: machine- and volume-scoped storage operations."""
from __future__ import annotations
from pathlib import Path
from smftools.logging_utils import get_logger
logger = get_logger(__name__)
def data_init_volume(mount: str | Path, *, label: str, kind: str) -> tuple[dict, bool, list[st... | jkmckenna/smftools | src/smftools/cli/data_cmd.py | .py | c14221a428313c13 | 7.3 | 3 |
"""CLI logic for exporting per-barcode FASTQ files of QC-passed reads.
Sequence and quality are read directly from the raw ragged store (no BAM
re-parsing); the QC-passed read set is resolved from the most complete
preprocessing artifact available for each experiment.
"""
from __future__ import annotations
from path... | jkmckenna/smftools | src/smftools/cli/export_fastq.py | .py | a806f3fd41241eec | 7.3 | 3 |
"""CLI rendering for read-only generation inventories.
Presentation only; discovery lives in
:mod:`smftools.informatics.generation_listing`.
"""
from __future__ import annotations
import json
from pathlib import Path
from typing import Any, Iterable
from ..informatics.generation_listing import (
STAGE_GENERATIO... | jkmckenna/smftools | src/smftools/cli/generations.py | .py | c57387167b7a687f | 7.3 | 3 |
#!/usr/bin/env python3
"""
@Time : 2025-07-18
@Author : Rey
@Contact : reyxbo@163.com
@Explain : Base methods.
"""
from typing import Any, TypedDict, Literal
from enum import EnumType
from sqlalchemy import Engine, Connection, text as sqlalchemy_text, bindparam as sqlalchemy_bindparam
from sqlalchemy.... | reyxbo/reydb-py | src/reydb/rbase.py | .py | 417eebc09402ea22 | 7 | 0 |
import dash_mantine_components as dmc
from dash_iconify import DashIconify
from lib.constants import HEADER_HEIGHT
excluded_links = [
"/404",
"/styles-api",
"/style-props",
"/dash-iconify",
"/migration",
"/learning-resources",
]
def create_nav_link(icon, text, href, external=False):
"""C... | pip-install-python/dash_pannellum | components/navbar.py | .py | dbd84e2e02662717 | 7.3 | 3 |
"""The access policy this site hands to dash-improve-my-llms.
One function matters — :func:`check` — and its *ordering* is the whole design:
tier -> short-circuit public/hidden
-> local Clerk session (a person in a browser)
-> hub verification of ?key= (an agent, later, elsewhere)
*... | pip-install-python/dash_pannellum | lib/access.py | .py | a95bd829de650b23 | 7.3 | 3 |
"""
ASGI/Starlette middleware ports of Flask-only hooks used in this boilerplate.
When the Dash backend is FastAPI, these slot in where the Flask
``before_request`` decorator was used.
"""
from __future__ import annotations
from starlette.middleware.base import BaseHTTPMiddleware
from starlette.requests import Reques... | pip-install-python/dash_pannellum | lib/asgi_middleware.py | .py | 7e787fc028000261 | 7.3 | 3 |
"""Heading ids that survive inline formatting — and match their TOC anchors.
Two defects in markdown2dash's heading handling, both hit as soon as a heading
contains anything other than plain text:
1. **`## The `peers` tier` raises `AttributeError`.**
``DashRenderer.heading`` does ``create_heading_id(text[0])``, wh... | pip-install-python/dash_pannellum | lib/directives/headings.py | .py | e6046ba606ef15a2 | 7.3 | 3 |
import importlib
import inspect
from markdown2dash.src.directives.kwargs import Kwargs as KwargsBase
def convert_docstring_to_dict(docstring):
"""Convert numpy style parameter docstring to a list of dicts with keys name, type, description"""
lines: list[str] = docstring.split("----------\n")[-1].split("\n")
... | pip-install-python/dash_pannellum | lib/directives/kwargs.py | .py | 86c4ce901a8086b2 | 7.3 | 3 |
"""The interactive gate — what a browser sees instead of a page it may not read.
Ported from pip-docs+ (`lib/page_visibility.py`, the gate-layout half) with the
boilerplate's fail postures: the verdict comes from
:func:`lib.access.resolve_page_access`, which falls OPEN for ``auth`` docs when
Clerk is unconfigured and ... | pip-install-python/dash_pannellum | lib/gate_layouts.py | .py | 2f1ba9d35a969b18 | 7.3 | 3 |
"""
``/healthz`` liveness probe for the Flask and Quart backends.
The 2plot.ai hub sweeps every satellite's ``/healthz`` once an hour and records
up/down + latency — that's the "Satellite health & reach" panel on ``/traffic``
(the traffic rollup this app POSTs supplies the other half). The FastAPI build
declares a typ... | pip-install-python/dash_pannellum | lib/health.py | .py | 3e918a1c7ab9ed31 | 7.3 | 3 |
"""Client for the network hub's agent-key and page-tier endpoints.
Three calls, all satellite → hub, never browser → hub::
POST {hub}/api/agent-key/current -> {"key": "k2p_..."} for the copy button
POST {hub}/api/agent-key/verify -> {"verdict": ..., "ttl": ...}
POST {hub}/api/page-tiers ->... | pip-install-python/dash_pannellum | lib/hub_client.py | .py | 7370e8c879b081db | 7.3 | 3 |
"""Cross-host directory for the 2plot network — one definition, every satellite.
Why this file exists
--------------------
Search engines follow links between hosts weakly; agents don't follow them at
all. A model answering "what does this ecosystem provide?" fetches one or two
URLs and reasons from what came back. La... | pip-install-python/dash_pannellum | lib/network_directory.py | .py | b5891950835e9987 | 7.3 | 3 |
"""Who may read a page — the local half of the network's access rule.
Four tiers, least to most restrictive:
``public`` anyone, including agents and crawlers
``auth`` any signed-in user; anonymous readers get the gate document
``admin`` signed in AND allowlisted (``ADMIN_EMAILS`` / ``ADMIN_USER_IDS``)
``hidd... | pip-install-python/dash_pannellum | lib/page_tiers.py | .py | a677c797add8349a | 7.3 | 3 |
from __future__ import annotations
import os
from fastapi import Header, HTTPException, Request, status
from commercelens.jobs.models import AccountStatus, ApiKeyRecord
from commercelens.jobs.store import JobStore
def get_job_store():
backend = os.getenv("COMMERCELENS_STORE_BACKEND", "sqlite").lower()
if b... | dipeshbabu/commerce-lens | commercelens/api/auth.py | .py | 028c4dabde3f7468 | 7.15 | 1 |
from datetime import datetime
import logging
import urllib
import os
import pandas as pd
from .wind_reader import WindReader
from .plot_extractor import PlotExtractor
bbox_conf1 = {
'wind_speed': {'bbox_plot': (24, 633, 274, 749),
'bbox_y_label': (3, 625, 20, 640),
'bbox_x_l... | marc-moreaux/silvaplana-winds-history | src/como_reader.py | .py | 515efe8562d5a1a3 | 7 | 0 |
from datetime import datetime, timedelta
from typing import List
import logging
import re
import pandas as pd
import numpy as np
import pytesseract
import cv2
wind_plot_ys = (625, 775)
class PlotExtractor():
def __init__(self, image_path: str,
bbox_plot: tuple[int, int, int, int] = (24, 633, ... | marc-moreaux/silvaplana-winds-history | src/plot_extractor.py | .py | 6d54ee676b6c1b41 | 7 | 0 |
import logging
import abc
import re
import os
from datetime import datetime
from bs4 import BeautifulSoup
import urllib.request
import pandas as pd
def date2datetime(str_date: str,
date_format: str = "%d.%m. %H:%M",
today: datetime = datetime.now()):
'''convert a str date to d... | marc-moreaux/silvaplana-winds-history | src/wind_reader.py | .py | e8caacfe7d3c4553 | 7 | 0 |
from src import como_reader
import os
def test_main():
wReader = como_reader.ComoReader('Dervio')
wReader.db_dir = "./db_test/"
df = wReader.read_new_winds()
# Delete db_test file if it exists
if os.path.isfile(wReader.db_file):
os.remove(wReader.db_file)
# Test adding df to db twice... | marc-moreaux/silvaplana-winds-history | test/test_read_como.py | .py | 9a82de6a7a69e66b | 7.5 | 0 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distrib... | NeCTAR-RC/python-varroaclient | varroaclient/osc/plugin.py | .py | 435587db898dc197 | 7.24 | 2 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distrib... | NeCTAR-RC/python-varroaclient | varroaclient/osc/v1/ip_usage.py | .py | 602ad2a92f56fa53 | 7.24 | 2 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distrib... | NeCTAR-RC/python-varroaclient | varroaclient/v1/client.py | .py | 370fad642194ecb5 | 7.24 | 2 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distrib... | NeCTAR-RC/python-varroaclient | varroaclient/v1/security_risks.py | .py | 7e314e07a13c86c9 | 7.24 | 2 |
"""Asynchronous Python client for the WAQI API."""
from __future__ import annotations
import asyncio
from dataclasses import dataclass
from importlib import metadata
from typing import TYPE_CHECKING, Any, cast
from aiohttp import ClientSession
from aiohttp.hdrs import METH_GET
from yarl import URL
from .exceptions ... | joostlek/python-waqi | src/aiowaqi/waqi.py | .py | 5a8d71db73b5c106 | 7.15 | 1 |
"""Fixtures for the aiowaqi package."""
from collections.abc import AsyncGenerator
import aiohttp
import pytest
from aiowaqi import WAQIClient
from syrupy import SnapshotAssertion
from .syrupy import WAQISnapshotExtension
@pytest.fixture(name="snapshot")
def snapshot_assertion(snapshot: SnapshotAssertion) -> Snap... | joostlek/python-waqi | tests/conftest.py | .py | b2da8849dc77f84b | 7.65 | 1 |
"""Asynchronous Python client for WAQI."""
from __future__ import annotations
from dataclasses import asdict, is_dataclass
from typing import TYPE_CHECKING, Any
from syrupy.extensions import AmberSnapshotExtension
from syrupy.extensions.amber import AmberDataSerializer
if TYPE_CHECKING:
from syrupy.types import... | joostlek/python-waqi | tests/syrupy.py | .py | f5a5e163db9830cd | 7.65 | 1 |
"""Backup Handler."""
import os
import click
import requests
from requests.exceptions import RequestException
from homelab_node_red_backup.handler.flows import get_flows
DEFAULT_TIMEOUT = 30
# Credential node types configurable via environment variable CREDENTIAL_NODES
# Format: comma-separated values, e.g. "serve... | muhlba91/homelab-node-red-backup | homelab_node_red_backup/handler/backup.py | .py | 6655ab2a18a2a6d7 | 7.15 | 1 |
"""
Support script for github workflow to display GitHub milestones automatically in the README file
Author: Sven Prevrhal
Date: 2024-11-22
"""
import json
def load(json_file):
"""
Load JSON file
"""
with open(json_file, 'r', encoding='utf-8') as f:
milestones = json.load(f)
return mile... | sprevrha/seezeichen | update_readme.py | .py | 0035af8cbc26673d | 7 | 0 |
#!/usr/bin/env python3
"""
Renumber changeset ids for all changesets in changelog.
Starts with n and increments by 1. Saves the resulting changelog at the given path.
"""
from __future__ import annotations
import xml.etree.ElementTree as ET
from typing import TYPE_CHECKING
import click
if TYPE_CHECKING:
from p... | CBIIT/bento-mdb | scripts/renumber_changelog.py | .py | 274dc4c0a9d964cf | 7.24 | 2 |
"""Cypher generation for CDE PVs and Synonyms."""
from __future__ import annotations
import copy
import logging
from typing import TYPE_CHECKING, cast
from bento_meta.model import make_nanoid
from bento_meta.objects import Term, ValueSet
from liquichange.changelog import Changelog, Changeset, CypherChange
from tqdm ... | CBIIT/bento-mdb | src/bento_mdb/cde_cypher.py | .py | b89a6c9b6a921257 | 7.24 | 2 |
"""Common functions shared by cypher generation scripts."""
from __future__ import annotations
from datetime import UTC, datetime
from string import Template
from typing import TYPE_CHECKING
from bento_meta.objects import Concept, Edge, Property, Tag, Term, ValueSet
from minicypher.clauses import (
Clause,
C... | CBIIT/bento-mdb | src/bento_mdb/cypher_utils.py | .py | 10f13a9eb1036ec6 | 7.24 | 2 |
"""Data types for CDE PVs and Synonyms."""
from __future__ import annotations
from typing import TYPE_CHECKING, Any, NotRequired, TypedDict
if TYPE_CHECKING:
from pathlib import Path
class ModelSpec(TypedDict):
"""CRDC model spec. Dict with model repository info and MDF file details."""
repository: st... | CBIIT/bento-mdb | src/bento_mdb/datatypes.py | .py | 4c95a9e9eba1c77f | 7.24 | 2 |
"""Generate matrix with models/versions to be added to MDB."""
from __future__ import annotations
import json
from pathlib import Path
from prefect import flow
from bento_mdb.constants import MDB_IDS_WITH_PRERELEASES
from bento_mdb.mdb_utils import init_mdb_connection
from bento_mdb.model_cdes import (
compare_... | CBIIT/bento-mdb | src/bento_mdb/flows/generate_model_version_matrix.py | .py | 284d96dda79538e3 | 7.24 | 2 |
"""Export MDB data from Neo4j into S3."""
from __future__ import annotations
from datetime import datetime
from typing import TYPE_CHECKING
from zoneinfo import ZoneInfo
from prefect import flow, get_run_logger, task
from prefect.cache_policies import NO_CACHE
from bento_mdb.constants import DEFAULT_S3_ENDPOINT, MD... | CBIIT/bento-mdb | src/bento_mdb/flows/mdb_s3.py | .py | 72b4bf1aab5a70cb | 7.24 | 2 |
"""Prune prerelease data from MDB."""
from __future__ import annotations
from datetime import datetime
from typing import TYPE_CHECKING
from zoneinfo import ZoneInfo
from prefect import flow, get_run_logger, task
from prefect.cache_policies import NO_CACHE
from bento_mdb.mdb_utils import init_mdb_connection
if TYP... | CBIIT/bento-mdb | src/bento_mdb/flows/prune_prerelease.py | .py | 0fefc16775c59961 | 7.24 | 2 |
"""Run arbitrary Cypher queries on MDB."""
from __future__ import annotations
import logging
from typing import TYPE_CHECKING
import boto3
from bento_meta.mdb import MDB
from prefect import flow, get_run_logger, task
from prefect.cache_policies import INPUTS
from bento_mdb.mdb_utils import init_mdb_connection
if T... | CBIIT/bento-mdb | src/bento_mdb/flows/run_cypher.py | .py | ecf686b7ba920b30 | 7.24 | 2 |
from logging.config import fileConfig
from sqlalchemy import engine_from_config, pool
from alembic import context
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config file for Python logging.
# This line sets up logger... | HelloblueAI/Bleu.js | alembic/env.py | .py | 49ec47c9dc1bb097 | 7.24 | 2 |
#!/usr/bin/env python3
"""
Bleu.js CI/CD Integration Demo
==============================
This example demonstrates how to integrate Bleu.js with CI/CD pipelines,
automated testing, and deployment workflows.
Author: Pejman Haghighatnia
Company: Helloblue, Inc.
"""
import asyncio
import json
import logging
import os
i... | HelloblueAI/Bleu.js | examples/ci_cd_demo.py | .py | a54dce869361804f | 7.24 | 2 |
"""
Example demonstrating PyTorch with MPS (Metal Performance Shaders) acceleration on Mac.
This example shows:
1. How to check for MPS availability
2. How to move models and tensors to MPS device
3. Performance comparison between CPU and MPS
"""
import time
import torch
import torch.nn as nn
import torch.optim as o... | HelloblueAI/Bleu.js | examples/mps_acceleration_demo.py | .py | 9effd2b5e6b0f7e4 | 7.24 | 2 |
#!/usr/bin/env python3
"""
Single entry point for the Bleu.js product app (bleujs.org).
Run the product app (dashboard + API): python main.py
Or with uvicorn: python -m uvicorn src.main:app --reload
For the legacy ML/internal backend (src.python.backend), set:
BLEUJS_LEGACY_BACKEND=1 py... | HelloblueAI/Bleu.js | main.py | .py | ea0489d4bae60194 | 7.24 | 2 |
#!/usr/bin/env python3
"""
Check PyPI download statistics for Bleu.js
"""
import json
from datetime import datetime
import requests
def get_pypistats(package_name="bleu-js", stat_type="recent"):
"""Fetch PyPI statistics"""
url = f"https://pypistats.org/api/packages/{package_name}/{stat_type}"
try:
... | HelloblueAI/Bleu.js | scripts/check_downloads.py | .py | ac5b3c3aa452e00d | 7.24 | 2 |
#!/usr/bin/env python3
"""Script to create and upload a model to Hugging Face Hub.
This script helps you:
1. Create a new model repository on Hugging Face
2. Upload model files
3. Create a model card
4. Set repository visibility (public/private)
"""
import argparse
import os
from typing import Optional
from huggingf... | HelloblueAI/Bleu.js | scripts/create_hf_model.py | .py | 82a0c481ac59503e | 7.24 | 2 |
#!/usr/bin/env python3
"""
Professional Dependency Manager for Bleu.js
Handles dependency conflicts, security updates, and version compatibility
"""
import argparse
import json
import subprocess
from pathlib import Path
from typing import Dict, List, Optional, Tuple
class DependencyManager:
def __init__(self):
... | HelloblueAI/Bleu.js | scripts/dependency_manager.py | .py | 10d47d6e9e4960ba | 7.24 | 2 |
#!/usr/bin/env python3
"""
Comprehensive vulnerability and code quality fixer for Bleu.js project.
This script addresses:
1. Security vulnerabilities in dependencies
2. Code quality issues (flake8, black, isort)
3. SonarQube blocking issues
"""
import subprocess
from pathlib import Path
from typing import Dict, Tuple... | HelloblueAI/Bleu.js | scripts/fix_all_vulnerabilities.py | .py | 691a699f87012499 | 7.24 | 2 |
#!/usr/bin/env python3
"""
World-Class Professional GIF Creator for Bleu.js
Automatically creates the perfect demo GIF using advanced techniques
"""
import json
import os
import subprocess
import time
from pathlib import Path
class ProfessionalGIFCreator:
def __init__(self):
self.project_root = Path.cwd(... | HelloblueAI/Bleu.js | scripts/professional_gif_creator.py | .py | 3e7f6b4dbbc857ce | 7.24 | 2 |
#!/usr/bin/env python3
"""Quantum optimization script for automatic optimization during development."""
import json
from pathlib import Path
from typing import Dict, List
from qiskit.optimization import QuadraticProgram
from src.quantum_py.optimization.contest_strategy import QuantumContestOptimizer
def get_change... | HelloblueAI/Bleu.js | scripts/quantum_optimize.py | .py | 1827b8a5f0340020 | 7.24 | 2 |
#!/usr/bin/env python3
"""
Security Vulnerability Fix Script for Bleu.js
This script fixes all identified security vulnerabilities by updating packages
to their secure versions and creating updated requirements files.
"""
import os
import subprocess
# Vulnerable packages and their secure versions
VULNERABILITY_FIXES... | HelloblueAI/Bleu.js | scripts/security_vulnerability_fix.py | .py | 1d6febceb9003dce | 7.24 | 2 |
#!/usr/bin/env python3
"""Automated setup script for Hugging Face model repository.
Usage:
# With token in environment
export HF_TOKEN="your_token"
python scripts/setup_hf_model_auto.py
# Or pass token as argument
python scripts/setup_hf_model_auto.py --token "your_token"
"""
import argparse
impo... | HelloblueAI/Bleu.js | scripts/setup_hf_model_auto.py | .py | 21f5fe954b3f1fef | 7.24 | 2 |
#!/usr/bin/env python3
"""Complete setup script for Hugging Face model repository.
This script will:
1. Check/request Hugging Face token
2. Create the repository
3. Upload all model files
4. Upload the model card
"""
import os
import sys
from pathlib import Path
from huggingface_hub import HfApi, create_repo
from hu... | HelloblueAI/Bleu.js | scripts/setup_hf_model_complete.py | .py | 360affa40ad6c147 | 7.24 | 2 |
import os
import subprocess
def run_command(command):
"""Run a shell command and return its output."""
print(f"Running: {command}")
result = subprocess.run(command.split(), capture_output=True, text=True)
if result.returncode != 0:
print(f"Error: {result.stderr}")
return False
prin... | HelloblueAI/Bleu.js | setup_and_test.py | .py | a05454dd62315920 | 7.74 | 2 |
import logging
import os
import time
from datetime import datetime, timezone
import psutil
from fastapi import FastAPI, Header, HTTPException
from fastapi.middleware.cors import CORSMiddleware
from fastapi.middleware.trustedhost import TrustedHostMiddleware
from pydantic import BaseModel
from services.subscription_se... | HelloblueAI/Bleu.js | src/api/main.py | .py | 7a12b0fcc5bb1299 | 7.24 | 2 |
"""
Healthcare application implementation for medical imaging analysis.
"""
import logging
from typing import Dict, List, Optional
import numpy as np
from opentelemetry import trace
from pydantic import BaseModel
from src.ml.enhanced_xgboost import EnhancedXGBoost
from src.quantum.quantum_processor import QuantumPro... | HelloblueAI/Bleu.js | src/applications/healthcare.py | .py | 7c7668a0b4f961d7 | 7.24 | 2 |
"""
Enhanced comprehensive benchmarking system for Bleu.js performance validation.
"""
import logging
import time
from dataclasses import dataclass
from typing import Dict, List, Optional
import numpy as np
import psutil
from pydantic import BaseModel
from scipy import stats
logger = logging.getLogger(__name__)
try... | HelloblueAI/Bleu.js | src/benchmarks/performance_benchmark.py | .py | 1be35e8d3e6a2f1e | 7.24 | 2 |
"""
Ensemble Manager Implementation
Provides advanced ensemble management capabilities for machine learning models.
"""
import logging
from typing import Dict, List, Optional, Tuple, Union
import catboost as cb
import lightgbm as lgb
import numpy as np
import xgboost as xgb
from sklearn.ensemble import (
Gradient... | HelloblueAI/Bleu.js | src/bleu_ai/ai/ensembleManager.py | .py | eca0cb91e809ec1f | 7.24 | 2 |
"""
Feature Analyzer Implementation
Provides advanced feature analysis capabilities for machine learning models.
"""
import logging
from typing import List, Optional
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
import shap
from sklearn.feature_selection import mutual_in... | HelloblueAI/Bleu.js | src/bleu_ai/ai/featureAnalyzer.py | .py | 07ae2b907732b883 | 7.24 | 2 |
"""
Uncertainty Handler Implementation
Provides advanced uncertainty estimation and management for machine learning models.
"""
import logging
from typing import Optional, Tuple
import numpy as np
import torch
import torch.nn as nn
from sklearn.ensemble import RandomForestClassifier
from torch.distributions import No... | HelloblueAI/Bleu.js | src/bleu_ai/ai/uncertaintyHandler.py | .py | 02b2e167bd76e2c3 | 7.24 | 2 |
import logging
import time
from typing import Any, Dict, List
import numpy as np
import psutil
import torch
from ..utils.metrics import MetricsCollector
from ..utils.performanceOptimizer import PerformanceOptimizer
from ..utils.quantumProcessor import QuantumProcessor
class BenchmarkSuite:
def __init__(self):
... | HelloblueAI/Bleu.js | src/bleu_ai/benchmarks/benchmark_suite.py | .py | 27fbd5815a480972 | 7.24 | 2 |
"""
Advanced Model Compression Implementation
Implements various compression techniques for machine learning models.
"""
import logging
import os
from typing import Optional, Union
import joblib
import numpy as np
import torch
import torch.nn as nn
import torch.quantization
import xgboost as xgb
from sklearn.cluster ... | HelloblueAI/Bleu.js | src/bleu_ai/compression/model_compressor.py | .py | 973bba8c3845cf5c | 7.24 | 2 |
"""
Distributed Training Manager Implementation
Provides distributed training capabilities for machine learning models.
"""
import logging
from typing import Dict, Optional, Union
import dask.array as da
import numpy as np
import torch
import torch.distributed as dist
import torch.nn as nn
import xgboost as xgb
from ... | HelloblueAI/Bleu.js | src/bleu_ai/distributed/distributed_manager.py | .py | 56ffa9010024b1f8 | 7.24 | 2 |
"""
Training Manager Implementation
Provides distributed training capabilities for machine learning models.
"""
import logging
import ray
import torch
import torch.distributed as dist
import torch.nn as nn
from ray import tune
from ray.tune.schedulers import ASHAScheduler
from ray.tune.search.optuna import OptunaSear... | HelloblueAI/Bleu.js | src/bleu_ai/distributed/training_manager.py | .py | ef20ed720170c4b8 | 7.24 | 2 |
"""Fetch and normalize public GitHub metrics for the profile README."""
from __future__ import annotations
import json
import os
from datetime import UTC, datetime, timedelta
from email.message import Message
from pathlib import Path
from typing import Any
from urllib import error, parse, request
import click
from ... | szmyty/szmyty | tools/modules/github_metrics.py | .py | 86cf6da1c2ae234e | 7.24 | 2 |
"""Fetch and normalize public Medium RSS feed articles for the profile README.
Uses the documented public profile RSS feed only. Strips unsafe HTML and
remote tracking markup. Falls back to a static configured snapshot when
the feed is unavailable or Medium is not yet configured.
Reference:
https://help.medium.co... | szmyty/szmyty | tools/modules/medium.py | .py | 4aee2bbebe56d371 | 7.24 | 2 |
"""Validate and persist manual music highlight metadata for the profile README."""
from __future__ import annotations
from pathlib import Path
from typing import Any
import click
import yaml
from tools.profile_builder.models import MusicHighlight
MODULE_NAME = "music-highlight"
REPO_ROOT = Path(__file__).resolve()... | szmyty/szmyty | tools/modules/music_highlight.py | .py | 38dd0945e2796df9 | 7.24 | 2 |
"""Fetch and normalize public ORCID record data for the profile README.
Uses the ORCID public API only. Falls back to a static configured fixture
when the API is unavailable or the ORCID iD is not yet configured.
Reference: https://info.orcid.org/what-is-orcid/services/public-api/
"""
from __future__ import annotat... | szmyty/szmyty | tools/modules/orcid.py | .py | 511427d7f3ceb2f4 | 7.24 | 2 |
"""Fetch and normalize public SoundCloud profile data for the profile README.
Setup
-----
1. Register an application at https://soundcloud.com/you/apps and note the
client ID and client secret.
2. Add ``SOUNDCLOUD_CLIENT_ID`` and ``SOUNDCLOUD_CLIENT_SECRET`` as repository
secrets in GitHub → Settings → Secrets a... | szmyty/szmyty | tools/modules/soundcloud.py | .py | 3895511dd4262f7e | 7.24 | 2 |
"""Render the owner-approved manual 16Personalities working-style snapshot."""
from __future__ import annotations
import json
from pathlib import Path
from typing import Any
def _load_snapshot(path: Path) -> dict[str, Any]:
payload = json.loads(path.read_text(encoding="utf-8"))
if not isinstance(payload, di... | szmyty/szmyty | tools/modules/working_style.py | .py | 8805b717f4ba7adf | 7.24 | 2 |
from __future__ import annotations
from enum import Enum
class EventTypes(Enum):
"""
В данном классе перечислены все типы событий FunPayAPI.
"""
INITIAL_CHAT = 0
"""Обнаружен чат (при первом запросе Runner'а)."""
CHATS_LIST_CHANGED = 1
"""Список чатов и/или последнее сообщение одного/неск... | Hectorxs22/FunPAY-Bot | FunPayAPI/common/enums.py | .py | d407716e14599cf9 | 7.35 | 4 |
from colorama import Fore, Back, Style
import logging.handlers
import logging
import re
"""
В данном модуле написаны форматтеры для логгера.
"""
LOG_COLORS = {
logging.DEBUG: Fore.BLACK + Style.BRIGHT,
logging.INFO: Fore.GREEN,
logging.WARN: Fore.YELLOW,
logging.ERROR: For... | Hectorxs22/FunPAY-Bot | Utils/logger.py | .py | a01659f58f7ab625 | 7.35 | 4 |
from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from vertex import Vertex
import FunPayAPI.types
from datetime import datetime
import Utils.exceptions
import itertools
import psutil
import json
import sys
import os
import re
PHOTO_RE = re.compile(r'\$photo=[\d]+')
ENTITY_RE... | Hectorxs22/FunPAY-Bot | Utils/vertex_tools.py | .py | 4a12276cbe3f5846 | 7.35 | 4 |
from locales import ru, eng
class Localizer:
def __new__(cls, *args, **kwargs):
if not hasattr(cls, "instance"):
cls.instance = super(Localizer, cls).__new__(cls)
return getattr(cls, "instance")
def __init__(self, curr_lang: str | None = None):
self.languages = {
... | Hectorxs22/FunPAY-Bot | locales/localizer.py | .py | 2cfe482e01f58f13 | 7.35 | 4 |
"""
В данном модуле описаны функции для ПУ загрузки / выгрузки конфиг-файлов.
Модуль реализован в виде плагина.
"""
from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from vertex import Vertex
from tg_bot import CBT, static_keyboards
from telebot import types
import logging
impo... | Hectorxs22/FunPAY-Bot | tg_bot/config_loader_cp.py | .py | e7213f45342d48b8 | 7.35 | 4 |
"""Holds the tokens retrieved from authentication."""
from __future__ import annotations
class AuthenticationTokens:
"""
A class to handle authentication tokens.
Initializes an AuthenticationTokens object with the provided data dictionary. It
extracts the 'IdToken' and 'RefreshToken' if available, s... | IceBotYT/nice-go | src/nice_go/_authentication_tokens.py | .py | 29815527fc9d8970 | 7.3 | 3 |
"""AWS Cognito authentication and identity management.
This module provides a class to handle AWS Cognito authentication and identity
management.
Info:
You do not need to use this module directly. It is used by the `nice_go_api`
module to authenticate with AWS Cognito.
"""
import logging
import boto3
from a... | IceBotYT/nice-go | src/nice_go/_aws_cognito_authenticator.py | .py | 0af476fc209e36ea | 7.3 | 3 |
# sourcery skip: snake-case-variable-declarations
"""Module containing classes for barriers.
This module contains classes for barriers and their states. The Barrier class
provides methods to interact with the barrier, such as opening and closing it,
and turning the light on and off.
Classes:
ConnectionState: Repr... | IceBotYT/nice-go | src/nice_go/_barrier.py | .py | 1eebb0c468032de1 | 7.3 | 3 |
"""Utilities for the nice_go package."""
from __future__ import annotations
import json
from typing import Any
from nice_go._const import REQUEST_TEMPLATES
async def get_request_template(
request_name: str,
arguments: dict[str, str] | None,
) -> Any:
"""Get a request template with optional arguments.
... | IceBotYT/nice-go | src/nice_go/_util.py | .py | c80c086666335987 | 7.3 | 3 |
"""This module contains the WebSocketClient class, which is used to interact with the
WebSocket server.
Classes:
WebSocketClient: A class that represents a WebSocket client.
"""
from __future__ import annotations
import asyncio
import base64
import json
import logging
import uuid
from typing import TYPE_CHECKING... | IceBotYT/nice-go | src/nice_go/_ws_client.py | .py | c7e421dacdc876bc | 7.3 | 3 |
"""Fixtures for tests."""
# ruff: noqa: SLF001
from unittest.mock import AsyncMock, MagicMock
import pytest
from tenacity import wait_none
from nice_go._aws_cognito_authenticator import AwsCognitoAuthenticator
from nice_go._ws_client import WebSocketClient
from nice_go.nice_go_api import NiceGOApi
@pytest.fixture... | IceBotYT/nice-go | tests/conftest.py | .py | a07e626b0df77ecb | 7.8 | 3 |
"""
An MCP Server which will store and encode a knowledge database in a JSON file. This database can be prompted using singular words or phrases which are connected to a taxonomy if applicable. The server will respond using the phrases that are stored in the database. If a prompt is not found in the database, the serve... | dhelmrich/ConvenienceScripts | fact_mcp.py | .py | ca993917d1d69d52 | 7 | 0 |
"""Content-hash based caching system for PDF processing."""
import json
import logging
import os
import pickle
import time
from pathlib import Path
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
from .utils import compute_file_hash
logger = logging.getLogger(__name__)
class CacheEntry... | dhelmrich/ConvenienceScripts | pdf_mcp/src/pdf_mcp/cache.py | .py | 8b705aa5ae046a40 | 7 | 0 |
"""Pydantic models for PDF MCP Server."""
from dataclasses import dataclass
from typing import Any, Dict, List, Optional
from pydantic import BaseModel, Field
class PageContent(BaseModel):
"""Content of a single PDF page."""
page_number: int = Field(..., ge=1, description="Page number (1-indexed)")
mar... | dhelmrich/ConvenienceScripts | pdf_mcp/src/pdf_mcp/models.py | .py | a4818af160631c36 | 7 | 0 |
"""Utility functions for path validation."""
import logging
import os
import re
import sys
from pathlib import Path
from typing import List
logger = logging.getLogger(__name__)
# Maximum PDF size: 100 MB
MAX_PDF_SIZE = 100 * 1024 * 1024
# Minimum text threshold per page (characters)
MIN_TEXT_THRESHOLD = 50
class ... | dhelmrich/ConvenienceScripts | pdf_mcp/src/pdf_mcp/utils.py | .py | 8d8ba04f560b95d3 | 7 | 0 |
"""Unit tests for PDF MCP Server.
Consolidated, focused suite covering: text PDFs, scanned PDFs, invalid paths,
caching, page citations, and search/query behavior.
"""
from pathlib import Path
import pytest
from pdf_mcp.cache import PDFCache
from pdf_mcp.pdf_processor import PDFProcessor
from pdf_mcp.server import ... | dhelmrich/ConvenienceScripts | pdf_mcp/tests/test_server.py | .py | df862d4d5ac78bee | 7.5 | 0 |
#!/usr/bin/env python3
"""
Script to find and replace non-ASCII characters in text files.
Recursively scans a folder, prompts for replacements, and maintains a mapping file.
"""
import os
import sys
import json
import argparse
import unicodedata
from pathlib import Path
# Common folders to ignore (starting with dot)... | dhelmrich/ConvenienceScripts | replace_unicode.py | .py | 6589a47e48c29eda | 7 | 0 |
#!/usr/bin/env python3
"""
Set Visual Studio Code as default for appropriate text-based file types.
This script manages desktop file defaults by updating mimeinfo.cache or
using xdg-mime to set defaults for appropriate text-based file types.
"""
import os
import sys
import subprocess
from pathlib import Path
# MIME ... | dhelmrich/ConvenienceScripts | set_vscode_defaults.py | .py | 233388786b47557a | 7 | 0 |
#!/usr/bin/env python3
"""
Sync language models from opencode.json providers to VS Code chatLanguageModels.json
"""
import json
import os
import re
import sys
import requests
from pathlib import Path
from typing import Optional
def get_opencode_config() -> dict:
"""Load opencode.json configuration, stripping Jav... | dhelmrich/ConvenienceScripts | sync_lm_models.py | .py | ea5d1131fdb803eb | 7 | 0 |
"""Project management logic."""
import logging
from .storage.json_store import JsonStore
logger = logging.getLogger(__name__)
class ProjectManager:
"""Manages project data operations."""
def __init__(self, store: JsonStore = None):
self.store = store or JsonStore()
def get_projects(self... | dhelmrich/ConvenienceScripts | viewpro/viewpro/project_manager.py | .py | e7f73428dd3688af | 7 | 0 |
"""JSON storage layer for project data."""
import json
import logging
import os
import re
import sys
from pathlib import Path
from urllib.parse import quote
logger = logging.getLogger(__name__)
class JsonStore:
"""Handles loading and saving projects to a JSON file."""
def __init__(self, filepath: str =... | dhelmrich/ConvenienceScripts | viewpro/viewpro/storage/json_store.py | .py | 05ffa132d2b0893e | 7 | 0 |
# flake8: noqa: UP035, E501
import atexit
import pickle
from typing import TYPE_CHECKING, Any, cast
from urllib.parse import urljoin
import pytest
import requests
from filelock import FileLock
from testcontainers.core.container import DockerContainer
from testcontainers.core.waiting_utils import wait_container_is_read... | lasuillard-s/mockbook | examples/pytest-testcontainers/test/conftest.py | .py | ea3454f3e0a299b4 | 7.5 | 0 |
"""Import Jupyter notebooks as modules.
Source from https://jupyter-notebook.readthedocs.io/en/stable/examples/Notebook/Importing%20Notebooks.html
"""
from __future__ import annotations
import io
import os
import sys
import types
from importlib.abc import Loader, MetaPathFinder
from importlib.util import spec_from_l... | lasuillard-s/mockbook | mockbook/loader.py | .py | b05b646064a6d346 | 7 | 0 |
"""Serve the argument layer of one source at a time, straight from the store.
`backend.pipeline.argument_layer_view` builds the same data for a standalone
file. This router exists so the reviewer does not have to regenerate anything:
the store is the authority, and what the page shows is what it holds right now.
Not... | junyang168/smart-answer | backend/api/argument_layer.py | .py | 145bce1a56a7f116 | 7 | 0 |
from __future__ import annotations
import hashlib
import json
from collections import Counter
from datetime import datetime, timezone
from pathlib import Path
from typing import Any, Callable, Optional
from pydantic import ValidationError
from .knowledge_models import (
KNOWLEDGE_COLLECTIONS,
CompositionDeci... | junyang168/smart-answer | backend/api/canonical_repository/knowledge_importer.py | .py | 82ceb4ccfab32118 | 7 | 0 |
"""Re-pin viewpoint Claim links a Claim review moved, and only those.
A link pins the Claim revision and the Claim fingerprint it was validated
against, so that a link can never come to describe a Claim that has since
changed. The fingerprint is ``semantic_record_sha``, which strips only
``revision`` -- review metada... | junyang168/smart-answer | backend/api/canonical_repository/viewpoint_claim_repin.py | .py | 6353904273886492 | 7 | 0 |
"""Review structures and relations that were committed without one.
The batch contract reviews what a batch proposes. Sixteen structures and
relations reached the Registry before the review schema had a place for them,
and they belong to no pending batch -- there is no proposal left to review.
Re-running their origi... | junyang168/smart-answer | backend/api/canonical_repository/viewpoint_graph_backreview.py | .py | 290cfc7c0b2a40ef | 7 | 0 |
"""Compile reviewed ArgumentRoutes into an atomic Registry package."""
from __future__ import annotations
from collections.abc import Mapping, Sequence
from typing import Any
from .knowledge_models import (
ArgumentRouteAttestationRecord,
ArgumentRouteRecord,
ArgumentRouteRevisionRecord,
ArgumentRout... | junyang168/smart-answer | backend/api/canonical_repository/viewpoint_route_changeset.py | .py | 56a4153f3efec38b | 7 | 0 |
"""Durable single-host queue for committed-CVP ArgumentRoute work.
Enqueue artifacts are immutable. Mutable execution state lives in separate
current pointers backed by append-only events, so a crashed worker can recover
an expired lease without rewriting what was originally requested.
"""
from __future__ import anno... | junyang168/smart-answer | backend/api/canonical_repository/viewpoint_route_queue.py | .py | b837dd0c37aae2ee | 7 | 0 |
"""Serve the corpus-wide extraction health view.
`/admin/wang` answers "which sources have been run". This router answers "is
there anything I should be looking at", and it answers it from the packages and
reviews already written to disk -- no model is called, and nothing here is a
gate: the numbers route attention, ... | junyang168/smart-answer | backend/api/extraction_health.py | .py | 61ce3f2770e0ff0a | 7 | 0 |
from __future__ import annotations
from google import genai
from google.genai import types
from .config import GENERATION_MODEL, GEMINI_API_KEY
class GeminiClient:
def __init__(self) -> None:
# Standard Client (Gemini 1.5/2.0 Pro/Flash etc via AI Studio)
if GEMINI_API_KEY:
self._clie... | junyang168/smart-answer | backend/api/gemini_client.py | .py | 6f8bc953d57d5676 | 7 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.