repo_full_name stringlengths 6 93 | repo_url stringlengths 25 112 | repo_api_url stringclasses 28
values | owner stringclasses 28
values | repo_name stringclasses 28
values | description stringclasses 28
values | stars int64 617 98.8k | forks int64 31 355 ⌀ | watchers int64 990 999 ⌀ | license stringclasses 2
values | default_branch stringclasses 2
values | repo_created_at timestamp[s]date 2012-07-24 23:12:50 2025-06-16 08:07:28 ⌀ | repo_updated_at timestamp[s]date 2026-02-23 15:23:15 2026-05-03 18:52:12 ⌀ | repo_topics listlengths 0 13 ⌀ | repo_languages unknown | is_fork bool 1
class | open_issues int64 3 104 ⌀ | file_path stringlengths 3 208 | file_name stringclasses 509
values | file_extension stringclasses 1
value | file_size_bytes int64 101 84k ⌀ | file_url stringclasses 627
values | file_raw_url stringclasses 627
values | file_sha stringclasses 624
values | language stringclasses 8
values | parsed_at stringdate 2026-05-04 01:12:36 2026-05-04 19:41:55 | text stringlengths 100 102k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
yaohungt/Multimodal-Transformer | https://github.com/yaohungt/Multimodal-Transformer | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/models.py | null | null | null | null | null | null | Python | 2026-05-04T01:35:55.717368 | import torch
from torch import nn
import torch.nn.functional as F
from modules.transformer import TransformerEncoder
class MULTModel(nn.Module):
def __init__(self, hyp_params):
"""
Construct a MulT model.
"""
super(MULTModel, self).__init__()
self.orig_d_l, self.orig_d_a, ... |
yaohungt/Multimodal-Transformer | https://github.com/yaohungt/Multimodal-Transformer | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/train.py | null | null | null | null | null | null | Python | 2026-05-04T01:35:55.719472 | import torch
from torch import nn
import sys
from src import models
from src import ctc
from src.utils import *
import torch.optim as optim
import numpy as np
import time
from torch.optim.lr_scheduler import ReduceLROnPlateau
import os
import pickle
from sklearn.metrics import classification_report
from sklearn.metric... |
yaohungt/Multimodal-Transformer | https://github.com/yaohungt/Multimodal-Transformer | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/ctc.py | null | null | null | null | null | null | Python | 2026-05-04T01:35:55.720880 | import torch
from torch import nn
class CTCModule(nn.Module):
def __init__(self, in_dim, out_seq_len):
'''
This module is performing alignment from A (e.g., audio) to B (e.g., text).
:param in_dim: Dimension for input modality A
:param out_seq_len: Sequence length for output modali... |
yaohungt/Multimodal-Transformer | https://github.com/yaohungt/Multimodal-Transformer | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | modules/transformer.py | null | null | null | null | null | null | Python | 2026-05-04T01:35:55.724222 | import torch
from torch import nn
import torch.nn.functional as F
from modules.position_embedding import SinusoidalPositionalEmbedding
from modules.multihead_attention import MultiheadAttention
import math
class TransformerEncoder(nn.Module):
"""
Transformer encoder consisting of *args.encoder_layers* layers.... |
yaohungt/Multimodal-Transformer | https://github.com/yaohungt/Multimodal-Transformer | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | modules/multihead_attention.py | null | null | null | null | null | null | Python | 2026-05-04T01:35:55.738454 | import torch
from torch import nn
from torch.nn import Parameter
import torch.nn.functional as F
import sys
# Code adapted from the fairseq repo.
class MultiheadAttention(nn.Module):
"""Multi-headed attention.
See "Attention Is All You Need" for more details.
"""
def __init__(self, embed_dim, num_hea... |
yaohungt/Multimodal-Transformer | https://github.com/yaohungt/Multimodal-Transformer | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/dataset.py | null | null | null | null | null | null | Python | 2026-05-04T01:35:55.804072 | import numpy as np
from torch.utils.data.dataset import Dataset
import pickle
import os
from scipy import signal
import torch
if torch.cuda.is_available():
torch.set_default_tensor_type('torch.cuda.FloatTensor')
else:
torch.set_default_tensor_type('torch.FloatTensor')
#####################################... |
yaohungt/Multimodal-Transformer | https://github.com/yaohungt/Multimodal-Transformer | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | main.py | null | null | null | null | null | null | Python | 2026-05-04T01:35:55.821759 | import torch
import argparse
from src.utils import *
from torch.utils.data import DataLoader
from src import train
parser = argparse.ArgumentParser(description='MOSEI Sentiment Analysis')
parser.add_argument('-f', default='', type=str)
# Fixed
parser.add_argument('--model', type=str, default='MulT',
... |
yaohungt/Multimodal-Transformer | https://github.com/yaohungt/Multimodal-Transformer | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/eval_metrics.py | null | null | null | null | null | null | Python | 2026-05-04T01:35:55.822709 | import torch
import numpy as np
from sklearn.metrics import classification_report
from sklearn.metrics import confusion_matrix
from sklearn.metrics import precision_recall_fscore_support
from sklearn.metrics import accuracy_score, f1_score
def multiclass_acc(preds, truths):
"""
Compute the multiclass accuracy... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/api.py | null | null | null | null | null | null | Python | 2026-05-04T01:35:59.281947 | """Stable public API for Takopi plugins."""
from __future__ import annotations
from .backends import EngineBackend, EngineConfig, SetupIssue
from .commands import (
CommandBackend,
CommandContext,
CommandExecutor,
CommandResult,
RunMode,
RunRequest,
RunResult,
)
from .config import ConfigE... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | scripts/release_notify.py | null | null | null | null | null | null | Python | 2026-05-04T01:35:59.283277 | # /// script
# requires-python = ">=3.14"
# dependencies = [
# "mistune>=3.2.0",
# "requests>=2.32.5",
# "sulguk>=0.11.1",
# ]
# ///
import mistune
import sulguk
import requests
import os
import re
repo = os.environ["REPO"]
tag = os.environ["TAG_NAME"]
bot_token = os.environ["TELEGRAM_BOT_TOKEN"]
chat_id =... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/backends_helpers.py | null | null | null | null | null | null | Python | 2026-05-04T01:35:59.284660 | from __future__ import annotations
from .backends import SetupIssue
def install_issue(cmd: str, install_cmd: str | None) -> SetupIssue:
if install_cmd:
lines = (f" [dim]$[/] {install_cmd}",)
else:
lines = (" [dim]See engine setup docs for install instructions.[/]",)
return SetupIssue(... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/cli/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:35:59.285796 | from __future__ import annotations
# ruff: noqa: F401
from collections.abc import Callable
import sys
from pathlib import Path
import typer
from .. import __version__
from ..config import (
ConfigError,
HOME_CONFIG_PATH,
load_or_init_config,
write_config,
)
from ..config_migrations import migrate_co... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/cli/config.py | null | null | null | null | null | null | Python | 2026-05-04T01:35:59.286815 | from __future__ import annotations
import re
import sys
import tomllib
from pathlib import Path
from typing import Any
import typer
from pydantic import BaseModel
from ..config import (
ConfigError,
HOME_CONFIG_PATH,
dump_toml,
read_config,
write_config,
)
from ..config_migrations import migrate_... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | scripts/docs_prebuild.py | null | null | null | null | null | null | Python | 2026-05-04T01:35:59.287667 | #!/usr/bin/env python3
from __future__ import annotations
from pathlib import Path
import shutil
ROOT = Path(__file__).resolve().parents[1]
SRC = ROOT / "changelog.md"
DEST = ROOT / "docs" / "reference" / "changelog.md"
def main() -> None:
DEST.parent.mkdir(parents=True, exist_ok=True)
if DEST.is_symlink():... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/backends.py | null | null | null | null | null | null | Python | 2026-05-04T01:35:59.288880 | from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from pathlib import Path
from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
from .runner import Runner
EngineConfig = dict[str, Any]
@dataclass(frozen=True, slots=True)
class SetupIssue:
title: st... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | scripts/commit_notify.py | null | null | null | null | null | null | Python | 2026-05-04T01:35:59.290082 | # /// script
# requires-python = ">=3.14"
# dependencies = [
# "mistune>=3.2.0",
# "requests>=2.32.5",
# "sulguk>=0.11.1",
# ]
# ///
from __future__ import annotations
import json
import os
from pathlib import Path
import re
import mistune
import requests
import sulguk
repo = os.environ["REPO"]
bot_token... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | scripts/onboarding_preview.py | null | null | null | null | null | null | Python | 2026-05-04T01:35:59.291378 | from __future__ import annotations
from dataclasses import dataclass
from typing import Any, Iterable, Iterator
import anyio
from rich.console import Console
from rich.panel import Panel
from rich.text import Text
from takopi.config import ConfigError
from takopi.telegram import onboarding as ob
from takopi.telegram... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/config.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:01.327116 | from __future__ import annotations
import tomllib
from dataclasses import dataclass, field
import os
from pathlib import Path
import tempfile
from typing import Any
import tomli_w
HOME_CONFIG_PATH = Path.home() / ".takopi" / "takopi.toml"
class ConfigError(RuntimeError):
pass
def ensure_table(
config: di... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/commands.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:01.328354 | from __future__ import annotations
from collections.abc import Iterable, Sequence
from dataclasses import dataclass
from pathlib import Path
from typing import Any, Literal, Protocol, overload, runtime_checkable
from .config import ConfigError
from .context import RunContext
from .ids import RESERVED_COMMAND_IDS
from... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/context.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:01.329831 | from __future__ import annotations
from dataclasses import dataclass
@dataclass(frozen=True, slots=True)
class RunContext:
project: str | None = None
branch: str | None = None
|
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/cli/doctor.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:01.331246 | from __future__ import annotations
import os
import sys
from collections.abc import Awaitable, Callable
from dataclasses import dataclass
from pathlib import Path
from typing import Literal
import anyio
import typer
from ..config import ConfigError
from ..engines import list_backend_ids
from ..ids import RESERVED_CH... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/cli/init.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:01.339853 | from __future__ import annotations
from collections.abc import Callable
from pathlib import Path
import typer
from ..config import ConfigError, write_config
from ..config_migrations import migrate_config
from ..ids import RESERVED_CHAT_COMMANDS
from ..settings import TakopiSettings, validate_settings_data
from .conf... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/config_migrations.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:01.341065 | from __future__ import annotations
from pathlib import Path
from typing import Any
from .config import ConfigError, ensure_table, read_config, write_config
from .logging import get_logger
logger = get_logger(__name__)
def _ensure_subtable(
parent: dict[str, Any],
key: str,
*,
config_path: Path,
... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/cli/onboarding_cmd.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:01.342101 | from __future__ import annotations
import sys
from collections.abc import Callable
from functools import partial
from pathlib import Path
from typing import Any, cast
import anyio
import typer
from ..config import ConfigError, load_or_init_config, write_config
from ..config_migrations import migrate_config
from ..lo... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/cli/plugins.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:01.354169 | from __future__ import annotations
import sys
from collections.abc import Callable
from importlib.metadata import EntryPoint
from pathlib import Path
from typing import cast
import typer
from ..commands import get_command
from ..config import ConfigError
from ..engines import get_backend
from ..ids import RESERVED_C... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/config_watch.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:01.379408 | from __future__ import annotations
import os
from dataclasses import dataclass
from pathlib import Path
from collections.abc import Awaitable, Callable, Iterable
from watchfiles import awatch
from .config import ConfigError
from .ids import RESERVED_CHAT_COMMANDS
from .logging import get_logger
from .runtime_loader ... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/cli/run.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:01.381296 | from __future__ import annotations
import os
import sys
from collections.abc import Callable
from functools import partial
from pathlib import Path
from typing import Any, cast
import anyio
import typer
from .. import __version__
from ..backends import EngineBackend
from ..config import ConfigError, load_or_init_con... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/ids.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:02.188887 | from __future__ import annotations
import re
ID_PATTERN = r"^[a-z0-9_]{1,32}$"
_ID_RE = re.compile(ID_PATTERN)
RESERVED_CLI_COMMANDS = frozenset({"config", "doctor", "init", "plugins"})
RESERVED_CHAT_COMMANDS = frozenset(
{"cancel", "file", "new", "agent", "model", "reasoning", "trigger", "topic", "ctx"}
)
RESER... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/directives.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:02.190273 | from __future__ import annotations
from dataclasses import dataclass
from .config import ProjectsConfig
from .context import RunContext
from .model import EngineId
@dataclass(frozen=True, slots=True)
class ParsedDirectives:
prompt: str
engine: EngineId | None
project: str | None
branch: str | None
... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/logging.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:02.191480 | from __future__ import annotations
import errno
import io
import os
import re
import sys
from contextlib import contextmanager
from contextvars import ContextVar
from typing import Any, TextIO, cast
import structlog
from structlog.types import Processor
TELEGRAM_TOKEN_RE = re.compile(r"bot\d+:[A-Za-z0-9_-]+")
TELEGR... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/events.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:02.193251 | """Event factory helpers for runner implementations."""
from __future__ import annotations
from typing import Any
from .model import (
Action,
ActionEvent,
ActionKind,
ActionLevel,
ActionPhase,
CompletedEvent,
EngineId,
ResumeToken,
StartedEvent,
)
class EventFactory:
__slot... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/engines.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:02.194717 | from __future__ import annotations
from collections.abc import Iterable
from .backends import EngineBackend
from .config import ConfigError
from .plugins import ENGINE_GROUP, list_ids, load_plugin_backend
from .ids import RESERVED_ENGINE_IDS
def _validate_engine_backend(backend: object, ep) -> None:
if not isin... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/plugins.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:02.356141 | from __future__ import annotations
from collections.abc import Iterable
from dataclasses import dataclass
from importlib.metadata import EntryPoint, entry_points
import re
from typing import Any
from collections.abc import Callable
from .ids import ID_PATTERN, is_valid_id
ENGINE_GROUP = "takopi.engine_backends"
TRAN... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/lockfile.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:02.389558 | from __future__ import annotations
import hashlib
import json
import os
from dataclasses import dataclass
from pathlib import Path
from .logging import get_logger
logger = get_logger(__name__)
@dataclass(frozen=True, slots=True)
class LockInfo:
pid: int | None
token_fingerprint: str | None
class LockErro... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/presenter.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:02.391021 | from __future__ import annotations
from typing import Protocol
from .progress import ProgressState
from .transport import RenderedMessage
class Presenter(Protocol):
def render_progress(
self,
state: ProgressState,
*,
elapsed_s: float,
label: str = "working",
) -> Rend... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/markdown.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:02.645990 | from __future__ import annotations
import os
import textwrap
from dataclasses import dataclass
from pathlib import Path
from .model import Action, ActionEvent, StartedEvent, TakopiEvent
from .progress import ProgressState
from .transport import RenderedMessage
from .utils.paths import relativize_path
STATUS = {"runn... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/router.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:02.807046 | from __future__ import annotations
from dataclasses import dataclass
from typing import Literal
from collections.abc import Iterable
from .model import EngineId, ResumeToken
from .runner import Runner
class RunnerUnavailableError(RuntimeError):
def __init__(self, engine: EngineId, issue: str | None = None) -> N... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/runner.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:02.814330 | """Runner protocol and shared runner definitions."""
from __future__ import annotations
import json
import re
import subprocess
from collections.abc import AsyncIterator, Callable
from dataclasses import dataclass
from typing import Any, Protocol, cast
from weakref import WeakValueDictionary
import anyio
from .logg... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/progress.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:02.860573 | from __future__ import annotations
from dataclasses import dataclass
from collections.abc import Callable
from .model import Action, ActionEvent, ResumeToken, StartedEvent, TakopiEvent
@dataclass(frozen=True, slots=True)
class ActionState:
action: Action
phase: str
ok: bool | None
display_phase: str... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/runner_bridge.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:02.882385 | from __future__ import annotations
import time
from collections.abc import Awaitable, Callable
from dataclasses import dataclass, field
import anyio
from .context import RunContext
from .logging import bind_run_context, get_logger
from .model import CompletedEvent, ResumeToken, StartedEvent, TakopiEvent
from .presen... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/runners/claude.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:03.185298 | from __future__ import annotations
import os
import re
import shutil
from dataclasses import dataclass, field
from pathlib import Path
from typing import Any
import msgspec
from ..backends import EngineBackend, EngineConfig
from ..events import EventFactory
from ..logging import get_logger
from ..model import Action... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/runners/codex.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:03.392065 | from __future__ import annotations
import re
from dataclasses import dataclass, field
from pathlib import Path
from typing import Any
import msgspec
from ..backends import EngineBackend, EngineConfig
from ..config import ConfigError
from ..events import EventFactory
from ..logging import get_logger
from ..model impo... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/runners/mock.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:03.457228 | from __future__ import annotations
import re
import uuid
from collections.abc import AsyncIterator, Awaitable, Callable, Iterable
from dataclasses import dataclass, replace
import anyio
from ..model import (
ActionEvent,
CompletedEvent,
EngineId,
ResumeToken,
StartedEvent,
TakopiEvent,
)
from... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/schemas/claude.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:04.042845 | """Msgspec models and decoder for Claude Code stream-json output."""
from __future__ import annotations
from typing import Any, Literal
import msgspec
class StreamTextBlock(
msgspec.Struct, tag="text", tag_field="type", forbid_unknown_fields=False
):
text: str
class StreamThinkingBlock(
msgspec.Struc... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/model.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:04.064782 | """Takopi domain model types (events, actions, resume tokens)."""
from __future__ import annotations
from dataclasses import dataclass, field
from typing import Any, Literal
type EngineId = str
type ActionKind = Literal[
"command",
"tool",
"file_change",
"web_search",
"subagent",
"note",
... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/schemas/codex.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:04.068259 | from __future__ import annotations
# Headless JSONL schema derived from tag rust-v0.77.0 (git 112f40e91c12af0f7146d7e03f20283516a8af0b).
from typing import Any, Literal
import msgspec
type CommandExecutionStatus = Literal[
"in_progress",
"completed",
"failed",
"declined",
]
type PatchApplyStatus = L... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/runners/opencode.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:04.292377 | """OpenCode CLI runner.
This runner integrates with the OpenCode CLI (https://github.com/sst/opencode).
OpenCode outputs JSON events in a streaming format with types:
- step_start: Marks the beginning of a processing step
- tool_use: Tool invocation with input/output
- text: Text output from the model
- step_finish: ... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/schemas/opencode.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:04.423580 | """Msgspec models and decoder for opencode --format json output."""
from __future__ import annotations
from typing import Any
import msgspec
class _Event(msgspec.Struct, tag_field="type", forbid_unknown_fields=False):
pass
class StepStart(_Event, tag="step_start"):
timestamp: int | None = None
sessio... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/schemas/pi.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:04.619070 | """Msgspec models and decoder for pi --mode json output."""
from __future__ import annotations
from typing import Any
import msgspec
class _Event(msgspec.Struct, tag_field="type", forbid_unknown_fields=False):
pass
class SessionHeader(_Event, tag="session"):
id: str | None = None
version: int | None ... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/settings.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:04.720451 | from __future__ import annotations
from pathlib import Path
from typing import Annotated, Any, ClassVar, Literal
from collections.abc import Iterable
from pydantic import (
BeforeValidator,
BaseModel,
ConfigDict,
Field,
ValidationError,
StringConstraints,
field_validator,
model_validat... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/runtime_loader.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:08.447904 | from __future__ import annotations
import shutil
from dataclasses import dataclass
from pathlib import Path
from typing import Any
from collections.abc import Iterable, Mapping
from .backends import EngineBackend
from .config import ConfigError, ProjectsConfig
from .engines import get_backend, list_backend_ids
from .... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/runners/run_options.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:08.456645 | from __future__ import annotations
from collections.abc import Iterator
from contextlib import contextmanager
from contextvars import ContextVar, Token
from dataclasses import dataclass
@dataclass(frozen=True, slots=True)
class EngineRunOptions:
model: str | None = None
reasoning: str | None = None
_RUN_OP... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/runners/pi.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:08.461707 | from __future__ import annotations
import os
import re
from collections.abc import AsyncIterator
from dataclasses import dataclass, field
from datetime import datetime, UTC
from pathlib import Path, PurePath
from typing import Any
from uuid import uuid4
import msgspec
from ..backends import EngineBackend, EngineConf... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/runners/tool_actions.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:08.467516 | from __future__ import annotations
from collections.abc import Mapping, Sequence
from typing import Any
from ..model import ActionKind
from ..utils.paths import relativize_command, relativize_path
def tool_input_path(
tool_input: Mapping[str, Any],
*,
path_keys: Sequence[str],
) -> str | None:
for k... |
banteg/takopi | https://github.com/banteg/takopi | null | null | null | null | 979 | null | null | mit | null | null | null | null | null | null | null | src/takopi/scheduler.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:08.497520 | from __future__ import annotations
from collections import deque
from dataclasses import dataclass
from typing import Any, Protocol
from collections.abc import Awaitable, Callable
import anyio
from .context import RunContext
from .logging import get_logger
from .model import ResumeToken
from .transport import Channe... |
aploium/shootback | https://github.com/aploium/shootback | null | null | null | null | 978 | null | null | mit | null | null | null | null | null | null | null | build_singlefile_slaver.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:10.470524 | #!/usr/bin/env python3
# coding=utf-8
def build_singlefile_slaver(outfile_name="slaver_singlefile.py"):
import os
import shutil
base_path = os.path.dirname(os.path.abspath(__file__))
output_fullpath = os.path.join(base_path, outfile_name)
if os.path.exists(output_fullpath):
ch = input("tar... |
aploium/shootback | https://github.com/aploium/shootback | null | null | null | null | 978 | null | null | mit | null | null | null | null | null | null | null | master.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:10.477446 | #!/usr/bin/env python3
# coding=utf-8
import os
import tempfile
import queue
import atexit
from common_func import *
_listening_sockets = [] # for close at exit
__author__ = "Aploium <i@z.codes>"
__website__ = "https://github.com/aploium/shootback"
_DEFAULT_SSL_KEY = '''\
-----BEGIN PRIVATE KEY-----
MIICdQIBADANBgkq... |
aploium/shootback | https://github.com/aploium/shootback | null | null | null | null | 978 | null | null | mit | null | null | null | null | null | null | null | common_func.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:10.478186 | #!/usr/bin/env python
# coding=utf-8
from __future__ import print_function, unicode_literals, division, absolute_import
import sys
import time
import binascii
import struct
import collections
import logging
import socket
import functools
import threading
import traceback
import warnings
try:
import selectors
f... |
aploium/shootback | https://github.com/aploium/shootback | null | null | null | null | 978 | null | null | mit | null | null | null | null | null | null | null | slaver.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:10.488507 | #!/usr/bin/env python3
# coding=utf-8
from __future__ import print_function, unicode_literals, division, absolute_import
from common_func import *
__author__ = "Aploium <i@z.codes>"
__website__ = "https://github.com/aploium/shootback"
class Slaver(object):
"""
slaver socket阶段
连接master->等待->心跳(重复)---... |
tonbistudio/turboquant-pytorch | https://github.com/tonbistudio/turboquant-pytorch | null | null | null | null | 978 | null | null | mit | null | null | null | null | null | null | null | turboquant/test_turboquant.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:12.581192 | """
Verification script for TurboQuant implementation.
Tests MSE distortion bounds, inner product accuracy, and compression ratios
against theoretical predictions from the paper.
"""
import torch
import math
import time
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))... |
tonbistudio/turboquant-pytorch | https://github.com/tonbistudio/turboquant-pytorch | null | null | null | null | 978 | null | null | mit | null | null | null | null | null | null | null | turboquant/lloyd_max.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:12.603562 | """
Lloyd-Max optimal scalar quantizer for the Beta distribution
arising from random rotation of unit-norm vectors.
After rotating a d-dimensional unit vector by a random orthogonal matrix,
each coordinate follows: f(x) = Gamma(d/2) / (sqrt(pi) * Gamma((d-1)/2)) * (1-x^2)^((d-3)/2)
supported on [-1, 1].
For practical... |
tonbistudio/turboquant-pytorch | https://github.com/tonbistudio/turboquant-pytorch | null | null | null | null | 978 | null | null | mit | null | null | null | null | null | null | null | turboquant/generation_test_v2.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:12.606324 | """
Generation test v2: comprehensive sweep of window sizes and bit-widths.
Fixes the rw=0 bug from the original generation_test.py.
"""
import torch
import os
import sys
import gc
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from transformers import AutoModelForCausalLM, AutoToken... |
tonbistudio/turboquant-pytorch | https://github.com/tonbistudio/turboquant-pytorch | null | null | null | null | 978 | null | null | mit | null | null | null | null | null | null | null | turboquant/compressors.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:12.607292 | """
TurboQuant KV cache v2: Asymmetric attention.
Instead of decompressing KV vectors and feeding them to standard attention,
we compute attention scores DIRECTLY from compressed representations using
the TurboQuant asymmetric inner product estimator.
Key insight from the paper:
<q, k> ≈ <q, k_mse> + ||r_k|| * sqrt... |
tonbistudio/turboquant-pytorch | https://github.com/tonbistudio/turboquant-pytorch | null | null | null | null | 978 | null | null | mit | null | null | null | null | null | null | null | turboquant/turboquant.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:12.626774 | """
TurboQuant: Two-stage vector quantization with near-optimal distortion.
Stage 1 (MSE): Random rotation + per-coordinate Lloyd-Max quantization
Stage 2 (QJL): 1-bit Quantized Johnson-Lindenstrauss on residuals for unbiased inner products
Reference: "TurboQuant: Online Vector Quantization with Near-optimal Distorti... |
tonbistudio/turboquant-pytorch | https://github.com/tonbistudio/turboquant-pytorch | null | null | null | null | 978 | null | null | mit | null | null | null | null | null | null | null | turboquant/validate.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:12.637624 | """
TurboQuant validation: compare attention scores on real model data.
Single forward pass, no monkey-patching. Just math.
"""
import torch
import torch.nn.functional as F
import time
import os
import sys
# Allow running as `python validate.py` from within the package directory
sys.path.insert(0, os.path.dirname(os.... |
tonbistudio/turboquant-pytorch | https://github.com/tonbistudio/turboquant-pytorch | null | null | null | null | 978 | null | null | mit | null | null | null | null | null | null | null | turboquant/generation_test.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:12.670734 | """
Quick generation test: can the model produce coherent output
using V3 decompressed KV cache?
"""
import torch
import os
import sys
import gc
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, DynamicCac... |
tonbistudio/turboquant-pytorch | https://github.com/tonbistudio/turboquant-pytorch | null | null | null | null | 978 | null | null | mit | null | null | null | null | null | null | null | turboquant/validate_v3.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:12.689896 | """
TurboQuant V3 validation: compare V2 (QJL) vs V3 (MSE-only, asymmetric, residual window)
on real model KV cache data.
"""
import torch
import torch.nn.functional as F
import time
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from transformers import AutoMode... |
tonbistudio/turboquant-pytorch | https://github.com/tonbistudio/turboquant-pytorch | null | null | null | null | 978 | null | null | mit | null | null | null | null | null | null | null | turboquant/compressors_v3.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:12.693672 | """
TurboQuant V3: Community-informed KV cache compression.
Changes from V2 based on findings from 6+ independent implementations:
1. MSE-only (no QJL) — QJL variance is amplified by softmax, hurting attention
2. Asymmetric K/V bits — keys need more precision than values
3. Residual windowing — keep recent token... |
tonbistudio/turboquant-pytorch | https://github.com/tonbistudio/turboquant-pytorch | null | null | null | null | 978 | null | null | mit | null | null | null | null | null | null | null | turboquant/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:12.715787 | from .turboquant import TurboQuantMSE, TurboQuantProd, TurboQuantKVCache
from .lloyd_max import LloydMaxCodebook, solve_lloyd_max
from .compressors import TurboQuantCompressorV2, TurboQuantCompressorMSE
from .compressors_v3 import TurboQuantV3, MSECompressor
|
ronibandini/reggaetonBeGone | https://github.com/ronibandini/reggaetonBeGone | null | null | null | null | 978 | null | null | mit | null | null | null | null | null | null | null | reggaetonBeGone.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:19.759169 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Reggaeton Be Gone
# Roni Bandini @RoniBandini https://bandini.medium.com
# February 2024 V 1.0 (Sucio y Desprolijo, as Pappo said)
# MIT License (c) 2024 Roni Bandini
# Disclaimer: this is an educational project. Use with your own BT speakers only.
import os
import subp... |
danielweidman/pixmob-ir-reverse-engineering | https://github.com/danielweidman/pixmob-ir-reverse-engineering | null | null | null | null | 977 | null | null | mit | null | null | null | null | null | null | null | demo_multiple_effects.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:22.329793 | import serial
import time
from python_tools.pixmob_conversion_funcs import bits_to_arduino_string
from python_tools.effect_definitions import base_color_effects, tail_codes, special_effects
import python_tools.config as cfg
# This file lets you send a series of light effect commands with customizable timings over IR b... |
danielweidman/pixmob-ir-reverse-engineering | https://github.com/danielweidman/pixmob-ir-reverse-engineering | null | null | null | null | 977 | null | null | mit | null | null | null | null | null | null | null | python_tools/bit_flipir_tail.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:22.330860 | import PySimpleGUI as sg
import serial
import clipboard
import time
from pixmob_conversion_funcs import bits_to_arduino_string
import config as cfg
# BitFlipIR
# This is a quick-and-dirty program requested by @Sean1983 to give a user a quick UI with some "bit"
# values in a list, where they can click on one to "flip" ... |
danielweidman/pixmob-ir-reverse-engineering | https://github.com/danielweidman/pixmob-ir-reverse-engineering | null | null | null | null | 977 | null | null | mit | null | null | null | null | null | null | null | python_tools/brute_force_gui.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:22.334805 | import PySimpleGUI as sg
import time
from serial_brute_forcer_class import ScopedBruteForcer
from effect_definitions import base_color_effects, special_effects
import config as cfg
# This script is used to perform scoped brute forcing of IR codes. You specify a list of packet bits, with which ones to
# treat as consta... |
danielweidman/pixmob-ir-reverse-engineering | https://github.com/danielweidman/pixmob-ir-reverse-engineering | null | null | null | null | 977 | null | null | mit | null | null | null | null | null | null | null | python_tools/config.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:22.336976 | # Shared configuration options
# Which serial port the Arduino is connected to. You can find this with the Arduino IDE or follow these instructions:
# https://www.mathworks.com/help/supportpkg/arduinoio/ug/find-arduino-port-on-windows-mac-and-linux.html
ARDUINO_SERIAL_PORT = "/dev/ttyUSB0" # This will be "COM<some nu... |
danielweidman/pixmob-ir-reverse-engineering | https://github.com/danielweidman/pixmob-ir-reverse-engineering | null | null | null | null | 977 | null | null | mit | null | null | null | null | null | null | null | python_tools/bit_flipir.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:22.339143 | import PySimpleGUI as sg
import serial
import clipboard
import time
from pixmob_conversion_funcs import bits_to_arduino_string
import config as cfg
# BitFlipIR
# This is a quick-and-dirty program requested by @Sean1983 to give a user a quick UI with some "bit"
# values in a list, where they can click on one to "flip" ... |
danielweidman/pixmob-ir-reverse-engineering | https://github.com/danielweidman/pixmob-ir-reverse-engineering | null | null | null | null | 977 | null | null | mit | null | null | null | null | null | null | null | demo_effect_repl.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:22.340478 | import argparse
import logging
import time
from typing import Optional
import serial
from python_tools.effect_definitions import (
base_color_effects,
special_effects,
tail_codes,
)
from python_tools.pixmob_conversion_funcs import bits_to_arduino_string
logging.basicConfig(
level=logging.INFO,
fo... |
danielweidman/pixmob-ir-reverse-engineering | https://github.com/danielweidman/pixmob-ir-reverse-engineering | null | null | null | null | 977 | null | null | mit | null | null | null | null | null | null | null | demo_single_effect.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:22.341336 | import serial
import time
from python_tools.pixmob_conversion_funcs import bits_to_arduino_string
from python_tools.effect_definitions import base_color_effects, tail_codes, special_effects
import python_tools.config as cfg
# This file lets you send a single command to bracelets over IR by way of an Arduino connected ... |
danielweidman/pixmob-ir-reverse-engineering | https://github.com/danielweidman/pixmob-ir-reverse-engineering | null | null | null | null | 977 | null | null | mit | null | null | null | null | null | null | null | demo_multiple_effects_advanced.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:22.342344 | import serial
import time
from python_tools.pixmob_conversion_funcs import bits_to_arduino_string
from python_tools.effect_definitions import base_color_effects, tail_codes, special_effects
import datetime
import python_tools.config as cfg
# This file lets you send a series of light effect commands with customizable ti... |
danielweidman/pixmob-ir-reverse-engineering | https://github.com/danielweidman/pixmob-ir-reverse-engineering | null | null | null | null | 977 | null | null | mit | null | null | null | null | null | null | null | python_tools/effect_definitions.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:22.344991 | # This file contains definitions for light effect IR codes we have discovered.
# flipped 46 and 47
# These are the base color effects. Transmitting them alone will cause the bracelets to turn the specified color for a
# brief time and then turn off. Appending a "tail code" (see below) will modify the effect.
base_c... |
danielweidman/pixmob-ir-reverse-engineering | https://github.com/danielweidman/pixmob-ir-reverse-engineering | null | null | null | null | 977 | null | null | mit | null | null | null | null | null | null | null | python_tools/send.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:23.558901 | import serial
import python_tools.pixmob_conversion_funcs as funcs
import python_tools.config as cfg
def send_one_code(code, arduino=None):
if arduino is None:
arduino = serial.Serial(port=cfg.ARDUINO_SERIAL_PORT, baudrate=cfg.ARDUINO_BAUD_RATE, timeout=.1)
try:
print(code)
arduino_str... |
danielweidman/pixmob-ir-reverse-engineering | https://github.com/danielweidman/pixmob-ir-reverse-engineering | null | null | null | null | 977 | null | null | mit | null | null | null | null | null | null | null | python_tools/serial_brute_forcer_class.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:23.559434 | # Importing Libraries
import serial
import time
import copy
from pixmob_conversion_funcs import bits_to_arduino_string, bits_to_run_lengths_pulses
import clipboard
import pickle
class ScopedBruteForcer():
def __init__(self, brute_force_base_bits, arduino_port, arduino_baud_rate, ignore_effects_dict, skip_already_... |
danielweidman/pixmob-ir-reverse-engineering | https://github.com/danielweidman/pixmob-ir-reverse-engineering | null | null | null | null | 977 | null | null | mit | null | null | null | null | null | null | null | python_tools/tests/test_flipper_file_to_ones_and_zeroes.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:23.589355 | import unittest
from unittest import TestCase
from python_tools.flipper_file_to_ones_and_zeroes import flipper_file_to_run_length_lists, split_run_length_list
class Test(TestCase):
def test_flipper_file_to_run_length_lists(self):
expected_run_length_lists = [
[442, 3115, 357, 1592, 518, 2934, ... |
danielweidman/pixmob-ir-reverse-engineering | https://github.com/danielweidman/pixmob-ir-reverse-engineering | null | null | null | null | 977 | null | null | mit | null | null | null | null | null | null | null | python_tools/pixmob_conversion_funcs.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:24.140548 | import itertools
import python_tools.config as cfg
# This file contains functions used for converting between different representations of the PixMob data
# packets, including:
#
# - "run length" (time between IR light high/low switches), measured in microseconds, and also in pulses(could be called
# bit widths... |
danielweidman/pixmob-ir-reverse-engineering | https://github.com/danielweidman/pixmob-ir-reverse-engineering | null | null | null | null | 977 | null | null | mit | null | null | null | null | null | null | null | python_tools/send_and_read_color_detector_repeater.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:24.170974 | import re
import serial
import time
from pixmob_conversion_funcs import bits_to_arduino_string
import threading
# This is an experimental file created to try and automatically assign RGB values to color signals
# as described by sean1983 here: https://github.com/danielweidman/pixmob-ir-reverse-engineering/iss... |
danielweidman/pixmob-ir-reverse-engineering | https://github.com/danielweidman/pixmob-ir-reverse-engineering | null | null | null | null | 977 | null | null | mit | null | null | null | null | null | null | null | python_tools/effects_to_flipper_files.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:24.171731 | from effect_definitions import base_color_effects, tail_codes, special_effects
from pixmob_conversion_funcs import bits_to_run_lengths_microseconds, bits_to_arduino_string
import serial
import time
import config as cfg
FILE_OUT = "pixmob_good.ir"
# This file is used to convert effects from the effect_definitions.py f... |
danielweidman/pixmob-ir-reverse-engineering | https://github.com/danielweidman/pixmob-ir-reverse-engineering | null | null | null | null | 977 | null | null | mit | null | null | null | null | null | null | null | python_tools/effects_to_csv.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:24.262811 | def write_effects_csv(effects_dict, output_filename="effects.csv", overwrite=False):
if overwrite:
mode="w"
else:
# append or create a new file if it doesn't exist
mode = "a"
with open(output_filename, mode=mode) as f:
for effect, bits in effects_dict.items():
f.w... |
danielweidman/pixmob-ir-reverse-engineering | https://github.com/danielweidman/pixmob-ir-reverse-engineering | null | null | null | null | 977 | null | null | mit | null | null | null | null | null | null | null | python_tools/tests/test_pixmob_conversion_funcs.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:24.284250 | import unittest
from unittest import TestCase
import python_tools.pixmob_conversion_funcs as funcs
class Test(TestCase):
def test_bits_to_hex(self):
input = [1, 1, 1, 1, 0, 0, 0, 0]
expected_result = "0xf0"
self.assertEqual(funcs.bits_to_hex(input), expected_result)
def test_bits_to_... |
danielweidman/pixmob-ir-reverse-engineering | https://github.com/danielweidman/pixmob-ir-reverse-engineering | null | null | null | null | 977 | null | null | mit | null | null | null | null | null | null | null | python_tools/flipper_file_to_ones_and_zeroes.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:24.284704 | # Read a flipper file and for each raw capture, output a list of 1s and 0s (700 us high = 1, 700us low = 0)
import serial
import python_tools.pixmob_conversion_funcs as funcs
from pathlib import Path
import python_tools.config as cfg
from python_tools.send import send_list_of_codes
def flipper_file_to_run_length_lis... |
danielweidman/pixmob-ir-reverse-engineering | https://github.com/danielweidman/pixmob-ir-reverse-engineering | null | null | null | null | 977 | null | null | mit | null | null | null | null | null | null | null | python_tools/send_and_read_color_detector.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:24.314228 | import re
import serial
import time
from pixmob_conversion_funcs import bits_to_arduino_string
# This is an experimental file created to try and automatically assign RGB values to color signals
# as described by sean1983 here: https://github.com/danielweidman/pixmob-ir-reverse-engineering/issues/8
# This versio... |
microsoft/routeros-scanner | https://github.com/microsoft/routeros-scanner | null | null | null | null | 977 | null | null | mit | null | null | null | null | null | null | null | commands/ports.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:26.532322 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import traceback
import sys
from commands.basecommand import BaseCommand
class Ports(BaseCommand):
def __init__(self):
self.__name__ = 'Ports'
def run_ssh(self, sshc):
res = self._ssh_data_with_header(sshc, '/ip service... |
microsoft/routeros-scanner | https://github.com/microsoft/routeros-scanner | null | null | null | null | 977 | null | null | mit | null | null | null | null | null | null | null | commands/users.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:26.551519 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import traceback
import sys
from commands.basecommand import BaseCommand
class Users(BaseCommand):
def __init__(self):
self.__name__ = 'Users'
def run_ssh(self, sshc):
res = self._ssh_data_with_header(sshc, '/user print... |
microsoft/routeros-scanner | https://github.com/microsoft/routeros-scanner | null | null | null | null | 977 | null | null | mit | null | null | null | null | null | null | null | commands/dns.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:26.552861 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import traceback
import re
import sys
from commands.basecommand import BaseCommand
class DNS(BaseCommand):
def __init__(self):
self.__name__ = 'DNS Cache'
def run_ssh(self, sshc):
data = self._ssh_data(sshc, '/ip dns pr... |
microsoft/routeros-scanner | https://github.com/microsoft/routeros-scanner | null | null | null | null | 977 | null | null | mit | null | null | null | null | null | null | null | commands/files.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:26.553946 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import traceback
import sys
from commands.basecommand import BaseCommand
class Files(BaseCommand):
def __init__(self):
self.__name__ = 'Files'
def run_ssh(self, sshc):
res = self._ssh_data_with_header(sshc, '/file print... |
microsoft/routeros-scanner | https://github.com/microsoft/routeros-scanner | null | null | null | null | 977 | null | null | mit | null | null | null | null | null | null | null | commands/basecommand.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:26.598044 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import traceback
import sys
class BaseCommand(object):
def _ssh_data(self, sshc, command):
res = ''
try:
stdin, stdout, stderr = sshc.exec_command(command)
res = str(stdout.read())
except Excep... |
microsoft/routeros-scanner | https://github.com/microsoft/routeros-scanner | null | null | null | null | 977 | null | null | mit | null | null | null | null | null | null | null | commands/scheduler.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:26.598546 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import traceback
import re
import sys
from commands.basecommand import BaseCommand
class Scheduler(BaseCommand):
def __init__(self):
self.__name__ = 'Scheduler'
def run_ssh(self, sshc):
res = self._ssh_data_with_header(... |
microsoft/routeros-scanner | https://github.com/microsoft/routeros-scanner | null | null | null | null | 977 | null | null | mit | null | null | null | null | null | null | null | commands/proxy.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:26.624674 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from commands.basecommand import BaseCommand
class Proxy(BaseCommand):
def __init__(self):
self.__name__ = 'Proxy'
def run_ssh(self, sshc):
data = self._ssh_data(sshc, '/ip proxy print')
enabled = 'enabled: yes'... |
microsoft/routeros-scanner | https://github.com/microsoft/routeros-scanner | null | null | null | null | 977 | null | null | mit | null | null | null | null | null | null | null | commands/fwnat.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:26.625418 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import traceback
from ipaddress import ip_address
import sys
from commands.basecommand import BaseCommand
class FWNat(BaseCommand):
def __init__(self):
self.__name__ = 'FW Nat'
def run_ssh(self, sshc):
res = self._ssh_d... |
microsoft/routeros-scanner | https://github.com/microsoft/routeros-scanner | null | null | null | null | 977 | null | null | mit | null | null | null | null | null | null | null | commands/fwrules.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:26.626149 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from commands.basecommand import BaseCommand
class FW(BaseCommand):
def __init__(self):
self.__name__ = 'FW Rules'
def run_ssh(self, sshc):
res = self._ssh_data_with_header(sshc, '/ip firewall filter print detail')
... |
microsoft/routeros-scanner | https://github.com/microsoft/routeros-scanner | null | null | null | null | 977 | null | null | mit | null | null | null | null | null | null | null | commands/socks.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:26.645111 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from commands.basecommand import BaseCommand
class Socks(BaseCommand):
def __init__(self):
self.__name__ = 'Socks'
def run_ssh(self, sshc):
data = self._ssh_data(sshc, '/ip socks print')
enabled = 'enabled: yes'... |
microsoft/routeros-scanner | https://github.com/microsoft/routeros-scanner | null | null | null | null | 977 | null | null | mit | null | null | null | null | null | null | null | commands/version.py | null | null | null | null | null | null | Python | 2026-05-04T01:36:27.126930 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import traceback
import re
import os
import sys
from commands.basecommand import BaseCommand
from nvd import CVEValidator
CVES_PATH = './assets/mikrotik_cpe_match.json'
class Version(BaseCommand):
def __init__(self):
self.__name__ ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.