code: def parse_rst(rst_filename: str) -> Set[str]:
      """Extract automodule directives from rst."""
      ret = set()
      with open(rst_filename, "r") as f:
          lines = f.readlines()
          for line in lines:
              line = line.strip()
              name = AUTOMODULE_REGEX.findall(line)
              if name:
                  ret.add(name[0])
      return ret
  
file_path: botorch/scripts/validate_sphinx.py
imports: from __future__ import annotations
  import argparse
  import os
  import pkgutil
  import re
  from typing import Set
label_desc: Use image node_id 1 for calling a global function with example usage: parse_rst(rst_filename) and returns: ret