code: def print_list(extracted_list, file=None):
      """Print the list of tuples as returned by extract_tb() or
      extract_stack() as a formatted stack trace to the given file."""
      if file is None:
          file = sys.stderr
      for item in StackSummary.from_list(extracted_list).format():
          print(item, file=file, end="")
  
imports: import collections.abc
  import itertools
  import linecache
  import sys
  import textwrap
  from contextlib import suppress
label_desc: Use image node_id 1 for calling a global function with example usage: print_list(extracted_list, file) without return types