code: def get_links_from_file(file):
      link_infos = []
      n = 1
      with open(file) as f:
          for line in f:
              for link in re.findall(r"\]\((.+?)\)", line):
                  if is_external_link(link):
                      link_infos.append((file, n, link, None, None))
                      continue
                  if link.startswith("#"):
                      link_infos.append((file, n, link, file, link[1:]))
                      continue
                  if link.endswith(".md"):
                      target = os.path.normpath(
                          os.path.join(file, "..", link)
                      )
                      link_infos.append((file, n, link, target, None))
                      continue
                  if ".md#" in link:
                      parts = link.split("#")
                      if len(parts) == 2:
                          target = os.path.normpath(
                              os.path.join(file, "..", parts[0])
                          )
                          link_infos.append(
                              (file, n, link, target, parts[1])
                          )
                      continue
  
                  # Unexpected link format, will be handled later
                  link_infos.append((file, n, link, None, None))
  
              n += 1
  
      return link_infos
  
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 3 for calling a global function with example usage: get_links_from_file(file) and returns: link_infos