| clean |
Ran ran; our contract draft was wrong, not the code |
Imhongyu/Ekphrasis/prompts/task_normalization.py code served (permissive licence) · get_code("f371050c01fc28d5") 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
torch.manual_seed(0)
# The function `clean` takes a single parameter `value` of type Any
# It converts the value to a string, uses `or ''` for None/falsy handling,
# and strips whitespace. We need to test with various types.
# Test cases for the value parameter:
# - String with whitespace
# - None (will become '')
# - Number
# - Empty string
# - Object with __str__
ARGS = {
"value": " hello world "
}
- 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
|
| contains_han |
Ran ran, violated the contract we drafted |
Imhongyu/Ekphrasis/src/utils/english_only.py code served (permissive licence) · get_code("63daf4d7bf9f5bf1") 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 bool, 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 re
from typing import Any
HAN_RE = re.compile('[\\u4e00-\\u9fff]')
def contains_han(value: Any) -> bool:
"""Return True if a value contains CJK Han characters."""
return bool(HAN_RE.search(str(value or '')))
# Test cases for different input types
ARGS = {
"value": "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 bool, 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_from_raw_output |
Ran ran; our contract draft was wrong, not the code |
Imhongyu/Ekphrasis/src/runner/extract.py code served (permissive licence) · get_code("bee10100eb4c1293") 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 re
from typing import Dict, List, Optional, Tuple
def _clean_text(value: Optional[str]) -> Optional[str]:
if value is None:
return None
text = value.strip()
return text if text else None
def _extract_field(raw_output: str, labels: list[str]) -> Optional[str]:
for label in labels:
pattern = f'(?is){label}\\s*:?\\s*(.+?)(?=\\n\\s*(?:###\\s*)?(?:\\d+\\.\\s*)?(?:Core\\s*Idea|Idea|Visual\\s*Description)\\b|\\Z)'
match = re.search(pattern, raw_output)
if match:
return _clean_text(match.group(1))
return None
def extract_from_raw_output(raw_output: str) -> Dict[str, Optional[str]]:
idea = _extract_field(raw_output, ['1\\.\\s*Core\\s*Idea', '###\\s*Core\\s*Idea', 'Core\\s*Idea', 'Idea'])
visual_description = _extract_field(raw_output, ['2\\.\\s*Visual\\s*Description', '###\\s*Visual\\s*Description', 'Visual\\s*Description'])
return {'idea': idea, 'visual_description': visual_description}
# Example raw output with properly formatted sections
raw_output_example = """
1. Core Idea: This is a creative concept about combining multiple design elements
into a cohesive visual system that represents modern innovation.
2. Visual Description: The visual design features bright colors, geometric shapes,
and clean typography arranged in a balanced composition.
"""
ARGS = {
"raw_output": raw_output_example
}
- 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 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
|
| find_han_paths |
Ran ran; our contract draft was wrong, not the code |
Imhongyu/Ekphrasis/src/utils/english_only.py code served (permissive licence) · get_code("8142ea83943bd0f3") 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
# Test case 1: Simple nested dict with Han characters
test_data = {
'name': '张三',
'age': 25,
'address': {
'city': '北京',
'street': 'Main St'
},
'hobbies': ['编程', 'reading', '游泳']
}
# Test case 2: Complex nested structure
complex_data = {
'users': [
{'username': 'user1', 'bio': '我是一个开发者'},
{'username': 'user2', 'bio': 'Regular user'}
],
'metadata': {
'title': '用户列表',
'tags': ['中文', 'english', '日本語']
},
'deeply': {
'nested': {
'value': '深度嵌套的汉字'
}
}
}
# Create test node - using a mix of dicts, lists, and strings with Han characters
node = {
'content': '这是一条包含汉字的文本',
'description': 'Plain English text',
'items': [
{'text': '项目一'},
{'text': 'item two'},
'第三项'
],
'nested': {
'deep': {
'value': '深层文本包含汉字'
}
},
'clean': 'no han here',
'list_of_mixed': [
'中文文本',
123,
{'inner': '还有更多汉字'}
]
}
ARGS = {
'node': node,
'prefix': '$',
'limit': 20
}
- 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
|
| load_embedding_models |
Ran ran; our contract draft was wrong, not the code |
Imhongyu/Ekphrasis/src/clients/embeddings.py code served (permissive licence) · get_code("67108410d2098254") 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 yaml
# Create a temporary YAML file with embedding models configuration
with tempfile.NamedTemporaryFile(mode='w', suffix='.yaml', delete=False, encoding='utf-8') as f:
config_data = {
'embedding_models': [
{
'name': 'model_1',
'dimension': 768,
'type': 'transformer'
},
{
'name': 'model_2',
'dimension': 384,
'type': 'sentence_transformer'
}
]
}
yaml.dump(config_data, f)
temp_yaml_path = f.name
ARGS = {
'models_config_path': temp_yaml_path
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- yaml — 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_embedding_response |
Ran ran, honoured the contract we drafted |
Imhongyu/Ekphrasis/src/clients/embeddings.py code served (permissive licence) · get_code("0a1977761c704002") 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 2, 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 Any, Dict, List, Optional, Union
torch.manual_seed(0)
# Construct a valid OpenAI-style embedding response
resp = {
'data': [
{
'index': 1,
'embedding': [0.1, 0.2, 0.3, 0.4]
},
{
'index': 0,
'embedding': [0.5, 0.6, 0.7, 0.8]
},
{
'index': 2,
'embedding': [0.9, 1.0, 1.1, 1.2]
}
]
}
ARGS = {
'resp': resp
}
- 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 2, 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
|
| props |
Ran ran; our contract draft was wrong, not the code |
Imhongyu/Ekphrasis/prompts/task_normalization.py code served (permissive licence) · get_code("82a388e52658b86d") 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 torch
torch.manual_seed(0)
# The function 'props' takes a 'task' dict parameter
# and returns task.get('task_properties', {}) or {}
# This means it retrieves the 'task_properties' key from the dict,
# with a default empty dict if not present, and returns that or an empty dict
# Build a minimal task dict with task_properties
task_dict = {
'task_properties': {
'property1': 'value1',
'property2': 42
}
}
ARGS = {
'task': task_dict
}
- 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 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
|
| resolve_embedding_model |
Ran ran; our contract draft was wrong, not the code |
Imhongyu/Ekphrasis/src/clients/embeddings.py code served (permissive licence) · get_code("f0d99951a8fe149f") 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 yaml
from pathlib import Path
# Create a temporary directory and config file
temp_dir = tempfile.TemporaryDirectory()
temp_path = Path(temp_dir.name)
config_file = temp_path / "models.yaml"
# Create a valid models.yaml config with embedding models
config_data = {
'embedding_models': [
{
'name': 'model_a',
'model_id': 'embedding-model-a',
'dimension': 384
},
{
'name': 'model_b',
'model_id': 'embedding-model-b',
'dimension': 768
}
]
}
with config_file.open('w', encoding='utf-8') as f:
yaml.safe_dump(config_data, f)
ARGS = {
'models_config_path': config_file,
'model_name': 'model_a'
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- yaml — 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
|
| sanitize_han_text |
Ran ran; our contract draft was wrong, not the code |
Imhongyu/Ekphrasis/src/utils/english_only.py code served (permissive licence) · get_code("3d458f0488b3eb47") 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 re
from typing import Any
HAN_SPAN_RE = re.compile('[\\u4e00-\\u9fff]+')
def sanitize_han_text(value: Any, *, replacement: str='[Chinese text omitted]') -> str:
"""Replace CJK Han spans before model-generated text is shown to judges."""
return HAN_SPAN_RE.sub(replacement, str(value or ''))
# Test values with Chinese Han characters and regular text
test_value_with_han = "这是中文文本 and some English"
test_value_without_han = "Just regular English text"
test_value_none = None
test_value_empty = ""
ARGS = {
'value': test_value_with_han,
'replacement': '[REDACTED]'
}
- 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 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
|
| source_pair |
Ran ran; our contract draft was wrong, not the code |
Imhongyu/Ekphrasis/prompts/task_normalization.py code served (permissive licence) · get_code("534d9bdc8d0e201c") 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 tuple, 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 typing import Any
def clean(value: Any) -> str:
return str(value or '').strip()
def props(task: dict) -> dict:
return task.get('task_properties', {}) or {}
def source_pair(task: dict) -> tuple[str, str]:
task_props = props(task)
sample1 = clean(task_props.get('Sample1') or task_props.get('sample1') or task.get('Sample1'))
sample2 = clean(task_props.get('Sample2') or task_props.get('sample2') or task.get('Sample2'))
if sample1 or sample2:
return (sample1, sample2)
combined = clean(task_props.get('cob_item') or task.get('cob_item') or task.get('elements') or task.get('concept'))
parts = [part.strip() for part in re.split('\\s*(?:\\||\\+|&| x | X |,| and )\\s*', combined, maxsplit=1) if part.strip()]
if len(parts) == 2:
return (parts[0], parts[1])
return (combined, '')
# Test case 1: Task with Sample1 and Sample2 in task_properties
task_1 = {
'task_properties': {
'Sample1': 'apple',
'Sample2': 'orange'
}
}
# Test case 2: Task with cob_item that contains separator
task_2 = {
'cob_item': 'cat | dog'
}
# Test case 3: Task with concept that needs splitting
task_3 = {
'concept': 'red & blue'
}
# Test case 4: Task with Sample1/Sample2 at top level
task_4 = {
'Sample1': 'dog',
'Sample2': 'cat',
'task_properties': {}
}
# Test case 5: Task with elements containing separator
task_5 = {
'elements': 'sun + moon'
}
# Test case 6: Minimal task with no relevant fields
task_6 = {}
ARGS = {
'task': task_1
}
- 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 tuple, ndim 1, dtype family float — a tuple 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
|
| utc_iso_to_cn |
Ran ran; our contract draft was wrong, not the code |
Imhongyu/Ekphrasis/src/utils/datetime_cn.py code served (permissive licence) · get_code("99728401c6eedbbd") 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.
from datetime import datetime
from zoneinfo import ZoneInfo
ARGS = {
'iso_utc': '2024-01-15T10:30:45.123456Z'
}
- 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 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
|