code: def __init__(
      self,
      *,
      options=None,
      pygmented=False,
      show_executing_node=True,
      pygments_formatter_cls=None,
      pygments_formatter_kwargs=None,
      pygments_style="monokai",
      executing_node_modifier="bg:#005080",
      use_code_qualname=True,
      strip_leading_indent=True,
      html=False,
      chain=True,
      collapse_repeated_frames=True,
      show_variables=False,
  ):
      if options is None:
          options = Options()
  
      if pygmented and not options.pygments_formatter:
          if show_executing_node:
              pygments_style = style_with_executing_node(
                  pygments_style, executing_node_modifier
              )
  
          if pygments_formatter_cls is None:
              if html:
                  from pygments.formatters.html import (
                      HtmlFormatter as pygments_formatter_cls,
                  )
              else:
                  from pygments.formatters.terminal256 import (
                      Terminal256Formatter as pygments_formatter_cls,
                  )
  
          options.pygments_formatter = pygments_formatter_cls(
              style=pygments_style,
              **pygments_formatter_kwargs or {},
          )
  
      self.pygmented = pygmented
      self.use_code_qualname = use_code_qualname
      self.strip_leading_indent = strip_leading_indent
      self.html = html
      self.chain = chain
      self.options = options
      self.collapse_repeated_frames = collapse_repeated_frames
      self.show_variables = show_variables
  
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 1 to create a new Serializer object  with example: obj = Serializer()