code: def extract_docstring(filename, ignore_heading=False):
      """Extract a module-level docstring, if any"""
      if six.PY2:
          lines = open(filename).readlines()
      else:
          lines = open(filename, encoding="utf-8").readlines()
      start_row = 0
      if lines[0].startswith("#!"):
          lines.pop(0)
          start_row = 1
      docstring = ""
      first_par = ""
      line_iterator = iter(lines)
      tokens = tokenize.generate_tokens(lambda: next(line_iterator))
      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 paragraphs:
                  if ignore_heading:
                      if len(paragraphs) > 1:
                          first_par = re.sub("\n", " ", paragraphs[1])
                          first_par = (
                              (first_par[:95] + "...")
                              if len(first_par) > 95
                              else first_par
                          )
                      else:
                          first_par = ""
                  else:
                      first_par = paragraphs[0]
  
          break
  
      # Fix because there is otherwise a conflict bewteen files that have a
      # docstring and those which have not
      if erow > 1:
          erow += 1
  
      return docstring, first_par, erow + start_row
  
imports: from __future__ import division, print_function
  from time import time
  import ast
  import os
  import re
  import shutil
  import traceback
  import glob
  import sys
  import gzip
  import posixpath
  import subprocess
  import warnings
  from sklearn.externals import six
  from docutils.core import publish_string
  import token
  import tokenize
  import numpy
  import joblib
label_desc: Use image node_id 3 for calling a global function with example usage: extract_docstring(filename, ignore_heading) and returns: docstring,  first_par,  unknown