class_docstr: Custom sphinx-gallery scraper to save the current Canvas to an image.
code: def _get_frame_list_from_source(self, filename):
      lines = open(filename, "rb").read().decode("utf-8").splitlines()
      for line in lines[:10]:
          if not line.startswith("# vispy:"):
              continue
          if "gallery-exports" in line:
              _frames = (
                  line.split("gallery-exports")[1].split(",")[0].strip()
              )
              frames = self._frame_exports_to_list(_frames)
              break
          if "gallery " in line:
              # Get what frames to grab
              _frames = line.split("gallery")[1].split(",")[0].strip()
              frames = self._frame_specifier_to_list(_frames)
              break
      else:
          # no frame number hint - don't grab any frames
          frames = []
      return frames
  
imports: from __future__ import annotations
  import os
  import time
  import shutil
  from vispy.io import imsave
  from vispy.gloo.util import _screenshot
  from vispy.scene import SceneCanvas
  from sphinx_gallery.scrapers import optipng, figure_rst
label_desc: Use image node_id 4 for calling the VisPyGalleryScraper obj's underlying member method code with example usage: obj._get_frame_list_from_source(filename) and returns: frames