Datasets:
example_name stringlengths 10 28 | python_file stringlengths 9 32 | python_code stringlengths 490 18.2k | rust_code stringlengths 0 434 | has_rust bool 2
classes | category stringlengths 2 20 | python_lines int32 13 586 | rust_lines int32 0 6 | blocking_features listlengths 0 7 | suspiciousness float32 0 0.95 | error stringlengths 33 500 ⌀ |
|---|---|---|---|---|---|---|---|---|---|---|
example_abs | abs_tool.py | #!/usr/bin/env python3
"""Abs Example - Absolute value operations CLI.
Examples:
>>> compute_abs_int(-5)
5
>>> compute_abs_int(5)
5
>>> compute_abs_float(-3.14)
3.14
>>> compute_abs_float(2.71)
2.71
"""
import argparse
def compute_abs_int(x: int) -> int:
"""Compute absolute value... | 📄 Source: /home/noah/src/reprorusted-python-cli/examples/example_abs/abs_tool.py (1236 bytes)
📝 Output: /home/noah/src/reprorusted-python-cli/examples/example_abs/abs_tool.rs (2536 bytes)
📦 Cargo.toml: /home/noah/src/reprorusted-python-cli/examples/example_abs/Cargo.toml (1 dependencies)
⏱️ Parse time: 48ms
📊 Thro... | true | abs | 65 | 6 | [] | 0 | null |
example_abs | test_abs_tool.py | """Tests for abs_tool - EXTREME TDD."""
import subprocess
from pathlib import Path
SCRIPT = Path(__file__).parent / "abs_tool.py"
def run(cmd):
return subprocess.run(
["python3", str(SCRIPT)] + cmd.split(),
capture_output=True,
text=True,
)
def test_int_positive():
r = run("int... | 📄 Source: /home/noah/src/reprorusted-python-cli/examples/example_abs/test_abs_tool.py (747 bytes)
📝 Output: /home/noah/src/reprorusted-python-cli/examples/example_abs/test_abs_tool.rs (2077 bytes)
📦 Cargo.toml: /home/noah/src/reprorusted-python-cli/examples/example_abs/Cargo.toml (2 dependencies)
⏱️ Parse time: 49m... | true | abs | 38 | 6 | [] | 0 | null |
example_age_calculator | age_cli.py | #!/usr/bin/env python3
"""Age calculator CLI.
Calculate age and related date information.
"""
import argparse
import sys
from datetime import date, datetime
def parse_date(date_str: str) -> date | None:
"""Parse date string into date object."""
formats = [
"%Y-%m-%d",
"%d/%m/%Y",
"%m... | 📄 Source: /home/noah/src/reprorusted-python-cli/examples/example_age_calculator/age_cli.py (6645 bytes)
📝 Output: /home/noah/src/reprorusted-python-cli/examples/example_age_calculator/age_cli.rs (14113 bytes)
📦 Cargo.toml: /home/noah/src/reprorusted-python-cli/examples/example_age_calculator/Cargo.toml (4 dependenci... | true | age_calculator | 241 | 6 | [
"exception_handling"
] | 0.577 | null |
example_age_calculator | test_age_cli.py | """Tests for age_cli.py"""
from datetime import date
from age_cli import (
calculate_age,
day_of_week,
days_in_month,
days_until_birthday,
format_age,
is_leap_year,
next_birthday,
parse_date,
total_days,
zodiac_sign,
)
class TestParseDate:
def test_iso_format(self):
... | 📄 Source: /home/noah/src/reprorusted-python-cli/examples/example_age_calculator/test_age_cli.py (4878 bytes)
📝 Output: /home/noah/src/reprorusted-python-cli/examples/example_age_calculator/test_age_cli.rs (10133 bytes)
📦 Cargo.toml: /home/noah/src/reprorusted-python-cli/examples/example_age_calculator/Cargo.toml (1 ... | true | age_calculator | 181 | 6 | [
"class_definition"
] | 0.612 | null |
example_any_all | any_all_tool.py | #!/usr/bin/env python3
"""Any All Example - Any/all operations CLI.
Examples:
>>> check_any(0, 0, 1, 0)
True
>>> check_all(1, 1, 1, 1)
True
"""
import argparse
def check_any(a: int, b: int, c: int, d: int) -> bool:
"""Check if any value is truthy.
>>> check_any(0, 0, 0, 0)
False
>>>... | 📄 Source: /home/noah/src/reprorusted-python-cli/examples/example_any_all/any_all_tool.py (1498 bytes)
📝 Output: /home/noah/src/reprorusted-python-cli/examples/example_any_all/any_all_tool.rs (2238 bytes)
📦 Cargo.toml: /home/noah/src/reprorusted-python-cli/examples/example_any_all/Cargo.toml (1 dependencies)
⏱️ Pars... | true | any_all | 63 | 6 | [] | 0 | null |
example_any_all | test_any_all_tool.py | """Tests for any_all_tool - EXTREME TDD."""
import subprocess
from pathlib import Path
SCRIPT = Path(__file__).parent / "any_all_tool.py"
def run(cmd):
return subprocess.run(
["python3", str(SCRIPT)] + cmd.split(),
capture_output=True,
text=True,
)
def test_any_true():
r = run(... | 📄 Source: /home/noah/src/reprorusted-python-cli/examples/example_any_all/test_any_all_tool.py (757 bytes)
📝 Output: /home/noah/src/reprorusted-python-cli/examples/example_any_all/test_any_all_tool.rs (2083 bytes)
📦 Cargo.toml: /home/noah/src/reprorusted-python-cli/examples/example_any_all/Cargo.toml (2 dependencies)... | true | any_all | 38 | 6 | [] | 0 | null |
example_argparse_minimal | minimal_cli.py | #!/usr/bin/env python3
"""
Minimal Argparse CLI - Baseline example that must compile
This is the absolute minimum argparse example:
- Single positional argument
- Single optional argument
- No subcommands
- Minimal handler
Purpose: Baseline CLI that depyler must handle correctly.
"""
import argparse
def main():
... | 📄 Source: /home/noah/src/reprorusted-python-cli/examples/example_argparse_minimal/minimal_cli.py (942 bytes)
📝 Output: /home/noah/src/reprorusted-python-cli/examples/example_argparse_minimal/minimal_cli.rs (582 bytes)
📦 Cargo.toml: /home/noah/src/reprorusted-python-cli/examples/example_argparse_minimal/Cargo.toml (1... | true | argparse_minimal | 48 | 6 | [
"context_manager"
] | 0.652 | null |
example_argparse_minimal | test_minimal_cli.py | """
Test suite for minimal_cli.py
Baseline CLI that must work with depyler
Following extreme TDD methodology.
"""
import subprocess
from pathlib import Path
import pytest
SCRIPT = Path(__file__).parent / "minimal_cli.py"
def run_cli(*args):
"""Helper to run CLI and capture output."""
result = subprocess.r... | false | argparse_minimal | 138 | 0 | [
"context_manager",
"class_definition",
"stdin_usage",
"decorator"
] | 0.652 |
Performance Warnings
══════════════════════════════════════════════════
[1] [Medium] Large value 'args' passed by copy
Location: run_cli, line 0
Impact: Complexity: O(n), Scales: Yes, Hot path: No
Why: Passing large values by copy is inefficient
Fix: Consider passing by reference (&) or using Box/Arc for ... | |
example_array | array_tool.py | #!/usr/bin/env python3
"""Array Example - Aggregate operations CLI."""
import argparse
def main():
parser = argparse.ArgumentParser(description="Array operations tool")
subs = parser.add_subparsers(dest="cmd", required=True)
s = subs.add_parser("sum")
s.add_argument("a", type=int)
s.add_argument... | 📄 Source: /home/noah/src/reprorusted-python-cli/examples/example_array/array_tool.py (718 bytes)
📝 Output: /home/noah/src/reprorusted-python-cli/examples/example_array/array_tool.rs (1043 bytes)
📦 Cargo.toml: /home/noah/src/reprorusted-python-cli/examples/example_array/Cargo.toml (1 dependencies)
⏱️ Parse time: 48m... | true | array | 29 | 6 | [] | 0 | null |
example_array | test_array_tool.py | #!/usr/bin/env python3
"""EXTREME TDD: Tests for array CLI."""
import subprocess
SCRIPT = "array_tool.py"
def run(args): return subprocess.run(["python3", SCRIPT] + args, capture_output=True, text=True, cwd=__file__.rsplit("/", 1)[0])
class TestSum:
def test_sum(self): r = run(["sum", "1", "2", "3"]); assert r.re... | 📄 Source: /home/noah/src/reprorusted-python-cli/examples/example_array/test_array_tool.py (566 bytes)
📝 Output: /home/noah/src/reprorusted-python-cli/examples/example_array/test_array_tool.rs (2004 bytes)
⏱️ Parse time: 49ms
📊 Throughput: 11.1 KB/s
⏱️ Total time: 49ms
| true | array | 15 | 5 | [
"class_definition"
] | 0.612 | null |
example_ascii | ascii_tool.py | #!/usr/bin/env python3
"""Ascii Example - ASCII operations CLI."""
import argparse
def main():
parser = argparse.ArgumentParser(description="ASCII operations tool")
subs = parser.add_subparsers(dest="cmd", required=True)
u = subs.add_parser("upper")
u.add_argument("code", type=int)
lo = subs.add... | 📄 Source: /home/noah/src/reprorusted-python-cli/examples/example_ascii/ascii_tool.py (695 bytes)
📝 Output: /home/noah/src/reprorusted-python-cli/examples/example_ascii/ascii_tool.rs (1046 bytes)
📦 Cargo.toml: /home/noah/src/reprorusted-python-cli/examples/example_ascii/Cargo.toml (1 dependencies)
⏱️ Parse time: 49m... | true | ascii | 28 | 6 | [] | 0 | null |
example_ascii | test_ascii_tool.py | """Tests for ascii_tool - EXTREME TDD."""
import subprocess
from pathlib import Path
SCRIPT = Path(__file__).parent / "ascii_tool.py"
def run(cmd):
return subprocess.run(
["python3", str(SCRIPT)] + cmd.split(),
capture_output=True,
text=True,
)
def test_upper():
r = run("upper ... | 📄 Source: /home/noah/src/reprorusted-python-cli/examples/example_ascii/test_ascii_tool.py (605 bytes)
📝 Output: /home/noah/src/reprorusted-python-cli/examples/example_ascii/test_ascii_tool.rs (1813 bytes)
📦 Cargo.toml: /home/noah/src/reprorusted-python-cli/examples/example_ascii/Cargo.toml (2 dependencies)
⏱️ Parse... | true | ascii | 32 | 6 | [] | 0 | null |
example_async_basic | async_basic_cli.py | #!/usr/bin/env python3
"""Async Basic CLI.
Basic async/await patterns and coroutine functions.
"""
import argparse
import asyncio
import sys
async def async_identity(value: int) -> int:
"""Simple async identity function."""
return value
async def async_add(a: int, b: int) -> int:
"""Async addition."""... | 📄 Source: /home/noah/src/reprorusted-python-cli/examples/example_async_basic/async_basic_cli.py (6186 bytes)
📝 Output: /home/noah/src/reprorusted-python-cli/examples/example_async_basic/async_basic_cli.rs (11954 bytes)
📦 Cargo.toml: /home/noah/src/reprorusted-python-cli/examples/example_async_basic/Cargo.toml (1 dep... | true | async_basic | 241 | 6 | [
"async_await",
"context_manager",
"exception_handling",
"functools"
] | 0.946 | null |
example_async_basic | test_async_basic_cli.py | """Tests for async_basic_cli.py"""
import pytest
from async_basic_cli import (
async_add,
async_all_positive,
async_any_match,
async_chain,
async_conditional,
async_count_matching,
async_delay,
async_early_return,
async_factorial,
async_fibonacci,
async_filter_positive,
... | 📄 Source: /home/noah/src/reprorusted-python-cli/examples/example_async_basic/test_async_basic_cli.py (5611 bytes)
📝 Output: /home/noah/src/reprorusted-python-cli/examples/example_async_basic/test_async_basic_cli.rs (13097 bytes)
⏱️ Parse time: 51ms
📊 Throughput: 106.2 KB/s
⏱️ Total time: 51ms
| true | async_basic | 202 | 5 | [
"context_manager",
"class_definition",
"functools"
] | 0.652 | null |
example_async_context | async_context_cli.py | #!/usr/bin/env python3
"""Async Context CLI.
Async context managers and resource management patterns.
"""
import argparse
import asyncio
import sys
from typing import Any
class AsyncResource:
"""Simple async resource with enter/exit."""
def __init__(self, name: str) -> None:
self._name: str = name
... | false | async_context | 301 | 0 | [
"async_await",
"context_manager",
"class_definition",
"exception_handling",
"multiprocessing"
] | 0.946 | Error: Unsupported type annotation: Constant(ExprConstant { range: 429..444, value: Str("AsyncResource"), kind: None })
| |
example_async_context | test_async_context_cli.py | """Tests for async_context_cli.py"""
import pytest
from async_context_cli import (
AsyncLock,
AsyncPool,
AsyncResource,
AsyncTransaction,
PooledConnection,
nested_resources,
pool_operations,
resource_with_error,
run_async,
scoped_lock_operations,
sequential_resources,
tr... | false | async_context | 231 | 0 | [
"async_await",
"context_manager",
"class_definition",
"exception_handling",
"multiprocessing"
] | 0.946 | Error: Statement type not yet supported: AsyncFunctionDef
| |
example_async_gather | async_gather_cli.py | #!/usr/bin/env python3
"""Async Gather CLI.
Concurrent async execution patterns with asyncio.gather.
"""
import argparse
import asyncio
import sys
async def async_delay_value(value: int, delay_ms: int) -> int:
"""Return value after delay."""
await asyncio.sleep(delay_ms / 1000.0)
return value
async de... | false | async_gather | 263 | 0 | [
"async_await",
"context_manager",
"exception_handling",
"multiprocessing",
"functools"
] | 0.946 | Error: Statement type not yet supported: AsyncFunctionDef
| |
example_async_gather | test_async_gather_cli.py | """Tests for async_gather_cli.py"""
import pytest
from async_gather_cli import (
async_compute,
async_delay_value,
async_may_fail,
batch_process,
concurrent_all_positive,
concurrent_filter_compute,
concurrent_find_any,
concurrent_map,
fan_out_fan_in,
gather_all,
gather_all_c... | 📄 Source: /home/noah/src/reprorusted-python-cli/examples/example_async_gather/test_async_gather_cli.py (4298 bytes)
📝 Output: /home/noah/src/reprorusted-python-cli/examples/example_async_gather/test_async_gather_cli.rs (10181 bytes)
⏱️ Parse time: 51ms
📊 Throughput: 82.2 KB/s
⏱️ Total time: 51ms
| true | async_gather | 162 | 5 | [
"context_manager",
"class_definition",
"multiprocessing"
] | 0.652 | null |
example_async_iterator | async_iterator_cli.py | #!/usr/bin/env python3
"""Async Iterator CLI.
Async iterators and async generators.
"""
import argparse
import asyncio
import sys
from collections.abc import AsyncIterator
class AsyncRange:
"""Async range iterator."""
def __init__(self, start: int, end: int, step: int = 1) -> None:
self._start: int... | false | async_iterator | 306 | 0 | [
"async_await",
"generator",
"context_manager",
"class_definition",
"exception_handling"
] | 0.946 | Error: Statement type not yet supported: AsyncFor
| |
example_async_iterator | test_async_iterator_cli.py | """Tests for async_iterator_cli.py"""
from async_iterator_cli import (
AsyncCounter,
AsyncRange,
all_positive_async,
any_async,
async_generator_chain,
async_generator_enumerate,
async_generator_fibonacci,
async_generator_filter,
async_generator_map,
async_generator_range,
as... | false | async_iterator | 256 | 0 | [
"async_await",
"generator",
"class_definition"
] | 0.946 | Error: Statement type not yet supported: AsyncFunctionDef
| |
example_async_queue | async_queue_cli.py | #!/usr/bin/env python3
"""Async Queue CLI.
Async queue patterns for producer-consumer scenarios.
"""
import argparse
import asyncio
import sys
from typing import Generic, TypeVar
T = TypeVar("T")
class AsyncQueue(Generic[T]):
"""Simple async queue implementation."""
def __init__(self, maxsize: int = 0) ->... | false | async_queue | 369 | 0 | [
"async_await",
"lambda",
"class_definition",
"exception_handling"
] | 0.946 | Type inference hints:
Hint: int for variable 'count' [Medium] (usage patterns suggest this type)
Type inference hints:
Hint: list[Any] for variable 'results' [High] (usage patterns suggest this type)
Type inference hints:
Hint: int for variable 'processed' [Medium] (usage patterns suggest this type)
Hint: int for var... | |
example_async_queue | test_async_queue_cli.py | """Tests for async_queue_cli.py"""
from async_queue_cli import (
AsyncChannel,
AsyncQueue,
accumulator_pattern,
batch_collector,
bounded_queue_test,
dedup_queue,
filter_pipeline,
priority_queue_simulation,
producer,
round_robin_queues,
run_async,
simple_producer_consumer... | false | async_queue | 225 | 0 | [
"async_await",
"class_definition",
"exception_handling"
] | 0.946 | Error: Statement type not yet supported: AsyncFunctionDef
| |
example_backup_tool | backup_cli.py | #!/usr/bin/env python3
"""Simple backup tool CLI.
Create and restore file backups with timestamps.
"""
import argparse
import hashlib
import os
import shutil
import sys
from datetime import datetime
def get_timestamp() -> str:
"""Get current timestamp for backup naming."""
return datetime.now().strftime("%Y... | 📄 Source: /home/noah/src/reprorusted-python-cli/examples/example_backup_tool/backup_cli.py (7237 bytes)
📝 Output: /home/noah/src/reprorusted-python-cli/examples/example_backup_tool/backup_cli.rs (13411 bytes)
📦 Cargo.toml: /home/noah/src/reprorusted-python-cli/examples/example_backup_tool/Cargo.toml (5 dependencies)... | true | backup_tool | 232 | 6 | [
"lambda",
"context_manager",
"exception_handling",
"walrus_operator"
] | 0.85 | null |
example_backup_tool | test_backup_cli.py | """Tests for backup_cli.py"""
import os
import tempfile
import time
import pytest
from backup_cli import (
backup_file,
get_file_checksum,
get_latest_backup,
get_timestamp,
list_backups,
parse_timestamp,
prune_backups,
restore_backup,
)
@pytest.fixture
def temp_env():
"""Create t... | false | backup_tool | 209 | 0 | [
"generator",
"context_manager",
"class_definition",
"decorator"
] | 0.927 | Type inference hints:
Hint: str for variable 'source' [Medium] (usage patterns suggest this type)
Profiling Report
══════════════════════════════════════════════════
Summary
Total estimated instructions: 1
Total estimated allocations: 0
Functions analyzed: 1
Hot Paths
[1] temp_env (100.0% of execution time)... | |
example_base64 | encode_tool.py | #!/usr/bin/env python3
"""Base64 Example - Encoding/decoding CLI."""
import argparse
import base64
import sys
def cmd_encode(args):
"""Base64 encode. Depyler: proven to terminate"""
data = sys.stdin.read().strip()
encoded = base64.b64encode(data.encode()).decode()
print(encoded)
def cmd_decode(args... | 📄 Source: /home/noah/src/reprorusted-python-cli/examples/example_base64/encode_tool.py (1231 bytes)
📝 Output: /home/noah/src/reprorusted-python-cli/examples/example_base64/encode_tool.rs (2467 bytes)
📦 Cargo.toml: /home/noah/src/reprorusted-python-cli/examples/example_base64/Cargo.toml (2 dependencies)
⏱️ Parse tim... | true | base64 | 48 | 6 | [
"stdin_usage"
] | 0.566 | null |
example_base64 | test_encode_tool.py | #!/usr/bin/env python3
"""EXTREME TDD: Tests for base64 CLI."""
import subprocess
from pathlib import Path
SCRIPT = Path(__file__).parent / "encode_tool.py"
SCRIPT = "encode_tool.py"
def run(args, input_text=None):
return subprocess.run(["python3", SCRIPT] + args, capture_output=True, text=True,
... | 📄 Source: /home/noah/src/reprorusted-python-cli/examples/example_base64/test_encode_tool.py (1152 bytes)
📝 Output: /home/noah/src/reprorusted-python-cli/examples/example_base64/test_encode_tool.rs (2705 bytes)
📦 Cargo.toml: /home/noah/src/reprorusted-python-cli/examples/example_base64/Cargo.toml (2 dependencies)
⏱️ ... | true | base64 | 39 | 6 | [
"class_definition"
] | 0.612 | null |
example_batch_processor | batch_cli.py | #!/usr/bin/env python3
"""Batch processor CLI.
Process items in batches with progress tracking.
"""
import argparse
import json
import sys
import time
from dataclasses import dataclass
@dataclass
class BatchResult:
"""Result of processing a batch."""
batch_index: int
items_processed: int
items_fail... | false | batch_processor | 279 | 0 | [
"context_manager",
"class_definition",
"stdin_usage",
"decorator",
"multiprocessing"
] | 0.652 | Type inference hints:
Hint: int for variable 'failed' [Medium] (usage patterns suggest this type)
Hint: int for variable 'processed' [Medium] (usage patterns suggest this type)
Hint: list[Any] for variable 'errors' [High] (usage patterns suggest this type)
Type inference hints:
Hint: list[Any] for variable 'items' [Hi... | |
example_batch_processor | test_batch_cli.py | """Tests for batch_cli.py"""
import time
from batch_cli import (
ProcessingStats,
chunk_list,
format_progress,
generate_items,
process_all,
process_batch,
process_item_dummy,
)
class TestChunkList:
def test_even_split(self):
items = list(range(10))
chunks = chunk_list... | false | batch_processor | 205 | 0 | [
"class_definition",
"multiprocessing"
] | 0.612 | Error: Expression type not yet supported: GeneratorExp { element: Binary { op: Eq, left: Call { func: "len", args: [Var("c")], kwargs: [] }, right: Literal(Int(1)) }, generators: [HirComprehension { target: "c", iter: Var("chunks"), conditions: [] }] }
| |
example_bencode_codec | bencode_cli.py | #!/usr/bin/env python3
"""Bencode codec CLI.
Encode and decode BitTorrent bencode format.
"""
import argparse
import json
import sys
def encode_int(value: int) -> bytes:
"""Encode integer to bencode."""
return f"i{value}e".encode("ascii")
def encode_bytes(value: bytes) -> bytes:
"""Encode bytes to ben... | 📄 Source: /home/noah/src/reprorusted-python-cli/examples/example_bencode_codec/bencode_cli.py (6564 bytes)
📝 Output: /home/noah/src/reprorusted-python-cli/examples/example_bencode_codec/bencode_cli.rs (13992 bytes)
📦 Cargo.toml: /home/noah/src/reprorusted-python-cli/examples/example_bencode_codec/Cargo.toml (3 depen... | true | bencode_codec | 238 | 6 | [
"context_manager",
"class_definition",
"exception_handling",
"stdin_usage",
"multiprocessing"
] | 0.652 | null |
example_bencode_codec | test_bencode_cli.py | """Tests for bencode_cli.py"""
from bencode_cli import (
bencode_decode,
bencode_encode,
encode_bytes,
encode_dict,
encode_int,
encode_list,
encode_string,
validate_bencode,
)
class TestEncodeInt:
def test_positive(self):
assert encode_int(42) == b"i42e"
def test_zero... | 📄 Source: /home/noah/src/reprorusted-python-cli/examples/example_bencode_codec/test_bencode_cli.py (3848 bytes)
📝 Output: /home/noah/src/reprorusted-python-cli/examples/example_bencode_codec/test_bencode_cli.rs (8640 bytes)
⏱️ Parse time: 51ms
📊 Throughput: 73.1 KB/s
⏱️ Total time: 51ms
| true | bencode_codec | 149 | 5 | [
"class_definition"
] | 0.612 | null |
example_bin | bin_tool.py | #!/usr/bin/env python3
"""Bin Example - Binary operations CLI."""
import argparse
def main():
parser = argparse.ArgumentParser(description="Binary operations tool")
subs = parser.add_subparsers(dest="cmd", required=True)
t = subs.add_parser("tobin")
t.add_argument("num", type=int)
f = subs.add_p... | 📄 Source: /home/noah/src/reprorusted-python-cli/examples/example_bin/bin_tool.py (801 bytes)
📝 Output: /home/noah/src/reprorusted-python-cli/examples/example_bin/bin_tool.rs (2624 bytes)
📦 Cargo.toml: /home/noah/src/reprorusted-python-cli/examples/example_bin/Cargo.toml (1 dependencies)
⏱️ Parse time: 48ms
📊 Throu... | true | bin | 33 | 6 | [] | 0 | null |
example_bin | test_bin_tool.py | """Tests for bin_tool - EXTREME TDD."""
import subprocess
from pathlib import Path
SCRIPT = Path(__file__).parent / "bin_tool.py"
def run(cmd):
return subprocess.run(
["python3", str(SCRIPT)] + cmd.split(),
capture_output=True,
text=True,
)
def test_tobin():
r = run("tobin 10")... | 📄 Source: /home/noah/src/reprorusted-python-cli/examples/example_bin/test_bin_tool.py (610 bytes)
📝 Output: /home/noah/src/reprorusted-python-cli/examples/example_bin/test_bin_tool.rs (1820 bytes)
📦 Cargo.toml: /home/noah/src/reprorusted-python-cli/examples/example_bin/Cargo.toml (2 dependencies)
⏱️ Parse time: 47m... | true | bin | 32 | 6 | [] | 0 | null |
example_binary_codec | binary_codec_cli.py | #!/usr/bin/env python3
"""Binary Codec CLI.
Binary encoding/decoding utilities (base64, hex, etc).
"""
import argparse
import base64
import sys
def encode_hex(data: bytes) -> str:
"""Encode bytes to hex string."""
return data.hex()
def decode_hex(hex_str: str) -> bytes:
"""Decode hex string to bytes."... | false | binary_codec | 357 | 0 | [
"context_manager",
"exception_handling"
] | 0.652 | Type inference hints:
Hint: str for variable 'bin_str' [Medium] (usage patterns suggest this type)
Type inference hints:
Hint: str for variable 'b' [Medium] (usage patterns suggest this type)
Hint: list[Any] for variable 'result' [High] (usage patterns suggest this type)
Type inference hints:
Hint: str for variable '... | |
example_binary_codec | test_binary_codec_cli.py | """Tests for binary_codec_cli.py"""
from binary_codec_cli import (
binary_string_to_bytes,
bit_reverse_bytes,
bytes_to_binary_string,
bytes_to_int_list,
caesar_cipher,
caesar_decipher,
calculate_crc8,
calculate_crc16,
decode_ascii_hex,
decode_base16,
decode_base32,
decod... | false | binary_codec | 284 | 0 | [
"class_definition"
] | 0.612 |
thread 'main' (2445357) panicked at crates/depyler-core/src/direct_rules.rs:1763:28:
expected identifier, found keyword `_`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
| |
example_binary_search | search_cli.py | #!/usr/bin/env python3
"""Binary search CLI.
Binary search implementations with various comparators.
"""
import argparse
import sys
from collections.abc import Callable
def binary_search(arr: list, target, key: Callable | None = None) -> int:
"""Basic binary search. Returns index or -1 if not found."""
left... | 📄 Source: /home/noah/src/reprorusted-python-cli/examples/example_binary_search/search_cli.py (6365 bytes)
📝 Output: /home/noah/src/reprorusted-python-cli/examples/example_binary_search/search_cli.rs (16559 bytes)
📦 Cargo.toml: /home/noah/src/reprorusted-python-cli/examples/example_binary_search/Cargo.toml (3 depende... | true | binary_search | 249 | 6 | [
"context_manager",
"stdin_usage"
] | 0.652 | null |
End of preview. Expand in Data Studio
Depyler CITL Corpus
Python→Rust transpilation pairs for Compiler-in-the-Loop training.
Dataset Description
606 Python CLI examples with corresponding Rust translations (where available), designed for training transpiler ML models.
| Split | Examples | With Rust | Size |
|---|---|---|---|
| train | 606 | 439 (72.4%) | 957 KB |
Schema
- example_name: str # Directory name (e.g., "example_fibonacci")
- python_file: str # Python filename
- python_code: str # Full Python source
- rust_code: str # Corresponding Rust (empty if not transpiled)
- has_rust: bool # Whether Rust translation exists
- category: str # Extracted category
- python_lines: int # Line count
- rust_lines: int # Line count
- blocking_features: [str] # Detected Python features (v2)
- suspiciousness: float # Tarantula score 0-1 (v2)
- error: str # Transpilation error if failed (v2)
Tarantula Fault Localization
The corpus_insights.json file contains fault localization analysis using the Tarantula algorithm from entrenar CITL.
Priority Features (by suspiciousness score)
| Feature | Score | Categories Affected | Priority |
|---|---|---|---|
| async_await | 0.946 | 4 | P0 |
| generator | 0.927 | 14 | P0 |
| walrus_operator | 0.850 | 1 | P1 |
| lambda | 0.783 | 29 | P1 |
| context_manager | 0.652 | 93 | P2 |
Higher suspiciousness = more correlated with transpilation failures.
Insights File Structure
{
"summary": { "total_pairs": 606, "success_rate": 71.9 },
"tarantula_fault_localization": { "scores": {...} },
"priority_features_to_implement": [...],
"zero_success_categories": [...],
"category_insights": {...}
}
Regenerate with: python3 scripts/generate_insights.py
Usage
from datasets import load_dataset
ds = load_dataset("paiml/depyler-citl")
# Filter to pairs with Rust translations
pairs = ds["train"].filter(lambda x: x["has_rust"])
for row in pairs:
print(f"Python: {row['python_lines']} lines → Rust: {row['rust_lines']} lines")
Related Projects
- depyler - Python→Rust transpiler
- alimentar - Dataset loading library
- entrenar - ML training with CITL
License
MIT
- Downloads last month
- 9