Test fixture
Code transformation while preserving behavior and intent.
The model receives the prompt (and optional system message). The run uses scorer contains_any with the JSON configuration below. Pass/fail and partial credit are determined entirely by that scorer against the model output; no human grading.
Refactor without changing behavior. Return only Python code.
def normalize_records_16(records):
out = []
for i in range(len(records)):
r = records[i]
if r.get('name') is not None:
name = r.get('name').strip().lower()
if name != '':
out.append({'name': name, 'active': bool(r.get('active', False))})
return out
{
"expected_contains": [
"for record in records",
"strip().lower()",
"return out"
]
}temperature
0
max_tokens
320
timeout (s)
120
type
scored
file
refactoring_hard_16.json