code: def validate_tutorial_links(repo_dir: str) -> None:
      """Checks that all .ipynb files that present are linked on the website, and vice
      versa, that any linked tutorial has an associated .ipynb file present.
      """
      with open(
          os.path.join(repo_dir, "website", "tutorials.json"), "r"
      ) as infile:
          tutorial_config = json.load(infile)
  
      tutorial_ids = {
          x["id"] for v in tutorial_config.values() for x in v
      }
  
      tutorials_nbs = {
          fn.replace(".ipynb", "")
          for fn in os.listdir(os.path.join(repo_dir, "tutorials"))
          if fn[-6:] == ".ipynb"
      }
  
      missing_files = tutorial_ids - tutorials_nbs
      missing_ids = tutorials_nbs - tutorial_ids
  
      if missing_files:
          raise RuntimeError(
              "The following tutorials are linked on the website, but missing an "
              f"associated .ipynb file: {missing_files}."
          )
  
      if missing_ids:
          raise RuntimeError(
              "The following tutorial files are present, but are not linked on the "
              "website: {}.".format(
                  ", ".join([nbid + ".ipynb" for nbid in missing_ids])
              )
          )
  
file_path: botorch/scripts/parse_tutorials.py
imports: from __future__ import annotations
  import argparse
  import json
  import os
  import nbformat
  from bs4 import BeautifulSoup
  from nbconvert import HTMLExporter, PythonExporter
label_desc: Use image node_id 1 for calling a global function with example usage: validate_tutorial_links(repo_dir) without return types