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
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
examples/calculate.py
null
null
null
null
null
null
Python
2026-05-04T01:48:23.729550
import os import sys from langchain_anthropic import ChatAnthropic from langchain_openai import ChatOpenAI from langchain_google_genai import ChatGoogleGenerativeAI sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import argparse import asyncio from mlx_use import Agent from pydantic imp...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
examples/basic_agent.py
null
null
null
null
null
null
Python
2026-05-04T01:48:23.737231
# --- START OF FILE examples/basic_agent.py --- import asyncio import json import time import logging import Cocoa from langchain_google_genai import ChatGoogleGenerativeAI from pydantic import SecretStr from mlx_use.mac.actions import click, type_into from mlx_use.mac.tree import MacUITreeBuilder NOTES_BUNDLE_ID = '...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
examples/check_time_online.py
null
null
null
null
null
null
Python
2026-05-04T01:48:23.741848
import os import sys from langchain_anthropic import ChatAnthropic from langchain_openai import ChatOpenAI from langchain_google_genai import ChatGoogleGenerativeAI sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import argparse import asyncio from mlx_use import Agent from pydantic imp...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
examples/try.py
null
null
null
null
null
null
Python
2026-05-04T01:48:23.742984
import os import sys from langchain_anthropic import ChatAnthropic from langchain_openai import ChatOpenAI from langchain_google_genai import ChatGoogleGenerativeAI sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import argparse import asyncio from mlx_use import Agent from pydantic imp...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
examples/gradio_app.py
null
null
null
null
null
null
Python
2026-05-04T01:48:23.762813
import asyncio import gradio as gr from mlx_use import Agent from mlx_use.controller.service import Controller from langchain_openai import ChatOpenAI # As an example, we are instantiating a ChatOpenAI language model. # Ensure you have your OpenAI API key set as an environment variable, or pass it here. llm = ChatOpe...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
examples/login_to_auth0.py
null
null
null
null
null
null
Python
2026-05-04T01:48:23.763986
import os import sys from langchain_anthropic import ChatAnthropic from langchain_openai import ChatOpenAI from langchain_google_genai import ChatGoogleGenerativeAI sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import asyncio from mlx_use import Agent from pydantic import SecretStr fr...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
conftest.py
null
null
null
null
null
null
Python
2026-05-04T01:48:23.766154
import os import sys from mlx_use.logging_config import setup_logging # Get the absolute path to the project root project_root = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, project_root) setup_logging()
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
examples/lunch_notes.py
null
null
null
null
null
null
Python
2026-05-04T01:48:23.803678
import os import sys from langchain_anthropic import ChatAnthropic from langchain_openai import ChatOpenAI from langchain_google_genai import ChatGoogleGenerativeAI sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import argparse import asyncio from mlx_use import Agent from pydantic imp...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
gradio_app/src/config/example_prompts.py
null
null
null
null
null
null
Python
2026-05-04T01:48:24.277654
EXAMPLE_CATEGORIES = { "Quick Tasks": [ {"name": "Play 'Tiny Dancer'", "prompt": "Play 'Tiny Dancer' by Elton John"}, {"name": "Making Siri Speak", "prompt": "say Shame on YOU! i'm not Siri! but if you want to make me speak, just prompt the agent with 'say' followed by what you want."}, {"na...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
gradio_app/app.py
null
null
null
null
null
null
Python
2026-05-04T01:48:24.284666
import os import signal import socket import asyncio import logging from typing import Dict, Union, Optional import gradio as gr from gradio_app.src.models.app import MacOSUseGradioApp from gradio_app.src.ui.interface import ( create_agent_tab, create_automations_tab, create_configuration_tab ) def creat...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
gradio_app/src/models/llm_models.py
null
null
null
null
null
null
Python
2026-05-04T01:48:24.375125
from typing import Optional from pydantic import SecretStr from langchain_anthropic import ChatAnthropic from langchain_openai import ChatOpenAI from langchain_google_genai import ChatGoogleGenerativeAI # LLM model mappings LLM_MODELS = { "OpenAI": ["gpt-4o", "o3-mini"], "Anthropic": ["claude-3-5-sonnet-202406...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
gradio_app/src/utils/logging_utils.py
null
null
null
null
null
null
Python
2026-05-04T01:48:24.380462
import logging import queue class QueueHandler(logging.Handler): def __init__(self, log_queue): super().__init__() self.log_queue = log_queue def emit(self, record): try: msg = self.format(record) self.log_queue.put(f"{msg}\n") except Exception: ...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
gradio_app/src/services/google_form.py
null
null
null
null
null
null
Python
2026-05-04T01:48:24.382265
import requests import logging def send_prompt_to_google_sheet(prompt: str, terminal_output: str = None) -> bool: """ Sends the prompt text and optional terminal output to a Google Form, which appends it to a linked Google Sheet. """ form_url = "https://docs.google.com/forms/d/1kbAdjvIU3KCplgk5OhzyK9aW...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
mlx_use/agent/message_manager/tests.py
null
null
null
null
null
null
Python
2026-05-04T01:48:24.388490
import pytest from langchain_anthropic import ChatAnthropic from langchain_core.messages import AIMessage, HumanMessage, SystemMessage from langchain_openai import AzureChatOpenAI, ChatOpenAI from mlx_use.agent.message_manager.service import MessageManager from mlx_use.agent.prompts import SystemPrompt from mlx_use.ag...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
mlx_use/__init__.py
null
null
null
null
null
null
Python
2026-05-04T01:48:24.412667
from mlx_use.logging_config import setup_logging setup_logging() from mlx_use.agent.prompts import SystemPrompt as SystemPrompt from mlx_use.agent.service import Agent as Agent from mlx_use.agent.views import ActionModel as ActionModel from mlx_use.agent.views import ActionResult as ActionResult from mlx_use.agent.vi...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
gradio_app/src/ui/interface.py
null
null
null
null
null
null
Python
2026-05-04T01:48:24.445881
import gradio as gr from typing import Dict, List, Any def create_agent_tab(app_instance) -> List[gr.components.Component]: with gr.Row(): # Left Column (scale=2) with gr.Column(scale=2): gr.Markdown("### Examples: How to prompt the agent") # Category Selection B...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
gradio_app/src/models/app.py
null
null
null
null
null
null
Python
2026-05-04T01:48:24.446380
import os import json import queue import logging import asyncio import traceback from pathlib import Path from typing import Optional, Generator, AsyncGenerator, List from dotenv import load_dotenv, set_key import gradio as gr from ..utils.logging_utils import setup_logging from ..models.llm_models import LLM_MODELS,...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
mlx_use/agent/message_manager/service.py
null
null
null
null
null
null
Python
2026-05-04T01:48:24.448637
from __future__ import annotations import logging from datetime import datetime from typing import List, Optional, Type from langchain_anthropic import ChatAnthropic from langchain_core.language_models import BaseChatModel from langchain_core.messages import ( AIMessage, BaseMessage, HumanMessage, ToolMessage, ) ...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
mlx_use/agent/message_manager/views.py
null
null
null
null
null
null
Python
2026-05-04T01:48:24.842407
from __future__ import annotations from typing import List, Optional from langchain_core.messages import AIMessage, BaseMessage, HumanMessage, SystemMessage from pydantic import BaseModel, Field class MessageMetadata(BaseModel): """Metadata for a message including token counts""" input_tokens: int = 0 class Ma...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
mlx_use/agent/prompts.py
null
null
null
null
null
null
Python
2026-05-04T01:48:24.857316
from datetime import datetime from typing import List, Optional from langchain_core.messages import HumanMessage, SystemMessage from mlx_use.agent.views import ActionResult, AgentStepInfo class SystemPrompt: def __init__(self, action_description: str, current_date: datetime, max_actions_per_step: int = 10): ...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
mlx_use/controller/registry/service.py
null
null
null
null
null
null
Python
2026-05-04T01:48:24.988694
import asyncio from inspect import iscoroutinefunction, signature from typing import Any, Callable, Optional, Type from pydantic import BaseModel, Field, create_model from mlx_use.controller.registry.views import ( ActionModel, ActionRegistry, RegisteredAction, ) from mlx_use.mac.tree import MacUITreeBuilder from ...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
mlx_use/agent/views.py
null
null
null
null
null
null
Python
2026-05-04T01:48:24.995397
from __future__ import annotations import json import traceback from dataclasses import dataclass from pathlib import Path from typing import Any, Dict, Optional, Type from openai import RateLimitError from pydantic import BaseModel, ConfigDict, Field, ValidationError, create_model from mlx_use.controller.registry.v...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
mlx_use/controller/registry/views.py
null
null
null
null
null
null
Python
2026-05-04T01:48:25.009290
from typing import Callable, Dict, Type from pydantic import BaseModel, ConfigDict class RegisteredAction(BaseModel): """Model for a registered action""" name: str description: str function: Callable param_model: Type[BaseModel] requires_mac_builder: bool = False model_config = ConfigDict(arbitrary_types_al...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
mlx_use/controller/views.py
null
null
null
null
null
null
Python
2026-05-04T01:48:25.033514
from typing import Literal, Optional from pydantic import BaseModel # mlx-use actions class DoneAction(BaseModel): text: str class InputTextAction(BaseModel): index: int text: str submit: bool class ClickElementAction(BaseModel): index: int action: str class RightClickElementAction(BaseModel): index: int...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
mlx_use/agent/service.py
null
null
null
null
null
null
Python
2026-05-04T01:48:25.034816
from __future__ import annotations import asyncio import base64 import io import json import logging import os import platform import textwrap import uuid from io import BytesIO from pathlib import Path from typing import Any, Callable, Dict, List, Optional, Type, TypeVar from dotenv import load_dotenv from langchain...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
mlx_use/logging_config.py
null
null
null
null
null
null
Python
2026-05-04T01:48:25.042489
import logging import os import sys from dotenv import load_dotenv load_dotenv() def addLoggingLevel(levelName, levelNum, methodName=None): """ Comprehensively adds a new logging level to the `logging` module and the currently configured logging class. `levelName` becomes an attribute of the `logging` module w...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
mlx_use/controller/service.py
null
null
null
null
null
null
Python
2026-05-04T01:48:25.083756
import asyncio import json import logging from typing import Literal import subprocess import Cocoa from playwright.async_api import Page from mlx_use.agent.views import ActionModel, ActionResult from mlx_use.controller.registry.service import Registry from mlx_use.controller.views import ( DoneAction, InputTextAct...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
mlx_use/mac/actions.py
null
null
null
null
null
null
Python
2026-05-04T01:48:25.101522
# --- START OF FILE mac_use/mac/actions.py --- import logging import Cocoa from ApplicationServices import ( AXUIElementPerformAction, AXUIElementSetAttributeValue, kAXPressAction, kAXValueAttribute, kAXConfirmAction, AXUIElementCopyActionNames ) from Foundation import NSString from mlx_use.mac.element impo...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
mlx_use/mac/context.py
null
null
null
null
null
null
Python
2026-05-04T01:48:25.418551
""" MacOS application controller using Accessibility API """ import asyncio import logging import os import uuid from dataclasses import dataclass, field from typing import TYPE_CHECKING, Dict, List, Optional import objc from ApplicationServices import ( AXObserverCreate, AXUIElementCopyAttributeValue, AXUIElement...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
mlx_use/mac/element.py
null
null
null
null
null
null
Python
2026-05-04T01:48:25.479329
# --- START OF FILE mac_use/mac/element.py --- from dataclasses import dataclass, field from typing import Optional, Dict, List, Any from functools import cached_property @dataclass class MacElementNode: """Represents a UI element in macOS with enhanced accessibility information""" # Required fields role: ...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
mlx_use/telemetry/service.py
null
null
null
null
null
null
Python
2026-05-04T01:48:25.590342
import logging import os import uuid from pathlib import Path from dotenv import load_dotenv from posthog import Posthog from mlx_use.telemetry.views import BaseTelemetryEvent from mlx_use.utils import singleton load_dotenv() logger = logging.getLogger(__name__) POSTHOG_EVENT_SETTINGS = { 'process_person_profil...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
mlx_use/mac/tree.py
null
null
null
null
null
null
Python
2026-05-04T01:48:25.591080
# --- START OF FILE mac_use/mac/tree.py --- import asyncio # --- START OF FILE mac_use/mac/actions.py --- import logging from typing import Callable, Dict, List, Optional import Cocoa from ApplicationServices import AXUIElementPerformAction, AXUIElementSetAttributeValue, kAXPressAction, kAXValueAttribute from Foundat...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
mlx_use/mac/views.py
null
null
null
null
null
null
Python
2026-05-04T01:48:25.646469
from dataclasses import dataclass from typing import Any, Optional from pydantic import BaseModel from mlx_use.dom.history_tree_processor.service import DOMHistoryElement from mlx_use.dom.views import DOMState # Pydantic class TabInfo(BaseModel): """Represents information about a browser tab""" page_id: int url...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
mlx_use/utils.py
null
null
null
null
null
null
Python
2026-05-04T01:48:25.646975
import logging import time from functools import wraps from typing import Any, Callable, Coroutine, ParamSpec, TypeVar logger = logging.getLogger(__name__) # Define generic type variables for return type and parameters R = TypeVar('R') P = ParamSpec('P') def time_execution_sync(additional_text: str = '') -> Callab...
browser-use/macOS-use
https://github.com/browser-use/macOS-use
null
null
null
null
1,934
null
null
mit
null
null
null
null
null
null
null
mlx_use/telemetry/views.py
null
null
null
null
null
null
Python
2026-05-04T01:48:25.675870
from abc import ABC, abstractmethod from dataclasses import asdict, dataclass from typing import Any, Dict, Optional from mlx_use.controller.registry.views import ActionModel @dataclass class BaseTelemetryEvent(ABC): @property @abstractmethod def name(self) -> str: pass @property def properties(self) -> Dict...
nat/natbot
https://github.com/nat/natbot
null
null
null
null
1,932
null
null
mit
null
null
null
null
null
null
null
natbot.py
null
null
null
null
null
null
Python
2026-05-04T01:48:28.140528
#!/usr/bin/env python3 # # natbot.py # # Set OPENAI_API_KEY to your API key, and then run this from a terminal. # from playwright.sync_api import sync_playwright import time from sys import argv, exit, platform import openai import os quiet = False if len(argv) >= 2: if argv[1] == '-q' or argv[1] == '--quiet': qui...
SathyaBhat/spotify-dl
https://github.com/SathyaBhat/spotify-dl
null
null
null
null
1,929
null
null
mit
null
null
null
null
null
null
null
tests/test_spotify_link.py
null
null
null
null
null
null
Python
2026-05-04T01:48:30.873349
from spotify_dl.spotify import parse_spotify_url, get_item_name from test_spotify_fetch_tracks import spotify_auth def test_parse_spotify_url(): album_url = "https://open.spotify.com/album/aabbccddee" playlist_url = "https://open.spotify.com/playlist/aabbccddee" track_url = "https://open.spotify.com/track...
SathyaBhat/spotify-dl
https://github.com/SathyaBhat/spotify-dl
null
null
null
null
1,929
null
null
mit
null
null
null
null
null
null
null
setup.py
null
null
null
null
null
null
Python
2026-05-04T01:48:30.874359
#!/usr/bin/env python3 from setuptools import setup, find_packages from spotify_dl.constants import VERSION with open("README.md") as f: long_description = f.read() with open("requirements.txt") as f: requirements = f.read().splitlines() setup( name="spotify_dl", version=VERSION, python_requires...
SathyaBhat/spotify-dl
https://github.com/SathyaBhat/spotify-dl
null
null
null
null
1,929
null
null
mit
null
null
null
null
null
null
null
spotify_dl/spotify_dl.py
null
null
null
null
null
null
Python
2026-05-04T01:48:30.886195
#!/usr/bin/env python3 import argparse import time import json import os import sys from logging import DEBUG, ERROR from pathlib import Path, PurePath import spotipy from spotipy.oauth2 import SpotifyClientCredentials from spotify_dl.constants import VERSION from spotify_dl.scaffold import log, setLogLevel, console, ...
SathyaBhat/spotify-dl
https://github.com/SathyaBhat/spotify-dl
null
null
null
null
1,929
null
null
mit
null
null
null
null
null
null
null
spotify_dl/youtube.py
null
null
null
null
null
null
Python
2026-05-04T01:48:30.894933
import urllib.request from os import path import os import shutil import multiprocessing import json import mutagen import csv import yt_dlp import ytmusicapi from mutagen.easyid3 import EasyID3 from mutagen.id3 import APIC, ID3 from mutagen.mp3 import MP3 from spotify_dl.scaffold import log from spotify_dl.utils impo...
SathyaBhat/spotify-dl
https://github.com/SathyaBhat/spotify-dl
null
null
null
null
1,929
null
null
mit
null
null
null
null
null
null
null
tests/test_spotify_fetch_tracks.py
null
null
null
null
null
null
Python
2026-05-04T01:48:30.896093
from spotipy.oauth2 import SpotifyClientCredentials from spotify_dl.spotify import fetch_tracks import spotipy import base64 def spotify_auth(): # test client ids, b64 for just to deter. client = spotipy.Spotify( auth_manager=SpotifyClientCredentials( client_id=base64.b64decode("NjliZDE4Zj...
SathyaBhat/spotify-dl
https://github.com/SathyaBhat/spotify-dl
null
null
null
null
1,929
null
null
mit
null
null
null
null
null
null
null
spotify_dl/constants.py
null
null
null
null
null
null
Python
2026-05-04T01:48:30.925718
import os from pathlib import Path __all__ = ["VERSION"] VERSION = "8.9.0" if os.getenv("XDG_CACHE_HOME") is not None: SAVE_PATH = os.getenv("XDG_CACHE_HOME") + "/spotifydl" else: SAVE_PATH = str(Path.home()) + "/.cache/spotifydl" DOWNLOAD_LIST = "download_list.log"
SathyaBhat/spotify-dl
https://github.com/SathyaBhat/spotify-dl
null
null
null
null
1,929
null
null
mit
null
null
null
null
null
null
null
spotify_dl/__init__.py
null
null
null
null
null
null
Python
2026-05-04T01:48:30.926356
import signal import sys def signal_handler(sig, frame): # Signal handler to handle SIGINT, usually when Ctrl+C is pressed.. or if SIGINT is sent. # Thanks to https://stackoverflow.com/a/1112350/92837 print("\nCaught interrupt(did you press Ctrl+C?), stopping spotify_dl") sys.exit(0) signal.signal(s...
SathyaBhat/spotify-dl
https://github.com/SathyaBhat/spotify-dl
null
null
null
null
1,929
null
null
mit
null
null
null
null
null
null
null
spotify_dl/utils.py
null
null
null
null
null
null
Python
2026-05-04T01:48:31.459885
import Levenshtein def get_closest_match(results, expected) -> str: """ Returns closest matching result based on Levenshtein edit distance. """ best_r = "" min_distance = float('inf') for r in results: curr_distance = Levenshtein.distance(r, expected) if (curr_distance < min_di...
SathyaBhat/spotify-dl
https://github.com/SathyaBhat/spotify-dl
null
null
null
null
1,929
null
null
mit
null
null
null
null
null
null
null
tests/test_youtube.py
null
null
null
null
null
null
Python
2026-05-04T01:48:31.472415
import os import urllib import urllib.request from pathlib import Path from mutagen.easyid3 import EasyID3 from mutagen.id3 import APIC, ID3 from mutagen.mp3 import MP3 from spotify_dl import youtube as yt def test_download_one_false_skip(): songs = { "urls": [ { "save_path":...
SathyaBhat/spotify-dl
https://github.com/SathyaBhat/spotify-dl
null
null
null
null
1,929
null
null
mit
null
null
null
null
null
null
null
spotify_dl/spotify.py
null
null
null
null
null
null
Python
2026-05-04T01:48:31.501940
import sys from spotify_dl.scaffold import log from spotify_dl.utils import sanitize from rich.progress import Progress def fetch_tracks(sp, item_type, item_id): """ Fetches tracks from the provided item_id. :param sp: Spotify client :param item_type: Type of item being requested for: album/playlist/t...
SathyaBhat/spotify-dl
https://github.com/SathyaBhat/spotify-dl
null
null
null
null
1,929
null
null
mit
null
null
null
null
null
null
null
tests/test_utils.py
null
null
null
null
null
null
Python
2026-05-04T01:48:31.528663
from spotify_dl.utils import sanitize def test_sanitize_flename(): name = sanitize("Dank: Tunes<> $ V The* Dranks |Strike Back/") assert name == "Dank Tunes V The Dranks Strike Back" name2 = sanitize('Dank: Tunes<> $ V " The* Dra?nks |Strike Back/', "#") assert name2 == "Dank# Tunes## # V # The# Dra...
SathyaBhat/spotify-dl
https://github.com/SathyaBhat/spotify-dl
null
null
null
null
1,929
null
null
mit
null
null
null
null
null
null
null
spotify_dl/scaffold.py
null
null
null
null
null
null
Python
2026-05-04T01:48:31.584580
import logging from os import getenv import sentry_sdk from rich.logging import RichHandler from rich.console import Console __all__ = ["log", "setLogLevel", "get_tokens", "console"] logging.basicConfig( level=logging.INFO, format="%(message)s", datefmt="[%X]", handlers=[RichHandler(show_level=False, ...
omnilib/aiomultiprocess
https://github.com/omnilib/aiomultiprocess
null
null
null
null
1,928
null
null
mit
null
null
null
null
null
null
null
aiomultiprocess/tests/core.py
null
null
null
null
null
null
Python
2026-05-04T01:48:33.658509
# Copyright 2022 Amethyst Reese # Licensed under the MIT license import asyncio import sys import time from unittest import TestCase from unittest.mock import patch import aiomultiprocess as amp from .base import ( async_test, do_nothing, get_dummy_constant, initializer, raise_fn, sleepy, ...
omnilib/aiomultiprocess
https://github.com/omnilib/aiomultiprocess
null
null
null
null
1,928
null
null
mit
null
null
null
null
null
null
null
aiomultiprocess/__init__.py
null
null
null
null
null
null
Python
2026-05-04T01:48:33.662178
# Copyright 2022 Amethyst Reese # Licensed under the MIT license """ AsyncIO version of the standard multiprocessing module """ __author__ = "Amethyst Reese" from .__version__ import __version__ from .core import Process, set_context, set_start_method, Worker from .pool import Pool, PoolResult from .scheduler import...
omnilib/aiomultiprocess
https://github.com/omnilib/aiomultiprocess
null
null
null
null
1,928
null
null
mit
null
null
null
null
null
null
null
aiomultiprocess/scheduler.py
null
null
null
null
null
null
Python
2026-05-04T01:48:33.663569
# Copyright 2022 Amethyst Reese # Licensed under the MIT license import itertools from abc import ABC, abstractmethod from typing import Any, Awaitable, Callable, Dict, Iterator, List, Sequence from .types import Queue, QueueID, R, TaskID class Scheduler(ABC): @abstractmethod def register_queue(self, tx: Qu...
omnilib/aiomultiprocess
https://github.com/omnilib/aiomultiprocess
null
null
null
null
1,928
null
null
mit
null
null
null
null
null
null
null
aiomultiprocess/tests/__main__.py
null
null
null
null
null
null
Python
2026-05-04T01:48:33.675204
# Copyright 2022 Amethyst Reese # Licensed under the MIT license import unittest if __name__ == "__main__": # pragma: no cover unittest.main(module="aiomultiprocess.tests", verbosity=2)
omnilib/aiomultiprocess
https://github.com/omnilib/aiomultiprocess
null
null
null
null
1,928
null
null
mit
null
null
null
null
null
null
null
aiomultiprocess/pool.py
null
null
null
null
null
null
Python
2026-05-04T01:48:33.682293
# Copyright 2022 Amethyst Reese # Licensed under the MIT license import asyncio import logging import os import queue import traceback from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, Dict, Generator, Optional, Sequence, Tuple, TypeVar, ) from .c...
omnilib/aiomultiprocess
https://github.com/omnilib/aiomultiprocess
null
null
null
null
1,928
null
null
mit
null
null
null
null
null
null
null
aiomultiprocess/tests/perf.py
null
null
null
null
null
null
Python
2026-05-04T01:48:33.682744
# Copyright 2022 Amethyst Reese # Licensed under the MIT license import asyncio import time from unittest import TestCase import aiomultiprocess as amp from .base import perf_test PERF_SETS = [ # sleep, tasks, processes, concurrency ((0,), 400, 4, 8), ((0,), 800, 4, 16), ((0,), 1600, 4, 32), ((0,...
omnilib/aiomultiprocess
https://github.com/omnilib/aiomultiprocess
null
null
null
null
1,928
null
null
mit
null
null
null
null
null
null
null
aiomultiprocess/core.py
null
null
null
null
null
null
Python
2026-05-04T01:48:33.683781
# Copyright 2022 Amethyst Reese # Licensed under the MIT license import asyncio import logging import multiprocessing import multiprocessing.context import multiprocessing.managers import os import sys from typing import Any, Callable, Dict, Optional, Sequence from .types import Context, R, Unit DEFAULT_START_METHOD...
omnilib/aiomultiprocess
https://github.com/omnilib/aiomultiprocess
null
null
null
null
1,928
null
null
mit
null
null
null
null
null
null
null
aiomultiprocess/tests/__init__.py
null
null
null
null
null
null
Python
2026-05-04T01:48:33.709886
# Copyright 2022 Amethyst Reese # Licensed under the MIT license import logging import sys from .core import CoreTest from .perf import PerfTest from .pool import PoolTest from .scheduler import SchedulerTest logging.basicConfig(level=logging.INFO, stream=sys.stderr)
omnilib/aiomultiprocess
https://github.com/omnilib/aiomultiprocess
null
null
null
null
1,928
null
null
mit
null
null
null
null
null
null
null
aiomultiprocess/tests/base.py
null
null
null
null
null
null
Python
2026-05-04T01:48:33.757343
# Copyright 2022 Amethyst Reese # Licensed under the MIT license import asyncio import os from functools import wraps from unittest import skipUnless RUN_PERF_TESTS = bool(os.environ.get("PERF_TESTS", False)) def do_nothing(): return async def two(): return 2 async def sleepy(): await asyncio.sleep(...
omnilib/aiomultiprocess
https://github.com/omnilib/aiomultiprocess
null
null
null
null
1,928
null
null
mit
null
null
null
null
null
null
null
aiomultiprocess/tests/scheduler.py
null
null
null
null
null
null
Python
2026-05-04T01:48:34.234128
# Copyright 2022 Amethyst Reese # Licensed under the MIT license from unittest import TestCase import aiomultiprocess as amp class SchedulerTest(TestCase): def test_roundrobin_scheduler_one(self): scheduler = amp.RoundRobin() qid = scheduler.register_queue(object()) scheduler.register_pr...
omnilib/aiomultiprocess
https://github.com/omnilib/aiomultiprocess
null
null
null
null
1,928
null
null
mit
null
null
null
null
null
null
null
aiomultiprocess/tests/pool.py
null
null
null
null
null
null
Python
2026-05-04T01:48:34.255147
# Copyright 2022 Amethyst Reese # Licensed under the MIT license import asyncio from unittest import TestCase import aiomultiprocess as amp from aiomultiprocess.core import get_context from aiomultiprocess.pool import PoolWorker, ProxyException from .base import async_test, mapper, raise_fn, starmapper, two async ...
omnilib/aiomultiprocess
https://github.com/omnilib/aiomultiprocess
null
null
null
null
1,928
null
null
mit
null
null
null
null
null
null
null
aiomultiprocess/types.py
null
null
null
null
null
null
Python
2026-05-04T01:48:34.280382
# Copyright 2022 Amethyst Reese # Licensed under the MIT license import multiprocessing from asyncio import BaseEventLoop from typing import ( Any, Callable, Dict, NamedTuple, NewType, Optional, Sequence, Tuple, TypeVar, ) T = TypeVar("T") R = TypeVar("R") Context = multiprocessin...
omnilib/aiomultiprocess
https://github.com/omnilib/aiomultiprocess
null
null
null
null
1,928
null
null
mit
null
null
null
null
null
null
null
docs/conf.py
null
null
null
null
null
null
Python
2026-05-04T01:48:34.280979
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
beacon_chain_impl/bls.py
null
null
null
null
null
null
Python
2026-05-04T01:48:36.530535
try: from hashlib import blake2s except: from pyblake2 import blake2s blake = lambda x: blake2s(x).digest() from py_ecc.optimized_bn128 import G1, G2, neg, add, multiply, FQ, FQ2, FQ12, pairing, \ normalize, field_modulus, b, b2, is_on_curve, curve_order, final_exponentiate def compress_G1(pt): x, y = ...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
beacon_chain_impl/progressive_merkle_tree.py
null
null
null
null
null
null
Python
2026-05-04T01:48:36.534114
from hashlib import blake2s import binascii def hash(x): return blake2s(x).digest() zerohashes = [b'\x00' * 32] for i in range(1, 32): zerohashes.append(hash(zerohashes[i-1] + zerohashes[i-1])) # Add a value to a Merkle tree by using the algo # that stores a branch of sub-roots def add_value(branch, index, value...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
barycentric_low_degree_check/poly_utils.py
null
null
null
null
null
null
Python
2026-05-04T01:48:36.539681
# Creates an object that includes convenience operations for numbers # and polynomials in some prime field class PrimeField(): def __init__(self, modulus): assert pow(2, modulus, modulus) == 2 self.modulus = modulus def add(self, x, y): return (x+y) % self.modulus def sub(self, x, ...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
3sf-mini/consensus.py
null
null
null
null
null
null
Python
2026-05-04T01:48:36.548955
from dataclasses import dataclass, field, asdict from typing import Optional, List, Dict import hashlib import json import copy ZERO_HASH = '0'*64 # Chain configuration @dataclass class Config: num_validators: int # Blockchain state @dataclass class State: config: Config latest_justified_hash: str la...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
99fault/consensus.py
null
null
null
null
null
null
Python
2026-05-04T01:48:36.559134
# Implementation of 99% fault tolerant consensus as decribed by Leslie Lamport # on page 391 of https://people.eecs.berkeley.edu/~luca/cs174/byzantine.pdf import random from network import Network TIMEOUT = 10 LATENCY = 5 # A node in the network (not including the "commander") class Node(): def __init__(self, ne...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
barycentric_low_degree_check/barycentric_low_degree_check.py
null
null
null
null
null
null
Python
2026-05-04T01:48:36.561445
from random import randint, shuffle, choice from poly_utils import PrimeField MODULUS = 0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001 PRIMITIVE_ROOT = 7 assert pow(PRIMITIVE_ROOT, (MODULUS - 1) // 2, MODULUS) != 1 assert pow(PRIMITIVE_ROOT, MODULUS - 1, MODULUS) == 1 primefield = PrimeField(MODU...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
3sf-mini/test_p2p.py
null
null
null
null
null
null
Python
2026-05-04T01:48:36.562522
from consensus import ( State, Vote, Block, Config, get_latest_justified_hash, get_fork_choice_head, compute_hash ) from p2p import Staker, P2PNetwork from typing import Optional, List, Dict import random SLOT_DURATION = 12 NUM_STAKERS = 10 ZERO_HASH = '0'*64 import matplotlib.pyplot as plt import network...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
beacon_chain_impl/full_pos.py
null
null
null
null
null
null
Python
2026-05-04T01:48:36.563653
try: from hashlib import blake2s except: from pyblake2 import blake2s blake = lambda x: blake2s(x).digest() import bls import random from bls import decompress_G1, aggregate_pubs, verify, sign, privtopub from simpleserialize import deepcopy, serialize, to_dict SHARD_COUNT = 20 ATTESTER_COUNT = 32 DEFAULT_BALA...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
3sf-mini/p2p.py
null
null
null
null
null
null
Python
2026-05-04T01:48:36.564514
import random import heapq from typing import List, Dict, Union, Optional, Set import copy from consensus import ( State, Vote, Block, process_block, get_latest_justified_hash, get_fork_choice_head, compute_hash, is_justifiable_slot ) from collections import defaultdict SLOT_DURATION = 12 # time units ZER...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
beacon_chain_impl/simpleserialize.py
null
null
null
null
null
null
Python
2026-05-04T01:48:36.588454
def serialize(val, typ=None): if typ is None and hasattr(val, 'fields'): typ = type(val) if typ in ('hash32', 'address'): assert len(val) == 20 if typ == 'address' else 32 return val elif isinstance(typ, str) and typ[:3] == 'int': length = int(typ[3:]) assert length %...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
beacon_chain_impl/test.py
null
null
null
null
null
null
Python
2026-05-04T01:48:37.146131
from bls import G1, G2, hash_to_G2, compress_G1, compress_G2, \ decompress_G1, decompress_G2, normalize, multiply, \ sign, privtopub, aggregate_sigs, aggregate_pubs, verify from simpleserialize import serialize, deserialize, eq from full_pos import ActiveState, CheckpointRecord for x in (1, 5, 124, 735, 1274...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
beacon_chain_impl/test_full_pos.py
null
null
null
null
null
null
Python
2026-05-04T01:48:37.146703
from full_pos import blake, mk_genesis_state_and_block, compute_state_transition, \ get_attesters_and_signer, Block, get_crosslink_aggvote_msg, AggregateVote, \ SHARD_COUNT, ATTESTER_COUNT, get_shard_attesters import random import bls from simpleserialize import serialize, deserialize, eq, deepcopy import time ...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
binary_fft.py
null
null
null
null
null
null
Python
2026-05-04T01:48:37.152485
def log2(x): return 0 if x <= 1 else 1 + log2(x // 2) def raw_mul(a, b): if a*b == 0: return 0 o = 0 for i in range(log2(b) + 1): if b & (1<<i): o ^= a<<i return o def raw_mod(a, b): blog = log2(b) alog = log2(a) while alog >= blog: if a & (1<<alog):...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
binary_fft/binary_fft.py
null
null
null
null
null
null
Python
2026-05-04T01:48:37.172561
def log2(x): o = 0 while x > 1: x //= 2 o += 1 return o def is_power_of_2(x): return x > 0 and x&(x-1) == 0 def raw_mul(a, b): if a*b == 0: return 0 o = 0 for i in range(log2(b) + 1): if b & (1<<i): o ^= a<<i return o def raw_mod(a, b): ...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
binius/binary_ntt.py
null
null
null
null
null
null
Python
2026-05-04T01:48:37.196665
from binary_fields import BinaryFieldElement as B from utils import log2, eval_poly_at, mul_polys, add_polys # Computes the polynomial that returns 0 on 0.....(1<<i)-1 and 1 on (1<<i) # Relies on the identity W{i+1}(X) = Wi(X) * (Wi(X) + Wi(1<<i)) def get_Wi(i): if i == 0: return [B(0), B(1)] else: ...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
binius/binary_fields.py
null
null
null
null
null
null
Python
2026-05-04T01:48:37.205778
# Multiply v1 * v2 in the binary tower field # See https://blog.lambdaclass.com/snarks-on-binary-fields-binius/ # for introduction to how binary tower fields work # # The general rule is that if i = b0b1...bk in binary, then the # index-i bit is the product of all x_i where b_i=1, eg. the # index-5 bit (32) is x_2 * x_...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
binary_fft/ethereum_data_root.py
null
null
null
null
null
null
Python
2026-05-04T01:48:37.206860
# import fast_binary_fft as b import binary_fft as b f = b.BinaryField(65579) from hashlib import sha256 def hash(x): return sha256(x).digest() log2 = b.log2 # Alternative optimized/simplified inverse-FFT implementation # shift_polys[i][j] is the 2**j degree coefficient of the polynomial that evaluates to [1,1...1, ...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
binary_fft/test_binary_fft.py
null
null
null
null
null
null
Python
2026-05-04T01:48:37.208487
import binary_fft bigf = binary_fft.BinaryField(1033) poly = [x**9 % 1024 for x in range(1024)] z = binary_fft.fft(bigf, range(1024), poly) z2 = binary_fft._simple_ft(bigf, range(1024), poly) assert z == z2 poly2 = binary_fft.invfft(bigf, range(1024), z) assert poly2 == poly print("Invfft and fft tests passed") poly3 ...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
binius/merkle.py
null
null
null
null
null
null
Python
2026-05-04T01:48:37.266393
from hashlib import sha256 def hash(x): return sha256(x).digest() # Build a Merkle tree from the inputs, where o[i] is the parent node of # o[2i] and o[2i+1], the second half of o is the original data, and o[1] # is the root def merkelize(vals): assert len(vals) & (len(vals)-1) == 0 o = [None] * len(vals)...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
binary_fft/test_ethereum_data_root.py
null
null
null
null
null
null
Python
2026-05-04T01:48:37.304485
import ethereum_data_root as e import sys import os from hashlib import sha256 datastream = b''.join([sha256(bytes([i])).digest() for i in range(256)]) if __name__ == '__main__': L = int(sys.argv[1]) data = (datastream * (L // len(datastream) + 1))[:L] print(e.mk_data_root(data))
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
binius/simple_binius.py
null
null
null
null
null
null
Python
2026-05-04T01:48:37.740301
EXPANSION_FACTOR = 8 NUM_CHALLENGES = 32 BYTES_PER_ELEMENT = 2 from utils import ( get_class, enforce_type_compatibility, evaluation_tensor_product, log2, multilinear_poly_eval ) from binary_ntt import extend from merkle import hash, merkelize, get_root, get_branch, verify_branch def choose_row_length_and_cou...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
binius/packed_binius.py
null
null
null
null
null
null
Python
2026-05-04T01:48:37.756348
EXPANSION_FACTOR = 8 NUM_CHALLENGES = 32 PACKING_FACTOR = 16 from binary_fields import BinaryFieldElement from utils import ( get_class, pack_vector, evaluation_tensor_product, log2, multilinear_poly_eval ) from merkle import hash, merkelize, get_root, get_branch, verify_branch from binary_ntt import extend #...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
binius/test.py
null
null
null
null
null
null
Python
2026-05-04T01:48:37.791521
from binary_fields import BinaryFieldElement as B from utils import ( extend, log2, eval_poly_at, multilinear_poly_eval, evaluation_tensor_product ) from simple_binius import simple_binius_proof, verify_simple_binius_proof from packed_binius import ( packed_binius_proof, verify_packed_binius_proof ) from op...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
bitcoin_unlimited_style_sizelimits.py
null
null
null
null
null
null
Python
2026-05-04T01:48:37.804382
# The purpose of this script is to create an evolutionary # model to study the equilibrium effects of Bitcoin Unlimited-style # "emergent consensus". Note that the model is not yet quite # complete as it does not take into account the benefits of # mining "sister blocks" that steal transaction fees, though it # does gi...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
blind_and_swap/blind_and_swap.py
null
null
null
null
null
null
Python
2026-05-04T01:48:37.817981
# THIS IS EXPERIMENTAL CODE. DO NOT USE IN PRODUCTION! from hashlib import sha256 hash_to_int = lambda x: int.from_bytes(sha256(x).digest(), 'little') from py_ecc import bn128 as curve POINT = tuple SIG2 = tuple SIG3 = tuple def serialize_int(x): return x.to_bytes(32, 'little') def serialize_point(pt): x, y...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
binius/utils.py
null
null
null
null
null
null
Python
2026-05-04T01:48:37.823370
# Helper methods to allow the below methods to be used for multiple types # (binary fields, prime fields, regular integers), while still enforcing # compatibility # # The type flexibility also lets us reuse much of the same code for # packed-binius that we use for simple-binius def get_class(arg, start=int): if is...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
binius/optimized_utils.py
null
null
null
null
null
null
Python
2026-05-04T01:48:37.824586
from binary_fields import BinaryFieldElement as B, binmul from binary_ntt import get_Wi_eval from utils import log2 try: import cupy as np x = np.arange(10**5) except: import numpy as np MAX_SIZE = 32768 LOW_MEMORY = True # Build a 65536*65536 multiplication table of uint16's (takes 8 GB RAM) def build_m...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
blind_and_swap/swapsim.py
null
null
null
null
null
null
Python
2026-05-04T01:48:37.865600
import random, sys def run(width, rounds, swaps_per_round, extract_positions): array = list(range(width)) o = [] for r in range(rounds): # Swap offsets = [(r*2+1)*i for i in range(swaps_per_round)] swap_indices = [(extract_positions[r-1] + offset) % width for offset in offsets] ...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
binius/optimized_binius.py
null
null
null
null
null
null
Python
2026-05-04T01:48:37.869927
EXPANSION_FACTOR = 4 NUM_CHALLENGES = 40 PACKING_FACTOR = 16 from utils import log2 from optimized_utils import ( extend, multilinear_poly_eval, bytestobits, bitstobytes, uint16s_to_bits, bits_to_uint16s, evaluation_tensor_product, bigbin_to_int, big_mul, multisubset, np, xor_along_axis ) from merkle i...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
blind_and_swap/swapsim2.py
null
null
null
null
null
null
Python
2026-05-04T01:48:37.918121
import copy, sys, random LOG_LEVEL = [None] FUNCTION = (lambda: 0).__class__ DEFAULTS = { 'width': 256, 'rounds': 512, 'swaps_per_round': 15, 'log_level': 1 } def merge_probs(*probs): L = len(probs) #if isinstance(probs[0], list): # return [sum(prob[i]) / len(probs) o = {} for ...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
bulletproofs/multicombs.py
null
null
null
null
null
null
Python
2026-05-04T01:48:38.345288
import random, time, sys, math def multisubset(numbers, subsets, adder=lambda x,y: x+y, zero=0): # Split up the numbers into partitions partition_size = 1 + int(math.log(len(subsets) + 1)) # Align number count to partition size (for simplicity) numbers = numbers[::] while len(numbers) % partition_s...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
bulletproofs/ipa_commitments.py
null
null
null
null
null
null
Python
2026-05-04T01:48:38.346510
from py_ecc import optimized_bls12_381 as b from hashlib import sha256 from dataclasses import dataclass from multicombs import lincomb import time # See page 25 and 29 of https://eprint.iacr.org/2020/1536.pdf and # page 49-50 of https://eprint.iacr.org/2020/499.pdf # -------------------------------------------------...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
casper4/basic_validation_code.se.py
null
null
null
null
null
null
Python
2026-05-04T01:48:38.350328
~calldatacopy(0, 0, 128) ~call(3000, 1, 0, 0, 128, 0, 32) return(~mload(0) == 0xfe2ec957647679d210034b65e9c7db2452910b0c)
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
casper4/griefing_one_third_offline_simulator.py
null
null
null
null
null
null
Python
2026-05-04T01:48:38.415446
import math # Length of an epoch in seconds epoch_len = 1400 # In-protocol penalization parameter increment = 0.00002 # Parameters NFP = 0 NCP = 3 NCCP = 3 NPP = 3 NPCP = 3 def sim_offline(p): online, offline = 1-p, p for i in range(1, 999999): # Lost by offline validators offline_loss = NFP ...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
casper4/sighash.se.py
null
null
null
null
null
null
Python
2026-05-04T01:48:38.432961
# Fetches the char from calldata at position $x macro calldatachar($x): div(calldataload($x), 2**248) # Fetches the next $b bytes from calldata starting at position $x # Assumes that there is nothing important in memory at bytes 0..63 macro calldatabytes_as_int($x, $b): ~mstore(32-$b, calldataload($x)) ~m...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
casper4/griefing_factor_calculator.py
null
null
null
null
null
null
Python
2026-05-04T01:48:38.434121
# Computes griefing factors of various parameter sets for Casper the # Friendly Finality Gadget # Case 1: <1/3 non-commit (optimal if epsilon participate) def gf1(x1, x2, x3, x4, x5): return x2 / x1 # Case 2: censor <1/3 committers (optimal if 1/3 get censored) def gf2(x1, x2, x3, x4, x5): return 1.5 * (x1 + ...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
casper4/simple_casper.v.py
null
null
null
null
null
null
Python
2026-05-04T01:48:38.463896
# Information about validators validators: public({ # Amount of wei the validator holds deposit: wei_value, # The dynasty the validator is joining dynasty_start: num, # The dynasty the validator joined for the first time original_dynasty_start: num, # The dynasty the validator is leaving ...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
casper4/simple_casper_tester.py
null
null
null
null
null
null
Python
2026-05-04T01:48:38.485779
from ethereum import tester as t from ethereum import utils, state_transition, transactions, abi from viper import compiler import serpent from ethereum.slogging import LogRecorder, configure_logging, set_level config_string = ':info,eth.vm.log:trace,eth.vm.op:trace,eth.vm.stack:trace,eth.vm.exit:trace,eth.pb.msg:trace...
ethereum/research
https://github.com/ethereum/research
null
null
null
null
1,927
null
null
mit
null
null
null
null
null
null
null
casper4/fixed_address_creator.py
null
null
null
null
null
null
Python
2026-05-04T01:48:38.517983
import serpent import rlp from ethereum import utils from ethereum import tester from ethereum import transactions sighash = serpent.compile('sighash.se.py') tests = [ [b"\x01"], [b"\x80", "a"], [b"\x81", "b"], [b""], [b"", b"\x01", b""], [b"", b"\x81", b""], [b"dog", b"c" * 54, b"\x01"],...