code: def print_exc_info():
      """thread-safe return of string from print_exception call"""
  
      import traceback
      import io
  
      sio = io.StringIO()
      traceback.print_exc(
          file=sio
      )  # thread-safe print_exception to string
      sio.seek(0, 0)
  
      return sio.read()
  
imports: import os
label_desc: Use image node_id 3 for calling a global function with example usage: print_exc_info() and returns: sio