code: def format_lines(self, lines):
      for line in lines:
          if isinstance(line, Line):
              yield dict(type="line", **self.format_line(line))
          else:
              yield dict(type="line_gap")
  
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 8 for calling the Serializer obj's underlying member method code with example usage: obj.format_lines(lines) without return types