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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
microsoft/magentic-ui | https://github.com/microsoft/magentic-ui | null | null | null | null | 9,802 | null | null | mit | null | null | null | null | null | null | null | src/magentic_ui/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:10.099352 | from .task_team import get_task_team
from .teams.orchestrator.orchestrator_config import OrchestratorConfig
from .input_func import AsyncInputFunc, InputFuncType, InputRequestType, SyncInputFunc
from .approval_guard import (
BaseApprovalGuard,
MaybeRequiresApproval,
DEFAULT_REQUIRES_APPROVAL,
)
from .guarde... |
microsoft/magentic-ui | https://github.com/microsoft/magentic-ui | null | null | null | null | 9,802 | null | null | mit | null | null | null | null | null | null | null | src/magentic_ui/_cli.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:10.160502 | import asyncio
import json
import logging
import os
import signal
import sys
import types
from datetime import datetime
from pathlib import Path
from typing import Any, List, Literal, Optional, cast
from typing_extensions import Annotated
import typer
import yaml
from autogen_core import EVENT_LOGGER_NAME, Cancellatio... |
microsoft/magentic-ui | https://github.com/microsoft/magentic-ui | null | null | null | null | 9,802 | null | null | mit | null | null | null | null | null | null | null | samples/sample_azure_agent.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:10.194319 | import asyncio
from autogen_agentchat.messages import TextMessage
from autogen_core import CancellationToken
from autogen_ext.agents.azure._azure_ai_agent import AzureAIAgent
from azure.ai.projects.aio import AIProjectClient
from azure.identity.aio import DefaultAzureCredential
import dotenv
import os
from typing impor... |
microsoft/magentic-ui | https://github.com/microsoft/magentic-ui | null | null | null | null | 9,802 | null | null | mit | null | null | null | null | null | null | null | src/magentic_ui/agents/file_surfer/_code_markdown_file_browser.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:10.197553 | import io
import re
import time
from pathlib import Path
from mimetypes import guess_type
from typing import List, Optional, Tuple, Union
from autogen_core.code_executor import CodeExecutor, CodeBlock
from autogen_core import CancellationToken
from ._browser_code_helpers import (
get_path_validation_code,
get_... |
microsoft/magentic-ui | https://github.com/microsoft/magentic-ui | null | null | null | null | 9,802 | null | null | mit | null | null | null | null | null | null | null | src/magentic_ui/agents/file_surfer/_file_surfer.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:10.440305 | import json
from pathlib import Path
import traceback
from typing import List, Sequence, Tuple, AsyncGenerator, Optional, Dict, Any, Mapping
from datetime import datetime
from loguru import logger
import asyncio
from autogen_agentchat.agents import BaseChatAgent
from autogen_agentchat.base import Response
from autogen... |
microsoft/magentic-ui | https://github.com/microsoft/magentic-ui | null | null | null | null | 9,802 | null | null | mit | null | null | null | null | null | null | null | src/magentic_ui/agents/file_surfer/_tool_definitions.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:10.512330 | from autogen_core.tools import ParametersSchema
from ...tools.tool_metadata import load_tool
EXPLANATION_TOOL_PROMPT = "Explain to the user the action to be performed and reason for doing so. Phrase as if you are directly talking to the user."
TOOL_OPEN_PATH = load_tool(
{
"type": "function",
"fun... |
microsoft/magentic-ui | https://github.com/microsoft/magentic-ui | null | null | null | null | 9,802 | null | null | mit | null | null | null | null | null | null | null | src/magentic_ui/agents/mcp/_agent.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:10.557574 | from typing import Any, AsyncGenerator, List, Sequence
from autogen_agentchat.agents import AssistantAgent
from autogen_agentchat.base import Response
from autogen_agentchat.messages import (
BaseAgentEvent,
BaseChatMessage,
BaseTextChatMessage,
ToolCallRequestEvent,
ToolCallExecutionEvent,
)
from ... |
microsoft/magentic-ui | https://github.com/microsoft/magentic-ui | null | null | null | null | 9,802 | null | null | mit | null | null | null | null | null | null | null | src/magentic_ui/agents/mcp/_config.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:10.665694 | from typing import List
from autogen_agentchat.agents._assistant_agent import AssistantAgentConfig
from ...tools.mcp import NamedMcpServerParams
class McpAgentConfig(AssistantAgentConfig):
mcp_servers: List[NamedMcpServerParams]
model_context_token_limit: int | None = None
tool_call_summary_format: str ... |
microsoft/magentic-ui | https://github.com/microsoft/magentic-ui | null | null | null | null | 9,802 | null | null | mit | null | null | null | null | null | null | null | src/magentic_ui/agents/users/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:10.670115 | from ._dummy_user_proxy import DummyUserProxy
from ._metadata_user_proxy import MetadataUserProxy
__all__ = ["DummyUserProxy", "MetadataUserProxy"]
|
microsoft/magentic-ui | https://github.com/microsoft/magentic-ui | null | null | null | null | 9,802 | null | null | mit | null | null | null | null | null | null | null | src/magentic_ui/agents/users/_dummy_user_proxy.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:10.753241 | from typing import AsyncGenerator, Sequence, List
from autogen_core.models import (
LLMMessage,
AssistantMessage,
)
from autogen_agentchat.agents import BaseChatAgent
from autogen_agentchat.base import Response
from autogen_agentchat.messages import BaseAgentEvent, BaseChatMessage, TextMessage
from autogen_co... |
microsoft/magentic-ui | https://github.com/microsoft/magentic-ui | null | null | null | null | 9,802 | null | null | mit | null | null | null | null | null | null | null | src/magentic_ui/agents/users/_metadata_user_proxy.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:10.778797 | from typing import AsyncGenerator, Sequence, List, Literal
from autogen_agentchat.agents import BaseChatAgent
from autogen_agentchat.base import Response
from autogen_agentchat.messages import (
BaseAgentEvent,
BaseChatMessage,
TextMessage,
)
from autogen_core.model_context import TokenLimitedChatCompletion... |
microsoft/magentic-ui | https://github.com/microsoft/magentic-ui | null | null | null | null | 9,802 | null | null | mit | null | null | null | null | null | null | null | src/magentic_ui/agents/web_surfer/_cua_web_surfer.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:10.796914 | import base64
import json
from typing import AsyncGenerator, Sequence
from autogen_agentchat.base import Response
from autogen_agentchat.messages import BaseChatMessage, TextMessage
from autogen_core import CancellationToken
from autogen_agentchat.messages import (
MultiModalMessage,
)
from openai import OpenAI
f... |
microsoft/magentic-ui | https://github.com/microsoft/magentic-ui | null | null | null | null | 9,802 | null | null | mit | null | null | null | null | null | null | null | src/magentic_ui/agents/web_surfer/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:10.850344 | from ._web_surfer import WebSurfer, WebSurferConfig
from ._cua_web_surfer import WebSurferCUA
from .fara._fara_web_surfer import FaraWebSurfer
__all__ = [
"WebSurfer",
"WebSurferConfig",
"WebSurferCUA",
"FaraWebSurfer",
]
|
microsoft/magentic-ui | https://github.com/microsoft/magentic-ui | null | null | null | null | 9,802 | null | null | mit | null | null | null | null | null | null | null | src/magentic_ui/agents/web_surfer/_events.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:11.051087 | from dataclasses import dataclass
from typing import Any, Dict
@dataclass
class WebSurferEvent:
source: str
message: str
url: str
action: str | None = None
arguments: Dict[str, Any] | None = None
|
microsoft/magentic-ui | https://github.com/microsoft/magentic-ui | null | null | null | null | 9,802 | null | null | mit | null | null | null | null | null | null | null | src/magentic_ui/agents/web_surfer/_set_of_mark.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:11.126123 | import io
from typing import BinaryIO, Dict, List, Tuple, cast
from PIL import Image, ImageDraw, ImageFont
from ...tools.playwright.types import DOMRectangle, InteractiveRegion
"""
This module provides functionality to annotate screenshots with numbered markers for interactive regions.
It handles marking visible ele... |
microsoft/magentic-ui | https://github.com/microsoft/magentic-ui | null | null | null | null | 9,802 | null | null | mit | null | null | null | null | null | null | null | src/magentic_ui/agents/web_surfer/_prompts.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:11.133612 | WEB_SURFER_SYSTEM_MESSAGE = """
You are a helpful assistant that controls a web browser. You are to utilize this web browser to answer requests.
The date today is: {date_today}
You will be given a screenshot of the current page and a list of targets that represent the interactive elements on the page.
The list of targ... |
microsoft/magentic-ui | https://github.com/microsoft/magentic-ui | null | null | null | null | 9,802 | null | null | mit | null | null | null | null | null | null | null | src/magentic_ui/agents/web_surfer/_tool_definitions.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:11.163183 | from autogen_core.tools import ToolSchema
from ...tools.tool_metadata import load_tool, make_approval_prompt
EXPLANATION_TOOL_PROMPT = "Explain to the user the action to be performed and reason for doing so. Phrase as if you are directly talking to the user."
REFINED_GOAL_PROMPT = "1) Summarize all the information o... |
microsoft/magentic-ui | https://github.com/microsoft/magentic-ui | null | null | null | null | 9,802 | null | null | mit | null | null | null | null | null | null | null | src/magentic_ui/agents/web_surfer/_web_surfer.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:11.306134 | import asyncio
import io
import json
import logging
import os
import re
import time
from datetime import datetime
import tldextract
from typing import (
Any,
AsyncGenerator,
BinaryIO,
Dict,
List,
Optional,
Sequence,
cast,
Mapping,
Union,
Tuple,
Literal,
)
from typing_exte... |
microsoft/magentic-ui | https://github.com/microsoft/magentic-ui | null | null | null | null | 9,802 | null | null | mit | null | null | null | null | null | null | null | src/magentic_ui/agents/web_surfer/fara/_fara_web_surfer.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:11.355782 | from typing import AsyncGenerator, Sequence, List, Tuple, Dict, Any
import asyncio
import logging
import io
import json
import ast
import os
import time
from urllib.parse import quote_plus
from tenacity import retry, stop_after_attempt, wait_exponential, before_sleep_log
from autogen_agentchat.base import Response
from... |
microsoft/magentic-ui | https://github.com/microsoft/magentic-ui | null | null | null | null | 9,802 | null | null | mit | null | null | null | null | null | null | null | src/magentic_ui/agents/web_surfer/fara/_prompts.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:11.363565 | import math
from typing import Union, Tuple
from .qwen_helpers.base_tool import BaseTool
from .qwen_helpers.fncall_prompt import NousFnCallPrompt
from .qwen_helpers.schema import (
ContentItem,
Message,
)
IMAGE_FACTOR = 28
MIN_PIXELS = 4 * 28 * 28
MAX_PIXELS = 16384 * 28 * 28
MAX_RATIO = 200
# @register_to... |
microsoft/magentic-ui | https://github.com/microsoft/magentic-ui | null | null | null | null | 9,802 | null | null | mit | null | null | null | null | null | null | null | src/magentic_ui/agents/web_surfer/fara/qwen_helpers/base_tool.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:11.446258 | # Source: https://github.com/QwenLM/Qwen-Agent/blob/main/qwen_agent/tools/base.py
import json
from abc import ABC, abstractmethod
from typing import List, Optional, Union
from .schema import ContentItem
from .utils import has_chinese_chars, json_loads
def is_tool_schema(obj: dict) -> bool:
"""
Check if obj ... |
microsoft/magentic-ui | https://github.com/microsoft/magentic-ui | null | null | null | null | 9,802 | null | null | mit | null | null | null | null | null | null | null | src/magentic_ui/agents/web_surfer/fara/qwen_helpers/fncall_prompt.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:11.628921 | # Source: https://github.com/QwenLM/Qwen-Agent/blob/main/qwen_agent/llm/fncall_prompts/nous_fncall_prompt.py
import copy
import json
import os
from typing import List, Literal, Union
from .schema import ASSISTANT, FUNCTION, SYSTEM, USER, ContentItem, Message
class NousFnCallPrompt:
def __init__(self, template_... |
microsoft/magentic-ui | https://github.com/microsoft/magentic-ui | null | null | null | null | 9,802 | null | null | mit | null | null | null | null | null | null | null | src/magentic_ui/agents/web_surfer/fara/qwen_helpers/schema.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:11.719298 | # Source: https://github.com/QwenLM/Qwen-Agent/blob/main/qwen_agent/llm/schema.py
from typing import List, Literal, Optional, Tuple, Union
from pydantic import BaseModel, field_validator, model_validator
DEFAULT_SYSTEM_MESSAGE = "You are a helpful assistant."
ROLE = "role"
CONTENT = "content"
REASONING_CONTENT = "... |
microsoft/magentic-ui | https://github.com/microsoft/magentic-ui | null | null | null | null | 9,802 | null | null | mit | null | null | null | null | null | null | null | src/magentic_ui/agents/web_surfer/fara/qwen_helpers/utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:11.769234 | # Source: https://github.com/QwenLM/Qwen-Agent/blob/main/qwen_agent/utils/utils.py
import json
import re
from typing import Any
CHINESE_CHAR_RE = re.compile(r"[\u4e00-\u9fff]")
def has_chinese_chars(data: Any) -> bool:
text = f"{data}"
return bool(CHINESE_CHAR_RE.search(text))
def json_loads(text: str) ... |
microsoft/magentic-ui | https://github.com/microsoft/magentic-ui | null | null | null | null | 9,802 | null | null | mit | null | null | null | null | null | null | null | src/magentic_ui/approval_guard.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:11.769881 | from .input_func import InputFuncType, AsyncInputFunc, SyncInputFunc
from autogen_agentchat.messages import TextMessage, MultiModalMessage
from autogen_core import CancellationToken, Image, EVENT_LOGGER_NAME
from autogen_core.models import (
ChatCompletionClient,
LLMMessage,
SystemMessage,
UserMessage,... |
microsoft/magentic-ui | https://github.com/microsoft/magentic-ui | null | null | null | null | 9,802 | null | null | mit | null | null | null | null | null | null | null | src/magentic_ui/backend/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:11.882529 | from .database.db_manager import DatabaseManager
from .datamodel import Team
from .teammanager import TeamManager
from ..version import __version__
__all__ = ["DatabaseManager", "Team", "TeamManager", "__version__"]
|
darknessomi/musicbox | https://github.com/darknessomi/musicbox | null | null | null | null | 9,801 | null | null | mit | null | null | null | null | null | null | null | NEMbox/const.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:14.115105 | # encoding: UTF-8
# KenHuang: 使配置文件夹符合XDG标准
import os
class Constant(object):
if "XDG_CONFIG_HOME" in os.environ:
conf_dir = os.path.join(os.environ["XDG_CONFIG_HOME"], "netease-musicbox")
else:
conf_dir = os.path.join(os.path.expanduser("~"), ".netease-musicbox")
config_path = os.path.joi... |
darknessomi/musicbox | https://github.com/darknessomi/musicbox | null | null | null | null | 9,801 | null | null | mit | null | null | null | null | null | null | null | NEMbox/encrypt.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:14.116726 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import base64
import binascii
import hashlib
import json
import os
from Cryptodome.Cipher import AES
__all__ = ["encrypted_id", "encrypted_request"]
MODULUS = (
"00e0b509f6259df8642dbc35662901477df22677ec152b5ff68ace615bb7"
"b725152b3ab17a876aea8a5aa76d2e417629ec... |
darknessomi/musicbox | https://github.com/darknessomi/musicbox | null | null | null | null | 9,801 | null | null | mit | null | null | null | null | null | null | null | NEMbox/__main__.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:14.131804 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import _curses
import argparse
import curses
import sys
import traceback
from . import __version__
from .menu import Menu
def start():
version = __version__
parser = argparse.ArgumentParser()
parser.add_argument(
"-v", "--version", help="show this ve... |
darknessomi/musicbox | https://github.com/darknessomi/musicbox | null | null | null | null | 9,801 | null | null | mit | null | null | null | null | null | null | null | NEMbox/config.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:14.134684 | # encoding: UTF-8
import json
import os
from .const import Constant
from .singleton import Singleton
from .utils import utf8_data_to_file
class Config(Singleton):
def __init__(self):
if hasattr(self, "_init"):
return
self._init = True
self.path = Constant.config_path
... |
darknessomi/musicbox | https://github.com/darknessomi/musicbox | null | null | null | null | 9,801 | null | null | mit | null | null | null | null | null | null | null | NEMbox/kill_thread.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:14.147906 | import ctypes
import inspect
import threading
import time
__all__ = ["stop_thread"]
def _async_raise(tid, exctype):
"""raises the exception, performs cleanup if needed"""
tid = ctypes.c_long(tid)
if not inspect.isclass(exctype):
exctype = type(exctype)
res = ctypes.pythonapi.PyThreadState_Set... |
darknessomi/musicbox | https://github.com/darknessomi/musicbox | null | null | null | null | 9,801 | null | null | mit | null | null | null | null | null | null | null | NEMbox/logger.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:14.149468 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: omi
# @Date: 2014-08-24 21:51:57
import logging
from . import const
FILE_NAME = const.Constant.log_path
with open(FILE_NAME, "a+") as f:
f.write("#" * 80)
f.write("\n")
def getLogger(name):
log = logging.getLogger(name)
log.setLevel(loggin... |
darknessomi/musicbox | https://github.com/darknessomi/musicbox | null | null | null | null | 9,801 | null | null | mit | null | null | null | null | null | null | null | NEMbox/api.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:14.151175 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: omi
# @Date: 2014-08-24 21:51:57
"""
网易云音乐 Api
"""
import json
import platform
import time
from collections import OrderedDict
from http.cookiejar import Cookie
from http.cookiejar import MozillaCookieJar
import requests
import requests_cache
from .config imp... |
darknessomi/musicbox | https://github.com/darknessomi/musicbox | null | null | null | null | 9,801 | null | null | mit | null | null | null | null | null | null | null | NEMbox/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:14.155863 | r"""
__ ___________________________________________
| \ ||______ | |______|_____||______|______
| \_||______ | |______| |______||______
________ __________________________ _____ _ _
| | || ||______ | | |_____]| | \___/
| | ||_____|______|__|__|_____ |_____]|_____|_/ \_
+... |
darknessomi/musicbox | https://github.com/darknessomi/musicbox | null | null | null | null | 9,801 | null | null | mit | null | null | null | null | null | null | null | NEMbox/cache.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:14.156374 | # -*- coding: utf-8 -*-
# @Author: Catofes
# @Date: 2015-08-15
"""
Class to cache songs into local storage.
"""
import os
import signal
import subprocess
import threading
from . import logger
from .api import NetEase
from .config import Config
from .const import Constant
from .singleton import Singleton
log = logge... |
darknessomi/musicbox | https://github.com/darknessomi/musicbox | null | null | null | null | 9,801 | null | null | mit | null | null | null | null | null | null | null | NEMbox/cmd_parser.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:14.206338 | #!/usr/bin/env python
# coding=utf-8
# __author__='walker'
"""
捕获类似curses键盘输入流,生成指令流
"""
import curses
from copy import deepcopy
from functools import wraps
from .config import Config
ERASE_SPEED = 5 # 屏幕5秒刷新一次 去除错误的显示
__all__ = ["cmd_parser", "parse_keylist", "coroutine", "erase_coroutine"]
KEY_MAP = Config().get... |
darknessomi/musicbox | https://github.com/darknessomi/musicbox | null | null | null | null | 9,801 | null | null | mit | null | null | null | null | null | null | null | NEMbox/ui.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:16.216184 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: omi
# @Date: 2014-08-24 21:51:57
# KenHuang:
# 1.增加显示颜色自定义;
# 2.调整显示格式;
"""
网易云音乐 Ui
"""
import curses
import datetime
import os
import re
from shutil import get_terminal_size
from . import logger
from .config import Config
from .scrollstring import scrollstri... |
darknessomi/musicbox | https://github.com/darknessomi/musicbox | null | null | null | null | 9,801 | null | null | mit | null | null | null | null | null | null | null | NEMbox/osdlyrics.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:16.991363 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# osdlyrics.py --- desktop lyrics for musicbox
# Copyright (c) 2015-2016 omi & Contributors
import sys
from multiprocessing import Process
from multiprocessing import set_start_method
from . import logger
from .config import Config
log = logger.getLogger(__name__)
config... |
darknessomi/musicbox | https://github.com/darknessomi/musicbox | null | null | null | null | 9,801 | null | null | mit | null | null | null | null | null | null | null | NEMbox/player.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:17.104579 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: omi
# @Date: 2014-07-15 15:48:27
# @Last Modified by: AlanAlbert
# @Last Modified time: 2018-11-21 14:00:00
"""
网易云音乐 Player
"""
# Let's make some noise
import os
import random
import subprocess
import threading
import time
from . import logger
from .api imp... |
darknessomi/musicbox | https://github.com/darknessomi/musicbox | null | null | null | null | 9,801 | null | null | mit | null | null | null | null | null | null | null | NEMbox/menu.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:17.672782 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: omi
# @Date: 2014-08-24 21:51:57
# KenHuang:
# 1.增加按键映射功能;
# 2.修复搜索按键功能映射错误;
# 3.使用定时器实现自动关闭功能;
"""
网易云音乐 Menu
"""
import curses as C
import locale
import os
import signal
import sys
import threading
import time
import webbrowser
from collections import namedtu... |
darknessomi/musicbox | https://github.com/darknessomi/musicbox | null | null | null | null | 9,801 | null | null | mit | null | null | null | null | null | null | null | NEMbox/storage.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:18.926022 | # -*- coding: utf-8 -*-
# @Author: Catofes
# @Date: 2015-08-15
"""
Class to stores everything into a json file.
"""
import json
from .const import Constant
from .singleton import Singleton
from .utils import utf8_data_to_file
class Storage(Singleton):
def __init__(self):
"""
Database stores eve... |
darknessomi/musicbox | https://github.com/darknessomi/musicbox | null | null | null | null | 9,801 | null | null | mit | null | null | null | null | null | null | null | NEMbox/scrollstring.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:18.926478 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from time import time
class scrollstring(object):
def __init__(self, content, START):
self.content = content # the true content of the string
self.display = content # the displayed string
self.START = START // 1 # when this instance is created
... |
darknessomi/musicbox | https://github.com/darknessomi/musicbox | null | null | null | null | 9,801 | null | null | mit | null | null | null | null | null | null | null | NEMbox/singleton.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:24.743188 | # -*- coding: utf-8 -*-
class Singleton(object):
"""Singleton Class
This is a class to make some class being a Singleton class.
Such as database class or config class.
usage:
class xxx(Singleton):
def __init__(self):
if hasattr(self, '_init'):
r... |
darknessomi/musicbox | https://github.com/darknessomi/musicbox | null | null | null | null | 9,801 | null | null | mit | null | null | null | null | null | null | null | NEMbox/utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:24.756116 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# utils.py --- utils for musicbox
# Copyright (c) 2015-2016 omi & Contributors
"""
定义几个函数 写文件 通知 返回键 创建目录 创建文件
"""
import os
import platform
import subprocess
import hashlib
from collections import OrderedDict
__all__ = [
"utf8_data_to_file",
"notify",
"uniq"... |
darknessomi/musicbox | https://github.com/darknessomi/musicbox | null | null | null | null | 9,801 | null | null | mit | null | null | null | null | null | null | null | tests/test_api.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:24.861866 | from NEMbox.api import NetEase
from NEMbox.api import Parse
def test_api():
api = NetEase()
ids = [347230, 496619464, 405998841, 28012031]
print(api.songs_url(ids))
print(api.songs_detail(ids))
print(Parse.song_url(api.songs_detail(ids)[0]))
# user = api.login('example@163.com', md5(b'').hexdi... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | bins/tta/train_tta.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:27.618547 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import os
import torch
from models.tta.autoencoder.autoencoder_trainer import AutoencoderKLTrainer
from models.tta.ldm.audioldm_trainer import Aud... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | bins/tta/inference.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:27.619798 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
from argparse import ArgumentParser
import os
from models.tta.ldm.audioldm_inference import AudioLDMInference
from utils.util import save_config, ... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | bins/calc_metrics.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:27.623193 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import sys
import numpy as np
import json
import argparse
import whisper
import torch
from glob import glob
from tqdm import tqdm
from collections impor... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | bins/tts/inference.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:27.628660 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
from argparse import ArgumentParser
import os
from models.tts.fastspeech2.fs2_inference import FastSpeech2Inference
from models.tts.vits.vits_infe... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | bins/svc/train.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:27.642043 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import torch
from models.svc.diffusion.diffusion_trainer import DiffusionTrainer
from models.svc.comosvc.comosvc_trainer import ComoSVCTrainer
fr... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | bins/svc/preprocess.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:27.643701 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import faulthandler
faulthandler.enable()
import os
import argparse
import json
from multiprocessing import cpu_count
from utils.util import load_config
from p... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | bins/codec/inference.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:27.645069 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
from argparse import ArgumentParser
import os
from models.codec.facodec.facodec_inference import FAcodecInference
from utils.util import load_conf... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | bins/tta/preprocess.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:27.663883 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import faulthandler
faulthandler.enable()
import os
import argparse
import json
import pyworld as pw
from multiprocessing import cpu_count
from utils.util impo... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | bins/svc/inference.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:27.673191 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import os
import glob
from tqdm import tqdm
import json
import torch
import time
from models.svc.diffusion.diffusion_inference import DiffusionInf... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | bins/codec/train.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:27.674243 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import torch
from models.codec.facodec.facodec_trainer import FAcodecTrainer
from models.codec.vevo.vqvae_trainer import (
VQVAETrainer,
)
fr... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | bins/tts/preprocess.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:28.212514 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import faulthandler
faulthandler.enable()
import os
import argparse
import json
import pyworld as pw
from multiprocessing import cpu_count
from utils.util impo... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | bins/tts/train.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:28.216543 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import torch
from models.tts.fastspeech2.fs2_trainer import FastSpeech2Trainer
from models.tts.vits.vits_trainer import VITSTrainer
from models.t... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | bins/vc/train.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:28.249366 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import torch
from models.vc.flow_matching_transformer.fmt_trainer import (
FlowMatchingTransformerTrainer,
)
from models.vc.autoregressive_tra... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | bins/vc/Noro/train.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:28.264156 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import torch
from models.vc.Noro.noro_trainer import NoroTrainer
from utils.util import load_config
def build_trainer(args, cfg):
supported_... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | bins/vocoder/inference.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:28.280412 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import os
import torch
from models.vocoders.vocoder_inference import VocoderInference
from utils.util import load_config
def build_inference(ar... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | bins/vocoder/train.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:28.281502 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import torch
from models.vocoders.gan.gan_vocoder_trainer import GANVocoderTrainer
from models.vocoders.diffusion.diffusion_vocoder_trainer impor... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | bins/vocoder/preprocess.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:28.295897 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import faulthandler
faulthandler.enable()
import os
import argparse
import json
import pyworld as pw
from multiprocessing import cpu_count
from utils.util impo... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | evaluation/features/long_term_average_spectrum.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:28.305528 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import librosa
from scipy import signal
def extract_ltas(audio, fs=None, n_fft=1024, hop_length=256):
"""Extract Long-Term Average Spectrum for a given audio... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | evaluation/metrics/energy/energy_pearson_coefficients.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:29.274195 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
import librosa
import torch
import numpy as np
from numpy import linalg as LA
from torchmetrics import PearsonCorrCoef
def extract_energy_pearson_c... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | evaluation/metrics/f0/f0_corr.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:29.275803 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
import librosa
import numpy as np
import parselmouth
from utils.f0 import interpolate
def get_cents(f0_hz):
"""
F_{cent} = 1200 * log2 (F/4... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | evaluation/metrics/energy/energy_rmse.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:29.279775 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
import librosa
import torch
import numpy as np
from numpy import linalg as LA
def extract_energy_rmse(
audio_ref,
audio_deg,
n_fft=1024,... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | evaluation/metrics/f0/f0_periodicity_rmse.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:29.281553 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torchcrepe
import math
import librosa
import torch
import numpy as np
def extract_f0_periodicity_rmse(
audio_ref,
audio_deg,
hop_length=256,
... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | evaluation/metrics/f0/f0_pearson_coefficients.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:29.283994 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
import librosa
import numpy as np
from torchmetrics import PearsonCorrCoef
from utils.util import JsonHParams
from utils.f0 import get_f0_features_... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | evaluation/features/singing_power_ratio.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:30.114766 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
import librosa
from utils.util import JsonHParams
from utils.f0 import get_f0_features_using_parselmouth, get_pitch_sub_median
from utils.mel import ... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | evaluation/features/signal_to_noise_ratio.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:30.228469 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
import scipy.signal as sig
import copy
import librosa
def bandpower(ps, mode="time"):
"""
estimate bandpower, see https://de.mathworks... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | evaluation/metrics/f0/f0_rmse.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:30.486305 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
import librosa
import torch
import numpy as np
from utils.util import JsonHParams
from utils.f0 import get_f0_features_using_parselmouth, get_pitch_s... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | evaluation/metrics/similarity/models/RawNetBasicBlock.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:30.494216 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class PreEmphasis(torch.nn.Module):
def __init__(self, coef: flo... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | evaluation/metrics/intelligibility/character_error_rate.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:30.521403 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
from torchmetrics import CharErrorRate
def extract_cer(
model,
**kwargs,
):
"""Compute Character Error Rate (CER) between the predicted... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | evaluation/metrics/intelligibility/word_error_rate.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:30.522906 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
from torchmetrics import WordErrorRate
def extract_wer(
model,
**kwargs,
):
"""Compute Word Error Rate (WER) between the predicted and ... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | evaluation/metrics/similarity/models/RawNetModel.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:30.538124 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# -*- encoding: utf-8 -*-
import torch
import torch.nn as nn
from asteroid_filterbanks import Encoder, ParamSincFB
from .RawNetBasicBlock import Bottle2neck, Pre... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | evaluation/metrics/f0/v_uv_f1.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:30.567890 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
import librosa
import torch
import numpy as np
from utils.util import JsonHParams
from utils.f0 import get_f0_features_using_parselmouth
ZERO = 1e-8... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | evaluation/metrics/spectrogram/mel_cepstral_distortion.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:31.320360 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from pymcd.mcd import Calculate_MCD
def extract_mcd(audio_ref, audio_deg, **kwargs):
"""Extract Mel-Cepstral Distance for a two given audio.
Args:
... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | evaluation/metrics/spectrogram/frechet_distance.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:31.359672 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from frechet_audio_distance import FrechetAudioDistance
def extract_fad(
audio_dir1,
audio_dir2,
**kwargs,
):
"""Extract Frechet Audio Distance f... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | evaluation/metrics/similarity/speaker_similarity.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:31.433490 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import numpy as np
import soundfile as sf
import torch
import torch.nn.functional as F
from tqdm import tqdm
import librosa
from evaluation.metrics.sim... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | models/base/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:32.018122 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from .new_trainer import BaseTrainer
from .new_inference import BaseInference
|
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | evaluation/metrics/spectrogram/pesq.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:36.082868 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import librosa
import numpy as np
from pypesq import pesq
def extract_pesq(audio_ref, audio_deg, **kwargs):
"""Extract PESQ for a two given audio.
audi... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | evaluation/metrics/spectrogram/scale_invariant_signal_to_noise_ratio.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:36.120251 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
import librosa
import numpy as np
from torchmetrics import ScaleInvariantSignalNoiseRatio
def extract_si_snr(audio_ref, audio_deg, **kwargs):
... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | evaluation/metrics/spectrogram/short_time_objective_intelligibility.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:36.122321 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
import librosa
import numpy as np
from torchmetrics.audio.stoi import ShortTimeObjectiveIntelligibility
def extract_stoi(audio_ref, audio_deg, **k... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | evaluation/metrics/spectrogram/scale_invariant_signal_to_distortion_ratio.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:36.139304 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
import librosa
import numpy as np
from torchmetrics import ScaleInvariantSignalDistortionRatio
def extract_si_sdr(audio_ref, audio_deg, **kwargs):... |
open-mmlab/Amphion | https://github.com/open-mmlab/Amphion | null | null | null | null | 9,783 | null | null | mit | null | null | null | null | null | null | null | evaluation/metrics/spectrogram/multi_resolution_stft_distance.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:36.198287 | # Copyright (c) 2023 Amphion.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import librosa
import torch
import numpy as np
def extract_mstft(
audio_ref,
audio_deg,
**kwargs,
):
"""Compute Multi-Scale STFT Distance (mstft... |
vishnubob/wait-for-it | https://github.com/vishnubob/wait-for-it | null | null | null | null | 9,779 | null | null | mit | null | null | null | null | null | null | null | test/container-runners.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:38.587451 | #!/usr/bin/env python
# Unit tests to run wait-for-it.py unit tests in several different docker images
import unittest
import os
import docker
from parameterized import parameterized
client = docker.from_env()
app_path = os.path.abspath(os.path.join(os.path.dirname( __file__ ), '..'))
volumes = {app_path: {'bind': '... |
vishnubob/wait-for-it | https://github.com/vishnubob/wait-for-it | null | null | null | null | 9,779 | null | null | mit | null | null | null | null | null | null | null | test/wait-for-it.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:38.588124 | #!/usr/bin/env python
import unittest
import shlex
from subprocess import Popen, PIPE
import os
import sys
import socket
import re
MISSING_ARGS_TEXT = "Error: you need to provide a host and port to test."
HELP_TEXT = "Usage:" # Start of help text
DIVIDE_LINE = '-'*71 # Output line of dashes
class TestWaitForIt(un... |
jiaaro/pydub | https://github.com/jiaaro/pydub | null | null | null | null | 9,757 | null | null | mit | null | null | null | null | null | null | null | pydub/effects.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:41.040750 | import sys
import math
import array
from .utils import (
db_to_float,
ratio_to_db,
register_pydub_effect,
make_chunks,
audioop,
get_min_max_value
)
from .silence import split_on_silence
from .exceptions import TooManyMissingFrames, InvalidDuration
if sys.version_info >= (3, 0):
xrange = ran... |
jiaaro/pydub | https://github.com/jiaaro/pydub | null | null | null | null | 9,757 | null | null | mit | null | null | null | null | null | null | null | pydub/pyaudioop.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:41.046523 | try:
from __builtin__ import max as builtin_max
from __builtin__ import min as builtin_min
except ImportError:
from builtins import max as builtin_max
from builtins import min as builtin_min
import math
import struct
try:
from fractions import gcd
except ImportError: # Python 3.9+
from math imp... |
jiaaro/pydub | https://github.com/jiaaro/pydub | null | null | null | null | 9,757 | null | null | mit | null | null | null | null | null | null | null | pydub/playback.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:41.099467 | """
Support for playing AudioSegments. Pyaudio will be used if it's installed,
otherwise will fallback to ffplay. Pyaudio is a *much* nicer solution, but
is tricky to install. See my notes on installing pyaudio in a virtualenv (on
OSX 10.10): https://gist.github.com/jiaaro/9767512210a1d80a8a0d
"""
import subprocess
fr... |
jiaaro/pydub | https://github.com/jiaaro/pydub | null | null | null | null | 9,757 | null | null | mit | null | null | null | null | null | null | null | pydub/generators.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:41.102869 | """
Each generator will return float samples from -1.0 to 1.0, which can be
converted to actual audio with 8, 16, 24, or 32 bit depth using the
SiganlGenerator.to_audio_segment() method (on any of it's subclasses).
See Wikipedia's "waveform" page for info on some of the generators included
here: http://en.wikipedia.... |
jiaaro/pydub | https://github.com/jiaaro/pydub | null | null | null | null | 9,757 | null | null | mit | null | null | null | null | null | null | null | pydub/exceptions.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:41.145823 | class PydubException(Exception):
"""
Base class for any Pydub exception
"""
class TooManyMissingFrames(PydubException):
pass
class InvalidDuration(PydubException):
pass
class InvalidTag(PydubException):
pass
class InvalidID3TagVersion(PydubException):
pass
class CouldntDecodeError(... |
jiaaro/pydub | https://github.com/jiaaro/pydub | null | null | null | null | 9,757 | null | null | mit | null | null | null | null | null | null | null | pydub/logging_utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:41.147320 | """
"""
import logging
converter_logger = logging.getLogger("pydub.converter")
def log_conversion(conversion_command):
converter_logger.debug("subprocess.call(%s)", repr(conversion_command))
def log_subprocess_output(output):
if output:
for line in output.rstrip().splitlines():
converter... |
jiaaro/pydub | https://github.com/jiaaro/pydub | null | null | null | null | 9,757 | null | null | mit | null | null | null | null | null | null | null | pydub/audio_segment.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:41.148154 | from __future__ import division
import array
import os
import subprocess
from tempfile import NamedTemporaryFile
import wave
import sys
import struct
from .logging_utils import log_conversion, log_subprocess_output
from .utils import mediainfo_json, fsdecode
import base64
from collections import namedtuple
try:
f... |
jiaaro/pydub | https://github.com/jiaaro/pydub | null | null | null | null | 9,757 | null | null | mit | null | null | null | null | null | null | null | pydub/scipy_effects.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:41.179031 | """
This module provides scipy versions of high_pass_filter, and low_pass_filter
as well as an additional band_pass_filter.
Of course, you will need to install scipy for these to work.
When this module is imported the high and low pass filters from this module
will be used when calling audio_segment.high_pass_filter(... |
jiaaro/pydub | https://github.com/jiaaro/pydub | null | null | null | null | 9,757 | null | null | mit | null | null | null | null | null | null | null | pydub/silence.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:41.199180 | """
Various functions for finding/manipulating silence in AudioSegments
"""
import itertools
from .utils import db_to_float
def detect_silence(audio_segment, min_silence_len=1000, silence_thresh=-16, seek_step=1):
"""
Returns a list of all silent sections [start, end] in milliseconds of audio_segment.
In... |
jiaaro/pydub | https://github.com/jiaaro/pydub | null | null | null | null | 9,757 | null | null | mit | null | null | null | null | null | null | null | setup.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:41.652811 | __doc__ = """
Manipulate audio with an simple and easy high level interface.
See the README file for details, usage info, and a list of gotchas.
"""
from setuptools import setup
setup(
name='pydub',
version='0.25.1',
author='James Robert',
author_email='jiaaro@gmail.com',
description='Manipulate ... |
jiaaro/pydub | https://github.com/jiaaro/pydub | null | null | null | null | 9,757 | null | null | mit | null | null | null | null | null | null | null | pydub/utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:41.677420 | from __future__ import division
from io import BufferedReader
import json
import os
import re
import sys
from subprocess import Popen, PIPE
from math import log, ceil
from tempfile import TemporaryFile
from warnings import warn
from functools import wraps
try:
import audioop
except ImportError:
import pyaudio... |
jiaaro/pydub | https://github.com/jiaaro/pydub | null | null | null | null | 9,757 | null | null | mit | null | null | null | null | null | null | null | test/test.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:41.703419 | from functools import partial
import os
import sys
import unittest
from tempfile import (
NamedTemporaryFile,
mkdtemp,
gettempdir
)
import tempfile
import struct
from pydub import AudioSegment
from pydub.audio_segment import extract_wav_headers
from pydub.utils import (
db_to_float,
ratio_to_db,
... |
KoljaB/RealtimeSTT | https://github.com/KoljaB/RealtimeSTT | null | null | null | null | 9,755 | null | null | mit | null | null | null | null | null | null | null | RealtimeSTT_server/stt_cli_client.py | null | null | null | null | null | null | Python | 2026-05-04T02:03:45.453586 | # stt_cli_client.py
from difflib import SequenceMatcher
from collections import deque
import argparse
import string
import shutil
import time
import sys
import os
from RealtimeSTT import AudioToTextRecorderClient
from RealtimeSTT import AudioInput
from colorama import init, Fore, Style
init()
DEFAULT_CONTROL_URL = ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.