Test fixture
Code transformation while preserving behavior and intent.
The model receives the prompt (and optional system message). The run uses scorer contains_all 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_users(users):
out = []
for i in range(len(users)):
u = users[i]
if "name" in u and u["name"] is not None:
name = u["name"].strip().lower()
if name != "":
out.append({"name": name, "active": bool(u.get("active", False))})
return out
{
"expected_contains": [
"for user in users",
"user.get(\"active\", False)",
"name = user[\"name\"].strip().lower()"
]
}temperature
0
max_tokens
260
timeout (s)
120
type
scored
file
refactoring_medium_01.json