def patch_code()

in src/open_r1/utils/competitive_programming/code_patcher.py [0:0]


def patch_code(text, lang):
    if not text:
        return text
    if lang in ("python", "python3", "Python 3", "PyPy 3", "PyPy 3-64"):
        return fix_python3_imports(text)
    elif "cpp" in lang or "C++" in lang:
        return fix_cpp_includes(text)
    return text