class_docstr: Execute the file and store the output, docstring, and
  sequence of matplotlib figures
class_docstr_tok: ["Execute","the","file","and","store","the","output",",","docstring",",","and","sequence","of","matplotlib","figures"]
docstr: Extract a module-level docstring
          
docstr_tok: ["Extract","a","module-level","docstring"]
code: def extract_docstring(self):
      """Extract a module-level docstring"""
      lines = open(self.filename).readlines()
      start_row = 0
      if lines[0].startswith("#!"):
          lines.pop(0)
          start_row = 1
  
      docstring = ""
      first_par = ""
      tokens = tokenize.generate_tokens(lines.__iter__().next)
      for tok_type, tok_content, _, (erow, _), _ in tokens:
          tok_type = token.tok_name[tok_type]
          if tok_type in (
              "NEWLINE",
              "COMMENT",
              "NL",
              "INDENT",
              "DEDENT",
          ):
              continue
          elif tok_type == "STRING":
              docstring = eval(tok_content)
              # If the docstring is formatted with several paragraphs, extract
              # the first one:
              paragraphs = "\n".join(
                  line.rstrip() for line in docstring.split("\n")
              ).split("\n\n")
              if len(paragraphs) > 0:
                  first_par = paragraphs[0]
          break
  
      self.docstring = docstring
      self.short_desc = first_par
      self.end_line = erow + 1 + start_row
  
file_path: astroML/doc/sphinxext/exfile.py
imports: import sys
  import os
  import traceback
  import token
  import tokenize
  import gc
  import matplotlib
  import pylab
label_desc: Use image node_id 5 for calling the ExecFile obj's underlying member method code with example usage: obj.extract_docstring() without return types