#NEWLINE# def eval( self , code ) : #NEWLINE# #INDENT# if ( '__builtins__' not in self . env ) : #NEWLINE# #INDENT# eval ( '1' , input . env ) #NEWLINE# self . env [ '__builtins__' ] [ 'kernel' ] = self . kernel #NEWLINE# if PY3 : #NEWLINE# #INDENT# self . env [ '__builtins__' ] [ 'input' ] = self . kernel . raw_input #NEWLINE# self . env [ 'input' ] = self . kernel . raw_input #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# def input( * args , **kwargs ) : #NEWLINE# #INDENT# return eval ( self . kernel . raw_input ( * args , ** kwargs ) ) #NEWLINE# #UNINDENT# self . env [ '__builtins__' ] [ 'input' ] = input #NEWLINE# self . env [ 'input' ] = input #NEWLINE# self . env [ '__builtins__' ] [ 'raw_input' ] = self . kernel . raw_input = self . kernel . raw_input #NEWLINE# self . env [ 'raw_input' ] = self . kernel . raw_input = self . kernel . raw_input #NEWLINE# #UNINDENT# #UNINDENT# try : #NEWLINE# #INDENT# return eval ( code . strip ( ) , self . env ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# return exec_code ( code . strip ( ) , self . env , self . kernel )