class_docstr: A list of FrameSummary objects, representing a stack of frames.
class_docstr_tok: ["A","list","of","FrameSummary","objects",",","representing","a","stack","of","frames","."]
docstr: Format the stack ready for printing.
  
  Returns a list of strings ready for printing.  Each string in the
  resulting list corresponds to a single frame from the stack.
  Each string ends in a newline; the strings may contain internal
  newlines as well, for those items with source text lines.
  
  For long sequences of the same frame and line, the first few
  repetitions are shown, followed by a summary line stating the exact
  number of further repetitions.
code: def format(self):
      """Format the stack ready for printing.
  
      Returns a list of strings ready for printing.  Each string in the
      resulting list corresponds to a single frame from the stack.
      Each string ends in a newline; the strings may contain internal
      newlines as well, for those items with source text lines.
  
      For long sequences of the same frame and line, the first few
      repetitions are shown, followed by a summary line stating the exact
      number of further repetitions.
      """
      result = []
      last_file = None
      last_line = None
      last_name = None
      count = 0
      for frame_summary in self:
          formatted_frame = self.format_frame_summary(frame_summary)
          if formatted_frame is None:
              continue
          if (
              last_file is None
              or last_file != frame_summary.filename
              or last_line is None
              or last_line != frame_summary.lineno
              or last_name is None
              or last_name != frame_summary.name
          ):
              if count > _RECURSIVE_CUTOFF:
                  count -= _RECURSIVE_CUTOFF
                  result.append(
                      f"  [Previous line repeated {count} more "
                      f'time{"s" if count > 1 else ""}]\n'
                  )
              last_file = frame_summary.filename
              last_line = frame_summary.lineno
              last_name = frame_summary.name
              count = 0
          count += 1
          if count > _RECURSIVE_CUTOFF:
              continue
          result.append(formatted_frame)
  
      if count > _RECURSIVE_CUTOFF:
          count -= _RECURSIVE_CUTOFF
          result.append(
              f"  [Previous line repeated {count} more "
              f'time{"s" if count > 1 else ""}]\n'
          )
      return result
  
imports: import collections.abc
  import itertools
  import linecache
  import sys
  import textwrap
  from contextlib import suppress
label_desc: Use image node_id 5 for calling the StackSummary obj's underlying member method code with example usage: obj.format() and returns: result