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 |
|---|---|---|---|---|---|---|
# Copyright 2024 Rapyuta Robotics
#
# 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 writ... | rapyuta-robotics/rapyuta-io-cli | riocli/auth/staging.py | .py | 24400f85b3d1b83b | 7.15 | 1 |
# Copyright 2025 Rapyuta Robotics
#
# 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 writ... | rapyuta-robotics/rapyuta-io-cli | riocli/auth/util.py | .py | 335d2cdfee81f814 | 7.15 | 1 |
from urllib.parse import quote
import requests
from yaml import safe_load
from riocli.utils import tabulate_data
DEFAULT_REPOSITORY = (
"https://rapyuta-robotics.github.io/rapyuta-charts/incubator/index.yaml" # noqa
)
# Azure Blob Storage s3bucket where helm charts are populated by rapyuta-charts CI on PR open/... | rapyuta-robotics/rapyuta-io-cli | riocli/chart/util.py | .py | 7c7f3de1e265a1fa | 7.15 | 1 |
from __future__ import annotations
from dataclasses import dataclass, field
from typing import Literal
# Type aliases for better readability
EnvironmentDict = dict[str, str | int | float]
DependsDict = dict[str, "DependsCondition"]
ServiceDict = dict[str, "Service"]
# Constants
DEFAULT_PULL_POLICY = "if_not_present"... | rapyuta-robotics/rapyuta-io-cli | riocli/compose/model.py | .py | 73940e1ee6256930 | 7.15 | 1 |
# Copyright 2024 Rapyuta Robotics
#
# 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 writ... | rapyuta-robotics/rapyuta-io-cli | riocli/config/context.py | .py | c44bcf54bd0d8d63 | 7.15 | 1 |
# Copyright 2024 Rapyuta Robotics
#
# 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 writ... | rapyuta-robotics/rapyuta-io-cli | riocli/configtree/diff.py | .py | 02601bd4e1636cb9 | 7.15 | 1 |
# Copyright 2024 Rapyuta Robotics
#
# 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 writ... | rapyuta-robotics/rapyuta-io-cli | riocli/configtree/import_keys.py | .py | dc770b44e24b2146 | 7.15 | 1 |
# Copyright 2024 Rapyuta Robotics
#
# 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 writ... | rapyuta-robotics/rapyuta-io-cli | riocli/configtree/merge.py | .py | 38c52d1e9a4eeaad | 7.15 | 1 |
"""
Image data contracts.
Defines structured interfaces for medical image data (NIfTI, NRRD, DICOM).
"""
from dataclasses import dataclass, field
from pathlib import Path
from typing import Optional, Tuple
import numpy as np
import SimpleITK as sitk
@dataclass
class ImageMetadata:
"""
Metadata for medical ... | alonsoJASL/imatools | src/imatools/contracts/image.py | .py | e89c2efa583b8e03 | 7.24 | 2 |
"""
Mesh data contracts.
Defines structured interfaces for 3D mesh data (VTK polydata, unstructured grids).
"""
from dataclasses import dataclass
from pathlib import Path
from typing import Literal, Optional
import numpy as np
import vtk
MeshType = Literal["polydata", "ugrid", "stl"]
@dataclass
class MeshMetadata... | alonsoJASL/imatools | src/imatools/contracts/mesh.py | .py | 0828de8170708666 | 7.24 | 2 |
"""
Operation contracts.
Defines structured interfaces for image/mesh processing operations.
"""
from dataclasses import dataclass
from enum import Enum
from typing import Any, Literal, Optional
class MorphOperationType(str, Enum):
"""Morphological operation types."""
DILATE = "dilate"
ERODE = "erode"
... | alonsoJASL/imatools | src/imatools/contracts/operations.py | .py | ca4f4b0a00ae4795 | 7.24 | 2 |
"""
Mesh-report data contracts.
Back the `imatools-report` CLI: a mesh plus OPTIONAL per-anatomy data, so a
partial input renders only the anatomies actually present (a missing field is
a first-class "absent", not a crash), and rendering parameters kept separate
from the data being rendered.
"""
from dataclasses impo... | alonsoJASL/imatools | src/imatools/contracts/report.py | .py | 6a430c3a4d355ae6 | 7.24 | 2 |
# src/imatools/core/mesh_topology.py
"""Graph-based mesh connectivity analysis migrated from
``imatools.common.vtktools`` (M2a-2; zero-caller-but-KEEP functions relocated
per Jose's M2 review — see MIGRATION_M2.md).
Bridge/thin-region detection over a triangle-mesh cell-adjacency graph, built
on ``networkx``. The 5 fu... | alonsoJASL/imatools | src/imatools/core/mesh_topology.py | .py | 16b33a2c73c720c2 | 7.24 | 2 |
"""Pure scar-quantification logic migrated from ``imatools.common.scarqtools`` (M1.6a/c).
All functions here are stateless and accept explicit arguments — no class state, no
singletons. ``imatools.cli.scar`` is the CLI/state layer (M1.6c); this module holds
the deterministic numeric core that is golden-backed.
``get_... | alonsoJASL/imatools | src/imatools/core/scar.py | .py | 8619824dffd96f1f | 7.24 | 2 |
"""Composed, pure segmentation-editing workflows (sitk.Image -> sitk.Image, no I/O)."""
from typing import Tuple
import SimpleITK as sitk
from imatools.core import image as core_image
from imatools.core import label as core_label
def morph_label(image, label, operation, radius=3, kernel="ball") -> sitk.Image:
... | alonsoJASL/imatools | src/imatools/core/segmentation.py | .py | 6420d7452fe56567 | 7.24 | 2 |
"""Path helper utilities.
Migrated from ``imatools.common.ioutils`` (functions: ext, get_subfolders,
find_file, slot_in_path_hrchy, num2padstr; that shim module was deleted in M2)
and from ``imatools.core.io`` (check_file_exists) as part of T2c3.
``imatools.core.io`` still re-exports ``check_file_exists`` from here fo... | alonsoJASL/imatools | src/imatools/io/paths.py | .py | 6868a010cd879256 | 7.24 | 2 |
"""Scar-quantification file I/O migrated from ``imatools.common.scarqtools`` (M1.6a/c).
Functions here read/write the data formats used by the scar pipeline:
- ``prodStats.txt`` — blood-pool statistics and threshold scores.
- ``options.json`` — scar options for CEMRG MitkCemrgScarProjectionOptions.
- ``state.json`` — ... | alonsoJASL/imatools | src/imatools/io/scar_io.py | .py | c43a3bace7a73ab6 | 7.24 | 2 |
# src/imatools/parsers/dotmesh.py
"""Parsers for Biosense Webster .mesh files and CARP-style text arrays.
Functions migrated from:
- ``imatools.common.vtktools`` — ``parse_dotmesh_file``
- ``imatools.convert_dotmesh`` — ``save_array``
The old import paths still resolve via bottom-of-file shims in the source
modules ... | alonsoJASL/imatools | src/imatools/parsers/dotmesh.py | .py | f7bd19e1a41adc87 | 7.24 | 2 |
"""
Generic dict-plotting and scar-stats-to-dataframe helpers.
Stateless data-in/figure-or-dataframe-out functions, plus one small file
reader (``extract_scar_stats_from_file``) that was already file-path-based
in ``plotutils.py`` (kept verbatim — behaviour-preserving relocation only,
no new I/O added).
"""
import os... | alonsoJASL/imatools | src/imatools/render/plots.py | .py | 7c518129527ba588 | 7.24 | 2 |
"""
VTK-to-PNG offscreen rendering.
Stateless: takes VTK file paths + render parameters, produces PNG image(s).
The low-level VTK reader/mapper/actor helpers (``create_vtk_reader``,
``create_vtk_mapper``, ``create_vtk_actor``, ``center_vtk_data``) are defined
locally in this module.
"""
import os
import numpy as np
... | alonsoJASL/imatools | src/imatools/render/vtk_png.py | .py | b502326f184c019c | 7.24 | 2 |
#!/usr/bin/env python3
"""
Golden-master capture harness — records master's behaviour as the test contract.
This is the **orchestrator**: it discovers capture cases, runs each function from the
master worktree against the shared synthetic fixtures, and serializes the output into
``tests/golden/``. It owns I/O, paths, ... | alonsoJASL/imatools | tests/_capture_golden.py | .py | ace58b52eaa48628 | 7.74 | 2 |
"""
Contains functions to calculate the endmembers of common minerals
e.g. olivine, feldspar, clinopyroxene and spinel.
"""
import numpy as np
import pandas as pd
from .cations import calc_apfu
from .fe_partition import calc_Fe2O3_Droop
from .probe import ProbeData
def calc_ol_EM(cations: pd.DataFrame) -> pd.DataFra... | fboschetty/ProbeDataTools | src/probedatatools/endmembers.py | .py | 3749e3558e0e6dd5 | 7.15 | 1 |
"""
Core data model for electron-microprobe data.
`ProbeData` associates a probe-analysis DataFrame with metadata required
to process its analytical species.
"""
from __future__ import annotations
from collections.abc import Sequence
from dataclasses import dataclass
from importlib.resources import files
import pan... | fboschetty/ProbeDataTools | src/probedatatools/probe.py | .py | 52013417d54f0ace | 7.15 | 1 |
"""Small general-purpose utilities used by ProbeDataTools."""
from __future__ import annotations
from collections.abc import Callable, Sequence
import numpy as np
import pandas as pd
def aggregate_repeats(
data: pd.DataFrame,
group_by: Sequence[str],
numeric_agg: str | Callable = "mean",
) -> pd.DataFr... | fboschetty/ProbeDataTools | src/probedatatools/utils.py | .py | 5eab14e43a8497f8 | 7.15 | 1 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Proxy for fw-update RPCs.
Forwards all firmware update RPC calls to wb-mqtt-serial and logs a deprecation warning.
Clients should call wb-mqtt-serial/fw-update directly.
"""
from jsonrpc.exceptions import JSONRPCDispatchException
from mqttrpc import client as rpccli... | wirenboard/wb-device-manager | wb/device_manager/fw_update_proxy.py | .py | 22211d7cd362d326 | 7 | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from dataclasses import dataclass
from typing import Optional
@dataclass
class StateError:
"""
Represents an error published in the /wb-device-manager/state topic.
Attributes:
id (str): The ID of the error.
message (str): The error message.
... | wirenboard/wb-device-manager | wb/device_manager/state_error.py | .py | 503bb91f8ace3913 | 7 | 0 |
import asyncio
import json
import os
import time
from typing import Optional
import aiohttp
from utils.creds import TwitchCreds
from utils.logger import Log
TOKEN_URL = 'https://id.twitch.tv/oauth2/token'
# refresh this many seconds before the token actually expires
EXPIRY_BUFFER = 300
class TwitchToken:
"""Man... | sam-hudson02/TwitchSpotifyBot | src/utils/twitch_token.py | .py | a356553cd56f2fa4 | 7.39 | 5 |
"""The public command-line entry point for FFBayes."""
from __future__ import annotations
import argparse
import importlib
import sys
from dataclasses import dataclass
from typing import Iterable, Sequence
@dataclass(frozen=True)
class CommandSpec:
"""Description of a CLI subcommand."""
name: str
modul... | nicholas-camarda/ffbayes | src/ffbayes/cli.py | .py | 457368a4f8a19646 | 7 | 0 |
"""Immutable-style live draft state transitions.
The dashboard keeps one instance of :class:`DraftState` per league. A state
transition returns a new value rather than mutating the previous one, which
makes it possible for the service to validate and commit a complete action
atomically.
"""
from __future__ import an... | nicholas-camarda/ffbayes | src/ffbayes/draft_2026/draft_state.py | .py | 1365346b16324b4f | 7 | 0 |
"""This module contains all of the functions and Flask routes
which renders all the content.
"""
import hashlib
import platform
from flask import Flask, jsonify, render_template, send_from_directory
import psutil
from waitress import serve
app = Flask(__name__, static_folder=None)
def hash_color(input_string):
... | bcbrookman/docker-buoy | app.py | .py | 47f4d897b8160267 | 7.15 | 1 |
import logging
import random
import sys
import time
import typing
import apache_beam as beam
from apache_beam import RestrictionProvider
from apache_beam.io.iobase import RestrictionTracker
from apache_beam.io.restriction_trackers import OffsetRange, OffsetRestrictionTracker
from apache_beam.io.watermark_estimators im... | iht/splittable-dofns-python | mydofns/synthetic_sdfn_streaming.py | .py | da9dc2b295b64b9c | 7.24 | 2 |
import json
from ksyun.common.exception.ksyun_sdk_exception import KsyunSDKException
from ksyun.common.abstract_client import AbstractClient
class ActiontrailClient(AbstractClient):
_apiVersion = '2019-04-01'
_endpoint = 'actiontrail.api.ksyun.com'
_service = 'actiontrail'
def ListOperateLogs(self, r... | kingsoftcloud/sdk-python | ksyun/client/actiontrail/v20190401/client.py | .py | 876567fd076c7635 | 7.15 | 1 |
import json
from ksyun.common.exception.ksyun_sdk_exception import KsyunSDKException
from ksyun.common.abstract_client import AbstractClient
class BillClient(AbstractClient):
_apiVersion = '2022-06-01'
_endpoint = 'bill.api.ksyun.com'
_service = 'bill'
def GetMonthConsume(self, request):
"""获... | kingsoftcloud/sdk-python | ksyun/client/bill/v20220601/client.py | .py | 348296e07760d934 | 7.15 | 1 |
from ksyun.common.abstract_model import AbstractModel
class GetMonthConsumeRequest(AbstractModel):
"""GetMonthConsume请求参数结构体
"""
def __init__(self):
r"""获取日耗月账单
:param BillMonth: 必选参数,账单月份必选参数,账单月份YYYY-MM
:type PathPrefix: String
"""
self.BillMonth = None
def ... | kingsoftcloud/sdk-python | ksyun/client/bill/v20220601/models.py | .py | 2ded02459dbc8e94 | 7.15 | 1 |
from ksyun.common.abstract_model import AbstractModel
class QueryItemBillsRequest(AbstractModel):
"""QueryItemBills请求参数结构体
"""
def __init__(self):
r"""查询计费项账单
:param CustomerBillMonth: 账期
:type PathPrefix: Int
:param ProductGroupCode: 产品线CODE
:type PathPrefix: Strin... | kingsoftcloud/sdk-python | ksyun/client/bill_union/v20250801/models.py | .py | e3ac726c1904b2b6 | 7.15 | 1 |
from ksyun.common.abstract_model import AbstractModel
class GetRefreshOrPreloadTaskRequest(AbstractModel):
"""GetRefreshOrPreloadTask请求参数结构体
"""
def __init__(self):
r"""刷新预热进度查询接口
:param DomainIds: DomainIds
:type PathPrefix: String
"""
self.DomainIds = None
de... | kingsoftcloud/sdk-python | ksyun/client/cdn/v20160901/models.py | .py | 3530004a6520e984 | 7.15 | 1 |
import collections
import itertools
import re
import sys
import typing
from importlib.metadata import entry_points
from .base import BaseParser
PYTHON_VERSION = sys.version_info
if PYTHON_VERSION[0] == 3 and PYTHON_VERSION[1] < 10:
def get_entry_points():
return entry_points().get("nibbler_parsers", [])... | Big-Dig-Data/celus-nibbler | src/celus_nibbler/parsers/__init__.py | .py | 5c781cb8fa6b117b | 7.15 | 1 |
import copy
import datetime
import logging
import typing
from celus_nibbler.coordinates import Coord, CoordRange, Direction, RelativeTo, Value
from celus_nibbler.data_headers import DataHeaders
from celus_nibbler.errors import TableException
from celus_nibbler.parsers.base import BaseHeaderArea, BaseTabularParser
from... | Big-Dig-Data/celus-nibbler | src/celus_nibbler/parsers/non_counter/celus_format.py | .py | e6d161d6e32eab53 | 7.15 | 1 |
# coding: utf-8
"""
Copyright 2026 Calcasa B.V.
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... | calcasa/api-python | calcasa/api/models/aanvraagdoel.py | .py | 159492042de14e7e | 7.15 | 1 |
# coding: utf-8
"""
Copyright 2026 Calcasa B.V.
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... | calcasa/api-python | calcasa/api/models/adres.py | .py | 7209c7aae8589f43 | 7.15 | 1 |
# coding: utf-8
"""
Copyright 2026 Calcasa B.V.
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... | calcasa/api-python | calcasa/api/models/adres_info.py | .py | dedfe2446f9f6d9d | 7.15 | 1 |
# coding: utf-8
"""
Copyright 2026 Calcasa B.V.
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... | calcasa/api-python | calcasa/api/models/bestemmingsdata.py | .py | fe55562abf0964ef | 7.15 | 1 |
# coding: utf-8
"""
Copyright 2026 Calcasa B.V.
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... | calcasa/api-python | calcasa/api/models/bodem_status_type.py | .py | dc332d98c94c7364 | 7.15 | 1 |
# coding: utf-8
"""
Copyright 2026 Calcasa B.V.
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... | calcasa/api-python | calcasa/api/models/bodemdata.py | .py | b34e45cc05f1e3d4 | 7.15 | 1 |
# coding: utf-8
"""
Copyright 2026 Calcasa B.V.
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... | calcasa/api-python | calcasa/api/models/business_rules_code.py | .py | 00b502eeafe7d442 | 7.15 | 1 |
# coding: utf-8
"""
Copyright 2026 Calcasa B.V.
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... | calcasa/api-python | calcasa/api/models/business_rules_problem_details.py | .py | ccf2b04eb87ef62c | 7.15 | 1 |
# coding: utf-8
"""
Copyright 2026 Calcasa B.V.
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... | calcasa/api-python | calcasa/api/models/callback.py | .py | 372cb801d7c1f271 | 7.15 | 1 |
# coding: utf-8
"""
Copyright 2026 Calcasa B.V.
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... | calcasa/api-python | calcasa/api/models/callback_authentication.py | .py | ef5f4f723702db18 | 7.15 | 1 |
# coding: utf-8
"""
Copyright 2026 Calcasa B.V.
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... | calcasa/api-python | calcasa/api/models/callback_inschrijving.py | .py | 85b3062b753ac501 | 7.15 | 1 |
# coding: utf-8
"""
Copyright 2026 Calcasa B.V.
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... | calcasa/api-python | calcasa/api/models/cbs_indeling.py | .py | 329cc497a69ea773 | 7.15 | 1 |
# coding: utf-8
"""
Copyright 2026 Calcasa B.V.
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... | calcasa/api-python | calcasa/api/models/compression_type.py | .py | 098a5c21329a571f | 7.15 | 1 |
# coding: utf-8
"""
Copyright 2026 Calcasa B.V.
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... | calcasa/api-python | calcasa/api/models/content_too_large_problem_details.py | .py | b9a1ac5fb9461634 | 7.15 | 1 |
# coding: utf-8
"""
Copyright 2026 Calcasa B.V.
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... | calcasa/api-python | calcasa/api/models/create_inbound_file_set_request.py | .py | acdb5c55cdfe1655 | 7.15 | 1 |
# coding: utf-8
"""
Copyright 2026 Calcasa B.V.
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... | calcasa/api-python | calcasa/api/models/deel_waardering_webhook_payload.py | .py | c44846fa1037d2ed | 7.15 | 1 |
# coding: utf-8
"""
Copyright 2026 Calcasa B.V.
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... | calcasa/api-python | calcasa/api/models/energielabel.py | .py | c32a1f8a2e3424f3 | 7.15 | 1 |
# coding: utf-8
"""
Copyright 2026 Calcasa B.V.
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... | calcasa/api-python | calcasa/api/models/energielabel_data.py | .py | c5c6987cecd02249 | 7.15 | 1 |
# coding: utf-8
"""
Copyright 2026 Calcasa B.V.
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... | calcasa/api-python | calcasa/api/models/expired_valuation_problem_details.py | .py | fd975788b9be7940 | 7.15 | 1 |
# coding: utf-8
"""
Copyright 2026 Calcasa B.V.
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... | calcasa/api-python | calcasa/api/models/factuur.py | .py | 7a17fb17deccbe1e | 7.15 | 1 |
# coding: utf-8
"""
Copyright 2026 Calcasa B.V.
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... | calcasa/api-python | calcasa/api/models/file_content_error.py | .py | 7bb299fb09caa062 | 7.15 | 1 |
# coding: utf-8
"""
Copyright 2026 Calcasa B.V.
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... | calcasa/api-python | calcasa/api/models/file_info.py | .py | d5f6f7dadc77408b | 7.15 | 1 |
# coding: utf-8
"""
Copyright 2026 Calcasa B.V.
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... | calcasa/api-python | calcasa/api/models/file_notice.py | .py | 4914107b5e76a9d2 | 7.15 | 1 |
# coding: utf-8
"""
Copyright 2026 Calcasa B.V.
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... | calcasa/api-python | calcasa/api/models/file_set.py | .py | fb4209affdf0d3a7 | 7.15 | 1 |
# coding: utf-8
"""
Copyright 2026 Calcasa B.V.
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... | calcasa/api-python | calcasa/api/models/file_set_limits.py | .py | 71fe6464e798af66 | 7.15 | 1 |
# coding: utf-8
"""
Copyright 2026 Calcasa B.V.
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... | calcasa/api-python | calcasa/api/models/foto.py | .py | e8629a6f177a2e26 | 7.15 | 1 |
# coding: utf-8
"""
Copyright 2026 Calcasa B.V.
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... | calcasa/api-python | calcasa/api/models/frontend_deeplinks.py | .py | c6c52c2c25b837f9 | 7.15 | 1 |
# coding: utf-8
"""
Copyright 2026 Calcasa B.V.
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... | calcasa/api-python | calcasa/api/models/fundering_data_bron.py | .py | fa49d8bab2127e3d | 7.15 | 1 |
# coding: utf-8
"""
Copyright 2026 Calcasa B.V.
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... | calcasa/api-python | calcasa/api/models/fundering_herstel_type.py | .py | 686bedf6c16c3ed8 | 7.15 | 1 |
#!/usr/bin/env python3
# SPDX-License-Identifier: MIT
# Copyright (C) 2023 iris-GmbH infrared & intelligent sensors
import os
import tarfile
import click
import shutil
import logging
import tempfile
from pathlib import Path
from gitlab import Gitlab
from gitlab.v4.objects.projects import Project
from gitlab.exception... | iris-GmbH/iris-kas | utils/create_gitlab_release/src/create_gitlab_release.py | .py | 57aee61932082513 | 7 | 0 |
#!/usr/bin/env python3
"""
Simple CLI tool to build the photo site.
"""
import argparse
import http.server
import os
import shutil
import socketserver
import sys
from jinja2 import Environment, FileSystemLoader
import photosite
def serve_site(port=8000):
"""Serve the site directory on localhost."""
os.chdir('... | thaen/photosite | build_site.py | .py | 1ed434237bf6d7fb | 7 | 0 |
"""
Simple photo gallery site generator that processes images only when necessary.
"""
import os
import shutil
import subprocess
import calendar
from datetime import datetime
from glob import glob
from exif import Image
from jinja2 import Environment, FileSystemLoader
def ensure_dir(path):
"""Create directory if i... | thaen/photosite | photosite.py | .py | ed025a6d77f5e4bf | 7 | 0 |
'''
Build content/static/trivia/bank.js from the cached Trivia API response.
The cache is the raw API shape. The game wants six categories, a couple
of which are several API categories merged, and it wants the fields under
the names app.js reads. Doing both here means the browser loads a bank it
can use directly, wi... | thaen/photosite | scripts/build_trivia_bank.py | .py | 8ed5bcbec908a912 | 7 | 0 |
"""Record successfully rebuilt deployable doit targets."""
import os
from pathlib import Path
from doit.reporter import ConsoleReporter
class UploadListReporter(ConsoleReporter):
"""Append successful file targets below site/ to PHOTOSITE_UPLOAD_LIST."""
def __init__(self, outstream, options=None):
... | thaen/photosite | scripts/release_reporter.py | .py | afd1b1dc7814f1bc | 7 | 0 |
import importlib.util
import unittest
from pathlib import Path
MODULE_PATH = Path(__file__).with_name("trivia_artwork.py")
SPEC = importlib.util.spec_from_file_location("trivia_artwork", MODULE_PATH)
artwork = importlib.util.module_from_spec(SPEC)
SPEC.loader.exec_module(artwork)
ROOT = MODULE_PATH.parent.parent
ASS... | thaen/photosite | scripts/test_trivia_artwork.py | .py | 311f60be89fbb15b | 7.5 | 0 |
import unittest
import os
import shutil
import calendar
from glob import glob
from jinja2 import Environment, FileSystemLoader
import photosite
class TestNewPhotoSite(unittest.TestCase):
def setUp(self):
"""Set up test fixtures before each test method."""
# Clean up any existing directories
... | thaen/photosite | test_new_photosite.py | .py | 141d44fe56515fb5 | 7.5 | 0 |
import unittest
import os
import shutil
from glob import glob
import subprocess
import sys
from dodo import _sitepath, _largepath, _thumbpath
# Get the doit executable path
def check_doit_in_path():
"""Check if doit is available in PATH"""
try:
subprocess.run(['doit', '--version'], capture_output=True,... | thaen/photosite | test_photosite.py | .py | ebc746610f4d5f96 | 7.5 | 0 |
"""Home team builder page."""
import logging
import pandas as pd
import streamlit as st
from src.config import DIFFICULTY_PRESETS, PLAYER_COLUMNS, configure_page
from src.database.connection import (
DatabaseConnectionError,
load_data,
)
from src.database.queries import get_players_by_full_names, search_play... | HatmanStack/streamlit-nba | pages/1_home_team.py | .py | 56de599a89e5094d | 7 | 0 |
"""Game play page with prediction and scoring."""
import logging
import random
import pandas as pd
import streamlit as st
from src.config import (
DEFAULT_LOSER_SCORE,
DEFAULT_WINNER_SCORE,
LOSER_SCORE_RANGE,
MAX_QUERY_ATTEMPTS,
STAT_COLUMNS,
TEAM_SIZE,
WINNER_SCORE_RANGE,
configure_p... | HatmanStack/streamlit-nba | pages/2_play_game.py | .py | f6c6e6cab53d32c5 | 7 | 0 |
#!/usr/bin/env python3
"""NBA game winner prediction model training script.
This script trains a neural network to predict game winners based on
team statistics. It uses RandomizedSearchCV to find optimal hyperparameters.
Usage:
python scripts/compile_model.py
"""
import logging
from pathlib import Path
import ... | HatmanStack/streamlit-nba | scripts/compile_model.py | .py | 350b931d73dbb5fd | 7 | 0 |
"""Application configuration, constants, and logging setup."""
import logging
from typing import Final
# Database column names for player data
PLAYER_COLUMNS: Final[list[str]] = [
"FULL_NAME",
"AST",
"BLK",
"DREB",
"FG3A",
"FG3M",
"FG3_PCT",
"FGA",
"FGM",
"FG_PCT",
"FTA",
... | HatmanStack/streamlit-nba | src/config.py | .py | 10eee1fceedd83e2 | 7 | 0 |
"""Local CSV data management with error handling."""
import logging
from pathlib import Path
import pandas as pd
logger = logging.getLogger("streamlit_nba")
# Resolve path relative to this module
CSV_PATH = Path(__file__).resolve().parent.parent.parent / "snowflake_nba.csv"
class DatabaseConnectionError(Exception... | HatmanStack/streamlit-nba | src/database/connection.py | .py | 1ccfab9274e0c573 | 7 | 0 |
"""Local data queries using pandas on loaded CSV data."""
import logging
import pandas as pd
from src.config import MAX_QUERY_ATTEMPTS, PLAYER_COLUMNS
from src.database.connection import QueryExecutionError
logger = logging.getLogger("streamlit_nba")
def search_player_by_name(df: pd.DataFrame, name: str) -> list[... | HatmanStack/streamlit-nba | src/database/queries.py | .py | 3e135c76dc966392 | 7 | 0 |
"""Machine learning model loading and prediction."""
import logging
from pathlib import Path
import numpy as np
from tensorflow.keras.models import Model, load_model
from src.config import STAT_COLUMNS, TEAM_SIZE
logger = logging.getLogger("streamlit_nba")
# Default model path relative to the project root
DEFAULT_... | HatmanStack/streamlit-nba | src/ml/model.py | .py | 254ba37770343bb0 | 7 | 0 |
"""Pydantic models for game data."""
from typing import ClassVar
from pydantic import BaseModel, Field, field_validator
from src.config import DIFFICULTY_PRESETS
class DifficultySettings(BaseModel):
"""Model for game difficulty settings."""
VALID_PRESETS: ClassVar[set[str]] = set(DIFFICULTY_PRESETS.keys()... | HatmanStack/streamlit-nba | src/models/player.py | .py | 5b822c51122a3869 | 7 | 0 |
"""Session state management for the Streamlit application."""
import logging
from typing import cast
import pandas as pd
import streamlit as st
from src.config import DIFFICULTY_PRESETS
logger = logging.getLogger("streamlit_nba")
# Default difficulty preset
DEFAULT_DIFFICULTY = "Regular"
def init_session_state()... | HatmanStack/streamlit-nba | src/state/session.py | .py | 8edf89d0561d927b | 7 | 0 |
"""Input validation for user-provided data."""
import re
from pydantic import BaseModel, Field, field_validator
class PlayerSearchInput(BaseModel):
"""Validated player search input."""
search_term: str = Field(
...,
min_length=1,
max_length=100,
description="Player name sear... | HatmanStack/streamlit-nba | src/validation/inputs.py | .py | a4a628ea2a1e2fd5 | 7 | 0 |
"""Pytest fixtures for NBA Streamlit application tests."""
from typing import Any
import pandas as pd
import pytest
@pytest.fixture
def sample_player_data() -> list[tuple[Any, ...]]:
"""Create sample player data matching database schema.
Returns:
List of tuples with sample player data
"""
r... | HatmanStack/streamlit-nba | tests/conftest.py | .py | c080142ac193f53c | 7.5 | 0 |
"""Tests for database module using local pandas data."""
from unittest.mock import patch
import pandas as pd
import pytest
from src.config import PLAYER_COLUMNS
from src.database.connection import (
DatabaseConnectionError,
QueryExecutionError,
get_data,
load_data,
)
from src.database.queries import ... | HatmanStack/streamlit-nba | tests/test_database.py | .py | 5600f2d0368ecc97 | 7.5 | 0 |
"""Tests for Pydantic models."""
import pytest
from src.config import DIFFICULTY_PRESETS
from src.models.player import DifficultySettings
class TestDifficultySettings:
"""Tests for DifficultySettings model."""
@pytest.mark.parametrize("preset_name", list(DIFFICULTY_PRESETS.keys()))
def test_from_preset... | HatmanStack/streamlit-nba | tests/test_models.py | .py | dc5814a69765e507 | 7.5 | 0 |
"""Tests for input validation module."""
import pytest
from src.validation.inputs import (
PlayerSearchInput,
is_valid_search_term,
validate_search_term,
)
class TestPlayerSearchInput:
"""Tests for PlayerSearchInput validation."""
def test_valid_simple_name(self) -> None:
"""Test valid ... | HatmanStack/streamlit-nba | tests/test_validation.py | .py | 659146d7f678eb0c | 7.5 | 0 |
#!/usr/bin/python2
#-*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2014 Federal Office of Topography swisstopo, Wabern, CH and Aaron Schmocker
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software... | mmznrSTAT/wassertemperaturen | ch1903_wgs84.py | .py | a97ac5fd54d8fc3f | 7 | 0 |
from collections.abc import Sequence
from json import dumps
from cbltest.api.error import CblTestError
from .api.cluster import CouchbaseCluster
from .api.couchbaseserver import CouchbaseServer
from .api.edgeserver import EdgeServer
from .api.syncgateway import SyncGateway
from .api.syncgatewaycluster import SyncGate... | couchbaselabs/couchbase-lite-tests | client/src/cbltest/__init__.py | .py | 6a799068a969d0e2 | 7.74 | 2 |
from abc import ABC
from types import FunctionType
import pytest
from packaging.specifiers import SpecifierSet
from packaging.version import Version
from cbltest.api.syncgateway import SyncGateway
from cbltest.api.testserver import TestServer
from cbltest.globals import CBLPyTestGlobal
from cbltest.logging import cbl... | couchbaselabs/couchbase-lite-tests | client/src/cbltest/api/cbltestclass.py | .py | a659828f60f3d02c | 7.74 | 2 |
from collections.abc import Sequence
from json import dumps, loads
from pathlib import Path
from typing import cast
import aiofiles
from opentelemetry.trace import get_tracer
from cbltest.api.couchbaseserver import CouchbaseServer
from cbltest.api.error import CblTestError
from cbltest.api.syncgateway import Database... | couchbaselabs/couchbase-lite-tests | client/src/cbltest/api/cluster.py | .py | 5f5f3718cba07f6b | 7.74 | 2 |
from enum import Enum
from typing import Any
from cbltest.api.jsonserializable import JSONSerializable
class DocumentEntry(JSONSerializable):
"""
A class for recording the fully qualified name of a document in any database
"""
def __init__(self, collection: str, id: str) -> None:
self.collec... | couchbaselabs/couchbase-lite-tests | client/src/cbltest/api/database_types.py | .py | 7f83e1e456888614 | 7.74 | 2 |
from __future__ import annotations
from typing import Final
class ErrorDomain:
"""An enum representing the domain of an error returned by the server"""
TESTSERVER: Final[str] = "TESTSERVER"
"""The test server itself encountered an error (not a library bug)"""
CBL: Final[str] = "CBL"
"""High lev... | couchbaselabs/couchbase-lite-tests | client/src/cbltest/api/error_types.py | .py | 498a80111874aa2d | 7.74 | 2 |
import random
import sys
import time
import uuid
from collections.abc import Callable
from concurrent.futures import ThreadPoolExecutor
from typing import Any
class JSONGenerator:
"""
Utility class to generate and update reproducible JSON documents for testing.
Usage:
gen = JSONGenerator(size=100... | couchbaselabs/couchbase-lite-tests | client/src/cbltest/api/json_generator.py | .py | 29cd423a26d5c58d | 7.74 | 2 |
from abc import ABC, abstractmethod
from json import dumps
from typing import Any
class JSONSerializable(ABC):
"""A class that can be conveniently serialized to pretty JSON"""
def serialize(self) -> str:
"""Serializes the object into a pretty formatted JSON string"""
def fallback_serializer(... | couchbaselabs/couchbase-lite-tests | client/src/cbltest/api/jsonserializable.py | .py | 91ac6d06f09faf43 | 7.74 | 2 |
from typing import cast
from opentelemetry.trace import get_tracer
from cbltest.api.database import Database
from cbltest.api.x509_certificate import CertKeyPair, create_leaf_certificate
from cbltest.logging import cbl_error, cbl_trace
from cbltest.requests import TestServerRequestType
from cbltest.response_types imp... | couchbaselabs/couchbase-lite-tests | client/src/cbltest/api/listener.py | .py | 5821d61caf745242 | 7.74 | 2 |
import asyncio
from datetime import timedelta
from time import time
from typing import cast
from opentelemetry.trace import get_tracer
from cbltest.api.database import Database
from cbltest.api.error import CblTestError, CblTimeoutError
from cbltest.api.multipeer_replicator_types import (
MultipeerReplicatorAuthe... | couchbaselabs/couchbase-lite-tests | client/src/cbltest/api/multipeer_replicator.py | .py | 78b88b56791d161a | 7.74 | 2 |
from abc import abstractmethod
from enum import Flag, auto
from typing import Any, cast
from cbltest.api.jsonserializable import JSONSerializable
from cbltest.api.x509_certificate import CertKeyPair
class MultipeerTransportType(Flag):
"""The transport types supported by the Multipeer Replicator"""
WIFI = au... | couchbaselabs/couchbase-lite-tests | client/src/cbltest/api/multipeer_replicator_types.py | .py | 89ddc52ec96f2e90 | 7.74 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.