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 |
|---|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2021, 2022, 2025 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""REANA-Commons job utils."""
import base64
import re
from reana_commons.config ... | reanahub/reana-commons | reana_commons/job_utils.py | .py | 8b6122e5d0e53ade | 7.3 | 3 |
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2022, 2024, 2026 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""REANA Kubernetes-Kerberos configuration."""
from collections import namedtuple... | reanahub/reana-commons | reana_commons/k8s/kerberos.py | .py | c092211f48fa62c5 | 7.3 | 3 |
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2019, 2020, 2021, 2023 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""REANA Kubernetes volumes."""
import os
from kubernetes.client.rest impo... | reanahub/reana-commons | reana_commons/k8s/volumes.py | .py | 1ef5219f24d767c0 | 7.3 | 3 |
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2018, 2019, 2020, 2021, 2022, 2023 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""REANA-Commons module to manage AMQP connections on REANA."""
... | reanahub/reana-commons | reana_commons/publisher.py | .py | 92c50d247b7e6273 | 7.3 | 3 |
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2021, 2022, 2023, 2024, 2026 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""REANA Snakemake Workflow utils."""
import os
import sys
from itert... | reanahub/reana-commons | reana_commons/snakemake.py | .py | 0dd8efc8187e3a56 | 7.3 | 3 |
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2022, 2023 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""REANA-Commons workflow specification utils."""
import json
import logging
import os
... | reanahub/reana-commons | reana_commons/specification.py | .py | 240e2663906a7685 | 7.8 | 3 |
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2026 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Test helpers around :class:`reana_commons.api_client.BaseAPIClient`."""
from __future__ im... | reanahub/reana-commons | reana_commons/testing/api_client.py | .py | 2147cadb023765db | 7.8 | 3 |
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""REANA-Commons utils."""
import datetime
imp... | reanahub/reana-commons | reana_commons/utils.py | .py | c58e0ddce675b0df | 7.3 | 3 |
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2022 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""REANA-Commons compute backend validation."""
from typing import Dict, List, Optional
from... | reanahub/reana-commons | reana_commons/validation/compute_backends.py | .py | f9bca79ef17e2a9d | 7.3 | 3 |
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2026 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""REANA-Commons Dask resources validation."""
from typing import Dict
from reana_commons.er... | reanahub/reana-commons | reana_commons/validation/dask.py | .py | 50bab9044c66a4f3 | 7.3 | 3 |
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2026 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Offline runtime-environment checks.
The server reports environment identities and reproduc... | reanahub/reana-commons | reana_commons/validation/environments.py | .py | e7535eb3f9218bd2 | 7.3 | 3 |
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2026 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Utilities for extracting container images from REANA workflow specifications."""
from typi... | reanahub/reana-commons | reana_commons/validation/images.py | .py | 8064b8f67c44c8e2 | 7.3 | 3 |
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2026 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
r"""Aggregate REANA workflow specification validation into a structured report.
This module r... | reanahub/reana-commons | reana_commons/validation/report.py | .py | fa6a5c42986f884a | 7.3 | 3 |
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2022, 2023, 2026 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""REANA-Commons validation utilities."""
import json
import logging
import math
... | reanahub/reana-commons | reana_commons/validation/utils.py | .py | 9699331873203655 | 7.3 | 3 |
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2021 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""REANA-Commons workflow engine common utils."""
import os
import base64
import json
import ... | reanahub/reana-commons | reana_commons/workflow_engine.py | .py | 653b3c30708180d4 | 7.3 | 3 |
# This file is part of REANA.
# Copyright (C) 2022, 2023, 2024, 2026 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Utilities to manage files in a workspace."""
import errno
import os
import re
import stat
from path... | reanahub/reana-commons | reana_commons/workspace.py | .py | b6c769c39383db62 | 7.3 | 3 |
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2021, 2022 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""REANA Yadage Workflow utils."""
import os
import copy
import yadageschemas
from jsons... | reanahub/reana-commons | reana_commons/yadage.py | .py | f997ce98ee67beeb | 7.3 | 3 |
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2018, 2019, 2021, 2022, 2023, 2024 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Pytest configuration for REANA-Commons."""
import pytest
fro... | reanahub/reana-commons | tests/conftest.py | .py | 8b13bdb3668fdbc2 | 7.8 | 3 |
# This file is part of REANA.
# Copyright (C) 2024, 2026 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
from uuid import uuid4
from reana_commons.k8s.secrets import Secret, UserSecrets
from reana_commons.k8s.kerberos i... | reanahub/reana-commons | tests/k8s/test_kerberos.py | .py | 1a72cc22e1709c89 | 7.8 | 3 |
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2019, 2020, 2021, 2024 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
import json
from uuid import uuid4
import pytest
from kubernetes import cli... | reanahub/reana-commons | tests/k8s/test_secrets.py | .py | f013203785b6052f | 7.8 | 3 |
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2026 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""REANA-Commons API client tests."""
import io
import json
import sys
from unittest import m... | reanahub/reana-commons | tests/test_api_client.py | .py | d5a2a95fcde3256c | 7.8 | 3 |
# This file is part of REANA.
# Copyright (C) 2024 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
from unittest.mock import patch
import pytest
import os
from reana_commons.gherkin_parser.parser import (
parse_featu... | reanahub/reana-commons | tests/test_gherkin_parser.py | .py | 41675f4efbff4107 | 7.8 | 3 |
import json
import logging
import shutil
from pathlib import Path
from typing import Any, Dict, List, Tuple
from .constants import DEFAULT_COMMAND_ALIAS_FILE, EXAMPLE_COMMAND_ALIAS_FILE
from .exceptions import HelpfulError
log = logging.getLogger(__name__)
RawAliasJSON = Dict[str, Any]
ComplexAliases = Dict[str, Tup... | Winding6636/Discostcast | musicbot/aliases.py | .py | d8cb7957c975abe7 | 7 | 0 |
import asyncio
import logging
import pathlib
import shutil
import time
from collections import UserList
from typing import TYPE_CHECKING, Dict, List, Optional, Set
from .constants import (
APL_FILE_APLCOPY,
APL_FILE_DEFAULT,
APL_FILE_HISTORY,
OLD_BUNDLED_AUTOPLAYLIST_FILE,
OLD_DEFAULT_AUTOPLAYLIST_... | Winding6636/Discostcast | musicbot/autoplaylist.py | .py | 1db9d4a88d4d0ff0 | 7 | 0 |
import asyncio
import inspect
import json
import logging
import pydoc
from collections import defaultdict
from typing import (
TYPE_CHECKING,
Any,
Callable,
DefaultDict,
Dict,
List,
Optional,
Set,
Type,
Union,
)
import discord
from .constants import DATA_GUILD_FILE_OPTIONS
from... | Winding6636/Discostcast | musicbot/constructs.py | .py | 4e7d0802abaf8c67 | 7 | 0 |
import shutil
import textwrap
from enum import Enum
# Base class for exceptions
class MusicbotException(Exception):
def __init__(self, message: str, *, expire_in: int = 0) -> None:
super().__init__(message) # ???
self._message = message
self.expire_in = expire_in
@property
def me... | Winding6636/Discostcast | musicbot/exceptions.py | .py | c8edb56303f19756 | 7 | 0 |
import asyncio
import glob
import json
import logging
import os
import pathlib
import shutil
import time
from typing import TYPE_CHECKING, Dict, Tuple
from .constants import DATA_FILE_CACHEMAP, DEFAULT_DATA_DIR
from .utils import format_size_from_bytes
if TYPE_CHECKING:
from .bot import MusicBot
from .config ... | Winding6636/Discostcast | musicbot/filecache.py | .py | 4470e4a13006987a | 7 | 0 |
import json
import logging
import pathlib
from typing import Any, Dict
log = logging.getLogger(__name__)
class Json:
def __init__(self, json_file: pathlib.Path) -> None:
"""
Managed JSON data, where some structure is expected.
"""
log.debug("Init JSON obj from file: %s", json_file... | Winding6636/Discostcast | musicbot/json.py | .py | e17f5ea9d0e78140 | 7 | 0 |
import asyncio
import collections
import traceback
from typing import TYPE_CHECKING, Any, Callable, DefaultDict, List, Set
if TYPE_CHECKING:
AsyncTask = asyncio.Task[Any]
else:
AsyncTask = asyncio.Task
EventCallback = Callable[..., Any]
EventList = List[EventCallback]
EventDict = DefaultDict[str, EventList]
... | Winding6636/Discostcast | musicbot/lib/event_emitter.py | .py | 8c4d17b93765f167 | 7 | 0 |
"""
ytdlp_oauth2_plugin contains code provided under an Unlicense license,
based on the plugin found here:
https://github.com/coletdjnz/yt-dlp-youtube-oauth2
It is modified by MusicBot contributors to better integrate features.
It may not contain all features or updates, and may break at any time.
It will be r... | Winding6636/Discostcast | musicbot/ytdlp_oauth2_plugin.py | .py | a10d0e8e5f8806d3 | 7 | 0 |
#!/usr/bin/env python3
import os
import shutil
import subprocess
import sys
import tempfile
import zipfile
from typing import Any, List, Optional, Tuple
from urllib.request import urlopen
def yes_or_no_input(question: str) -> bool:
"""
Prompt the user for a yes or no response to given `question`
As many ... | Winding6636/Discostcast | update.py | .py | 22b1313de0a361c3 | 7 | 0 |
"""CLI commands for actions (read/write)."""
from __future__ import annotations
import click
from frogger_cli.main import pass_ctx
from frogger_cli.output import format_json, format_table
from glassfrog.resources.actions import (
create_action,
delete_action,
list_actions,
update_action,
)
@click.g... | PrecisionNutrition/frogger | src/frogger_cli/commands/actions.py | .py | c88c5e07bd589d74 | 7.24 | 2 |
"""CLI commands for assignments (read/write)."""
from __future__ import annotations
import click
from frogger_cli.main import pass_ctx
from frogger_cli.output import format_json, format_table
from glassfrog.resources.assignments import (
create_assignment,
delete_assignment,
list_assignments,
update_... | PrecisionNutrition/frogger | src/frogger_cli/commands/assignments.py | .py | dd5f5619efb12cfc | 7.24 | 2 |
"""CLI commands for checklist items (read/write)."""
from __future__ import annotations
import click
from frogger_cli.main import pass_ctx
from frogger_cli.output import format_json, format_table
from glassfrog.resources.checklist_items import (
create_checklist_item,
delete_checklist_item,
list_checklis... | PrecisionNutrition/frogger | src/frogger_cli/commands/checklist_items.py | .py | 499e25035e1236ed | 7.24 | 2 |
"""CLI commands for circles (read-only)."""
from __future__ import annotations
import click
from frogger_cli.main import pass_ctx
from frogger_cli.output import format_json, format_table
from glassfrog.resources.circles import get_circle, list_circles
@click.group()
def circles() -> None:
"""Manage circles."""... | PrecisionNutrition/frogger | src/frogger_cli/commands/circles.py | .py | 08baff0f35029609 | 7.24 | 2 |
"""CLI commands for custom fields (read/write)."""
from __future__ import annotations
import click
from frogger_cli.main import pass_ctx
from frogger_cli.output import format_json, format_table
from glassfrog.resources.custom_fields import (
create_custom_field,
delete_custom_field,
list_custom_fields,
... | PrecisionNutrition/frogger | src/frogger_cli/commands/custom_fields.py | .py | efc5df93cee9c6d4 | 7.24 | 2 |
"""CLI commands for domains (read-only)."""
from __future__ import annotations
import click
from frogger_cli.main import pass_ctx
from frogger_cli.output import format_json, format_table
from glassfrog.resources.domains import list_domains
@click.group()
def domains() -> None:
"""Manage domains."""
@domains.... | PrecisionNutrition/frogger | src/frogger_cli/commands/domains.py | .py | 0985d1653ad92d4d | 7.24 | 2 |
"""CLI commands for metrics (read/write)."""
from __future__ import annotations
import click
from frogger_cli.main import pass_ctx
from frogger_cli.output import format_json, format_table
from glassfrog.resources.metrics import (
create_metric,
delete_metric,
list_metrics,
update_metric,
)
@click.g... | PrecisionNutrition/frogger | src/frogger_cli/commands/metrics.py | .py | 15cc39c495ddab26 | 7.24 | 2 |
"""CLI commands for people (read/write)."""
from __future__ import annotations
import click
from frogger_cli.main import pass_ctx
from frogger_cli.output import format_json, format_table
from glassfrog.resources.people import (
create_person,
delete_person,
get_person,
get_person_by_email,
list_p... | PrecisionNutrition/frogger | src/frogger_cli/commands/people.py | .py | c043b3ac58574c5f | 7.24 | 2 |
"""CLI commands for policies (read-only + propose)."""
from __future__ import annotations
import re
from datetime import date
from pathlib import Path
import click
from frogger_cli.main import pass_ctx
from frogger_cli.output import format_json, format_table
from glassfrog.resources.policies import list_policies
... | PrecisionNutrition/frogger | src/frogger_cli/commands/policies.py | .py | 488c7639ee0acfdf | 7.24 | 2 |
"""CLI commands for projects (read/write)."""
from __future__ import annotations
import click
from frogger_cli.main import pass_ctx
from frogger_cli.output import format_json, format_table
from glassfrog.resources.projects import (
create_project,
delete_project,
list_projects,
update_project,
)
@c... | PrecisionNutrition/frogger | src/frogger_cli/commands/projects.py | .py | 8242bd24cfe3fdb7 | 7.24 | 2 |
"""CLI commands for proposals (read/write)."""
from __future__ import annotations
import click
from frogger_cli.main import pass_ctx
from frogger_cli.output import format_json, format_table
from glassfrog.resources.proposals import create_proposal, list_proposals
@click.group()
def proposals() -> None:
"""Mana... | PrecisionNutrition/frogger | src/frogger_cli/commands/proposals.py | .py | 62b8c27c1edf919e | 7.24 | 2 |
"""CLI commands for roles (read-only)."""
from __future__ import annotations
import click
from frogger_cli.main import pass_ctx
from frogger_cli.output import format_json, format_table
from glassfrog.resources.roles import get_role, list_roles
@click.group()
def roles() -> None:
"""Manage roles."""
@roles.co... | PrecisionNutrition/frogger | src/frogger_cli/commands/roles.py | .py | 4ce015136bdea321 | 7.24 | 2 |
"""CLI commands for tensions (read/write)."""
from __future__ import annotations
import click
from frogger_cli.main import pass_ctx
from frogger_cli.output import format_json, format_table
from glassfrog.resources.tensions import (
create_tension,
list_tensions,
update_tension,
)
@click.group()
def ten... | PrecisionNutrition/frogger | src/frogger_cli/commands/tensions.py | .py | 1fdf6ea366290057 | 7.24 | 2 |
"""Output formatting for the Frogger CLI."""
from __future__ import annotations
import json
from typing import Any
def format_table(
rows: list[dict[str, Any]],
columns: list[str],
headers: dict[str, str] | None = None,
) -> str:
"""Format rows as an aligned text table.
Returns 'No results foun... | PrecisionNutrition/frogger | src/frogger_cli/output.py | .py | d3bf06c53585693b | 7.24 | 2 |
"""Backup utilities for GlassFrog data."""
from __future__ import annotations
import json
from datetime import datetime, timezone
from pathlib import Path
from typing import TYPE_CHECKING
from pydantic import BaseModel
from glassfrog.exceptions import GlassFrogAuthError
if TYPE_CHECKING:
from glassfrog.client ... | PrecisionNutrition/frogger | src/glassfrog/backup.py | .py | 319e4e39fdb40347 | 7.24 | 2 |
"""GlassFrog SDK exception types."""
class GlassFrogError(Exception):
"""Base exception for all GlassFrog errors."""
class GlassFrogAuthError(GlassFrogError):
"""Raised on 401/403 authentication or authorization failures."""
class GlassFrogNotFoundError(GlassFrogError):
"""Raised on 404 responses."""
... | PrecisionNutrition/frogger | src/glassfrog/exceptions.py | .py | e0474fa45d6bcd77 | 7.24 | 2 |
"""Operations for GlassFrog actions."""
from __future__ import annotations
from glassfrog.backup import backup_record
from glassfrog.client import GlassFrogClient
from glassfrog.exceptions import DeleteRequiresForceError, GlassFrogNotFoundError
from glassfrog.models import Action
def list_actions(
client: Glass... | PrecisionNutrition/frogger | src/glassfrog/resources/actions.py | .py | af4e12f44958ea53 | 7.24 | 2 |
"""Operations for GlassFrog assignments."""
from __future__ import annotations
from glassfrog.backup import backup_record
from glassfrog.client import GlassFrogClient
from glassfrog.exceptions import DeleteRequiresForceError, GlassFrogNotFoundError
from glassfrog.models import Assignment
def list_assignments(
c... | PrecisionNutrition/frogger | src/glassfrog/resources/assignments.py | .py | 2c688e86f9b0d437 | 7.24 | 2 |
"""Operations for GlassFrog checklist items."""
from __future__ import annotations
from glassfrog.backup import backup_record
from glassfrog.client import GlassFrogClient
from glassfrog.exceptions import DeleteRequiresForceError, GlassFrogNotFoundError
from glassfrog.models import ChecklistItem
def list_checklist_i... | PrecisionNutrition/frogger | src/glassfrog/resources/checklist_items.py | .py | 36b2f57059ca1d4f | 7.24 | 2 |
"""Read-only operations for GlassFrog circles."""
from __future__ import annotations
from glassfrog.client import GlassFrogClient
from glassfrog.models import Circle
def list_circles(
client: GlassFrogClient,
circle_id: int | None = None,
) -> list[Circle]:
"""Return all circles. If circle_id is provide... | PrecisionNutrition/frogger | src/glassfrog/resources/circles.py | .py | a6c6dcb90293cd2b | 7.24 | 2 |
"""Operations for GlassFrog custom fields."""
from __future__ import annotations
from glassfrog.backup import backup_record
from glassfrog.client import GlassFrogClient
from glassfrog.exceptions import DeleteRequiresForceError, GlassFrogNotFoundError
from glassfrog.models import CustomField
def list_custom_fields(c... | PrecisionNutrition/frogger | src/glassfrog/resources/custom_fields.py | .py | dc8c5e7806a57a86 | 7.24 | 2 |
"""Operations for GlassFrog metrics."""
from __future__ import annotations
from glassfrog.backup import backup_record
from glassfrog.client import GlassFrogClient
from glassfrog.exceptions import DeleteRequiresForceError, GlassFrogNotFoundError
from glassfrog.models import Metric
def list_metrics(
client: Glass... | PrecisionNutrition/frogger | src/glassfrog/resources/metrics.py | .py | 2a5a0fdcb1ab11ff | 7.24 | 2 |
"""Operations for GlassFrog people."""
from __future__ import annotations
from glassfrog.backup import backup_record
from glassfrog.client import GlassFrogClient
from glassfrog.exceptions import DeleteRequiresForceError
from glassfrog.models import Person
def list_people(
client: GlassFrogClient,
circle_id:... | PrecisionNutrition/frogger | src/glassfrog/resources/people.py | .py | 6191d3215c29ca90 | 7.24 | 2 |
"""Operations for GlassFrog projects."""
from __future__ import annotations
from glassfrog.backup import backup_record
from glassfrog.client import GlassFrogClient
from glassfrog.exceptions import DeleteRequiresForceError, GlassFrogNotFoundError
from glassfrog.models import Project
def list_projects(
client: Gl... | PrecisionNutrition/frogger | src/glassfrog/resources/projects.py | .py | 30cba8441e9eb159 | 7.24 | 2 |
"""Operations for GlassFrog proposals."""
from __future__ import annotations
from typing import Any
from glassfrog.client import GlassFrogClient
from glassfrog.models import Proposal
def list_proposals(client: GlassFrogClient) -> list[Proposal]:
"""Return all proposals."""
data = client.get("/proposals")
... | PrecisionNutrition/frogger | src/glassfrog/resources/proposals.py | .py | 5aff6a11c1dc54ad | 7.24 | 2 |
"""Read-only operations for GlassFrog roles."""
from __future__ import annotations
from glassfrog.client import GlassFrogClient
from glassfrog.models import Role
def list_roles(
client: GlassFrogClient,
circle_id: int | None = None,
) -> list[Role]:
"""Return all roles, optionally filtered by circle_id.... | PrecisionNutrition/frogger | src/glassfrog/resources/roles.py | .py | 47b90978bc15ba14 | 7.24 | 2 |
"""Operations for GlassFrog tensions."""
from __future__ import annotations
from glassfrog.client import GlassFrogClient
from glassfrog.models import Tension
def list_tensions(
client: GlassFrogClient,
circle_id: int | None = None,
) -> list[Tension]:
"""Return all tensions, optionally filtered by circl... | PrecisionNutrition/frogger | src/glassfrog/resources/tensions.py | .py | 51444c4cef5d8723 | 7.24 | 2 |
"""
Live integration tests — GET endpoints only.
Run with: pytest tests/integration/ -m integration -v -s
SAFETY: No POST/PATCH/DELETE calls. Read-only.
"""
import pytest
from glassfrog.resources import (
circles, roles, people, assignments, projects, metrics,
checklist_items, custom_fields, policies, domains, ... | PrecisionNutrition/frogger | tests/integration/test_live_gets.py | .py | 750aaa68bdd487f8 | 7.74 | 2 |
"""
Module: pigit/app_chrome.py
Description: Application chrome components (header, footer).
Author: Zev
Date: 2026-04-23
"""
from __future__ import annotations
from pigit.termui import (
EventType,
EVT_SELECTION_CHANGED,
by_id,
Component,
resolve_presentation_leaf,
)
from pigit.termui.containers ... | zlj-zz/pigit | pigit/app_chrome.py | .py | b89738f6553260bd | 7.15 | 1 |
"""
Module: pigit/app_command_palette.py
Description: Pigit command palette wiring with executable catalog entries.
Author: Zev
Date: 2026-04-23
"""
from __future__ import annotations
from collections.abc import Callable, Sequence
from pigit.termui import widgets as termui_widgets
from pigit.termui.widgets import Pa... | zlj-zz/pigit | pigit/app_command_palette.py | .py | d1599f2e5e4fcae5 | 7.15 | 1 |
"""
Module: pigit/app_commit_graph.py
Description: Pure algorithm for inline merge-graph layout per commit row.
Author: Zev
Date: 2026-05-04
"""
from __future__ import annotations
from typing import TYPE_CHECKING
from collections.abc import Sequence
from .app_types import GraphRow
if TYPE_CHECKING:
from pigit.g... | zlj-zz/pigit | pigit/app_commit_graph.py | .py | ecda223392fb304e | 7.15 | 1 |
"""
Module: pigit/app_contribution_graph.py
Description: GitHub-style contribution heatmap for commit history.
Each cell = one day; columns are weeks (Mon→Sun top-to-bottom).
Color intensity maps to daily commit count.
Author: Zev
Date: 2026-04-25
"""
from __future__ import annotations
import datetime
import hashlib... | zlj-zz/pigit | pigit/app_contribution_graph.py | .py | 758e46171e9959cb | 7.15 | 1 |
"""
Module: pigit/app_header_state.py
Description: Reactive header display state with Signal-backed properties.
Author: Zev
Date: 2026-05-07
"""
from __future__ import annotations
from typing import Any
from collections.abc import Callable
from pigit.termui import (
EventType,
EVT_SELECTION_CHANGED,
Comp... | zlj-zz/pigit | pigit/app_header_state.py | .py | 1da42772a3049542 | 7.15 | 1 |
"""
Module: pigit/app_keybindings.py
Description: Enumerate configurable keybindings and render the [app.keybindings] config template.
Author: Zev
Date: 2026-08-16
"""
from __future__ import annotations
import sys
from collections.abc import Sequence
from pigit.termui import Binding, collect_action_bindings
from pig... | zlj-zz/pigit | pigit/app_keybindings.py | .py | 39804845f56b4491 | 7.15 | 1 |
# -*- coding: utf-8 -*-
"""
Module: pigit/app_log_graph_preview.py
Description: 大屏 Branch 页只读 git log --graph 预览面板。
Author: Zev
Date: 2026-08-18
"""
from __future__ import annotations
from collections.abc import Callable
from typing import TYPE_CHECKING
from pigit.termui import (
AsyncTask,
EVT_SELECTION_CHA... | zlj-zz/pigit | pigit/app_log_graph_preview.py | .py | 72951cb19d4723fa | 7.15 | 1 |
"""
Module: pigit/app_log_ref.py
Description: Sheet to pick which ref the Commit panel logs.
Author: Zev
Date: 2026-08-19
"""
from __future__ import annotations
from collections.abc import Callable
from pigit.termui import bind_action, keys, palette, Segment
from pigit.termui.widgets import OptionList
from .app_the... | zlj-zz/pigit | pigit/app_log_ref.py | .py | 30ce8819882f4108 | 7.15 | 1 |
"""
Module: pigit/app_merge_state.py
Description: Merge session state persistence and header merge_target updates.
Author: Zev
Date: 2026-08-24
"""
from __future__ import annotations
import json
import os
from collections.abc import Callable
from pigit.app_header_state import HeaderState
from pigit.git.api import Gi... | zlj-zz/pigit | pigit/app_merge_state.py | .py | d3625f50cbb90104 | 7.15 | 1 |
"""
Module: pigit/app_merge_workflow.py
Description: Branch-merge workflow with continue-merge and push confirmation.
Author: Zev
Date: 2026-08-24
"""
from __future__ import annotations
import logging
from collections.abc import Callable
from pigit.app_branch import BranchPanel
from pigit.app_merge_state import Merg... | zlj-zz/pigit | pigit/app_merge_workflow.py | .py | d2aad7d15843f433 | 7.15 | 1 |
"""
Module: pigit/app_network_git.py
Description: Async push/pull network git operations with pull-conflict handling.
Author: Zev
Date: 2026-08-24
"""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from pigit.app_merge_state import MergeStateStore
from pigit... | zlj-zz/pigit | pigit/app_network_git.py | .py | 978bab2b519daddb | 7.15 | 1 |
"""
Module: pigit/app_observe.py
Description: Repo observation host with explicit ObserveDeps injection.
Author: Zev
Date: 2026-08-24
"""
from __future__ import annotations
import logging
from collections.abc import Callable
from dataclasses import dataclass, replace
from pathlib import Path
from pigit.app_branch im... | zlj-zz/pigit | pigit/app_observe.py | .py | bcaba57579c18e7c | 7.15 | 1 |
"""
Module: pigit/app_panel_nav.py
Description: Panel ring navigation for Status, Stash, Branch, and Commit tabs.
Author: Zev
Date: 2026-08-24
"""
from __future__ import annotations
from collections.abc import Callable
from pigit.app_branch import BranchPanel
from pigit.app_commit import CommitPanel
from pigit.app_s... | zlj-zz/pigit | pigit/app_panel_nav.py | .py | 2a38374c7b26bbd5 | 7.15 | 1 |
# -*- coding: utf-8 -*-
"""
Module: pigit/app_preview.py
Description: Large-screen Status/Stash side panel hosting DiffViewer with async loads.
Author: Zev
Date: 2026-05-26
"""
from __future__ import annotations
from dataclasses import dataclass
from typing import TYPE_CHECKING, Literal
from collections.abc import Ca... | zlj-zz/pigit | pigit/app_preview.py | .py | 3bd8357cc12381f3 | 7.15 | 1 |
"""
Module: pigit/app_rebase.py
Description: Interactive rebase todo-list panel (edit actions and order, then execute).
Author: Zev
Date: 2026-08-14
"""
from __future__ import annotations
import os
import shlex
import tempfile
from dataclasses import dataclass
from typing import TYPE_CHECKING
from collections.abc imp... | zlj-zz/pigit | pigit/app_rebase.py | .py | 060d4c2f80e1a9d7 | 7.15 | 1 |
"""
Module: pigit/app_recent_actions.py
Description: RecentActionsPanel for browsing and reversing session history.
Author: Zev
Date: 2026-06-01
"""
from __future__ import annotations
from typing import TYPE_CHECKING
from collections.abc import Callable
from pigit.ext.utils import relative_time
from pigit.termui imp... | zlj-zz/pigit | pigit/app_recent_actions.py | .py | 4b2285b05b74064f | 7.15 | 1 |
"""
Module: pigit/app_sequencer.py
Description: Rebase/cherry-pick/revert sequencer control and cherry-pick execution.
Author: Zev
Date: 2026-08-24
"""
from __future__ import annotations
from collections.abc import Callable
from pigit.git.api import GitApi, GitError, RepoError
from pigit.termui import (
Feedback... | zlj-zz/pigit | pigit/app_sequencer.py | .py | c87b4d76cfd164bc | 7.15 | 1 |
"""
Module: pigit/app_stash.py
Description: Stash list panel with cursor navigation.
Author: Zev
Date: 2026-05-27
"""
from __future__ import annotations
from typing import TYPE_CHECKING
from collections.abc import Callable
from pigit.termui import (
EVT_GOTO,
EVT_SELECTION_CHANGED,
FeedbackKind,
bind... | zlj-zz/pigit | pigit/app_stash.py | .py | be6dc2971a331614 | 7.15 | 1 |
"""
Module: pigit/app_types.py
Description: Shared TUI data types used by ViewModels and panels.
Author: Zev
Date: 2026-06-04
"""
from __future__ import annotations
from dataclasses import dataclass
from typing import Protocol, runtime_checkable
@dataclass
class FileSnapshot:
identity: str
path: str
blo... | zlj-zz/pigit | pigit/app_types.py | .py | bbbbcfadd6c517bc | 7.15 | 1 |
"""
Module: pigit/cmdparse/completion/base.py
Description: Base shell completion class.
Author: Zev
Date: 2026-04-12
"""
from __future__ import annotations
import os
import re
class ShellCompletionError(Exception):
"""ShellCompletion error class."""
class ShellCompletion:
"""Implement and inject help clas... | zlj-zz/pigit | pigit/cmdparse/completion/base.py | .py | 737e3e2cff840089 | 7.15 | 1 |
"""
Module: pigit/cmdparse/completion/bash.py
Description: Bash shell completion with git-aware argument completion.
Author: Zev
Date: 2026-04-12
"""
from __future__ import annotations
import textwrap
from .base import ShellCompletion
from .widgets import WIDGETS
from ...const import REPOS_PATH
# Git helper functio... | zlj-zz/pigit | pigit/cmdparse/completion/bash.py | .py | 79a6bf1dfd0d6be4 | 7.15 | 1 |
"""
Module: pigit/cmdparse/completion/fish.py
Description: Fish shell completion generator.
Author: Zev
Date: 2026-04-15
"""
from __future__ import annotations
import textwrap
from .base import ShellCompletion
from .widgets import WIDGETS
class FishCompletion(ShellCompletion):
SHELL: str = "fish"
TEMPLATE... | zlj-zz/pigit | pigit/cmdparse/completion/fish.py | .py | 21e74d1e849a2f0d | 7.15 | 1 |
"""
Module: pigit/config_data.py
Description: Typed TOML configuration dataclasses for pigit.
Author: Zev
Date: 2026-04-21
"""
from __future__ import annotations
from dataclasses import dataclass, field
from typing import Literal
@dataclass
class CmdConfig:
display: bool = True
recommend: bool = True
@dat... | zlj-zz/pigit | pigit/config_data.py | .py | 346499e2950d1c61 | 7.15 | 1 |
"""Explicit runtime context
Uses :class:`contextvars.ContextVar` (not ``threading.local`` on a dataclass field) so
async and nested overrides behave predictably. CLI startup calls
:meth:`Context.install`; tests may use ``with Context(...)`` to shadow.
"""
from __future__ import annotations
import logging
from contex... | zlj-zz/pigit | pigit/context.py | .py | 7d76c02ae0e12d67 | 7.15 | 1 |
from __future__ import annotations
import asyncio
import contextlib
import dataclasses
import logging
import os
import shlex
import sys
from subprocess import Popen, PIPE
from typing import Any, Final, cast
from collections.abc import Iterator
# Type defined
ExecResult = tuple[int | None, str | bytes | None, str | by... | zlj-zz/pigit | pigit/ext/executor.py | .py | 4de9206c58c8acbf | 7.15 | 1 |
"""Global executor selection for subprocess-backed git and helpers.
Production uses :class:`LocalExecutor` (subclass of :class:`~pigit.ext.executor.Executor`).
Tests may :meth:`ExecutorFactory.set_strategy` with a :class:`MockExecutor` or custom
:class:`ExecutorStrategy`, then :meth:`ExecutorFactory.reset` to restore ... | zlj-zz/pigit | pigit/ext/executor_factory.py | .py | b529a1b5136d96a9 | 7.15 | 1 |
from __future__ import annotations
import sys
import time
import contextlib
import inspect
from typing import Any
from collections.abc import Callable
from functools import wraps
def time_it(fn: Callable) -> Callable:
"""Print the overall running time.
When recursive calls exist, only the outermost layer is ... | zlj-zz/pigit | pigit/ext/func.py | .py | 638e0085c3ae87d4 | 7.15 | 1 |
from __future__ import annotations
import contextlib
import copy
import json
import os
import re
import stat
import threading
from concurrent.futures import ProcessPoolExecutor
from typing import TYPE_CHECKING
from collections.abc import Callable
from .log import logger
from .utils import adjudgment_type, confirm
if... | zlj-zz/pigit | pigit/ext/lcstat.py | .py | 32d1958a63c69338 | 7.15 | 1 |
import requests
import pandas as pd
import urllib.parse
BASE_HREF = "https://gegevensmagazijn.tweedekamer.nl/OData/v4/2.0/"
def _fetch_api_data(path: str) -> pd.DataFrame:
print(f"Fetching: {BASE_HREF + path}")
r = requests.get(BASE_HREF + path)
if r.status_code == 200:
return pd.DataFrame(r.jso... | bingneef/nl-parlement-committee-calenders | lib/api.py | .py | 46324ceceb71f963 | 7.3 | 3 |
import pandas as pd
from ics import Calendar, Event
from lib.tools import text_from_html_string
def _generate_actor_description_line(actor: pd.Series) -> str:
return f"{actor['ActorNaam'] or 'Onbekend'} ({actor['ActorFractie'] or 'onbekend'})"
def _description_from_api_event(api_event: pd.DataFrame) -> str:
... | bingneef/nl-parlement-committee-calenders | lib/calendar.py | .py | 2ee216aa2f6afb94 | 7.3 | 3 |
from typing import Tuple
import pandas as pd
from lib.tools import generate_safe_filename
from datetime import datetime
def _generate_calendar_url(name: str) -> str:
return (
"https://raw.githubusercontent.com/bingneef/rekenkamer-commissie-scraper/main/calendars/" +
generate_safe_filename(name, '.... | bingneef/nl-parlement-committee-calenders | lib/docs.py | .py | cfdeca740ca535ec | 7.3 | 3 |
import re
from bs4 import BeautifulSoup
from datetime import datetime
def current_formatted_time() -> str:
return datetime.now().strftime("%H:%M:%S")
def generate_safe_filename(root_filename: str, extension: str) -> str:
"""
Generate the root filename (thus without extension) stripped of unwanted charac... | bingneef/nl-parlement-committee-calenders | lib/tools.py | .py | b1ba544223c3e9fa | 7.3 | 3 |
import pandas as pd
import lib.calendar
def test_generate_actor_description_line():
"""Return the correct string"""
actor = pd.Series({'ActorNaam': 'A', 'ActorFractie': 'B'})
expected = 'A (B)'
assert lib.calendar._generate_actor_description_line(actor) == expected
def test_generate_actor_descripti... | bingneef/nl-parlement-committee-calenders | tests/lib/test_calendar.py | .py | 2ffca3f6a32a1c58 | 7.8 | 3 |
#!/usr/bin/env python
#
# @license Apache-2.0
#
# Copyright (c) 2018 The Stdlib Authors.
#
# 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
#
# ... | stdlib-js/math-base-special-trunc | benchmark/python/benchmark.py | .py | 954f1397acd752cf | 7.24 | 2 |
#!/usr/bin/env python
#
# @license Apache-2.0
#
# Copyright (c) 2018 The Stdlib Authors.
#
# 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
#
# ... | stdlib-js/math-base-special-round | benchmark/python/benchmark.py | .py | b8a0d2f2513f5d7c | 7.24 | 2 |
#!/usr/bin/env python
#
# @license Apache-2.0
#
# Copyright (c) 2018 The Stdlib Authors.
#
# 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
#
# ... | stdlib-js/math-base-special-round | benchmark/python/scipy/benchmark.py | .py | 180fec39e818c5d7 | 7.24 | 2 |
#!/usr/bin/env python
#
# @license Apache-2.0
#
# Copyright (c) 2018 The Stdlib Authors.
#
# 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
#
# ... | stdlib-js/math-base-special-floor | benchmark/python/benchmark.py | .py | b981a70b2d2f62c6 | 7.15 | 1 |
#!/usr/bin/env python
#
# @license Apache-2.0
#
# Copyright (c) 2018 The Stdlib Authors.
#
# 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
#
# ... | stdlib-js/math-base-special-ceil | benchmark/python/benchmark.py | .py | 11473da06ae95c70 | 7.15 | 1 |
# Copyright (c) The btclib developers
# Distributed under the MIT software license, see the accompanying
# LICENSE file or https://opensource.org/license/mit for the full text.
"""The vendored libsecp256k1 is the release README.md says it is.
`version-check` in .github/workflows/release.yml asks this of upstream,
ove... | btclib-org/btclib-secp256k1 | .github/scripts/check_submodule_pin.py | .py | c0ceecb20f8c3a11 | 7.24 | 2 |
# Copyright (c) The btclib developers
# Distributed under the MIT software license, see the accompanying
# LICENSE file or https://opensource.org/license/mit for the full text.
"""Re-check every vendored-vector pin against upstream, weekly.
tests/README.md pins each vendored vector to a commit and a git blob
SHA-1, w... | btclib-org/btclib-secp256k1 | .github/scripts/check_vendored_vectors.py | .py | f1eb649afd846cf7 | 7.24 | 2 |
# Copyright (c) The btclib developers
# Distributed under the MIT software license, see the accompanying
# LICENSE file or https://opensource.org/license/mit for the full text.
"""Count a Cosmic Ray session by outcome, the skipped mutants left out.
`cr-rate` answers the wrong question for a filtered session, and not ... | btclib-org/btclib-secp256k1 | .github/scripts/mutation_counts.py | .py | f1c55019b4d8af70 | 7.24 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.