async def run_code(self, code_obj, result=None, *, async_=False):
    'Execute a code object.\n\n        When an exception occurs, self.showtraceback() is called to display a\n        traceback.\n\n        Parameters\n        ----------\n        code_obj : code object\n          A compiled code object, to be executed\n        result : ExecutionResult, optional\n          An object to store exceptions that occur during execution.\n        async_ :  Bool (Experimental)\n          Attempt to run top-level asynchronous code in a default loop.\n\n        Returns\n        -------\n        False : successful execution.\n        True : an error occurred.\n        '
    __tracebackhide__ = '__ipython_bottom__'
    (old_excepthook, sys.excepthook) = (sys.excepthook, self.excepthook)
    self.sys_excepthook = old_excepthook
    outflag = True
    try:
        try:
            if async_:
                (await eval(code_obj, self.user_global_ns, self.user_ns))
            else:
                exec(code_obj, self.user_global_ns, self.user_ns)
        finally:
            sys.excepthook = old_excepthook
    except SystemExit as e:
        if (result is not None):
            result.error_in_exec = e
        self.showtraceback(exception_only=True)
        warn("To exit: use 'exit', 'quit', or Ctrl-D.", stacklevel=1)
    except self.custom_exceptions:
        (etype, value, tb) = sys.exc_info()
        if (result is not None):
            result.error_in_exec = value
        self.CustomTB(etype, value, tb)
    except:
        if (result is not None):
            result.error_in_exec = sys.exc_info()[1]
        self.showtraceback(running_compiled_code=True)
    else:
        outflag = False
    return outflag
Execute a code object.

When an exception occurs, self.showtraceback() is called to display a
traceback.

Parameters
----------
code_obj : code object
  A compiled code object, to be executed
result : ExecutionResult, optional
  An object to store exceptions that occur during execution.
async_ :  Bool (Experimental)
  Attempt to run top-level asynchronous code in a default loop.

Returns
-------
False : successful execution.
True : an error occurred.
async def run_code(self, code_obj, result=None, *, async_=False):
    'Execute a code object.\n\n        When an exception occurs, self.showtraceback() is called to display a\n        traceback.\n\n        Parameters\n        ----------\n        code_obj : code object\n          A compiled code object, to be executed\n        result : ExecutionResult, optional\n          An object to store exceptions that occur during execution.\n        async_ :  Bool (Experimental)\n          Attempt to run top-level asynchronous code in a default loop.\n\n        Returns\n        -------\n        False : successful execution.\n        True : an error occurred.\n        '
    __tracebackhide__ = '__ipython_bottom__'
    (old_excepthook, sys.excepthook) = (sys.excepthook, self.excepthook)
    self.sys_excepthook = old_excepthook
    outflag = True
    try:
        try:
            if async_:
                (await eval(code_obj, self.user_global_ns, self.user_ns))
            else:
                exec(code_obj, self.user_global_ns, self.user_ns)
        finally:
            sys.excepthook = old_excepthook
    except SystemExit as e:
        if (result is not None):
            result.error_in_exec = e
        self.showtraceback(exception_only=True)
        warn("To exit: use 'exit', 'quit', or Ctrl-D.", stacklevel=1)
    except self.custom_exceptions:
        (etype, value, tb) = sys.exc_info()
        if (result is not None):
            result.error_in_exec = value
        self.CustomTB(etype, value, tb)
    except:
        if (result is not None):
            result.error_in_exec = sys.exc_info()[1]
        self.showtraceback(running_compiled_code=True)
    else:
        outflag = False
    return outflag