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 |
|---|---|---|---|---|---|---|
from typing import Dict, Iterator, List, Mapping, Optional, Sequence, Set
import numpy as np
from .core import ClassNode, Description, NegatedRealNode, RealNode, TRealNode, TagNode
from .taxonomy import Taxonomy
import operator as op
NAN = float("nan")
class DescriptionEncoder:
"""
Encode descriptions into... | moi90/polytaxo | src/polytaxo/encoder.py | .py | b2370e0b020be315 | 7 | 0 |
from typing import Optional
import torch
import torch.nn.functional as F
from torch import nn
def multilabel_loss(
input: torch.Tensor,
target: torch.Tensor,
weight: Optional[torch.Tensor] = None,
reduction: str = "mean",
pos_weight: Optional[torch.Tensor] = None,
focal_gamma: float = 0.0,
):... | moi90/polytaxo | src/polytaxo/torch.py | .py | b28568014e334630 | 7 | 0 |
from polytaxo.core import Description, NegatedRealNode, ClassNode, TagNode
from polytaxo.descriptor import Descriptor
from polytaxo.parser import quote
from polytaxo.taxonomy import Expression
def format_descriptor_quoted(d: Descriptor, anchor=None, quote_chars="'\"") -> str:
if isinstance(d, (ClassNode, TagNode)... | moi90/polytaxo | tests/helpers.py | .py | a39662bcc5123958 | 7.5 | 0 |
"""Training on the GPU pool: a run that is interrupted and picks itself up.
Run it here, with no GPU, no cluster and no tracking server -- it degrades to
a plain loop:
uv run python examples/training.py
Then interrupt it with Ctrl-C partway through and start it again. It resumes
from its last checkpoint, which i... | gwenlake/gwenlake-python | examples/training.py | .py | 342449fdf17b0879 | 7.35 | 4 |
"""Foundry-style transforms over the Gwenlake catalog.
Requires the optional pandas/pyarrow extras: ``pip install gwenlake[transforms]``.
Uses the default credentials (GWENLAKE_API_KEY env var or the ``default`` profile).
"""
import gwenlake
from gwenlake.transforms import transform_df, transform, train, Input, Model... | gwenlake/gwenlake-python | examples/transforms.py | .py | 0952a47ce575f32b | 7.35 | 4 |
from __future__ import annotations
from typing import Optional
class GwenlakeException(Exception):
"""A base class for all Gwenlake exceptions."""
def __init__(self, message: Optional[str] = None) -> None:
super(GwenlakeException, self).__init__(message)
self.message = message
def __st... | gwenlake/gwenlake-python | src/gwenlake/exceptions.py | .py | 7f72907880b95ee6 | 7.35 | 4 |
from typing import Any, Dict, Optional, Union
from gwenlake.client import ApiClient, AsyncApiClient, RequestOptions
# What each `format` sends back, so `Accept` matches what the server will
# actually return (`pyarrow` is an Arrow IPC *file*, not JSON).
_ACCEPT_BY_FORMAT = {
"json": "application/json",
"csv"... | gwenlake/gwenlake-python | src/gwenlake/statements.py | .py | 08104842a3c1d24d | 7.35 | 4 |
#!/usr/bin/env python3
import os
import argparse
import pandas as pd
import re
def extract_urls(text):
"""Extracts all http/https URLs from a given text using a regex."""
if pd.isna(text):
return []
pattern = r'(https?://[^\s\'"<>]+)'
raw_urls = re.findall(pattern, str(text))
# Remove any l... | brianlmerritt/learning_tools_content_api | extract_urls.py | .py | c91f48b2fdbdee36 | 7.24 | 2 |
"""Runtime configuration from config.yaml (repo root).
Non-secret run settings live here; credentials and server URLs stay in .env.
Loaded once and cached; tests may pre-seed _config before first use.
"""
import os
import yaml
REPO_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
_config = None
... | brianlmerritt/learning_tools_content_api | lib/config.py | .py | 3074be918f478d34 | 7.24 | 2 |
from typing import Dict, List, Tuple, Any
import pandas as pd
import httpx
import json
import csv
from bs4 import BeautifulSoup
import re
from urllib.parse import urlparse, parse_qs
from lib.content_cleaners import content_cleaners
class content_utilities:
def __init__(self) -> None:
self.content_cleaner =... | brianlmerritt/learning_tools_content_api | lib/content_utilities.py | .py | 415e0805d22e103f | 7.24 | 2 |
import os
import csv
from datetime import datetime
from collections import deque
import atexit
class EventLogger:
def __init__(self):
"""
Initialize the event logger with an output directory and a deque to store events.
Args:
output_dir (str): Directory path where log_e... | brianlmerritt/learning_tools_content_api | lib/event_logger.py | .py | f57a9a8d6443f9db | 7.24 | 2 |
from typing import Dict, List, Any
import pandas as pd
import json
import os
from bs4 import BeautifulSoup
from urllib.parse import urlparse
from lib.content_cleaners import content_cleaners
from lib.content_utilities import content_utilities
from lib.event_logger import EventLogger
class ModuleHelper:
"""Helper c... | brianlmerritt/learning_tools_content_api | mod/moodle_mod_helper.py | .py | 97132a043a2aac09 | 7.24 | 2 |
import pandas as pd
import os
import urllib.parse
from pathlib import Path
def report_unused_moodle_book_files(base_path="course_data"):
"""
Generate a report of the top 10 largest unused book files for each RVC course.
Args:
base_path (str): Path to the directory containing course folders
... | brianlmerritt/learning_tools_content_api | mod/report_on_unused_large_book_files.py | .py | d2cc9b8026a6a0eb | 7.24 | 2 |
#!/usr/bin/env python3
import os
import argparse
import pandas as pd
import re
def extract_pluginfile_id(url):
"""
Given a URL, extracts the numeric file ID that comes immediately after 'pluginfile.php/'.
For example, from:
https://learn.rvc.ac.uk/webservice/pluginfile.php/469138/mod_resource/...
... | brianlmerritt/learning_tools_content_api | split_files_used_and_unused.py | .py | a49b3a12dff6725b | 7.24 | 2 |
"""
Main file for the API.
"""
import gc
import logging
import os
from contextlib import asynccontextmanager
from datetime import datetime
from typing import Dict
import geopandas as gpd
import mlflow
import numpy as np
import pyarrow.parquet as pq
from fastapi import FastAPI, Query, Request
from fastapi.responses im... | InseeFrLab/satellite-images-inference | app/main.py | .py | 0c3f07ac69aba1ae | 7.35 | 4 |
import json
import os
from typing import Dict
import geopandas as gpd
import mlflow
import numpy as np
import pyarrow.parquet as pq
from astrovision.data import SatelliteImage, SegmentationLabeledSatelliteImage
from s3fs import S3FileSystem
def get_satellite_image(image_path: str, n_bands: int):
"""
Retrieve... | InseeFrLab/satellite-images-inference | app/utils/data.py | .py | 3f86f88b76528227 | 7.35 | 4 |
from typing import List
import albumentations as A
import numpy as np
from albumentations.pytorch.transforms import ToTensorV2
from astrovision.data import SatelliteImage
def preprocess_image(
image: SatelliteImage,
normalization_mean: List[float],
transform: A.Compose,
):
"""
Preprocesses a sate... | InseeFrLab/satellite-images-inference | app/utils/preprocess_image.py | .py | 9be17b4ba6fd10c4 | 7.35 | 4 |
import albumentations as A
import cv2
import numpy as np
import torch
from astrovision.data import SatelliteImage
from astrovision.data.utils import get_bounds_for_tile, get_transform_for_tile
from monai.inferers import SlidingWindowSplitter
from app.logger_config import configure_logger
from app.utils.data import get... | InseeFrLab/satellite-images-inference | app/utils/split_and_normalize.py | .py | 35645eb3aca559a5 | 7.35 | 4 |
"""
Utils.
"""
import os
import tempfile
from contextlib import contextmanager
from typing import Dict
import geopandas as gpd
import numpy as np
import pandas as pd
import rasterio
import torch
from astrovision.data import SegmentationLabeledSatelliteImage
from rasterio.features import rasterize, shapes
from shapely... | InseeFrLab/satellite-images-inference | app/utils/utils.py | .py | 37a928e4e5ad2fd9 | 7.35 | 4 |
import geopandas as gpd
import pandas as pd
import pyarrow as pa
import pyarrow.parquet as pq
import s3fs
from astrovision.data import SatelliteImage
from osgeo import gdal
from pqdm.processes import pqdm
from shapely import Polygon
gdal.UseExceptions()
def create_polygon(image: str) -> gpd.GeoDataFrame:
try:
... | InseeFrLab/satellite-images-inference | src/build_filename_to_polygons.py | .py | 567f335446cbfb3e | 7.35 | 4 |
import argparse
import asyncio
import os
import tempfile
from datetime import datetime
import aiohttp
import geopandas as gpd
import pandas as pd
import requests
from tqdm.asyncio import tqdm
from app.utils.data import get_file_system, get_filename_to_polygons
# from src.postprocessing.postprocessing import clean_pre... | InseeFrLab/satellite-images-inference | src/make_predictions_from_api.py | .py | 7ddf36d28f58d775 | 7.35 | 4 |
from typing import Union
import geopandas as gpd
import libpysal
import networkx as nx
import pandas as pd
from geopandas import GeoSeries
from shapely.geometry import LineString, MultiLineString, MultiPolygon
from shapely.ops import unary_union
from tqdm import tqdm
def check_line_intersection(poly1: Union[LineStri... | InseeFrLab/satellite-images-inference | src/postprocessing/postprocessing.py | .py | 0b3f76c3c150ac81 | 7.35 | 4 |
import mlflow
from app.utils.utils import (
get_normalization_metrics,
)
def get_model_from_id(run_id: str) -> mlflow.pyfunc.PyFuncModel:
"""
This function fetches a trained machine learning model from the MLflow
model registry based on the specified model name and version.
Args:
model_n... | InseeFrLab/satellite-images-inference | src/retrievals/wrappers.py | .py | 957c4c0c54149fb6 | 7.35 | 4 |
# Copyright (c) 2024, Yefri Tavarez and Contributors
# For license information, please see license.txt
import frappe
def boot_session(bootinfo):
bootinfo.powerpro_settings = get_powerpro_settings()
bootinfo.roll_conversion_order_settings = get_roll_conversion_order_settings()
def get_powerpro_settings():
settin... | YefriTavarez/powerpro | powerpro/boot.py | .py | 25280691317979ef | 7.24 | 2 |
# Copyright (c) 2024, Yefri Tavarez and Contributors
# For license information, please see license.txt
import re
import frappe
from frappe.utils import cint
ITEM_GROUP_FIELDS = (
"custom_item_group_1",
"custom_item_group_2",
"custom_item_group_3",
"custom_item_group_4",
"custom_item_group_5",
)
def autoname(... | YefriTavarez/powerpro | powerpro/controllers/item.py | .py | 8e4fac262c68d819 | 7.24 | 2 |
# Copyright (c) 2025, Yefri Tavarez and Contributors
# For license information, please see license.txt
import frappe
from frappe import _
from frappe.utils import nestedset
CATEGORY_RANGES = {
"Artículos": (1000, 3999),
"Productos": (4000, 7999),
"Servicios": (9000, 9999),
}
def after_insert(doc, method=... | YefriTavarez/powerpro | powerpro/controllers/item_group.py | .py | c079719a701e8938 | 7.24 | 2 |
# Copyright (c) 2025, Yefri Tavarez and Contributors
# For license information, please see license.txt
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from frappe.model import document as document
import io
import uuid
from weasyprint import HTML
import frappe
from frappe.utils import flt
from powerpro.cont... | YefriTavarez/powerpro | powerpro/controllers/printcard/helper.py | .py | 84b235d0308128ee | 7.24 | 2 |
# Copyright (c) 2025, Yefri Tavarez and Contributors
# For license information, please see license.txt
from typing import TYPE_CHECKING, Union
if TYPE_CHECKING:
import datetime
import frappe
from frappe.utils import cint
def get_users_from_template(name, as_list=False):
"""
Retrieve users associated wi... | YefriTavarez/powerpro | powerpro/controllers/project/helper.py | .py | 6669c3a81ea2109b | 7.24 | 2 |
#!/usr/bin/env python3
"""Generate RECALL.md from the mental-model cards embedded in the notebooks.
The cards live in the notebooks, where they orient you before you read the code.
This collects them into one page where the answer is hidden behind a <details>,
so the same text can be used the other way round: read the... | ospatil/dsapy | scripts/build-recall.py | .py | 6e1766c79398890d | 7 | 0 |
"""Explicit calibration/run frame graph composition helpers."""
from __future__ import annotations
import math
from typing import Any, Mapping, Sequence
import numpy as np
from pytransform3d import rotations as pr
from pytransform3d import transformations as pt
from pytransform3d.transform_manager import TransformMa... | match-cow/posetestbot | posetestbot/calibration/frame_graph.py | .py | d33f00cb56d24be9 | 7.65 | 1 |
"""Neutral rigid-transform helpers for current calibration attempts."""
from __future__ import annotations
import math
from statistics import mean, median
from typing import Any, Mapping, Sequence
import numpy as np
from pytransform3d import rotations as pr
from pytransform3d import transformations as pt
def is_fi... | match-cow/posetestbot | posetestbot/calibration/transforms.py | .py | dfaa6e3dfe57b091 | 7.65 | 1 |
"""Real lab robot configuration defaults for PoseTestBot."""
from __future__ import annotations
import math
from dataclasses import dataclass, replace
LAB_ROBOT_IP = "172.31.1.147"
LAB_ROBOT_RECEIVER_IP = "172.31.1.169"
LAB_NORMAL_NETWORK_IP = "10.145.8.132"
DEFAULT_ROBOT_PORT = 30300
DEFAULT_RECEIVER_PORT = 8080
... | match-cow/posetestbot | posetestbot/config.py | .py | a7979e7c0f20971f | 7.65 | 1 |
# Copyright 2025 Remy Blank <remy@c-space.org>
# SPDX-License-Identifier: MIT
import functools
import os
import pathlib
import re
from docutils import statemachine
from myst_parser import mocking
from sphinx import jinja2glue
from sphinx.util import fileutil
def patch(obj, name):
"""Monkey-patch a function on a... | t-doc-org/common | tdoc/common/ext/patch.py | .py | f572b062d407a98a | 7 | 0 |
# Copyright 2024 Remy Blank <remy@c-space.org>
# SPDX-License-Identifier: MIT
import ast
import asyncio
import contextlib
import contextvars
import inspect
import io
import sys
import traceback
import js
from pyodide.ffi import run_sync
try:
from polyscript import xworker
except ImportError:
xworker = None
... | t-doc-org/common | tdoc/common/python/tdoc/core.py | .py | edc4433a57c4a4f5 | 7 | 0 |
# Copyright 2025 Remy Blank <remy@c-space.org>
# SPDX-License-Identifier: MIT
import asyncio
from pyodide.ffi import run_sync
from tdoc import core
class Clock:
"""A replacement for pygame.time.Clock."""
def __init__(self):
self.t, self.fps_cnt, self.fps = None, 0, 0
def tick(self, framerate=0)... | t-doc-org/common | tdoc/common/python/tdoc/pygame.py | .py | 8b4a2a93bffafba2 | 7 | 0 |
"""@file psdi_data_conversion/converters/script_template/converter.py
c2x file converter
"""
from psdi_data_conversion.converters.base import FileConverterMeta, ScriptFileConverter
class C2xFileConverter(ScriptFileConverter):
"""File converter specialised to use c2x for conversions"""
meta: FileConverterMe... | PSDI-UK/psdi-data-conversion | psdi_data_conversion/converters/c2x/converter.py | .py | 42f6b126e0967962 | 7 | 0 |
"""@file psdi_data_conversion/converters/example/converter.py
Example file converter
"""
from psdi_data_conversion.converters.base import FileConverter, FileConverterArgException, FileConverterMeta
def process_example_option(l_opts: list[str] | None) -> dict[str, str]:
"""Example method to process an option for... | PSDI-UK/psdi-data-conversion | psdi_data_conversion/converters/example/converter.py | .py | 2c6004bd526fda55 | 7 | 0 |
"""@file psdi_data_conversion/converters/script_template/converter.py
ScriptTemplate file converter
"""
from psdi_data_conversion.converters.base import FileConverterMeta, ScriptFileConverter
class ScriptTemplateFileConverter(ScriptFileConverter):
"""File converter specialised to use ScriptTemplate for conversi... | PSDI-UK/psdi-data-conversion | psdi_data_conversion/converters/script_template/converter.py | .py | 8655f492cec33179 | 7 | 0 |
"""@file psdi_data_conversion/converters/template/converter.py
Template file converter
"""
from psdi_data_conversion.converters.base import FileConverter, FileConverterMeta
class TemplateFileConverter(FileConverter):
"""File converter specialised to use Template for conversions"""
meta: FileConverterMeta =... | PSDI-UK/psdi-data-conversion | psdi_data_conversion/converters/template/converter.py | .py | 8556bed6fe5170c6 | 7 | 0 |
"""@file psdi_data_conversion/dist.py
Created 2025-02-25 by Bryan Gillis.
Functions and utilities related to handling multiple user OSes and distributions
"""
import os
import shutil
import sys
from psdi_data_conversion.file_io import get_package_path
# Labels for each platform (which we use for the folder in this... | PSDI-UK/psdi-data-conversion | psdi_data_conversion/dist.py | .py | 0dbee66cb2c035fb | 7 | 0 |
"""
# setup.py
This module handles setting up the Flask app
"""
import os
from collections.abc import Callable
from functools import wraps
from typing import Any
import werkzeug
from flask import Flask, cli
import psdi_data_conversion
from psdi_data_conversion import constants as const
from psdi_data_conversion.gu... | PSDI-UK/psdi-data-conversion | psdi_data_conversion/gui/setup.py | .py | d30b073ee6dd09d1 | 7 | 0 |
#!/usr/bin/env python3
"""psdi_data_conversion/main_create_plugin.py
=============
Created 2026-07-01 by Bryan Gillis.
Entry-point file for the script to create a new converter plugin.
"""
import importlib
import os
import re
import shutil
import sys
from argparse import ArgumentParser
from pathlib import Path
fro... | PSDI-UK/psdi-data-conversion | psdi_data_conversion/main_create_plugin.py | .py | 338f59f243b5598a | 7 | 0 |
"""Read text from PDFs and extract images/pages for vision analysis.
This module centralizes document IO helpers used by scraping: text extraction
from PDFs, text/PDF path lookup for paper rows, and image extraction/rendering
for figure or page-level model analysis.
"""
from __future__ import annotations
import io
i... | SMTG-Bham/PaperMinerToolkit | paperminertoolkit/corpus/documents.py | .py | 6bef47ca57921a88 | 7.35 | 4 |
"""Load and validate extraction recipes.
Recipes define the records to extract, target fields, examples, aliases, and
unit expectations used by scraping and storage. This module validates recipe
shape and maps extracted columns back to canonical output columns.
"""
from __future__ import annotations
import json
from... | SMTG-Bham/PaperMinerToolkit | paperminertoolkit/extraction/recipes.py | .py | 2b23ccc98da6cb10 | 7.35 | 4 |
"""Small maintenance utilities for the PaperMinerToolkit corpus.
These helpers back CLI commands for resetting pipeline status and printing a
progress summary for the SQLite paper corpus.
"""
from __future__ import annotations
from os import PathLike
from paperminertoolkit.corpus.database import PIPELINE_COLUMNS, c... | SMTG-Bham/PaperMinerToolkit | paperminertoolkit/workflows/utilities.py | .py | dcc0672414e47cd5 | 7.35 | 4 |
"""Shared HTTP test doubles for the data-source clients.
Every source client takes an injected HTTP session, so its tests need the same
two doubles: a prepared response and a session that hands them out in order
while recording what was asked for. They were written once per source and
drifted, so they live here instea... | SMTG-Bham/PaperMinerToolkit | tests/doubles.py | .py | 1c6e94c4a118c3cc | 7.85 | 4 |
"""Test compression policies, token estimates, and Headroom integration."""
from __future__ import annotations
import builtins
from pathlib import Path
import sys
import types
from typing import Any
import pytest
import paperminertoolkit.extraction.compression as compression
DATA_DIR = Path(__file__).resolve().par... | SMTG-Bham/PaperMinerToolkit | tests/test_compression.py | .py | 958d8612a1025432 | 7.85 | 4 |
"""Unit tests for CORE API request helpers and CORE record mapping."""
from __future__ import annotations
from typing import Any
import pytest
import paperminertoolkit.providers.core as core
from paperminertoolkit.providers import base as provider
from tests.doubles import FakeResponse, FakeSession
def work(core... | SMTG-Bham/PaperMinerToolkit | tests/test_core.py | .py | 99c815babb68572f | 7.85 | 4 |
"""
Example Description:
This example acts as a PC-based, graphical tool that interacts with
the Bird 4480A Digital Wattmeter over the USB bus using VISA. The
program sends SCPI comands to the 4480 and gets a responce every
second. It then takes the collected data such as forward and ref... | Bird-Technologies/Wattmeters | bird_4480_wattmeter_datalogging.py | .py | 8f0aec539275c1e6 | 7 | 0 |
import re
import types
from typing import Any, Optional, Union, get_args, get_origin
from pydantic import BaseModel
def apply_model_json_constraints(schema: dict, list_item_max_len: dict[str, int] = {}) -> dict:
for name, definition in schema["properties"].items():
if "anyOf" in definition:
de... | soumitsalman/pycoffeemaker | nlp/formatters.py | .py | a139063d49761a8e | 7.24 | 2 |
import asyncio
from itertools import batched, chain
import os
import queue
import threading
from concurrent.futures import ThreadPoolExecutor
from datetime import datetime, timedelta, timezone
from typing import Any, Optional
from pydantic import BaseModel
from .base import *
from psycopg_pool import AsyncConnectionPoo... | soumitsalman/pycoffeemaker | processingcache/extensions/pgclscache.py | .py | e02e4458b6d9acdc | 7.24 | 2 |
import asyncio
from itertools import batched, chain
import os
import queue
import threading
from concurrent.futures import ThreadPoolExecutor
from datetime import datetime, timedelta, timezone
from typing import Any, Optional
from pydantic import BaseModel
from .base import *
from psycopg_pool import AsyncConnectionPoo... | soumitsalman/pycoffeemaker | processingcache/pgcache.py | .py | eded325d06953f72 | 7.24 | 2 |
import mimetypes
import os
from pathlib import Path
import asyncio
import boto3
import aioboto3
from botocore.client import Config
_CONFIG = Config(s3={'addressing_style': 'virtual'})
_MAX_CONCURRENCY = 100
def _guess_type(file_path: str) -> str:
content_type, _ = mimetypes.guess_type(file_path)
return conten... | soumitsalman/pycoffeemaker | pybeansack/cdnstore.py | .py | a22471b692643f8e | 7.24 | 2 |
from cmath import log
import os
from pydantic import Field
import lancedb
from lancedb.rerankers import Reranker
from lancedb.pydantic import LanceModel, Vector
from datetime import timedelta
import pyarrow as pa
import pandas as pd
from .models import *
from .database import *
import logging
log = logging.getLogger(_... | soumitsalman/pycoffeemaker | pybeansack/lancesack.py | .py | 2520d1e064b41437 | 7.24 | 2 |
from functools import cached_property
from uuid import UUID
from typing_extensions import deprecated
from rfc3339 import rfc3339
from pydantic import BaseModel, Field, ConfigDict
from typing import Optional
from datetime import datetime
from utils import CLUSTER_EPS, VECTOR_LEN, ndays_ago, ndays_ago_str, now
from util... | soumitsalman/pycoffeemaker | pybeansack/models.py | .py | 2cc5d6ce3122b514 | 7.24 | 2 |
from datetime import datetime, timezone
import lancedb
from lancedb.pydantic import LanceModel, Vector
import pyarrow as pa
from typing import Any, Literal, Optional
from utils.config import VECTOR_LEN
ITEMS = "__items__"
ID = "id"
TS = "ts"
INDEXING_THRESHOLD = 100000
DISTANCE_FUNC = Literal["l2", "cosine", "dot"]
... | soumitsalman/pycoffeemaker | pybeansack/simplevectordb.py | .py | 1fc6d15dfde07a6a | 7.24 | 2 |
# NOTE: this is deprecated. IGNORE
from datetime import datetime
from deprecation import deprecated
import lancedb
from lancedb.pydantic import LanceModel
from pydantic import BaseModel, Field
from typing import Optional
from .models import Sip
SIPS = "sips"
# sip kinds
HEADLINE = "headline"
REPORT = "report"
EDITOR... | soumitsalman/pycoffeemaker | pycupboard/lancecupboard.py | .py | 9d7ad466b2d24ce8 | 7.24 | 2 |
import sys
import os
ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
sys.path.insert(0, ROOT)
from utils.env import load_coffeemaker_env
load_coffeemaker_env(ROOT)
import json
from datetime import datetime
from pathlib import Path
from coffeemaker.pybeansack.models import *
from coffeemaker.p... | soumitsalman/pycoffeemaker | tests/populate_cupboard.py | .py | b14edce638ed43ac | 7.74 | 2 |
"""Tests for the tests API."""
import os
from fastapi.testclient import TestClient
from uedition_editor import app
from uedition_editor.settings import init_settings
def test_fail_incorrect_fixture() -> None:
"""Test that creating an non-existent fixture fails."""
client = TestClient(app)
response = cl... | uEdition/uEditor | tests/functional_tests/api_tests/tests_test.py | .py | 9f10aee86cfea4ff | 7.74 | 2 |
"""Tests for the application settings."""
from fastapi import FastAPI
from uedition_editor.settings import get_uedition_settings, get_ueditor_settings, init_settings
def test_basic_env_settings(simple_app: FastAPI) -> None: # noqa: ARG001
"""Test that the basic env settings are loaded."""
assert init_setti... | uEdition/uEditor | tests/functional_tests/settings_test.py | .py | af31375518175bde | 7.74 | 2 |
# SPDX-FileCopyrightText: 2024-present Mark Hall <mark.hall@work.room3b.eu>
#
# SPDX-License-Identifier: MIT
"""The main uEditor server."""
import logging
from contextlib import asynccontextmanager
from copy import deepcopy
from fastapi import FastAPI
from fastapi.exceptions import HTTPException
from fastapi.response... | uEdition/uEditor | uedition_editor/__init__.py | .py | 708383ad6dc15c8a | 7.24 | 2 |
# SPDX-FileCopyrightText: 2024-present Mark Hall <mark.hall@work.room3b.eu>
#
# SPDX-License-Identifier: MIT
"""The uEditor server API."""
from typing import Literal
from fastapi import APIRouter
from pydantic import BaseModel
from pygit2 import GitError, Repository
from pygit2.enums import RepositoryOpenFlag
from u... | uEdition/uEditor | uedition_editor/api/__init__.py | .py | a9b71f329fe2063a | 7.24 | 2 |
# SPDX-FileCopyrightText: 2024-present Mark Hall <mark.hall@work.room3b.eu>
#
# SPDX-License-Identifier: MIT
"""The uEditor API for accessing branches."""
import logging
from typing import Annotated
from fastapi import APIRouter, Depends, Header
from fastapi.exceptions import HTTPException
from pydantic import BaseMo... | uEdition/uEditor | uedition_editor/api/branches.py | .py | 618fe9dd71c9cf7e | 7.24 | 2 |
# SPDX-FileCopyrightText: 2024-present Mark Hall <mark.hall@work.room3b.eu>
#
# SPDX-License-Identifier: MIT
"""The uEditor API for accessing configurations."""
import logging
import os
from shutil import copytree, rmtree
from fastapi import APIRouter
from fastapi.exceptions import HTTPException
logger = logging.get... | uEdition/uEditor | uedition_editor/api/tests.py | .py | 7fd045de8040635a | 7.74 | 2 |
"""Utility functionality for the API."""
import logging
from asyncio import Lock
from pygit2 import (
Commit,
CredentialType,
GitError,
KeypairFromAgent,
RemoteCallbacks,
Repository,
Signature,
)
from pygit2.enums import FetchPrune, MergeAnalysis, RepositoryOpenFlag
from uedition_editor.s... | uEdition/uEditor | uedition_editor/api/util.py | .py | bf167ef7e51eafd4 | 7.24 | 2 |
# SPDX-FileCopyrightText: 2024-present Mark Hall <mark.hall@work.room3b.eu>
#
# SPDX-License-Identifier: MIT
"""The uEditor CLI application."""
import re
from typing import Annotated
from pygit2 import GitError, Repository, Signature, init_repository
from pygit2.enums import RepositoryOpenFlag
from rich import print ... | uEdition/uEditor | uedition_editor/cli/__init__.py | .py | 8fd77a726491274c | 7.24 | 2 |
# SPDX-FileCopyrightText: 2024-present Mark Hall <mark.hall@work.room3b.eu>
#
# SPDX-License-Identifier: MIT
"""Regular jobs run in the background of the uEditor."""
import logging
import aiocron
from pygit2 import GitError, Repository
from pygit2.enums import RepositoryOpenFlag
from uedition_editor.api.util import ... | uEdition/uEditor | uedition_editor/cron.py | .py | 051545cad090793a | 7.24 | 2 |
#!/usr/bin/env python3
"""Resolve current SHA digests for all pinned Docker images and open a PR if any changed."""
import os
import re
import subprocess
import sys
from collections import defaultdict
from pathlib import Path
REPO_ROOT = Path(__file__).resolve().parents[2]
FILES_TO_SCAN = [
"app/Dockerfile",
... | chaBiselx/AmbianceBoard | .github/scripts/check_docker_digests.py | .py | b2310741d9acecc6 | 7.15 | 1 |
"""
Test d'intégration pour la route: create playlist (/playlist/create)
"""
from django.test import TestCase, Client, tag
from django.urls import reverse
from django.contrib.auth import get_user_model
User = get_user_model()
@tag('integration')
class AddPlaylistRouteTest(TestCase):
"""Tests pour la route create... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/AddPlaylistRouteTest.py | .py | 31dc3c9ca8aec93a | 7.65 | 1 |
"""
Test d'intégration pour la route: create account (/create-account/)
"""
from django.test import TestCase, Client, tag
from django.urls import reverse
from django.contrib.auth import get_user_model
User = get_user_model()
@tag('integration')
class CreateAccountRouteTest(TestCase):
"""Tests pour la route creat... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/CreateAccountRouteTest.py | .py | adede6d241ce84e5 | 7.65 | 1 |
"""
Test d'intégration pour la route: delete account (/account/settings/delete-account)
"""
from django.test import TestCase, Client, tag
from django.urls import reverse
from django.contrib.auth import get_user_model
User = get_user_model()
@tag('integration')
class DeleteAccountRouteTest(TestCase):
"""Tests pou... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/DeleteAccountRouteTest.py | .py | ddea720a4bcd59fb | 7.65 | 1 |
"""
Test d'intégration pour la route: home (/)
"""
from django.test import TestCase, Client, tag
from django.urls import reverse
@tag('integration')
class HomeRouteTest(TestCase):
"""Tests pour la route home"""
def setUp(self):
"""Configuration initiale"""
self.client = Client()
... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/HomeRouteTest.py | .py | 1c3fc2ff69e01ac5 | 7.65 | 1 |
"""
Test d'intégration pour la route: legal-notice (/legal-notice)
"""
from django.test import TestCase, Client, tag
from django.urls import reverse
@tag('integration')
class LegalNoticeRouteTest(TestCase):
"""Tests pour la route legal notice"""
def setUp(self):
"""Configuration initiale"""
... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/LegalNoticeRouteTest.py | .py | 23b3bb92d265a01b | 7.65 | 1 |
"""
Test d'intégration pour la route: login POST (/login/post)
"""
from django.test import TestCase, Client, tag
from django.urls import reverse
from django.contrib.auth import get_user_model
User = get_user_model()
@tag('integration')
class LoginPostRouteTest(TestCase):
"""Tests pour la route login POST"""
... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/LoginPostRouteTest.py | .py | 94b8e900e6fbad33 | 7.65 | 1 |
"""
Test d'intégration pour la route: login page (/login/)
"""
from django.test import TestCase, Client, tag
from django.urls import reverse
from django.contrib.auth import get_user_model
User = get_user_model()
@tag('integration')
class LoginRouteTest(TestCase):
"""Tests pour la route login page"""
def... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/LoginRouteTest.py | .py | c2c19a7789cff5cd | 7.65 | 1 |
"""
Test d'intégration pour la route: logout (/logout/)
"""
from django.test import TestCase, Client, tag
from django.urls import reverse
from django.contrib.auth import get_user_model
User = get_user_model()
@tag('integration')
class LogoutRouteTest(TestCase):
"""Tests pour la route logout"""
def setUp... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/LogoutRouteTest.py | .py | d3be11603d49d7b5 | 7.65 | 1 |
"""
Test d'intégration pour la route: manager dashboard (/manager/)
"""
from django.test import TestCase, Client, tag
from django.urls import reverse
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
User = get_user_model()
@tag('integration')
class ManagerDashboardRouteTest... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/ManagerDashboardRouteTest.py | .py | af9eba079ccfc9c1 | 7.65 | 1 |
"""
Test d'intégration pour la route: moderator dashboard (/moderator/)
"""
from django.test import TestCase, Client, tag
from django.urls import reverse
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
User = get_user_model()
@tag('integration')
class ModeratorDashboardRou... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/ModeratorDashboardRouteTest.py | .py | 146bf59bada87079 | 7.65 | 1 |
"""
Integration tests for route: moderator playlist tags listing (/moderator/playlist-tags/)
"""
from django.test import TestCase, Client, tag
from django.urls import reverse
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
User = get_user_model()
@tag("integration")
class ... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/ModeratorListingPlaylistTagsRouteTest.py | .py | e3510267e25c2c90 | 7.65 | 1 |
"""
Test d'intégration pour la route: moderator tags listing (/moderator/tags/)
"""
from django.test import TestCase, Client, tag
from django.urls import reverse
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
User = get_user_model()
@tag('integration')
class ModeratorList... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/ModeratorListingTagsRouteTest.py | .py | b34ca5088c994341 | 7.65 | 1 |
"""
Test d'intégration pour la route: Création de piste de streaming (/playlist/<uuid:playlist_uuid>/<int:music_id>)
"""
from django.test import TestCase, Client, tag
from django.urls import reverse
from django.contrib.auth import get_user_model
import uuid
User = get_user_model()
@tag('integration')
class PlaylistC... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/PlaylistCreateTrackStreamRouteTest.py | .py | bcf13a5c74e6c372 | 7.65 | 1 |
"""
Test d'intégration pour la route: list all playlists (/playlist/all)
"""
from django.test import TestCase, Client, tag
from django.urls import reverse
from django.contrib.auth import get_user_model
User = get_user_model()
@tag('integration')
class PlaylistsAllListRouteTest(TestCase):
"""Tests pour la route l... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/PlaylistsAllListRouteTest.py | .py | e09512eb6e63d2c0 | 7.65 | 1 |
"""
Test d'intégration pour la route: pricing (/pricing)
"""
from django.test import TestCase, Client, tag
from django.urls import reverse
@tag('integration')
class PricingRouteTest(TestCase):
"""Tests pour la route pricing"""
def setUp(self):
"""Configuration initiale"""
self.client = Cl... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/PricingRouteTest.py | .py | a4402cc98819dac1 | 7.65 | 1 |
"""
Test d'intégration pour la route: Favoris publics (/public/favorite)
"""
from django.test import TestCase, Client, tag
from django.urls import reverse
from django.contrib.auth import get_user_model
User = get_user_model()
@tag('integration')
class PublicFavoriteRouteTest(TestCase):
"""Tests pour la route des... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/PublicFavoriteRouteTest.py | .py | b9be7a4ad3293fa0 | 7.65 | 1 |
"""
Test d'intégration pour la route: public index (/public/)
"""
from django.test import TestCase, Client, tag
from django.urls import reverse
from django.contrib.auth import get_user_model
User = get_user_model()
@tag('integration')
class PublicIndexRouteTest(TestCase):
"""Tests pour la route public index"""
... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/PublicIndexRouteTest.py | .py | c8c81de2a699db07 | 7.65 | 1 |
"""
Test d'intégration pour la route: public soundboards listing (/public/soundboards)
"""
from django.test import TestCase, Client, tag
from django.urls import reverse
from django.contrib.auth import get_user_model
from main.architecture.persistence.models.SoundBoard import SoundBoard
from main.architecture.persistenc... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/PublicListingSoundboardRouteTest.py | .py | 6a7a6b8460950ae1 | 7.65 | 1 |
"""
Test d'intégration pour la route: Lecture publique de soundboard (/public/soundboards/<uuid:soundboard_uuid>)
"""
from django.test import TestCase, Client, tag
from django.urls import reverse
from django.contrib.auth import get_user_model
import uuid
from main.architecture.persistence.models.SoundBoard import Sound... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/PublicReadSoundboardRouteTest.py | .py | 9e3dbfae0feb4147 | 7.65 | 1 |
"""
Test d'intégration pour la route: Streaming public de musique (/public/soundboards/<uuid:soundboard_uuid>/<uuid:playlist_uuid>/stream)
"""
from django.test import TestCase, Client, tag
from django.urls import reverse
from django.contrib.auth import get_user_model
import uuid
User = get_user_model()
@tag('integra... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/PublicStreamMusicRouteTest.py | .py | a7cc71f76e86bdd6 | 7.65 | 1 |
"""
Test d'intégration pour la route: Publication de soundboard (/shared/<uuid:soundboard_uuid>)
"""
from django.test import TestCase, Client, tag
from django.urls import reverse
from django.contrib.auth import get_user_model
import uuid
User = get_user_model()
@tag('integration')
class PublishSoundboardRouteTest(Te... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/PublishSoundboardRouteTest.py | .py | 1fe1be5cd0efe8f0 | 7.65 | 1 |
"""
Test d'intégration pour la route: report content (/public/report)
"""
from django.test import TestCase, Client, tag
from django.urls import reverse
from django.contrib.auth import get_user_model
User = get_user_model()
@tag('integration')
class ReportingContentRouteTest(TestCase):
"""Tests pour la route repo... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/ReportingContentRouteTest.py | .py | 572af215e1bf526b | 7.65 | 1 |
"""
Test d'intégration pour la route: resend email confirmation (/resend-email/)
"""
from django.test import TestCase, Client, tag
from django.urls import reverse
from django.contrib.auth import get_user_model
User = get_user_model()
@tag('integration')
class ResendEmailConfirmationRouteTest(TestCase):
"""Tests ... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/ResendEmailConfirmationRouteTest.py | .py | 71b1d5ea74b28d0a | 7.65 | 1 |
"""
Test d'intégration pour la route: robots.txt (/robots.txt)
"""
from django.test import TestCase, Client, tag
from django.urls import reverse
from django.contrib.auth import get_user_model
User = get_user_model()
@tag('integration')
class RobotsTxtRouteTest(TestCase):
"""Tests pour la route robots.txt"""
... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/RobotsTxtRouteTest.py | .py | 9fcb0021028bfb8a | 7.65 | 1 |
"""
Test d'intégration pour la route: send reset password (/reset-password)
"""
from unittest.mock import patch
from django.test import TestCase, Client, tag
from django.urls import reverse
from django.contrib.auth import get_user_model
User = get_user_model()
@tag('integration')
class SendResetPasswordRouteTest(Te... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/SendResetPasswordRouteTest.py | .py | 0158861d86d540d3 | 7.65 | 1 |
"""
Test d'intégration pour la route: set-language (/set-language/)
"""
from django.conf import settings
from django.test import TestCase, Client, tag
from django.urls import reverse
@tag('integration')
class SetLanguageRouteTest(TestCase):
"""Tests pour la route set_language en fonction de la langue de l'utilisa... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/SetLanguageRouteTest.py | .py | 2d89af0a1499043f | 7.65 | 1 |
"""
Test d'intégration pour la route: settings index (/account/settings/)
"""
from django.test import TestCase, Client, tag
from django.urls import reverse
from django.contrib.auth import get_user_model
User = get_user_model()
@tag('integration')
class SettingsIndexRouteTest(TestCase):
"""Tests pour la route set... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/SettingsIndexRouteTest.py | .py | 9ce829caff9f0ec1 | 7.65 | 1 |
"""
Test d'intégration pour la route: Soundboard partagé (/shared/<uuid:soundboard_uuid>/<str:token>)
"""
from django.test import TestCase, Client, tag
from django.urls import reverse
from django.contrib.auth import get_user_model
import uuid
User = get_user_model()
@tag('integration')
class SharedSoundboardRouteTes... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/SharedSoundboardRouteTest.py | .py | b2448dfaaf8e8360 | 7.65 | 1 |
"""
Test d'intégration pour la route: Streaming de musique partagée (/shared/<uuid:soundboard_uuid>/<str:token>/<uuid:playlist_uuid>/<int:music_id>/stream)
"""
from django.test import TestCase, Client, tag
from django.urls import reverse
from django.contrib.auth import get_user_model
import uuid
User = get_user_model(... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/SharedStreamMusicRouteTest.py | .py | db2968c18388658d | 7.65 | 1 |
"""
Test d'intégration pour la route: sitemap.xml (/sitemap.xml)
"""
from django.test import TestCase, Client, tag
from django.urls import reverse
from django.contrib.auth import get_user_model
User = get_user_model()
@tag('integration')
class SitemapXmlRouteTest(TestCase):
"""Tests pour la route sitemap.xml"""
... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/SitemapXmlRouteTest.py | .py | 3737da5f8bf29596 | 7.65 | 1 |
"""
Test d'intégration pour la route: soundboards list (/soundBoards/)
"""
from django.test import TestCase, Client, tag
from django.urls import reverse
from django.contrib.auth import get_user_model
User = get_user_model()
@tag('integration')
class SoundboardsListRouteTest(TestCase):
"""Tests pour la route soun... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/SoundboardsListRouteTest.py | .py | 4043d696365f2e7c | 7.65 | 1 |
"""
Test d'intégration pour la route: create soundboard (/soundBoards/new)
"""
from django.test import TestCase, Client, tag
from django.urls import reverse
from django.contrib.auth import get_user_model
User = get_user_model()
@tag('integration')
class SoundboardsNewRouteTest(TestCase):
"""Tests pour la route c... | chaBiselx/AmbianceBoard | app/main/TNR/TI/routing/SoundboardsNewRouteTest.py | .py | adabd44e33f274d2 | 7.65 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.