def check_correctness(
    solution_code: str,
    test_code: str,
    timeout: float = 10,
    completion_id: int | None = None,
) -> dict:
    """Evaluates the functional correctness of a completion by running the test
    suite provided in the problem.

    :param completion_id: an optional completion ID so we can match
        the results later even if execution finishes asynchronously.
    """
    manager = multiprocessing.Manager()
    result = manager.list()

    p = multiprocessing.Process(
        target=unsafe_execute, args=(result, solution_code, test_code, timeout)
    )
    p.start()
    p.join(timeout=timeout + 1)
    if p.is_alive():
        p.kill()

    if not result:
        result.append('timed out')

    return dict(
        success=result[0] == 'passed',
        result=result[0],
        completion_id=completion_id,
    )
Evaluates the functional correctness of a completion by running the test
    suite provided in the problem.

    :param completion_id: an optional completion ID so we can match
        the results later even if execution finishes asynchronously.
    
evaluation/benchmarks/mint/utils.py