File size: 612 Bytes
e93bbca | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | from __future__ import annotations
from dataclasses import dataclass
@dataclass(frozen=True)
class EasyTask:
task_id: str = "rename_variables"
description: str = (
"Refactor the function by renaming generic variables (`x`, `tmp`, `i`) "
"into descriptive names while preserving behavior."
)
input_code: str = """\
def compute(x, y, tmp):
tmp = x + y
x = tmp * 2
result = x
return result
"""
expected_output: str = """\
def compute(left, right, sum_value):
sum_value = left + right
doubled = sum_value * 2
result = doubled
return result
"""
|