def eval(self, code, mode='single'):
        """Evaluate code in the context of the frame."""
        if isinstance(code, str):
            if isinstance(code, str):
                code = UTF8_COOKIE + code.encode('utf-8')
            code = compile(code, '<interactive>', mode)
        if mode != 'exec':
            return eval(code, self.globals, self.locals)
        exec(code, self.globals, self.locals)
Evaluate code in the context of the frame.