code: def format_exception(self, e=None) -> List[dict]:
      if e is None:
          e = sys.exc_info()[1]
  
      result = []
  
      if self.chain:
          if e.__cause__ is not None:
              result = self.format_exception(e.__cause__)
              result[-1]["tail"] = traceback._cause_message.strip()
          elif e.__context__ is not None and not e.__suppress_context__:
              result = self.format_exception(e.__context__)
              result[-1]["tail"] = traceback._context_message.strip()
  
      result.append(self.format_traceback_part(e))
      return result
  
imports: import inspect
  import logging
  import sys
  import traceback
  from collections import Counter
  from html import escape
  from types import FrameType, TracebackType
  from typing import Union, Iterable, List
  from stack_data import style_with_executing_node, Options, Line, FrameInfo, Variable, RepeatedFrames
  from stack_data.utils import some_str
label_desc: Use image node_id 2 for calling the Serializer obj's underlying member method code with example usage: obj.format_exception(e) and returns: result