class_docstr: Tools for generating an example page from a file
docstr: By default, just uses the last image in the notebook.
docstr_tok: ["By","default",",","just","uses","the","last","image","in","the","notebook","."]
code: def extract_preview_pic(self):
      """By default, just uses the last image in the notebook."""
      pic = None
      for cell in self.json_source["cells"]:
          for output in cell.get("outputs", []):
              if "image/png" in output.get("data", []):
                  pic = output["data"]["image/png"]
      if pic is not None:
          return base64.b64decode(pic)
      return None
  
file_path: pymc-examples/sphinxext/thumbnail_extractor.py
imports: import base64
  import json
  import os
  import shutil
  from glob import glob
  import matplotlib
  import matplotlib.pyplot
  from matplotlib import image
  import sphinx
label_desc: Use image node_id 2 for calling the NotebookGenerator obj's underlying member method code with example usage: obj.extract_preview_pic() and returns: None, base64