class_docstr: Tools for generating an example page from a file
class_docstr_tok: ["Tools","for","generating","an","example","page","from","a","file"]
code: def __init__(self, filename, target_dir, backend, target_dir_orig):
      self.filename = filename
      self.target_dir = target_dir
      self.backend = backend
      self._title = None
      self._gallery_category = ""
      self._alt_text = ""
      self.extract_docstring()
      with open(filename, "r") as fid:
          self.filetext = fid.read()
  
      outfilename = op.join(target_dir_orig, self.rstfilename)
  
      # Only actually run it if the output RST file doesn't
      # exist or it was modified less recently than the example
      if not op.exists(outfilename) or (
          op.getmtime(outfilename) < op.getmtime(filename)
      ):
          self.exec_file()
      else:
          print("skipping {0}".format(self.filename))
  
imports: import glob
  import os
  import os.path
  import re
  import shutil
  import token
  import tokenize
  from typing import Optional
  import matplotlib
  import matplotlib.pyplot
  from arviz.rcparams import rc_context
  from arviz import rcParams
label_desc: Use image node_id 1 to create a new ExampleGenerator object  with example: obj = ExampleGenerator(filename, target_dir, backend, target_dir_orig)