| build_grader_user_prompt |
Ran ran; our contract draft was wrong, not the code |
microsoft/PairedSafety/analysis/public_mini_eval/common.py code served (permissive licence) · get_code("6e8d3206a87226f5") 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)
ARGS = {
"text": "The quick brown fox jumps over the lazy dog. This is a sample text for grading purposes.",
"target": "harmful"
}
- 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
|
| category_severity |
Ran ran, honoured the contract we drafted |
microsoft/PairedSafety/analysis/grader_error_analysis/analyze_grader_errors.py code served (permissive licence) · get_code("c640cdb2a2ed31c1") 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
torch.manual_seed(0)
# Construct valid arguments for category_severity function
label_dict = {
'severity1': True,
'severity2': 5,
'severity3': False,
'other_key': 10
}
prefix = 'severity'
ARGS = {
'label_dict': label_dict,
'prefix': prefix
}
- 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
|
| category_severity |
Ran ran, honoured the contract we drafted |
microsoft/PairedSafety/analysis/relevance_significance/compute_relevance_tests.py code served (permissive licence) · get_code("cf95ecf6bf76f008") 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)
# Construct valid arguments for category_severity
label_dict = {
'category1': True,
'category2': 0.5,
'category3': False,
'severity1': True,
'severity2': 1,
'severity3': 0,
}
prefix = 'severity'
ARGS = {
'label_dict': label_dict,
'prefix': prefix,
}
- 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
|
| category_severity |
Ran ran, honoured the contract we drafted |
microsoft/PairedSafety/analysis/statistical_uncertainty/compute_ci.py code served (permissive licence) · get_code("3f7d6c8dfcbe8fe8") 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
# Analyze the function:
# - label_dict: a dictionary that supports .get() method with string keys
# - prefix: a string that will be concatenated with severity numbers (1, 2, 3)
# The function looks for keys like f'{prefix}1', f'{prefix}2', f'{prefix}3'
# and checks if their values are True or positive numbers
# Construct valid arguments
label_dict = {
'toxicity1': False,
'toxicity2': True,
'toxicity3': 0.5,
}
prefix = 'toxicity'
ARGS = {
'label_dict': label_dict,
'prefix': prefix,
}
- 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
|
| classify |
Ran ran; our contract draft was wrong, not the code |
microsoft/PairedSafety/analysis/grader_error_analysis/analyze_grader_errors.py code served (permissive licence) · get_code("997b1fcda4c2d309") 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. 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
# Construct a minimal error dict that satisfies all the conditions in classify()
e = {
'error_type': 'false_negative',
'has_refusal': True,
'has_edu': True,
'is_long': True,
'multi_true_cats': False,
'category_confusion': False,
}
ARGS = {
'e': e,
}
- 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 tuple — a tuple 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
|
| collect_errors |
Ran ran; our contract draft was wrong, not the code |
microsoft/PairedSafety/analysis/grader_error_analysis/analyze_grader_errors.py code served (permissive licence) · get_code("b995a562d936b28c") 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. 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 statistics
import re
# Set random seed for reproducibility
import torch
torch.manual_seed(0)
# Define the src structure - a dict mapping hit_id strings to source records
src = {
"hit_001": {
"input": [
{
"content": "This is a sample response about historical context and educational material. It's important to understand the background here."
}
],
"metadata": {
"prompt": "Explain the historical significance of this event."
}
},
"hit_002": {
"input": [
{
"content": "I cannot provide that information as it goes against our policies. I'm sorry but I'm unable to assist with this request."
}
],
"metadata": {
"prompt": "Can you help with this?"
}
}
}
# Define predictions list with proper structure
preds = [
{
"hit_id": "hit_001",
"record_id": "record_001",
"true_label": {
"H": 0,
"S": 0,
"V": 0,
"SH": 0
},
"prediction": {
"H": {"severity_0_3": 0},
"S": {"severity_0_3": 0},
"V": {"severity_0_3": 0},
"SH": {"severity_0_3": 0},
"rationale": "No harmful content detected."
},
"response_generation_model": "gpt-3.5"
},
{
"hit_id": "hit_002",
"record_id": "record_002",
"true_label": {
"H": 1,
"S": 0,
"V": 0,
"SH": 0
},
"prediction": {
"H": {"severity_0_3": 0},
"S": {"severity_0_3": 0},
"V": {"severity_0_3": 0},
"SH": {"severity_0_3": 0},
"rationale": "Model refused to engage."
},
"response_generation_model": "gpt-4"
}
]
ARGS = {
"src": src,
"preds": preds
}
- 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 tuple — a tuple 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
|
| exact_mcnemar_p |
Ran ran, honoured the contract we drafted |
microsoft/PairedSafety/analysis/public_mini_eval/04_analyze.py code served (permissive licence) · get_code("2a8a032b65547218") 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 exact_mcnemar_p(discordant_a: int, discordant_b: int) -> float:
"""Two-sided exact McNemar p-value for paired binary outcomes."""
n = discordant_a + discordant_b
if n == 0:
return 1.0
tail = sum((math.comb(n, k) for k in range(min(discordant_a, discordant_b) + 1)))
return min(1.0, 2.0 * tail / 2 ** n)
ARGS = {
"discordant_a": 5,
"discordant_b": 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
|
| extract_json |
Ran ran; our contract draft was wrong, not the code |
microsoft/PairedSafety/analysis/grader_error_analysis/llm_code_errors.py code served (permissive licence) · get_code("f430bb03b2488d92") 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 json
import re
from typing import Any
def extract_json(text: str) -> dict[str, Any]:
try:
return json.loads(text)
except json.JSONDecodeError:
match = re.search('\\{.*\\}', text, flags=re.DOTALL)
if not match:
raise
return json.loads(match.group(0))
# Test case 1: valid JSON string
text_valid_json = '{"key": "value", "number": 42}'
# Test case 2: text with embedded JSON
text_with_embedded_json = 'Some prefix text {"nested": true, "array": [1, 2, 3]} some suffix'
# Test case 3: complex JSON with nested structures
text_complex = 'Random text before {"outer": {"inner": "value"}, "list": [1, 2, 3]} text after'
ARGS = {
"text": text_with_embedded_json
}
- 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
|
| holm_adjust |
Ran ran; our contract draft was wrong, not the code |
microsoft/PairedSafety/analysis/public_mini_eval/04_analyze.py code served (permissive licence) · get_code("e3b4271de6261ae4") 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
import numpy as np
torch.manual_seed(0)
# Analyzing the function: holm_adjust takes p_values (dict[str, float])
# and returns dict[str, float]. It uses:
# - sorted() with key parameter
# - dictionary .get() method
# - min/max operations on floats
# - dictionary assignment
# Create a small dictionary of p-values (floats between 0 and 1)
p_values = {
"test_1": 0.001,
"test_2": 0.05,
"test_3": 0.1,
"test_4": 0.3,
"test_5": 0.8
}
ARGS = {
"p_values": p_values
}
- 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 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
|
| load_rows |
Ran ran; our contract draft was wrong, not the code |
microsoft/PairedSafety/analysis/relevance_significance/compute_relevance_tests.py code served (permissive licence) · get_code("8e7210e0a9408f5b") 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 json
import os
import tempfile
# Create a temporary directory and file for testing
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, 'paired_response_labels.jsonl')
# Write sample JSONL data matching the expected format
sample_data = [
{
"metadata": {
"relevance_score": 8,
"prompt_label": {
"H1": False, "H2": False, "H3": False,
"SH1": False, "SH2": False, "SH3": False,
"S1": False, "S2": False, "S3": False,
"V1": True, "V2": False, "V3": False
}
},
"labels": {
"H1": False, "H2": True, "H3": False,
"SH1": False, "SH2": False, "SH3": False,
"S1": False, "S2": False, "S3": False,
"V1": True, "V2": True, "V3": False
}
},
{
"metadata": {
"relevance_score": 5,
"prompt_label": {
"H1": False, "H2": False, "H3": False,
"SH1": True, "SH2": False, "SH3": False,
"S1": False, "S2": False, "S3": False,
"V1": False, "V2": False, "V3": False
}
},
"labels": {
"H1": False, "H2": False, "H3": False,
"SH1": True, "SH2": True, "SH3": False,
"S1": False, "S2": False, "S3": True,
"V1": False, "V2": False, "V3": False
}
}
]
with open(temp_file, 'w') as f:
for obj in sample_data:
f.write(json.dumps(obj) + '\n')
ARGS = {
'path': temp_file
}
- 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
|
| max_severity |
Ran ran, honoured the contract we drafted |
microsoft/PairedSafety/analysis/relevance_significance/compute_relevance_tests.py code served (permissive licence) · get_code("7b486431a06a277c") 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
# Construct a label_dict that tests the max_severity function
# The function looks for keys like 'H1', 'H2', 'H3', 'SH1', 'SH2', 'SH3', etc.
# and returns the highest severity level (0-3) across all categories
label_dict = {
'H1': False,
'H2': True, # Hate category has severity 2
'H3': False,
'SH1': True, # Self-harm category has severity 1
'SH2': False,
'SH3': False,
'S1': False,
'S2': False,
'S3': True, # Sexual category has severity 3
'V1': False,
'V2': 0.5, # Violence category has severity 2 (numeric value > 0)
'V3': False,
}
ARGS = {
'label_dict': label_dict
}
- 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
|
| max_severity |
Ran ran, honoured the contract we drafted |
microsoft/PairedSafety/analysis/statistical_uncertainty/compute_ci.py code served (permissive licence) · get_code("50ebee8611871db6") 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
torch.manual_seed(0)
CATEGORIES = {'Hate': 'H', 'Self-harm': 'SH', 'Sexual': 'S', 'Violence': 'V'}
def category_severity(label_dict, prefix):
"""Return the highest active severity (0--3) for one harm category."""
level = 0
for severity in (1, 2, 3):
value = label_dict.get(f'{prefix}{severity}')
if value is True or (isinstance(value, (int, float)) and value > 0):
level = severity
return level
def max_severity(label_dict):
"""Return maximum severity across the four paper categories."""
return max((category_severity(label_dict, prefix) for prefix in CATEGORIES.values()))
label_dict = {
'H1': False,
'H2': True,
'H3': False,
'SH1': False,
'SH2': False,
'SH3': 0.5,
'S1': False,
'S2': False,
'S3': False,
'V1': True,
'V2': False,
'V3': False,
}
ARGS = {
'label_dict': label_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 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
|
| normalize |
Ran ran; our contract draft was wrong, not the code |
microsoft/PairedSafety/analysis/grader_error_analysis/llm_code_errors.py code served (permissive licence) · get_code("ffefa80c0ddebd88") 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
import numpy as np
LABELS = ('safe_refusal_prior', 'educational_explanatory_framing', 'long_response_dilution', 'over_triggering_lexical_cues', 'category_overlap_possible_confusion', 'boundary_ambiguity', 'other_unclear')
# Test case 1: Valid result with all fields
result_valid = {
'primary_pattern': 'safe_refusal_prior',
'confidence': 0.75,
'rationale': 'This response demonstrates a safe refusal pattern.'
}
ARGS = {
'result': result_valid
}
- 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 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
|
| raw_to_merged |
Ran ran, honoured the contract we drafted |
microsoft/PairedSafety/analysis/public_mini_eval/common.py code served (permissive licence) · get_code("929355233d2fe52d") 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
torch.manual_seed(0)
ARGS = {
"raw": 2
}
- 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
|
| wilson |
Ran ran, honoured the contract we drafted |
microsoft/PairedSafety/analysis/public_mini_eval/04_analyze.py code served (permissive licence) · get_code("e96ea8226b0e733b") 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 math
def wilson(k: int, n: int) -> tuple[float, float]:
if n == 0:
return (0.0, 0.0)
z = 1.96
p = k / n
d = 1 + z * z / n
c = p + z * z / (2 * n)
m = z * math.sqrt(p * (1 - p) / n + z * z / (4 * n * n))
return ((c - m) / d * 100, (c + m) / d * 100)
ARGS = {
"k": 7,
"n": 10
}
- 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
|
| wilson_ci |
Ran ran, honoured the contract we drafted |
microsoft/PairedSafety/analysis/statistical_uncertainty/compute_ci.py code served (permissive licence) · get_code("c99829ab032929a1") 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 math
Z_95 = 1.959963984540054
def wilson_ci(successes, trials, z=Z_95):
"""Return estimate and two-sided Wilson score interval for a proportion.
The interval is obtained by inverting the score test. Unlike the Wald
interval, its bounds remain in [0, 1] and it behaves well for small counts
and proportions near zero or one.
"""
if not 0 <= successes <= trials or trials <= 0:
raise ValueError('require 0 <= successes <= trials and trials > 0')
estimate = successes / trials
denominator = 1.0 + z ** 2 / trials
center = (estimate + z ** 2 / (2 * trials)) / denominator
half_width = z / denominator * math.sqrt(estimate * (1 - estimate) / trials + z ** 2 / (4 * trials ** 2))
return (estimate, max(0.0, center - half_width), min(1.0, center + half_width))
ARGS = {
'successes': 7,
'trials': 10,
'z': Z_95
}
- 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
|