def annotate_code(path, code, coverage):
    """Annotate lines of code with line numbers and coverage status."""

    return [{ # line_num is 0-based, line numbers are 1-based
        'num': line_num+1,
        'status': str(coverage.lookup(path, line_num+1)).lower(),
        'code': line
    } for (line_num, line) in enumerate(code.splitlines())]