| ask_llm_tgi |
Ran ran on a synthesized input |
KDEGroup/CodeRAG/coderag/inference/tgi.py code served (permissive licence) · get_code("5cc7e713a361b98f") 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 coroutine. 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 asyncio
from typing import Any, Dict, Optional
# The function is async and makes HTTP calls, which we can't do in this sandbox
# So we'll provide realistic arguments that the function expects
prompt = "What is the capital of France?"
api_url = "http://localhost:8080/generate"
parameters = {
"max_new_tokens": 100,
"temperature": 0.7,
"top_p": 0.9,
"do_sample": True
}
ARGS = {
"prompt": prompt,
"api_url": api_url,
"parameters": parameters
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- httpx — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type coroutine — a coroutine output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a coroutine 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
|
| build_query_by_last_k_lines |
Ran ran; our contract draft was wrong, not the code |
KDEGroup/CodeRAG/coderag/build_query/build_query.py code served (permissive licence) · get_code("be289ff17cce3aa9") 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 torch
import numpy as np
from typing import Sequence, List
# Create sample source code strings
source_code_1 = """def hello():
print("Hello")
return True
# comment 1
# comment 2"""
source_code_2 = """class MyClass:
def __init__(self):
self.value = 0
def method(self):
return self.value
# end of class"""
source_code_3 = """x = 1
y = 2
z = 3"""
source_codes = [source_code_1, source_code_2, source_code_3]
k = 2
ARGS = {
"source_codes": source_codes,
"k": k
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — 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
|
| compute_EM |
Ran ran, honoured the contract we drafted |
KDEGroup/CodeRAG/coderag/evaluation/metrics.py code served (permissive licence) · get_code("e63c0b38c54cd391") 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 int, ndim 0, dtype family int, 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 numpy as np
torch.manual_seed(0)
# Analyzing the function:
# - target: string (code as string)
# - prediction: string (code as string)
# - language: string (either 'python' or 'java')
# The function compares target and prediction code after stripping comments and whitespace
target_code = """
def hello():
# This is a comment
print("hello")
x = 5
"""
prediction_code = """
def hello():
print("hello")
x = 5
"""
ARGS = {
'target': target_code,
'prediction': prediction_code,
'language': 'python'
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type int, ndim 0, dtype family int, 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
|
| count_tokens |
Ran ran, honoured the contract we drafted |
KDEGroup/CodeRAG/coderag/build_prompt/merge_retrieval.py code served (permissive licence) · get_code("c1a55b16a582d56f") 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 int, ndim 0, dtype family int, 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
class MockTransformersTokenizer:
"""Mock tokenizer that mimics transformers tokenizer behavior"""
def encode(self, text, add_special_tokens=False):
# Simple mock: return token ids based on text length
return list(range(len(text.split())))
class MockTiktokenTokenizer:
"""Mock tokenizer that mimics tiktoken behavior"""
def encode(self, text):
# Simple mock: return token ids based on text length
return list(range(len(text.split())))
# Create instances
transformers_tokenizer = MockTransformersTokenizer()
tiktoken_tokenizer = MockTiktokenTokenizer()
sample_text = "Hello world this is a test"
ARGS = {
"text": sample_text,
"tokenizer": transformers_tokenizer,
"is_transformers": True,
}
- 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 int, ndim 0, dtype family int, 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
|
| get_client |
Ran ran; our contract draft was wrong, not the code |
KDEGroup/CodeRAG/coderag/inference/limited_async_openai.py code served (permissive licence) · get_code("ee811882800fd4ae") 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 AsyncOpenAI. 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
import httpx
from openai import AsyncOpenAI
# Set seed for reproducibility
torch.manual_seed(0)
# Construct arguments for get_client function
ARGS = {
'api_key': 'sk-test-1234567890abcdefghijklmnopqrstuv',
'base_url': 'https://api.openai.com/v1',
'max_concurrent_requests': 5,
'timeout': 10.0,
'retries': 2
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- httpx, openai, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type AsyncOpenAI — a AsyncOpenAI output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a AsyncOpenAI 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
|
| hit |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
KDEGroup/CodeRAG/coderag/evaluation/metrics.py code served (permissive licence) · get_code("e3a7eba104f010a8") 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 numpy as np
# Construct search_cases with the required structure
search_cases = [
{
'metadata': {
'ground_truth': 'def hello():\n return 42\n'
},
'top_k_context': [
('def hello():\n return 42\n',),
('def world():\n return 0\n',),
('def other():\n pass\n',),
]
},
{
'metadata': {
'ground_truth': 'class MyClass:\n pass\n'
},
'top_k_context': [
('unrelated code\n',),
('class MyClass:\n pass\n',),
('another thing\n',),
]
},
{
'metadata': {
'ground_truth': '# comment\nfor i in range(10):\n print(i)\n'
},
'top_k_context': [
('for i in range(10):\n print(i)\n',),
('different code\n',),
]
}
]
hits = [1, 5, 10]
ARGS = {
'search_cases': search_cases,
'hits': hits
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — 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
|
| iterate_repos |
Ran ran; our contract draft was wrong, not the code |
KDEGroup/CodeRAG/coderag/benchmark/common.py code served (permissive licence) · get_code("6d4fa6a5220b6843") 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 dict. 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 tempfile
import os
from pathlib import Path
# Create a temporary directory structure with some Python files
temp_dir = tempfile.mkdtemp()
repo_base_path = Path(temp_dir)
# Create subdirectories for repos
repo1_dir = repo_base_path / "repo1"
repo1_dir.mkdir(exist_ok=True)
repo2_dir = repo_base_path / "repo2"
repo2_dir.mkdir(exist_ok=True)
# Create some Python files in repo1
(repo1_dir / "module1.py").write_text("def hello():\n pass\n")
(repo1_dir / "module2.py").write_text("class MyClass:\n pass\n")
# Create subdirectory in repo1
subdir1 = repo1_dir / "submodule"
subdir1.mkdir(exist_ok=True)
(subdir1 / "nested.py").write_text("# nested module\n")
# Create some Python files in repo2
(repo2_dir / "script.py").write_text("print('hello')\n")
ARGS = {
"repo_base_path": repo_base_path
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- loguru — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
|
| iterate_repository |
Ran ran; our contract draft was wrong, not the code |
KDEGroup/CodeRAG/coderag/benchmark/common.py code served (permissive licence) · get_code("2678b36e09057618") 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. 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 tempfile
from pathlib import Path
import os
# Create a temporary directory with some Python files
temp_dir = tempfile.mkdtemp()
repo_path = Path(temp_dir)
# Create a subdirectory structure with Python files
subdir = repo_path / "subdir"
subdir.mkdir(exist_ok=True)
# Create some test Python files
(repo_path / "test1.py").write_text("print('hello')\n")
(repo_path / "test2.py").write_text("def foo():\n pass\n")
(subdir / "nested.py").write_text("x = 42\n")
# Create a non-Python file that should be ignored
(repo_path / "readme.txt").write_text("This is not a python file\n")
ARGS = {
"repo_path": repo_path
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- loguru — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list — a list output has no array shape of its own; none is 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
|
| load_jsonl |
Ran ran; our contract draft was wrong, not the code |
KDEGroup/CodeRAG/coderag/benchmark/common.py code served (permissive licence) · get_code("08e488a1ef10ab01") 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
from pathlib import Path
import json
# Create a temporary JSONL file with sample data
with tempfile.NamedTemporaryFile(mode='w', suffix='.jsonl', delete=False, encoding='utf8') as f:
temp_path = Path(f.name)
f.write(json.dumps({"id": 1, "text": "hello"}) + "\n")
f.write(json.dumps({"id": 2, "text": "world"}) + "\n")
f.write(json.dumps({"id": 3, "data": [1, 2, 3]}) + "\n")
ARGS = {
"fname": temp_path
}
- 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
|
| process_one_file_sync |
Ran ran; our contract draft was wrong, not the code |
KDEGroup/CodeRAG/coderag/build_query/build_query.py code served (permissive licence) · get_code("3329eb864079863b") 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
import numpy as np
def create_mock_get_scores():
"""Create a callable that scores prompts based on their length."""
def get_scores(prompts: list[str]) -> list[float]:
# Return scores proportional to prompt length, with some variation
scores = [float(len(p)) / 100.0 for p in prompts]
return scores
return get_scores
# Create test source code with multiple lines
source_code = """def hello():
print("Hello world")
x = 1
y = 2
return x + y
def goodbye():
print("Goodbye world")
a = 3
b = 4
return a + b
def main():
hello()
goodbye()
print("Done")
"""
top_k = 2
chunk_size = 3
get_scores = create_mock_get_scores()
ARGS = {
"source_code": source_code,
"top_k": top_k,
"chunk_size": chunk_size,
"get_scores": get_scores
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, 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
|
| truncate_content_to_fit_token_limit |
Ran ran; our contract draft was wrong, not the code |
KDEGroup/CodeRAG/coderag/build_prompt/merge_retrieval.py code served (permissive licence) · get_code("b15d840bae43ef19") 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
import numpy as np
class MockTransformersTokenizer:
"""Mock tokenizer that behaves like transformers tokenizer"""
def __init__(self):
self.vocab = {chr(i): i for i in range(32, 127)}
self.id_to_token = {v: k for k, v in self.vocab.items()}
def encode(self, text, add_special_tokens=False):
# Simple encoding: map each character to its ASCII value
tokens = []
for char in text:
if char in self.vocab:
tokens.append(self.vocab[char])
else:
tokens.append(ord(char) % 256)
return tokens
def decode(self, token_ids):
# Simple decoding: map token IDs back to characters
result = []
for token_id in token_ids:
if token_id in self.id_to_token:
result.append(self.id_to_token[token_id])
else:
result.append(chr(token_id % 256))
return ''.join(result)
class MockTiktokenTokenizer:
"""Mock tokenizer that behaves like tiktoken tokenizer"""
def __init__(self):
self.vocab = {chr(i): i for i in range(32, 127)}
self.id_to_token = {v: k for k, v in self.vocab.items()}
def encode(self, text):
# Note: tiktoken.encode does NOT take add_special_tokens parameter
tokens = []
for char in text:
if char in self.vocab:
tokens.append(self.vocab[char])
else:
tokens.append(ord(char) % 256)
return tokens
def decode(self, token_ids):
result = []
for token_id in token_ids:
if token_id in self.id_to_token:
result.append(self.id_to_token[token_id])
else:
result.append(chr(token_id % 256))
return ''.join(result)
# Setup for transformers tokenizer
transformers_tokenizer = MockTransformersTokenizer()
ARGS = {
"prefix": "This is the prefix: ",
"content": "This is a very long content that needs to be truncated to fit within the token limit constraints.",
"tokenizer": transformers_tokenizer,
"max_token_n": 50,
"is_transformers": True
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, 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
|
| get_tokenizer |
Not yet run unverified (harvested, no recorded run) |
KDEGroup/CodeRAG/coderag/build_prompt/merge_retrieval.py code served (permissive licence) · get_code("86216a5e81faff6f") How it ran |