class_docstr: a immutable object holding a source code fragment,
  possibly deindenting it.
docstr: return compiled code object. if filename is None
  invent an artificial filename which displays
  the source/line position of the caller frame.
docstr_tok: ["return","compiled","code","object",".","if","filename","is","None","invent","an","artificial","filename","which","displays","the","source\/line","position","of","the","caller","frame","."]
code: def compile(
      self,
      filename=None,
      mode="exec",
      flag=generators.compiler_flag,
      dont_inherit=0,
      _genframe=None,
  ):
      """return compiled code object. if filename is None
      invent an artificial filename which displays
      the source/line position of the caller frame.
      """
      if not filename or py.path.local(filename).check(file=0):
          if _genframe is None:
              _genframe = sys._getframe(1)  # the caller
          fn, lineno = _genframe.f_code.co_filename, _genframe.f_lineno
          base = "<%d-codegen " % self._compilecounter
          self.__class__._compilecounter += 1
          if not filename:
              filename = base + "%s:%d>" % (fn, lineno)
          else:
              filename = base + "%r %s:%d>" % (filename, fn, lineno)
      source = "\n".join(self.lines) + "\n"
      try:
          co = cpy_compile(source, filename, mode, flag)
      except SyntaxError:
          ex = sys.exc_info()[1]
          # re-represent syntax errors from parsing python strings
          msglines = self.lines[: ex.lineno]
          if ex.offset:
              msglines.append(" " * ex.offset + "^")
          msglines.append(
              "(code was compiled probably from here: %s)" % filename
          )
          newex = SyntaxError("\n".join(msglines))
          newex.offset = ex.offset
          newex.lineno = ex.lineno
          newex.text = ex.text
          raise newex
      else:
          if flag & _AST_FLAG:
              return co
          lines = [(x + "\n") for x in self.lines]
          import linecache
  
          linecache.cache[filename] = (1, None, lines, filename)
          return co
  
imports: from __future__ import generators
  from bisect import bisect_right
  import sys
  import inspect, tokenize
  import py
  from types import ModuleType
label_desc: Use image node_id 14 for calling the Source obj's underlying member method code with example usage: obj.compile(filename, mode, flag, dont_inherit, _genframe) and returns: co, co