def compile(<EOL>self, filename=None, mode="<STR_LIT>", flag=<NUM_LIT:0>, dont_inherit=<NUM_LIT:0>, _genframe=None<EOL>):
if not filename or py.path.local(filename).check(file=<NUM_LIT:0>):<EOL><INDENT>if _genframe is None:<EOL><INDENT>_genframe = sys._getframe(<NUM_LIT:1>)  <EOL><DEDENT>fn, lineno = _genframe.f_code.co_filename, _genframe.f_lineno<EOL>base = "<STR_LIT>" % self._compilecounter<EOL>self.__class__._compilecounter += <NUM_LIT:1><EOL>if not filename:<EOL><INDENT>filename = base + "<STR_LIT>" % (fn, lineno)<EOL><DEDENT>else:<EOL><INDENT>filename = base + "<STR_LIT>" % (filename, fn, lineno)<EOL><DEDENT><DEDENT>source = "<STR_LIT:\n>".join(self.lines) + "<STR_LIT:\n>"<EOL>try:<EOL><INDENT>co = compile(source, filename, mode, flag)<EOL><DEDENT>except SyntaxError:<EOL><INDENT>ex = sys.exc_info()[<NUM_LIT:1>]<EOL>msglines = self.lines[: ex.lineno]<EOL>if ex.offset:<EOL><INDENT>msglines.append("<STR_LIT:U+0020>" * ex.offset + "<STR_LIT>")<EOL><DEDENT>msglines.append("<STR_LIT>" % filename)<EOL>newex = SyntaxError("<STR_LIT:\n>".join(msglines))<EOL>newex.offset = ex.offset<EOL>newex.lineno = ex.lineno<EOL>newex.text = ex.text<EOL>raise newex<EOL><DEDENT>else:<EOL><INDENT>if flag & _AST_FLAG:<EOL><INDENT>return co<EOL><DEDENT>lines = [(x + "<STR_LIT:\n>") for x in self.lines]<EOL>linecache.cache[filename] = (<NUM_LIT:1>, None, lines, filename)<EOL>return co<EOL><DEDENT>
return compiled code object. if filename is None
            invent an artificial filename which displays
            the source/line position of the caller frame.