code: def print_exception(
      exc,
      /,
      value=_sentinel,
      tb=_sentinel,
      limit=None,
      file=None,
      chain=True,
  ):
      """Print exception up to 'limit' stack trace entries from 'tb' to 'file'.
  
      This differs from print_tb() in the following ways: (1) if
      traceback is not None, it prints a header "Traceback (most recent
      call last):"; (2) it prints the exception type and value after the
      stack trace; (3) if type is SyntaxError and value has the
      appropriate format, it prints the line where the syntax error
      occurred with a caret on the next line indicating the approximate
      position of the error.
      """
      value, tb = _parse_value_tb(exc, value, tb)
      te = TracebackException(
          type(value), value, tb, limit=limit, compact=True
      )
      te.print(file=file, chain=chain)
  
imports: import collections.abc
  import itertools
  import linecache
  import sys
  import textwrap
  from contextlib import suppress
label_desc: Use image node_id 7 for calling a global function with example usage: print_exception(value, tb, limit, file, chain) without return types