| edit_similarity |
Ran ran, honoured the contract we drafted |
Rocky5502/OpenCoder_V1/opencoder/evaluation/metrics.py code served (permissive licence) · get_code("c5019596846e0026") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import difflib
def edit_similarity(pred: str, ref: str) -> float:
return float(difflib.SequenceMatcher(None, pred, ref).ratio())
ARGS = {
"pred": "hello world",
"ref": "hello word"
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| estimate_pass_at_k |
Ran ran, honoured the contract we drafted |
Rocky5502/OpenCoder_V1/opencoder/evaluation/metrics.py code served (permissive licence) · get_code("42c81d3f43739308") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import math
def estimate_pass_at_k(n: int, c: int, k: int) -> float:
"""Unbiased pass@k estimator from Codex/HumanEval.
``n`` is the number of generated samples and ``c`` is how many passed.
"""
if n <= 0 or c <= 0:
return 0.0
if k <= 0:
return 0.0
if k > n:
k = n
if n - c < k:
return 1.0
return float(1.0 - math.comb(n - c, k) / math.comb(n, k))
ARGS = {
"n": 10,
"c": 5,
"k": 3,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| exact_match |
Ran ran, honoured the contract we drafted |
Rocky5502/OpenCoder_V1/opencoder/evaluation/metrics.py code served (permissive licence) · get_code("095c99ea52e24d66") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
# The function exact_match takes two string parameters: pred and ref
# It strips both strings and compares them for equality
# No complex objects needed - just strings
ARGS = {
"pred": "hello world ",
"ref": "hello world"
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| extract_repo_knowledge |
Ran ran; our contract draft was wrong, not the code |
Rocky5502/OpenCoder_V1/opencoder/phase1_repo_knowledge/extract.py code served (permissive licence) · get_code("93c070bd84dd8a9a") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import tempfile
import os
# Create a temporary directory with some Python files for testing
temp_dir = tempfile.mkdtemp()
# Create a simple Python module structure
os.makedirs(os.path.join(temp_dir, 'module1'), exist_ok=True)
# Write test Python files
test_file_1 = os.path.join(temp_dir, 'test_module.py')
with open(test_file_1, 'w') as f:
f.write('''
def simple_function(x, y):
"""This is a simple function."""
return x + y
class MyClass:
"""A test class."""
def method_one(self, a):
"""First method."""
return a * 2
def method_two(self, b):
"""Second method."""
return b + 1
from ..utils import helper_func
''')
test_file_2 = os.path.join(temp_dir, 'module1', 'sub_module.py')
with open(test_file_2, 'w') as f:
f.write('''
def another_function(param):
"""Another test function."""
pass
class AnotherClass:
"""Another class."""
pass
''')
test_file_3 = os.path.join(temp_dir, 'empty.py')
with open(test_file_3, 'w') as f:
f.write('# Empty file with just a comment\n')
# Create __pycache__ directory to test skipping
os.makedirs(os.path.join(temp_dir, '__pycache__'), exist_ok=True)
with open(os.path.join(temp_dir, '__pycache__', 'should_skip.py'), 'w') as f:
f.write('# This should be skipped\n')
ARGS = {
'root': temp_dir,
'max_files': None
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| extract_source_knowledge |
Ran ran; our contract draft was wrong, not the code |
Rocky5502/OpenCoder_V1/opencoder/phase1_repo_knowledge/extract.py code served (permissive licence) · get_code("0615393cf2c5420a") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import ast
from dataclasses import dataclass, field
from typing import Iterator, List, Optional, Sequence, Tuple
@dataclass
class RepoFunction:
file_path: str
qualname: str
signature: str
docstring: Optional[str]
body: str
start_line: int
end_line: int
kind: str = 'function'
description: Optional[str] = None
uncertainty: Optional[float] = None
metadata: dict = field(default_factory=dict)
def _segment(source: str, node: ast.AST) -> str:
try:
return ast.get_source_segment(source, node) or ''
except Exception:
return ''
def extract_source_knowledge(file_path: str, source: str) -> List[RepoFunction]:
"""Extract knowledge items from one in-memory Python source string."""
try:
tree = ast.parse(source)
except Exception:
return []
items: List[RepoFunction] = []
parents: dict[ast.AST, ast.AST] = {}
for parent in ast.walk(tree):
for child in ast.iter_child_nodes(parent):
parents[child] = parent
local_definitions = {node.name for node in ast.iter_child_nodes(tree) if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef, ast.ClassDef))}
for node in ast.walk(tree):
if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef)):
parent = parents.get(node)
is_method = isinstance(parent, ast.ClassDef)
qualname = f'{parent.name}.{node.name}' if is_method else node.name
sig = f"{node.name}({', '.join((a.arg for a in node.args.args))})"
items.append(RepoFunction(file_path=file_path, qualname=qualname, signature=sig, docstring=ast.get_docstring(node), body=_segment(source, node), start_line=node.lineno, end_line=getattr(node, 'end_lineno', node.lineno), kind='method' if is_method else 'function'))
elif isinstance(node, ast.ClassDef):
items.append(RepoFunction(file_path=file_path, qualname=node.name, signature=f'class {node.name}', docstring=ast.get_docstring(node), body=_segment(source, node), start_line=node.lineno, end_line=getattr(node, 'end_lineno', node.lineno), kind='class'))
elif isinstance(node, ast.ImportFrom) and node.level > 0:
module = '.' * node.level + (node.module or '')
for alias in node.names:
if alias.name == '*':
continue
local_name = alias.asname or alias.name
if local_name in local_definitions:
continue
items.append(RepoFunction(file_path=file_path, qualname=local_name, signature=f'imported {local_name} from {module}', docstring=None, body=_segment(source, node), start_line=node.lineno, end_line=getattr(node, 'end_lineno', node.lineno), kind='imported_api'))
return items
source_code = '''
def hello_world(x, y):
"""A simple function."""
return x + y
class MyClass:
"""A simple class."""
def method_one(self, a):
"""Method docstring."""
return a * 2
def method_two(self, b, c):
return b - c
from ..utils import helper_func
from ..config import Config
'''
ARGS = {
'file_path': 'test_module.py',
'source': source_code
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| extract_sources_knowledge |
Ran ran; our contract draft was wrong, not the code |
Rocky5502/OpenCoder_V1/opencoder/phase1_repo_knowledge/extract.py code served (permissive licence) · get_code("63158217b21bd36c") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import ast
from dataclasses import dataclass, field
from typing import Iterator, List, Optional, Sequence, Tuple
@dataclass
class RepoFunction:
file_path: str
qualname: str
signature: str
docstring: Optional[str]
body: str
start_line: int
end_line: int
kind: str = 'function'
description: Optional[str] = None
uncertainty: Optional[float] = None
metadata: dict = field(default_factory=dict)
def _segment(source: str, node: ast.AST) -> str:
try:
return ast.get_source_segment(source, node) or ''
except Exception:
return ''
def extract_source_knowledge(file_path: str, source: str) -> List[RepoFunction]:
"""Extract knowledge items from one in-memory Python source string."""
try:
tree = ast.parse(source)
except Exception:
return []
items: List[RepoFunction] = []
parents: dict[ast.AST, ast.AST] = {}
for parent in ast.walk(tree):
for child in ast.iter_child_nodes(parent):
parents[child] = parent
local_definitions = {node.name for node in ast.iter_child_nodes(tree) if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef, ast.ClassDef))}
for node in ast.walk(tree):
if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef)):
parent = parents.get(node)
is_method = isinstance(parent, ast.ClassDef)
qualname = f'{parent.name}.{node.name}' if is_method else node.name
sig = f"{node.name}({', '.join((a.arg for a in node.args.args))})"
items.append(RepoFunction(file_path=file_path, qualname=qualname, signature=sig, docstring=ast.get_docstring(node), body=_segment(source, node), start_line=node.lineno, end_line=getattr(node, 'end_lineno', node.lineno), kind='method' if is_method else 'function'))
elif isinstance(node, ast.ClassDef):
items.append(RepoFunction(file_path=file_path, qualname=node.name, signature=f'class {node.name}', docstring=ast.get_docstring(node), body=_segment(source, node), start_line=node.lineno, end_line=getattr(node, 'end_lineno', node.lineno), kind='class'))
elif isinstance(node, ast.ImportFrom) and node.level > 0:
module = '.' * node.level + (node.module or '')
for alias in node.names:
if alias.name == '*':
continue
local_name = alias.asname or alias.name
if local_name in local_definitions:
continue
items.append(RepoFunction(file_path=file_path, qualname=local_name, signature=f'imported {local_name} from {module}', docstring=None, body=_segment(source, node), start_line=node.lineno, end_line=getattr(node, 'end_lineno', node.lineno), kind='imported_api'))
return items
def extract_sources_knowledge(sources: Sequence[Tuple[str, str]]) -> List[RepoFunction]:
items: List[RepoFunction] = []
for file_path, source in sources:
items.extend(extract_source_knowledge(file_path, source))
return items
source1 = '''
def hello(x, y):
"""Say hello."""
return x + y
class MyClass:
"""A simple class."""
def method_one(self, a):
"""Method one."""
return a * 2
from . import utils
from .config import Config
'''
source2 = '''
def process(data):
"""Process data."""
pass
async def async_fetch(url):
"""Fetch from URL."""
pass
'''
ARGS = {
'sources': [
('file1.py', source1),
('file2.py', source2),
]
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| parse_dependency_descriptions |
Ran ran; our contract draft was wrong, not the code |
Rocky5502/OpenCoder_V1/opencoder/baselines/alliancecoder.py code served (permissive licence) · get_code("34e72b2d2d0bd87c") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import re
from dataclasses import dataclass
from typing import Any, Iterable, List, Sequence
@dataclass(frozen=True)
class DependencyPrediction:
description: str
ordinal: int
_LIST_PREFIX = re.compile('^\\s*(?:[-*]\\s+|\\d+[.)]\\s+)')
_NAMED_DESCRIPTION = re.compile('^(?:\\*\\*)?`[^`]+`(?:\\*\\*)?\\s*:\\s*(.+)$')
def parse_dependency_descriptions(text: str) -> List[DependencyPrediction]:
"""Parse an LLM list while preserving order and removing exact repeats."""
predictions: List[DependencyPrediction] = []
seen: set[str] = set()
for line in text.splitlines():
value = _LIST_PREFIX.sub('', line).strip()
value = value.strip('` ')
named = _NAMED_DESCRIPTION.match(_LIST_PREFIX.sub('', line).strip())
if named:
value = named.group(1).strip()
if not value or value.lower() in {'none', 'n/a', 'no dependencies'}:
continue
normalized = re.sub('\\s+', ' ', value).casefold()
if normalized in seen:
continue
seen.add(normalized)
predictions.append(DependencyPrediction(value, len(predictions) + 1))
return predictions
# Setup code to construct valid arguments
sample_text = """- numpy
* pandas
1. scipy
2. torch
- NumPy
** `requests`: HTTP library
none
n/a
1. scikit-learn
Multiple spaces
"""
ARGS = {
"text": sample_text
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| re_safe_name |
Ran ran; our contract draft was wrong, not the code |
Rocky5502/OpenCoder_V1/opencoder/pipeline.py code served (permissive licence) · get_code("97e318479d9485e0") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
torch.manual_seed(0)
ARGS = {
"value": "Hello-World_123!@#$%"
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|