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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_refuters/add_unobserved_common_cause.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:06.314220 | import copy
import logging
import math
from typing import Dict, List, Optional, Union
import numpy as np
import pandas as pd
import scipy.stats
import statsmodels.api as sm
from sklearn.linear_model import LogisticRegression
from sklearn.preprocessing import StandardScaler
from tqdm.auto import tqdm
from dowhy.causal... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_refuters/assess_overlap.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:06.635468 | import logging
import warnings
from typing import List, Optional
from dowhy.causal_refuter import CausalRefuter
from dowhy.causal_refuters.assess_overlap_overrule import OverlapConfig, OverruleAnalyzer, SupportConfig
logger = logging.getLogger(__name__)
class AssessOverlap(CausalRefuter):
"""Assess Overlap
... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | clawmode_integration/cli.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:14.436106 | """
CLI entry point for ClawMode — nanobot gateway with ClawWork economic tracking.
All configuration lives in ~/.nanobot/config.json under ``agents.clawwork``.
No separate livebench config file is needed.
Usage:
python -m clawmode_integration.cli agent # interactive chat
python -m clawmode_integrati... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | eval/test_single_category.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:14.438107 | #!/usr/bin/env python3
"""
Test script to generate meta-prompt for a single category.
Useful for testing before running the full generation.
"""
import os
import sys
import json
import pandas as pd
from pathlib import Path
# Add the current directory to the path to import from generate_meta_prompts
sys.path.insert(0,... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | clawmode_integration/agent_loop.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:14.442927 | """
ClawWorkAgentLoop — subclasses nanobot's AgentLoop to add:
1. ClawWork economic tools (decide_activity, submit_work, learn, get_status)
2. Automatic per-message token cost tracking via TrackedProvider
3. Per-message economic record persistence (start_task / end_task)
4. Cost summary appended to agent responses
5. ... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | clawmode_integration/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:14.468028 | """
ClawMode Integration — ClawWork economic tracking for nanobot.
Extends nanobot's AgentLoop with economic tools so every conversation
is cost-tracked and the agent can check its balance and survival status.
"""
from clawmode_integration.agent_loop import ClawWorkAgentLoop
from clawmode_integration.task_classifier ... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | clawmode_integration/provider_wrapper.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:14.478277 | """
TrackedProvider — wraps a nanobot LLMProvider to feed token usage
into ClawWork's EconomicTracker on every chat() call.
Also provides CostCapturingLiteLLMProvider, a drop-in subclass of
LiteLLMProvider that enriches LLMResponse.usage with OpenRouter's
directly-reported cost field without touching nanobot source fi... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | clawmode_integration/artifact_tools.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:14.479911 | """
Artifact creation and reading tools as nanobot Tool ABC subclasses.
Ports from livebench/tools/productivity/:
- CreateArtifactTool (create_artifact) — from file_creation.py
- ReadArtifactTool (read_artifact) — from file_reading.py
Each tool receives a shared ClawWorkState dataclass.
"""
from __future... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | clawmode_integration/tools.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:14.884454 | """
ClawWork tools as nanobot Tool ABC subclasses.
Ports the 4 core tools from clawwork/tools/direct_tools.py:
- DecideActivityTool (decide_activity)
- SubmitWorkTool (submit_work)
- LearnTool (learn)
- GetStatusTool (get_status)
Each tool receives a shared ClawWorkState dataclass (repla... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | clawmode_integration/task_classifier.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:14.885120 | """
TaskClassifier — classifies free-form instructions into an occupation
category with an estimated task value (hours x hourly_wage).
Uses nanobot's configured LLM provider so no separate OPENAI_API_KEY is needed.
"""
from __future__ import annotations
import json
from pathlib import Path
from typing import Any
fr... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | eval/generate_meta_prompts.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:14.886666 | #!/usr/bin/env python3
"""
Generate Meta-Prompts for LLM-based Evaluation
This script iterates through all 44 task categories (occupations) in the gdpval dataset
and uses GPT-4o to generate detailed prompts and guidelines for evaluating task outputs
in each category.
The meta-prompts generated are category-specific (... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | clawmode_integration/config.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:15.346500 | """
ClawWork configuration — reads ``agents.clawwork`` from ~/.nanobot/config.json.
This is a plugin-side config layer. Nanobot's Pydantic schema is untouched;
we simply load the raw JSON and extract our section. Unknown keys are
silently ignored by nanobot's own ``load_config()``, so the two coexist.
"""
from __fu... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | livebench/agent/message_formatter.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:15.589559 | """
Helper functions for formatting tool results into proper message format
"""
import base64
from typing import Dict, Any, List, Union
def format_result_for_logging(result: Any) -> str:
"""Format tool result for logging (handles binary data gracefully)"""
if isinstance(result, dict):
result_type = r... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | livebench/agent/wrapup_workflow.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:15.595939 | """
Wrap-Up Workflow - LangGraph-based workflow for collecting and submitting artifacts
when the agent reaches iteration limit without completing the task.
This module provides a clean, modular workflow that:
1. Lists all artifacts in the active code sandbox
2. Asks the LLM to choose which artifacts to submit
3. Downl... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | livebench/agent/economic_tracker.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:15.613356 | """
Economic Tracker - Manages economic balance and token costs for LiveBench agents
"""
import os
import json
from datetime import datetime
from typing import Any, Dict, Optional, List
from pathlib import Path
class EconomicTracker:
"""
Tracks economic state for a LiveBench agent including:
- Balance (c... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | livebench/agent/live_agent.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:15.638393 | """
LiveAgent - Main agent class for LiveBench with decision-making framework
"""
import os
import json
import asyncio
from datetime import datetime
from typing import Dict, List, Optional, Any
from pathlib import Path
from langchain_mcp_adapters.client import MultiServerMCPClient
from langchain_openai import ChatOpe... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | livebench/data/agent_data/Gemini 3.1 Pro Preview/sandbox/2027-05-05/produce_track.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:15.670618 |
import numpy as np
import scipy.io.wavfile as wav
import os
SR = 48000
DURATION = 137
BPM = 140
def generate_full_tracks():
print("Generating full 2:17 tracks...")
# Load drums
sr_drum, drum_data = wav.read('/home/user/reference_files/DRUM REFERENCE TRACK.wav')
if drum_data.ndim > 1: drum_data = drum... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | livebench/data/agent_data/Gemini 3.1 Pro Preview/sandbox/2026-12-21/american_pricing_implementation.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:15.700936 |
import numpy as np
# ... (all the functions above) ...
# This script contains the implementation of American option pricing models.
|
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | livebench/api/server.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:15.754140 | """
LiveBench API Server - Real-time updates and data access for frontend
This FastAPI server provides:
- WebSocket endpoint for live agent activity streaming
- REST endpoints for agent data, tasks, and economic metrics
- Real-time updates as agents work and learn
"""
import os
import json
import asyncio
import rando... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | livebench/data/agent_data/qwen3-max-10dollar-1/sandbox/2026-02-09/video_editing_script.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:15.942044 |
#!/usr/bin/env python3
"""
Video editing script for Goodsin Studios showreel
This script demonstrates the proper workflow for creating the showreel
as specified in the task requirements.
"""
import os
from moviepy.editor import *
def create_goodsin_showreel():
"""
Creates a high-energy showreel for Goodsin S... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | livebench/langchain_mcp_adapters/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:16.498872 | """LangChain MCP Adapters - Bridge between MCP and LangChain"""
from .client import MultiServerMCPClient
__all__ = ["MultiServerMCPClient"]
|
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | livebench/prompts/live_agent_prompt.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:16.499560 | """
LiveBench Agent Prompts - System prompts with economic and token cost awareness
"""
import os
from typing import Dict, Optional
# Stop signal for agent to indicate session completion
STOP_SIGNAL = "<FINISH_SIGNAL>"
def get_live_agent_system_prompt(
date: str,
signature: str,
economic_state: Dict,
... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | livebench/tools/direct_tools.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:16.510897 | """
Direct LangChain tool wrappers for LiveBench (no MCP)
Core tools: decide_activity, submit_work, learn, get_status
Productivity tools: Imported from livebench.tools.productivity
"""
from langchain_core.tools import tool
from typing import Dict, Any, Union
import json
import os
from datetime import datetime
from l... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | livebench/langchain_mcp_adapters/client.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:16.595445 | """
MCP Client adapter for LangChain
Connects to MCP servers and provides LangChain-compatible tools
"""
import httpx
import json
from typing import Dict, List, Any, Optional
from langchain_core.tools import tool
from pydantic import BaseModel, Field
class MultiServerMCPClient:
"""Client to connect to multiple M... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | livebench/tools/productivity/search.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:17.105266 | """
Web search tool with support for Tavily (default) and Jina AI
"""
from langchain_core.tools import tool
from typing import Dict, Any, Optional
import os
def _search_tavily(query: str, max_results: int = 5) -> Dict[str, Any]:
"""
Search using Tavily API (recommended - structured results with answers)
... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | livebench/tools/productivity/code_execution_sandbox.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:17.106341 | """
Code execution tool with provider-agnostic sandboxing.
Default behavior:
- Use E2B by default (when CODE_SANDBOX_PROVIDER is unset)
Supported providers via CODE_SANDBOX_PROVIDER:
- e2b (default): E2B backend
- boxlite: BoxLite backend (experimental local virtualization)
"""
from __future__ import annotations
im... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | livebench/tools/productivity/file_reading.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:17.111091 | """
File creation tool supporting multiple formats
"""
from langchain_core.tools import tool
from typing import Dict, Any, List, Union
from pathlib import Path
from typing import Any
from io import BytesIO
import base64
import io
import os
import re
import time
import tempfile
import subprocess
from concurrent.futures... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | livebench/tools/productivity/video_creation.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:17.112289 | """
Video creation tool
"""
from langchain_core.tools import tool
from typing import Dict, Any
# Import global state from parent module
def _get_global_state():
"""Get global state from parent module"""
from livebench.tools.direct_tools import _global_state
return _global_state
@tool
def create_video(s... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | livebench/tools/productivity/file_creation.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:17.149006 | """
File creation tool supporting multiple formats
"""
from langchain_core.tools import tool
from typing import Dict, Any
# Import global state from parent module
def _get_global_state():
"""Get global state from parent module"""
from livebench.tools.direct_tools import _global_state
return _global_state... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | livebench/tools/start_live_services.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:17.164057 | """
Start LiveBench MCP Services - Direct Python execution
"""
import os
import sys
import subprocess
import time
from pathlib import Path
# Get project root (LiveBench root, not livebench/ subdirectory)
project_root = Path(__file__).parent.parent.parent
sys.path.insert(0, str(project_root))
sys.path.insert(0, str(pr... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | livebench/tools/tool_livebench.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:17.170181 | """
LiveBench MCP Tools - Tools for economic status, task details, and work submission
"""
import os
import json
from datetime import datetime
from typing import Dict, Optional
from fastmcp import FastMCP
# Create MCP server
mcp = FastMCP("LiveBench Tools")
# Global state (will be set by the LiveAgent)
CURRENT_STATE... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | livebench/main.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:17.205984 | """
LiveBench - Main Entry Point
Economic survival simulation for AI agents.
Agents must balance working and learning to maintain positive balance while being aware of token costs.
"""
import os
import sys
import json
import asyncio
import argparse
from pathlib import Path
from datetime import datetime
# Add project... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | livebench/tools/productivity/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:17.457056 | """
Productivity tools for LiveBench agents
Available tools:
- search_web: Internet search using Tavily or Jina AI
- read_webpage: Extract and read web page content using Tavily Extract
- create_file: Create files in multiple formats (txt, md, csv, json, xlsx, docx, pdf)
- execute_code_sandbox: Execute Python code in ... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | livebench/utils/logger.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:17.692794 | """
Persistent logging utility for LiveBench
Logs errors, warnings, and debug information to local files
"""
import os
import json
from datetime import datetime
from pathlib import Path
from typing import Optional, Dict, Any
import traceback
class LiveBenchLogger:
"""Persistent logger for LiveBench agents"""
... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | livebench/work/evaluator.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:17.693749 | """
Work Evaluator - Evaluates work artifacts and awards payment
"""
import os
import json
from typing import Dict, Optional, Tuple, List
from datetime import datetime
class WorkEvaluator:
"""
Evaluates submitted work artifacts and determines payment.
Uses LLM-based evaluation with category-specific rub... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | scripts/analyze_economic_improvements.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:17.729165 | """
Analysis script showing the improvements in economic tracking
Compares old vs new format and demonstrates query capabilities
"""
import json
import sys
from pathlib import Path
from collections import defaultdict
sys.path.insert(0, str(Path(__file__).parent.parent))
def analyze_old_format():
"""Analyze the... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | livebench/work/task_manager.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:17.735087 | """
Task Manager - Loads and manages gdpval work tasks for LiveBench
"""
import os
import json
import random
import pandas as pd
from typing import Dict, List, Optional, Any
from pathlib import Path
from datetime import datetime
class TaskManager:
"""
Manages work tasks from gdpval dataset:
- Loads tasks... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | scripts/backfill_balance_task_info.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:17.891567 | #!/usr/bin/env python3
"""
Backfill task_id and task_completion_time_seconds into existing balance.jsonl files.
Key insight: an agent may have been run multiple times (restarted), causing the same
simulation date to appear more than once in tasks.jsonl and balance.jsonl. Each run
still assigns exactly ONE task per da... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | livebench/work/llm_evaluator.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:17.899445 | """
LLM-based Work Evaluator using Category-Specific Meta-Prompts
This module implements evaluation using GPT and the comprehensive evaluation
criteria from eval/meta_prompts/ for each task category (occupation).
"""
import os
import json
import base64
from typing import Dict, Optional, Tuple, List, Union
from pathli... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | scripts/build_e2b_template.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:18.023017 | #!/usr/bin/env python3
"""
E2B Custom Sandbox Template Builder
This script creates a custom E2B sandbox template with preinstalled packages
that are commonly needed for GDPVal tasks based on analysis of task requirements.
Common packages needed (based on analysis of 220 GDPVal tasks):
- Word/DOCX: 126 tasks → python-... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | scripts/calculate_task_values.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:18.246139 | #!/usr/bin/env python3
"""
Calculate Task Values for GDPVal Dataset
This script:
1. Loads task hour estimates from task_hour_estimates/task_hours.jsonl
2. Loads hourly wage data from task_value_estimates/hourly_wage.csv
3. Uses GPT-5.2 to match each GDPVal occupation to the most appropriate OCC_TITLE in the wage data
... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | scripts/cleanup_failed_runs.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:18.317267 | #!/usr/bin/env python3
"""
Cleanup script for failed agent run data caused by billing/account errors.
Scans terminal logs for billing failures (402 credit errors, account access denied)
and deletes the corresponding terminal_logs, activity_logs, and sandbox dirs.
Only targets runs that never started due to payment/ac... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | scripts/derive_task_completions.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:18.384808 | #!/usr/bin/env python3
"""
Derive task_completions.jsonl from Existing Agent Logging Files
Reconstructs the task_completions.jsonl file (written live by the new code)
from pre-existing logging files for agent runs that pre-date the tracking change.
Only tasks where work was actually submitted (i.e. a work_income reco... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | scripts/domain_earnings_analysis.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:18.394208 | #!/usr/bin/env python3
"""
Domain Earnings Analysis - replicates the frontend Dashboard.jsx logic
for all agents in the LiveBench system.
Logic (from Dashboard.jsx):
QUALITY_CLIFF = 0.6
Group tasks by occupation (or sector if no occupation)
For each domain:
If task completed AND (score >= 0.6 or score is nul... |
HKUDS/ClawWork | https://github.com/HKUDS/ClawWork | null | null | null | null | 8,061 | null | null | mit | null | null | null | null | null | null | null | livebench/tools/productivity/code_execution.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:22.098698 | """
Code execution tool with sandboxing
"""
from langchain_core.tools import tool
from typing import Dict, Any
# Import global state from parent module
def _get_global_state():
"""Get global state from parent module"""
from livebench.tools.direct_tools import _global_state
return _global_state
@tool
de... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | _archived/init.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:24.448878 | # coding: utf-8
#
import datetime
import hashlib
import logging
import os
import shutil
import tarfile
from pathlib import Path
import adbutils
import progress.bar
import requests
from retry import retry
from uiautomator2.utils import natualsize
from uiautomator2.version import __apk_version__, __atx_agent_version__... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | demo_tests/test_core.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:24.456546 | # coding: utf-8
# author: codeskyblue
from typing import Optional
import uiautomator2 as u2
def get_app_process_pid(d: u2.Device) -> Optional[int]:
for line in d.shell("ps -u shell").output.splitlines():
fields = line.split()
if fields[-1] == 'app_process':
pid = fields[1]
... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | _archived/messagebox.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:24.460303 | # coding: utf-8
#
import time
try:
import Tkinter as tk
except ImportError:
import tkinter as tk
def retryskipabort(message, timeout=20):
"""
Show dialog of RETRY,SKIP,ABORT
Returns:
one of "retry", "skip", "abort"
"""
root = tk.Tk()
root.geometry("400x200")
root.title("E... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | _archived/ocr/baiduOCR.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:24.474546 | #!/usr/bin/env python3
"""
@version: 1.0.0
@author: rainy008
@description: 使用百度OCR实现截屏选取元素
"""
from aip import AipOcr
from uiautomator2.ext.ocr import OCR as u2OCR
from uiautomator2.ext.ocr import OCRSelector as u2OCRSelector
class OCR(u2OCR):
def __init__(self, d, app_id, api_key, secrect_key):
self._... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | _archived/ocr/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:24.488575 | # coding: utf-8
#
"""
import uiautomator2 as u2
import uiautomator2.ext.ocr as ocr
u2.plugin_add("ocr", ocr.OCR)
d = u2.connect()
d.ext_ocr("对战模式").click()
"""
import time
import requests
API = ""
class OCRObjectNotFound(Exception):
pass
class OCR(object):
def __init__(self, d):
"""
Arg... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | demo_tests/conftest.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:24.496336 | # coding: utf-8
# author: codeskyblue
import pytest
import uiautomator2 as u2
@pytest.fixture(scope="function")
def d():
_d = u2.connect_usb()
_d.press("home")
yield _d
@pytest.fixture(scope="function")
def app(d: u2.Device):
d.app_start("com.example.u2testdemo", stop=True)
d(text="Additio... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | _archived/webview.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:24.497424 | # coding: utf-8
#
# Not implemented yet.
#
import json
import logging
import string
from pprint import pprint
import adbutils
import pychrome
import requests
logger = logging.getLogger(__name__)
class WebviewDriver():
def __init__(self, url):
self._url = url
self._browser = pychrome.Browser(self.... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | demo_tests/test_app.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:24.542574 | # coding: utf-8
# author: codeskyblue
import pytest
import uiautomator2 as u2
PACKAGE = "com.example.u2testdemo"
def test_wait_activity(d: u2.Device):
# assert app.wait_activity('.MainActivity', timeout=10)
d.app_start(PACKAGE, activity=".AdditionActivity", wait=True)
assert d.wait_activity('.Addi... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | _archived/widget.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:24.586250 | # coding: utf-8
#
# DEPRECATED
#
# This file is deprecated and will be removed in the future.
import logging
import re
import time
from collections import defaultdict, namedtuple
from functools import partial
from pprint import pprint
from typing import Union
import requests
from lxml import etree
import uiautomato... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | _archived/aircv/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:24.684074 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import threading
import time
import cv2
import numpy as np
import requests
import websocket
__version__ = "0.0.1"
class CVHandler(object):
template_threshold = 0.95 # 模板匹配的阈值
def show(self, img):
''' 显示一个图片 '''
cv2.imshow('image', img)
... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | demo_tests/test_device.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:25.020725 | # coding: utf-8
# author: codeskyblue
import random
from pathlib import Path
import pytest
from PIL import Image
import uiautomator2 as u2
def test_info(d: u2.Device):
d.info
d.device_info
d.wlan_ip
assert isinstance(d.serial, str)
w, h = d.window_size()
assert w > 0 and h > 0
de... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | demo_tests/test_input.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:25.038884 | # coding: utf-8
# author: codeskyblue
import pytest
import uiautomator2 as u2
def test_set_ime(d: u2.Device):
d.set_input_ime(True)
d.set_input_ime(False)
def test_send_keys(app: u2.Device):
app(text="Addition").click()
num1 = app(className="android.widget.EditText", instance=0)
num2 = app(cla... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | demo_tests/test_selector.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:25.041234 | # coding: utf-8
# author: codeskyblue
import time
import pytest
import uiautomator2 as u2
from uiautomator2 import Selector
def test_selector_magic():
s = Selector(text='123').child(text='456').sibling(text='789').clone()
assert s['text'] == '123'
del s['text']
assert 'text' not in s
s.update_i... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | examples/batteryweb/main.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:25.117131 | # coding: utf-8
#
import flask
import requests
app = flask.Flask(__name__)
@app.route('/')
def index():
return flask.render_template('index.html')
@app.route('/battery_level/<ip>')
def battery_level(ip):
r = requests.get('http://'+ip+':7912/info').json()
return str(r.get('battery').get('level')) |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | examples/com.netease.cloudmusic/main.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:25.165924 | # coding: utf-8
import uiautomator2 as u2
def main():
u = u2.connect_usb()
u.app_start('com.netease.cloudmusic')
u(text='私人FM').click()
u(description='转到上一层级').click()
u(text='每日推荐').click()
u(description='转到上一层级').click()
u(text='歌单').click()
u(description='转到上一层级').click()
u(tex... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | examples/apk_install.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:25.169823 | # coding: utf-8
#
# Install problems
#
# OPPO need password
import time
import uiautomator2 as u2
def oppo_verify(u):
password = "your-password"
if u(packageName="com.coloros.safecenter", textContains="请验证身份后安装").exists:
print("Auto click install")
u.set_fastinput_ime()
u(className='... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | docs/conf.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:25.193936 | # 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... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | examples/minitouch.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:25.243651 | # coding: utf-8
#
# 半成品
import json
from websocket import create_connection
from . import Device
class Minitouch:
# TODO: need test
def __init__(self, d: Device):
self._d = d
self._prepare()
def _prepare(self):
self._w, self._h = self._d.window_size()
uri = self._d.path2... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | examples/com.codeskyblue.remotecamera/main_test.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:25.256778 | # coding: utf-8
import uiautomator2 as u2
pkg_name = 'com.codeskyblue.remotecamera'
d = u2.connect()
def setup_function():
d.app_start(pkg_name)
def test_simple():
assert d(text="Hello World!").exists
|
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | examples/runyaml/run.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:25.618788 | #!/usr/bin/env python3
# coding: utf-8
#
import argparse
import logging
import os
import re
import time
import bunch
import yaml
from logzero import logger
import uiautomator2 as u2
CLICK = "click"
# swipe
SWIPE_UP = "swipe_up"
SWIPE_RIGHT = "swipe_right"
SWIPE_LEFT = "swipe_left"
SWIPE_DOWN = "swipe_down"
SCREENS... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | examples/test_simple_example.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:25.619923 | # coding: utf-8
#
import uiautomator2 as u2
def test_simple():
d = u2.connect()
print(d.info)
if __name__ == "__main__":
test_simple()
|
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | examples/multi-thread-example.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:25.668028 | # coding: utf-8
#
# GIL limit python multi-thread effectiveness.
# But is seems fine, because these operation have so many socket IO
# So it seems no need to use multiprocess
#
import threading
import adbutils
from logzero import logger
import uiautomator2 as u2
def worker(d: u2.Device):
d.app_start("io.appium... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | mobile_tests/skip_test_image.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:25.726364 | # coding: utf-8
#
import os
import cv2
import numpy as np
import pytest
from PIL import Image
import uiautomator2.image as u2image
TESTDIR = os.path.dirname(os.path.abspath(__file__)) + "/testdata" # if set to DIR__, pytest will fail with TypeError: 'str' object is not callable
@pytest.fixture
def path_ae86():
... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | mobile_tests/conftest.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:25.752576 | # coding: utf-8
import adbutils
import pytest
import uiautomator2 as u2
@pytest.fixture(scope="module")
def d(device):
_d = device
_d.settings['operation_delay'] = (0.2, 0.2)
_d.settings['operation_delay_methods'] = ['click', 'swipe']
return _d
@pytest.fixture
def package_name():
return "io.ap... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | mobile_tests/test_screenrecord.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:25.753586 | # coding: utf-8
#
import time
import pytest
import uiautomator2 as u2
@pytest.mark.skip("deprecated")
def test_screenrecord(d: u2.Device):
import imageio
with pytest.raises(RuntimeError):
d.screenrecord.stop()
d.screenrecord("output.mp4", fps=10)
start = time.time()
with pytest.raises... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | mobile_tests/test_push_pull.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:25.755687 | # coding: utf-8
#
import io
import os
import uiautomator2 as u2
def test_push_and_pull(d: u2.Device):
device_target = "/data/local/tmp/hello.txt"
content = b"hello world"
d.push(io.BytesIO(content), device_target)
d.pull(device_target, "tmpfile-hello.txt")
with open("tmpfile-hello.txt", "rb") a... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | mobile_tests/test_simple.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:25.865246 | # coding: utf-8
#
# Test apk Download from
# https://github.com/appium/java-client/raw/master/src/test/java/io/appium/java_client/ApiDemos-debug.apk
import time
import unittest
import pytest
import uiautomator2 as u2
@pytest.mark.skip("not working")
def test_toast_get_message(dev: u2.Device):
d = dev
asser... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | mobile_tests/test_settings.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:25.913038 | # coding: utf-8
#
import time
import pytest
import uiautomator2 as u2
def test_set_xpath_debug(dev: u2.Device):
with pytest.raises(TypeError):
dev.settings['xpath_debug'] = 1
dev.settings['xpath_debug'] = True
assert dev.settings['xpath_debug'] == True
dev.settings['xpath_debug'] = Fa... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | mobile_tests/test_session.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:25.914334 | # coding: utf-8
#
import pytest
import uiautomator2 as u2
from uiautomator2.exceptions import SessionBrokenError
def test_session_function_exists(dev: u2.Device):
dev.wlan_ip
dev.watcher
dev.jsonrpc
dev.shell
dev.settings
dev.xpath
def test_app_mixin(dev: u2.Device, package_name: str):
... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | mobile_tests/test_swipe.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:26.269676 | # coding: utf-8
#
import time
import uiautomator2 as u2
def test_swipe_duration(d: u2.Device):
w, h = d.window_size()
start = time.time()
d.swipe(w//2, h//2, w-1, h//2, 2.0)
duration = time.time() - start
assert duration >= 1.5 # actually duration is about 7s in my TT
|
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | mobile_tests/test_xpath.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:26.296082 | # coding: utf-8
#
import threading
from functools import partial
import pytest
import uiautomator2 as u2
def test_get_text(dev: u2.Device):
assert dev.xpath("App").get_text() == "App"
def test_click(dev: u2.Device):
dev.xpath("App").click()
assert dev.xpath("Alarm").wait()
assert dev.xpath("Alarm... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | mobile_tests/test_watcher.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:26.353014 | # coding: utf-8
#
import uiautomator2 as u2
def test_watch_context(dev: u2.Device):
with dev.watch_context(builtin=True) as ctx:
ctx.when("App").click()
dev(text='Menu').click()
assert dev(text='Inflate from XML').wait()
def teardown_function(d: u2.Device):
print("Teardown"... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | tests/test_logger.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:26.354277 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Created on Thu Apr 04 2024 16:57:34 by codeskyblue
"""
import logging
import pytest
from uiautomator2 import enable_pretty_logging
def test_enable_pretty_logging(caplog: pytest.LogCaptureFixture):
logger = logging.getLogger("uiautomator2")
logger.info... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | tests/test_import.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:26.385429 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Created on Wed Mar 20 2024 14:51:03 by codeskyblue
"""
import uiautomator2 as u2
def test_import():
u2.Device
u2.connect
u2.connect_usb
u2.Device.app_install
u2.Device.app_uninstall
u2.Device.app_current
u2.Device.app_list
u2.Device.s... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | tests/test_input.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:26.408415 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for input method functionality"""
from unittest.mock import Mock, patch
import pytest
from uiautomator2._input import InputMethodMixIn
from uiautomator2.exceptions import AdbBroadcastError
class MockInputMethodMixIn(InputMethodMixIn):
"""Mock implementat... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | tests/test_core.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:26.465687 | # coding: utf-8
#
import hashlib
from unittest.mock import Mock, mock_open, patch
import pytest
from uiautomator2.core import BasicUiautomatorServer
@pytest.fixture
def mock_server():
"""Create a mock BasicUiautomatorServer instance with a mock device"""
mock_dev = Mock()
with patch.object(BasicUiautom... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | tests/test_xpath.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:26.497354 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Created on Thu Apr 04 2024 16:41:25 by codeskyblue
"""
from unittest.mock import Mock
import pytest
from PIL import Image
from uiautomator2.xpath import XMLElement, XPath, XPathElementNotFoundError, XPathEntry, XPathSelector, \
convert_to_camel_case, is_xpath_sy... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | tests/test_utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:26.515812 | # coding: utf-8
#
import threading
import time
import pytest
from PIL import Image
from uiautomator2 import utils
def test_list2cmdline():
testdata = [
[("echo", "hello"), "echo hello"],
[("echo", "hello&world"), "echo 'hello&world'"],
[("What's", "your", "name?"), """'What'"'"'s' your ... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | tests/test_settings.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:26.592102 | # coding: utf-8
# author: codeskyblue
import pytest
from uiautomator2 import Settings
def test_settings():
settings = Settings(None)
settings['wait_timeout'] = 10
assert settings['wait_timeout'] == 10
with pytest.raises(TypeError):
settings['wait_timeout'] = '30'
assert settings['wa... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | uiautomator2/__main__.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:26.882727 | # coding: utf-8
#
from __future__ import absolute_import, print_function
import argparse
import json
import logging
import pathlib
import shutil
import sys
import adbutils
import uiautomator2 as u2
from uiautomator2 import enable_pretty_logging
from uiautomator2.utils import with_package_resource
from uiautomator2.... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | uiautomator2/_proto.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:26.943260 | import enum
SCROLL_STEPS = 55
HTTP_TIMEOUT = 300
class Direction(str, enum.Enum):
LEFT = "left"
RIGHT = "right"
UP = "up"
DOWN = "down"
# 垂直操作
FORWARD = "up"
BACKWARD = "down"
# 水平操作
HORIZ_FORWARD = "left"
HORIZ_BACKWARD = "right" |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | uiautomator2/_selector.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:26.963813 | import logging
import time
import warnings
from typing import Optional, Tuple, List, Dict
from PIL import Image
from retry import retry
from uiautomator2._proto import SCROLL_STEPS
from uiautomator2.exceptions import HTTPError, UiObjectNotFoundError
from uiautomator2.utils import Exists, intersect
class Selector(di... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | uiautomator2/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:27.010959 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import base64
import contextlib
import dataclasses
import io
import logging
import os
import re
import time
import warnings
from functools import cached_property
from typing import Any, Dict, List, Optional, Tuple, Un... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | uiautomator2/abstract.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:27.032528 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Created on Thu Apr 25 2024 15:08:43 by codeskyblue
"""
import abc
import typing
from typing import Any, List, NamedTuple, Tuple, Union
import adbutils
from PIL import Image
from uiautomator2._proto import Direction
class ShellResponse(NamedTuple):
output: str
... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | uiautomator2/_input.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:27.046074 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Created on Wed May 22 2024 16:23:56 by codeskyblue
"""
import base64
import logging
import re
import time
import warnings
from dataclasses import dataclass
from pathlib import Path
from typing import Dict, List, Optional, Union
import adbutils
from retry import retry... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | uiautomator2/base.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:27.047503 | from __future__ import absolute_import, print_function
import logging
import re
import time
from functools import cached_property
from typing import Any, Dict, List, Optional, Tuple, Union
import adbutils
from uiautomator2._proto import HTTP_TIMEOUT, SCROLL_STEPS, Direction
from uiautomator2.abstract import ShellRes... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | uiautomator2/exceptions.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:27.115763 | # coding: utf-8
#
# BaseException
# +- RPCError
# | +- RPCUnknownError
# | +- RPCInvalidError
# | +- HierarchyEmptyError
# | +- RPCStackOverflowError
# | +- NormalError
# | +- XPathElementNotFoundError
# | +- UiObjectNotFoundError
# | +- AppNotFoundError
# | +- SessionBroke... |
openatx/uiautomator2 | https://github.com/openatx/uiautomator2 | null | null | null | null | 8,028 | null | null | mit | null | null | null | null | null | null | null | uiautomator2/core.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:27.124530 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Created on Thu Apr 25 2024 14:50:05 by codeskyblue
"""
import atexit
import datetime
import hashlib
import json
import logging
import os
import threading
import time
from http.client import HTTPConnection
from pathlib import Path
from typing import Any, Dict, Optional... |
docopt/docopt | https://github.com/docopt/docopt | null | null | null | null | 8,011 | null | null | mit | null | null | null | null | null | null | null | examples/arguments_example.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:29.756773 | """Usage: arguments_example.py [-vqrh] [FILE] ...
arguments_example.py (--left | --right) CORRECTION FILE
Process FILE and optionally apply correction to either left-hand side or
right-hand side.
Arguments:
FILE optional input file
CORRECTION correction angle, needs FILE, --left or --right to be... |
docopt/docopt | https://github.com/docopt/docopt | null | null | null | null | 8,011 | null | null | mit | null | null | null | null | null | null | null | conftest.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:29.758689 | import re
try:
import json
except ImportError:
import simplejson as json
import pytest
import docopt
def pytest_collect_file(path, parent):
if path.ext == ".docopt" and path.basename.startswith("test"):
return DocoptTestFile(path, parent)
def parse_test(raw):
raw = re.compile('#.*$', re.M)... |
docopt/docopt | https://github.com/docopt/docopt | null | null | null | null | 8,011 | null | null | mit | null | null | null | null | null | null | null | examples/counted_example.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:29.760153 | """Usage: counted_example.py --help
counted_example.py -v...
counted_example.py go [go]
counted_example.py (--path=<path>)...
counted_example.py <file> <file>
Try: counted_example.py -vvvvvvvvvv
counted_example.py go go
counted_example.py --path ./here --path ./there
counted_... |
docopt/docopt | https://github.com/docopt/docopt | null | null | null | null | 8,011 | null | null | mit | null | null | null | null | null | null | null | examples/git/git.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:29.761296 | #! /usr/bin/env python
"""
usage: git [--version] [--exec-path=<path>] [--html-path]
[-p|--paginate|--no-pager] [--no-replace-objects]
[--bare] [--git-dir=<path>] [--work-tree=<path>]
[-c <name>=<value>] [--help]
<command> [<args>...]
options:
-c <name=value>
-h, --hel... |
docopt/docopt | https://github.com/docopt/docopt | null | null | null | null | 8,011 | null | null | mit | null | null | null | null | null | null | null | examples/config_file_example.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:29.762663 | """Usage:
quick_example.py tcp [<host>] [--force] [--timeout=<seconds>]
quick_example.py serial <port> [--baud=<rate>] [--timeout=<seconds>]
quick_example.py -h | --help | --version
"""
from docopt import docopt
def load_json_config():
import json
# Pretend that we load the following JSON file:
sou... |
docopt/docopt | https://github.com/docopt/docopt | null | null | null | null | 8,011 | null | null | mit | null | null | null | null | null | null | null | docopt.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:29.763864 | """Pythonic command-line interface parser that will make you smile.
* http://docopt.org
* Repository and issue-tracker: https://github.com/docopt/docopt
* Licensed under terms of MIT license (see LICENSE-MIT)
* Copyright (c) 2013 Vladimir Keleshev, vladimir@keleshev.com
"""
import sys
import re
__all__ = ['doco... |
docopt/docopt | https://github.com/docopt/docopt | null | null | null | null | 8,011 | null | null | mit | null | null | null | null | null | null | null | examples/calculator_example.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:29.769205 | """Not a serious example.
Usage:
calculator_example.py <value> ( ( + | - | * | / ) <value> )...
calculator_example.py <function> <value> [( , <value> )]...
calculator_example.py (-h | --help)
Examples:
calculator_example.py 1 + 2 + 3 + 4 + 5
calculator_example.py 1 + 2 '*' 3 / 4 - 5 # note quotes around ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.