code: def format_stack_data(
      self, stack: Iterable[Union[FrameInfo, RepeatedFrames]]
  ) -> Iterable[dict]:
      for item in stack:
          if isinstance(item, FrameInfo):
              if not self.should_include_frame(item):
                  continue
              yield dict(type="frame", **self.format_frame(item))
          else:
              yield dict(
                  type="repeated_frames",
                  **self.format_repeated_frames(item),
              )
  
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 5 for calling the Serializer obj's underlying member method code with example usage: obj.format_stack_data(stack) without return types