code: def write_testcase(output, test_path, filename, exc_info):
      (type, value, tb) = exc_info
      test_name = filename.replace(".", "_")
      output.write(
          '<testcase classname="test_%s.%s" name="test_%s" time="1">'
          % (
              cgi.escape(test_path),
              cgi.escape(test_name.title()),
              cgi.escape(test_name),
          )
      )
      output.write(
          '<failure type="%s" message="%s"><![CDATA[%s'
          % (cgi.escape(str(type)), cgi.escape(str(value)), os.linesep)
      )
      traceback.print_exception(type, value, tb, None, output)
      output.write("]]></failure>")
      output.write("</testcase>")
  
file_path: turicreate/scenario-tests/tests/setup_reporter.py
imports: import cgi
  import os
  import sys
  import traceback
label_desc: Use image node_id 2 for calling a global function with example usage: write_testcase(output, test_path, filename, exc_info) without return types