code: def format_exception(self, e=None) -> Iterable[str]:
      if e is None:
          e = sys.exc_info()[1]
  
      if self.chain:
          if e.__cause__ is not None:
              yield from self.format_exception(e.__cause__)
              yield traceback._cause_message
          elif e.__context__ is not None and not e.__suppress_context__:
              yield from self.format_exception(e.__context__)
              yield traceback._context_message
  
      yield "Traceback (most recent call last):\n"
      yield from self.format_stack(e.__traceback__)
      yield from traceback.format_exception_only(type(e), e)
  
imports: import inspect
  import sys
  import traceback
  from types import FrameType, TracebackType
  from typing import Union, Iterable
  from stack_data import style_with_executing_node, Options, Line, FrameInfo, LINE_GAP, Variable, RepeatedFrames, BlankLineRange, BlankLines
  from stack_data.utils import assert_
label_desc: Use image node_id 6 for calling the Formatter obj's underlying member method code with example usage: obj.format_exception(e) without return types