code: def parse_lcov(
      outputs: List[str], func: Callable, mode: str = "branch"
  ):
      switch, extracted_outputs = False, []
      for line in outputs:
          if switch == False and "tmp_src" in line:
              switch = True
          if switch == True and "end_of_record" in line:
              switch = False
          if switch:
              extracted_outputs.append(line)
  
      src, start_lineno = inspect.getsourcelines(func)
      end_lineno = start_lineno + len(src) - 1
  
      if mode == "branch":
          branch, branch_covered = [], []
          for line in extracted_outputs:
              if line.startswith("BRDA"):
                  # BRDA format: BR:<lineno>,<blockno>,<branchno>,<taken>
                  lineno, blockno, branchno, taken = line[5:].split(",")
                  branch_sig = f"BR:{lineno},{blockno},{branchno}"
                  branch.append(branch_sig)
                  if taken not in ["0", "-"]:
                      branch_covered.append(branch_sig)
          per = (
              1.0
              if len(branch) == 0
              else len(branch_covered) / len(branch)
          )
          return per, branch, branch_covered
      else:
          not_covered_lines = []
          for line in extracted_outputs:
              if line.startswith("DA"):
                  # DA format: DA:<lineno>,<exec_count>[,...]
                  lineno, exec_count = line[3:].split(",")[:2]
                  if start_lineno <= int(lineno) <= end_lineno:
                      if exec_count == "0":
                          not_covered_lines.append(int(lineno))
          for lineno in not_covered_lines:
              line = src[lineno - start_lineno]
              if line.strip() != "" and "def" not in line:
                  src[lineno - start_lineno] = (
                      line[:-1] + "  # Not executed\n"
                  )
          return "".join(src)
  
file_path: evalplus/evalplus/_experimental/evaluate_coverage.py
imports: import argparse
  import importlib
  import inspect
  import multiprocessing
  import os
  import sys
  from io import StringIO
  from typing import Any, Callable, List, Union
  import coverage
  from evalplus.data import get_human_eval_plus
  from evalplus.data.utils import to_raw
  from evalplus.eval.utils import reliability_guard, swallow_io, time_limit
label_desc: Use image node_id 2 for calling a global function with example usage: parse_lcov(outputs, func, mode) and returns: per,  branch,  branch_covered, str