code: def format_repeated_frames(
      self, repeated_frames: RepeatedFrames
  ) -> dict:
      counts = sorted(
          Counter(repeated_frames.frame_keys).items(),
          key=lambda item: (-item[1], item[0][0].co_name),
      )
      return dict(
          frames=[
              dict(
                  name=code.co_name,
                  lineno=lineno,
                  count=count,
              )
              for (code, lineno), count in counts
          ]
      )
  
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 6 for calling the Serializer obj's underlying member method code with example usage: obj.format_repeated_frames(repeated_frames) and returns: dict