code: def extract_tb(tb, limit=None):
      """
      Return a StackSummary object representing a list of
      pre-processed entries from traceback.
  
      This is useful for alternate formatting of stack traces.  If
      'limit' is omitted or None, all entries are extracted.  A
      pre-processed stack trace entry is a FrameSummary object
      containing attributes filename, lineno, name, and line
      representing the information that is usually printed for a stack
      trace.  The line is a string with leading and trailing
      whitespace stripped; if the source is not available it is None.
      """
      return StackSummary._extract_from_extended_frame_gen(
          _walk_tb_with_full_positions(tb), limit=limit
      )
  
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 a global function with example usage: extract_tb(tb, limit) and returns: StackSummary