code: def main():
      print("Finding all markdown files in the current directory...")
  
      project_root = (pathlib.Path(__file__).parent / "..").resolve()
      markdown_files = project_root.glob("**/*.md")
  
      all_matches = set()
      url_regex = re.compile(r"\[([^!][^\]]+)\]\(([^)(]+)\)")
      for markdown_file in markdown_files:
          with open(markdown_file) as handle:
              for line in handle.readlines():
                  matches = url_regex.findall(line)
                  for name, link in matches:
                      if "localhost" not in link:
                          all_matches.add(
                              MatchTuple(
                                  source=str(markdown_file),
                                  name=name,
                                  link=link,
                              )
                          )
  
      print(f"  {len(all_matches)} markdown files found")
      print("Checking to make sure we can retrieve each link...")
  
      with Pool(processes=THREADS) as pool:
          results = pool.map(
              link_ok, [match for match in list(all_matches)]
          )
      unreachable_results = [
          (match_tuple, reason)
          for match_tuple, success, reason in results
          if not success
      ]
  
      if unreachable_results:
          print(f"Unreachable links ({len(unreachable_results)}):")
          for match_tuple, reason in unreachable_results:
              print("  > Source: " + match_tuple.source)
              print("    Name: " + match_tuple.name)
              print("    Link: " + match_tuple.link)
              if reason is not None:
                  print("    Reason: " + reason)
          sys.exit(1)
      print("No Unreachable link found.")
  
file_path: allennlp/scripts/check_links.py
imports: import re
  import sys
  import pathlib
  import os
  from multiprocessing.dummy import Pool
  from typing import Tuple, NamedTuple, Optional
  import requests
label_desc: Use image node_id 4 for calling a global function with example usage: main() without return types