mimo-openenv-software / solutions /format-code-task-000666.py
akseljoonas's picture
Publish validated twelve-task MiMo curriculum and immutable image request
2a3480c verified
Raw History Blame Contribute Delete
480 Bytes
"""Deterministic reference repair; verification fixture only."""
from pathlib import Path
path = Path('/workspace/repo/src/pyromat/__init__.py')
source = path.read_text()
assert '\ndef get(' not in source
source += '''
def get(idstr):
try:
return dat.data[idstr]
except KeyError:
utility.print_error('No substance named ' + str(idstr) + ' was found.')
raise utility.PMParamError('Invalid substance ID: ' + str(idstr))
'''
path.write_text(source)