| extract_first_number |
Ran ran on a synthesized input |
kenqgu/radar/radar/evaluate/measure.py code served (permissive licence) · get_code("f412d040d6b6fe8a") 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
def extract_first_number(s: str):
match = re.search('-?\\d+(?:\\.\\d+)?', s)
return match.group() if match else None
ARGS = {
's': "The temperature is -42.5 degrees"
}
- 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
|
| extract_value_from_answer |
Ran ran on a synthesized input |
kenqgu/radar/radar/evaluate/measure.py code served (permissive licence) · get_code("77fe7811b0f00b7b") 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
ARGS = {
"text": "The answer is: 42"
}
- 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
|
| flatten_results_to_df |
Ran ran on a synthesized input |
kenqgu/radar/radar/evaluate/results.py code served (permissive licence) · get_code("2875b5aa771834a7") 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 DataFrame. 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 pandas as pd
import torch
# Construct a results dictionary that matches the expected format
# The function expects either:
# 1. A dict with nested dicts containing 'accuracy' and 'count' keys
# 2. Or a fallback with 'overall' and length-based count
results = {
'category_1': {
'subgroup_a': {'accuracy': 0.95, 'count': 50},
'subgroup_b': {'accuracy': 0.87, 'count': 45},
'subgroup_c': {'accuracy': 0.92, 'count': 48},
},
'category_2': {
'subgroup_x': {'accuracy': 0.88, 'count': 60},
'subgroup_y': {'accuracy': 0.91, 'count': 55},
},
'category_3': {
'subgroup_1': {'accuracy': 0.93, 'count': 40},
},
}
ARGS = {
'results': results
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- pandas, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
|
| format_bytes |
Ran ran on a synthesized input |
kenqgu/radar/radar/utils.py code served (permissive licence) · get_code("197b0eabb68d51fc") 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 format_bytes takes a single parameter: num_bytes (an integer)
# It formats the number of bytes into a human-readable string with units
# Test with a few different byte sizes to demonstrate the function works
ARGS = {
'num_bytes': 1024
}
- 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_random_indices |
Ran ran on a synthesized input |
kenqgu/radar/radar/tasks/utils.py code served (permissive licence) · get_code("d51bad27fa5c0788") 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 ndarray, ndim 1, dtype family int, shape (2,) 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 pandas as pd
import numpy as np
# Create a small DataFrame with some sample data
df = pd.DataFrame({
'col1': [10, 20, 30, 40, 50],
'col2': ['a', 'b', 'c', 'd', 'e'],
'col3': [1.1, 2.2, 3.3, 4.4, 5.5]
})
# Define arguments for the function
ARGS = {
'df': df,
'percentage': 0.4,
'seed': 42
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ndarray, ndim 1, dtype family int, shape (2,) — shape (2,) 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_valid_indices |
Ran ran on a synthesized input |
kenqgu/radar/radar/tasks/utils.py code served (permissive licence) · get_code("b2e912ea19a52a79") 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 Index. 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 pandas as pd
import numpy as np
# Create a simple DataFrame with some empty and non-empty values
df = pd.DataFrame({
'col1': ['value1', '', 'value3', 'value4'],
'col2': ['a', 'b', '', 'd'],
'col3': ['x', 'y', 'z', '']
})
# Define columns to check
columns = ['col1', 'col2']
ARGS = {
'df': df,
'columns': columns
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Index — a Index output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Index output the recorded ndim 1 and dtype family int 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
|
| match_answer |
Ran ran on a synthesized input |
kenqgu/radar/radar/evaluate/measure.py code served (permissive licence) · get_code("cae88d7799e65f6a") 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 re
from typing import List, Union
def extract_first_number(s: str):
match = re.search('-?\\d+(?:\\.\\d+)?', s)
return match.group() if match else None
def match_answer(predicted: str, ground_truth: Union[str, float, int, List[str], List[float], List[int], List[List[Union[str, float, int]]]]) -> bool:
"""Evaluates a predicted answer against the ground truth.
Args:
predicted: The predicted answer string.
ground_truth: The ground truth value, which can be a string, number, or a
list of strings or numbers.
Returns:
True if the predicted answer matches the ground truth, False otherwise.
"""
def normalize(val):
if isinstance(val, str):
return val.strip().lower()
return val
def is_float_match(predicted_str, gt):
if not isinstance(gt, float):
return False
num_str = extract_first_number(predicted_str)
if num_str is None:
return False
predicted_val = float(num_str)
gt_str = str(gt)
if '.' in gt_str:
decimal_places = len(gt_str.split('.')[-1])
decimal_places_num_str = len(num_str.split('.')[-1])
if decimal_places_num_str <= 3:
decimal_places = max(decimal_places, decimal_places_num_str)
else:
decimal_places = 0
float_tol = 10 ** (-decimal_places)
return abs(predicted_val - float(gt)) <= float_tol
def is_int_match(predicted_str, gt):
if not isinstance(gt, int):
return False
num_str = extract_first_number(predicted_str)
if num_str is None:
return False
try:
num = float(num_str)
return num.is_integer() and int(num) == gt
except ValueError:
return False
def is_string_match(predicted_str, gt):
return isinstance(gt, str) and normalize(predicted_str) == normalize(gt)
def is_list_of_strings_match(predicted_str, gt_list):
predicted_items = [normalize(p) for p in predicted_str.split(',')]
gt_items = [normalize(g) for g in gt_list]
return set(predicted_items) == set(gt_items)
def is_list_of_numbers_match(predicted_str, gt_list):
try:
predicted_items = [float(p.strip()) for p in predicted_str.split(',')]
except ValueError:
return False
if not all((isinstance(g, (int, float)) for g in gt_list)):
return False
if len(gt_list) != len(predicted_items):
return False
for pred_val, gt_val in zip(sorted(predicted_items), sorted(gt_list)):
if not is_float_match(str(pred_val), gt_val):
return False
return True
def is_list_match(predicted_str, gt_list):
if all((isinstance(g, str) for g in gt_list)):
return is_list_of_strings_match(predicted_str, gt_list)
if all((isinstance(g, (int, float)) for g in gt_list)):
return is_list_of_numbers_match(predicted_str, gt_list)
return False
if isinstance(ground_truth, list) and all((isinstance(sub, list) for sub in ground_truth)):
for sublist in ground_truth:
if is_list_match(predicted, sublist):
return True
return False
if isinstance(ground_truth, list):
for gt in ground_truth:
if is_string_match(predicted, gt):
return True
if is_int_match(predicted, gt):
return True
if is_float_match(predicted, gt):
return True
return False
if is_string_match(predicted, ground_truth):
return True
if is_int_match(predicted, ground_truth):
return True
if is_float_match(predicted, ground_truth):
return True
return False
ARGS = {
"predicted": "42",
"ground_truth": 42
}
- 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 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
|
| parse_comma_separated_ints |
Ran ran on a synthesized input |
kenqgu/radar/radar/cli/build_task.py code served (permissive licence) · get_code("e88c54a38fa360ec") 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 int; 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
torch.manual_seed(0)
ARGS = {
"comma_separated_ints": "1,2,3,4,5"
}
- 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 int — 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_prompt |
Ran ran on a synthesized input |
kenqgu/radar/radar/logger.py code served (permissive licence) · get_code("e3b663392c838eb8") 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
from typing import Dict, List
# Construct a valid prompt argument
# The function expects a List[Dict[str, str]] where each dict has 'role' and 'content' keys
prompt = [
{
'role': 'system',
'content': 'You are a helpful assistant.'
},
{
'role': 'user',
'content': 'What is the capital of France?'
},
{
'role': 'assistant',
'content': 'The capital of France is Paris.'
}
]
ARGS = {
'prompt': prompt
}
- 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
|
| register_missing_data_function |
Ran ran on a synthesized input |
kenqgu/radar/radar/tasks/registry.py code served (permissive licence) · get_code("fcab2145e61fa5dd") 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 function. 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 pandas as pd
from typing import Callable
# Create a minimal global registry dict for the decorator to use
MISSING_DATA_FUNCTION_REGISTRY = {}
def register_missing_data_function(name: str):
def wrapper(func: Callable[[pd.DataFrame], 'datamodel.PerturbationReturn']):
MISSING_DATA_FUNCTION_REGISTRY[name] = func
return func
return wrapper
# Define a sample function that matches the expected signature
def sample_missing_data_handler(df: pd.DataFrame):
"""Sample handler for missing data that returns a mock PerturbationReturn."""
# Mock return value - in reality would be datamodel.PerturbationReturn
return {"processed": True, "shape": df.shape}
# Construct ARGS
ARGS = {
"name": "handle_missing_values"
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- pandas — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
|
| serialize |
Ran ran; our contract draft was wrong, not the code |
kenqgu/radar/radar/logger.py code served (permissive licence) · get_code("5bce9e2e8490b090") 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 json
from collections import OrderedDict
from enum import Enum
from unittest.mock import Mock
from datetime import datetime
# Define a level enum similar to logging.Level
class LogLevel(Enum):
INFO = "INFO"
DEBUG = "DEBUG"
ERROR = "ERROR"
# Create a mock file object with required attributes
mock_file = Mock()
mock_file.name = "test.py"
mock_file.path = "/path/to/test.py"
# Construct the record dictionary with all required keys
record = {
'level': LogLevel.INFO,
'message': 'This is a test log message',
'time': datetime(2024, 1, 15, 10, 30, 45, 123456),
'file': mock_file,
'function': 'test_function',
'line': 42,
'extra': {'user_id': 123, 'request_id': 'abc-def-ghi'}
}
ARGS = {
'record': record
}
- 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
|
| serialize_extras |
Ran ran; our contract draft was wrong, not the code |
kenqgu/radar/radar/logger.py code served (permissive licence) · get_code("0cc78509b6792f51") 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 json
import torch
torch.manual_seed(0)
# The function expects a dict with an 'extra' key that can be JSON serialized
record = {
'extra': {
'model_name': 'test_model',
'accuracy': 0.95,
'loss': 0.05,
'metadata': ['item1', 'item2'],
'config': {'lr': 0.001, 'epochs': 10}
}
}
ARGS = {
'record': record
}
- 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
|
| get_registered_answer_function |
Not yet run unverified (harvested, no recorded run) |
kenqgu/radar/radar/tasks/registry.py code served (permissive licence) · get_code("f7162dbe3e1b56df") How it ran |
| register_answer_function |
Not yet run unverified (harvested, no recorded run) |
kenqgu/radar/radar/tasks/registry.py code served (permissive licence) · get_code("254d9e06678c082a") How it ran |
| round_floats |
Not yet run unverified (harvested, no recorded run) |
kenqgu/radar/radar/evaluate/results.py code served (permissive licence) · get_code("aebdc6271f47565f") How it ran |