code: def check_links(link_infos):
      errors = []
      http_link_infos = []
  
      for link_info in link_infos:
          (
              src_file,
              line_num,
              original_link_text,
              target_file,
              header,
          ) = link_info
          if is_external_link(original_link_text):
              http_link_infos.append(link_info)
              continue
  
          if not target_file and not header:
              errors.append(
                  err_str(
                      src_file,
                      line_num,
                      original_link_text,
                      "unknown link format",
                  )
              ),
              continue
  
          error = check_local_link(
              src_file,
              line_num,
              original_link_text,
              target_file,
              header,
          )
          if error:
              errors.append(error)
  
      # fail fast if there are local link errors
      if len(errors) > 0:
          return errors
  
      if not skip_http:
          asyncio.get_event_loop().run_until_complete(
              check_all_http_links(http_link_infos, errors)
          )
  
      return errors
  
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 4 for calling a global function with example usage: check_links(link_infos) and returns: errors, errors