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 exec_file(self):
      # pylint: disable=exec-used
      print("running {0}".format(self.filename))
  
      plt.close("all")
      if self.backend == "matplotlib":
          pngfile = op.join(self.target_dir, self.pngfilename)
          my_globals = {"plt": plt}
          with open(self.filename, "r") as fp:
              code_text = fp.read()
              code_text = re.sub(r"(plt\.show\S+)", "", code_text)
              exec(
                  compile(code_text, self.filename, "exec"), my_globals
              )
  
          fig = plt.gcf()
          fig.canvas.draw()
          fig.savefig(pngfile, dpi=75)
  
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 19 for calling the ExampleGenerator obj's underlying member method code with example usage: obj.exec_file() without return types