code: def collect_stats(files, fd, pattern):
      # TODO: Handle compressed callgrind files
      line_regexs = [
          re.compile(r"(?P<lineno>[0-9]+)(\s[0-9]+)+"),
          re.compile(r"((jump)|(jcnd))=([0-9]+)\s(?P<lineno>[0-9]+)"),
      ]
  
      current_file = None
      current_function = None
      for i, line in enumerate(fd):
          if re.match("f[lie]=.+", line):
              path = line.split("=", 2)[1].strip()
              if os.path.exists(path) and re.search(pattern, path):
                  current_file = files.get_file(path)
              else:
                  current_file = None
          elif re.match("fn=.+", line):
              current_function = line.split("=", 2)[1].strip()
          elif current_file is not None:
              for regex in line_regexs:
                  match = regex.match(line)
                  if match:
                      lineno = int(match.group("lineno"))
                      current_file.mark_line(lineno, current_function)
  
file_path: numpy/tools/c_coverage/c_coverage_report.py
imports: import os
  import re
  import sys
  from xml.sax.saxutils import quoteattr, escape
label_desc: Use image node_id 1 for calling a global function with example usage: collect_stats(files, fd, pattern) without return types