Spaces:
Running
Running
def generate_fix(code): | |
lines = code.split('\n') | |
fixed_lines = [] | |
for line in lines: | |
stripped = line.strip() | |
# Fix print statements missing parentheses | |
if stripped.startswith("print ") and "(" not in stripped: | |
expression = stripped[6:] | |
fixed_line = f"print({expression})" | |
fixed_lines.append(fixed_line) | |
else: | |
fixed_lines.append(line) | |
return "\n".join(fixed_lines) | |
#genrate the fixed version of code using an ML Model |