<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def compile(file):
 """ Compile a Python program into byte code :param file: file to be compiled :raises check50.Failure: if compilation fails e.g. if there is a SyntaxError """

    log(_("compiling {} into byte code...").format(file))

    try:
        py_compile.compile(file, doraise=True)
    except py_compile.PyCompileError as e:
        log(_("Exception raised: "))
        for line in e.msg.splitlines():
            log(line)

        raise Failure(_("{} raised while compiling {} (rerun with --log for more details)").format(e.exc_type_name, file))