code: def check_local_link(
      src_file, line_num, original_link_text, target_file, header
  ):
      if not os.path.isfile(target_file):
          return err_str(
              src_file,
              line_num,
              original_link_text,
              "file does not exist",
          )
  
      if header:
          found_header = False
          with open(target_file) as f:
              for line in f:
                  if not line.startswith("#"):
                      continue
                  if header_matches(line, header):
                      found_header = True
                      break
          if not found_header:
              return err_str(
                  src_file,
                  line_num,
                  original_link_text,
                  "header does not exist",
              )
  
      return None
  
file_path: cortex/dev/find_missing_docs_links.py
imports: import sys
  import os
  import re
  import asyncio
  import aiohttp
label_desc: Use image node_id 5 for calling a global function with example usage: check_local_link(src_file, line_num, original_link_text, target_file, header) and returns: None, err_str, err_str