class_docstr: Execute the given python file and puts its result in the document.
class_docstr_tok: ["Execute","the","given","python","file","and","puts","its","result","in","the","document","."]
code: def run(self):
      self.content = list(self.content)
      content = list(self.content)
      content[-1] = "rv = " + content[-1]
      code = "\n".join(content)
      scope = {"pygal": pygal}
      try:
          exec(code, scope)
      except Exception:
          print_exc()
          return [
              docutils.nodes.system_message(
                  "An exception as occured during code parsing:"
                  " \n %s" % format_exc(),
                  type="ERROR",
                  source="/",
                  level=3,
              )
          ]
      rv = scope["rv"]
  
      return [docutils.nodes.raw("", rv, format="html")]
  
file_path: pygal/docs/ext/pygal_sphinx_directives.py
imports: from traceback import format_exc, print_exc
  import docutils.core
  from docutils.parsers.rst import Directive
  from sphinx.directives.code import CodeBlock
  import pygal
label_desc: Use image node_id 1 for calling the PygalTable obj's underlying member method code with example usage: obj.run() and returns: list, list