code: def add_traceback_cli(parser):
      parser.add_argument(
          "--traceback", "--tb", action="store_true", default=TRACEBACK
      )
      parser.add_argument(
          "--no-traceback",
          "--no-tb",
          dest="traceback",
          action="store_const",
          const=False,
      )
  
      def process_args(args, *, argv=None):
          ns = vars(args)
          key = "traceback_cm"
          if key in ns:
              parser.error(f"duplicate arg {key!r}")
          showtb = ns.pop("traceback")
  
          @contextlib.contextmanager
          def traceback_cm():
              restore = loggingutil.hide_emit_errors()
              try:
                  yield
              except BrokenPipeError:
                  # It was piped to "head" or something similar.
                  pass
              except NotImplementedError:
                  raise  # re-raise
              except Exception as exc:
                  if not showtb:
                      sys.exit(f"ERROR: {exc}")
                  raise  # re-raise
              except KeyboardInterrupt:
                  if not showtb:
                      sys.exit("\nINTERRUPTED")
                  raise  # re-raise
              except BaseException as exc:
                  if not showtb:
                      sys.exit(f"{type(exc).__name__}: {exc}")
                  raise  # re-raise
              finally:
                  restore()
  
          ns[key] = traceback_cm()
          return key
  
      return process_args
  
imports: import argparse
  import contextlib
  import logging
  import os
  import os.path
  import shutil
  import sys
  from .None import fsutil, strutil, iterutil, logging
label_desc: Use image node_id 11 for calling a global function with example usage: add_traceback_cli(parser) and returns: process_args, key