code: def extract_java_messages():
      """
      loop through java_*_0.out.txt and extract potentially dangerous WARN/ERRR/FATAL
      messages associated with a test.  The test may even pass but something terrible
      has actually happened.
  
      :return: none
      """
      global g_jenkins_url
      global g_failed_test_info_dict
      global g_java_filenames
  
      global g_failed_jobs  # record job names of failed jobs
      global g_failed_job_java_messages  # record failed job java message
      global g_failed_job_java_message_types
  
      global g_success_jobs  # record job names of passed jobs
      global g_success_job_java_messages  # record of successful jobs bad java messages
      global g_success_job_java_message_types
  
      global g_java_general_bad_messages  # store java error messages when no job is running
      global g_java_general_bad_message_types  # store java error message types when no job is running.
  
      if (
          len(g_failed_jobs) > 0
      ):  # artifacts available only during failure of some sort
          for (
              fname
          ) in (
              g_java_filenames
          ):  # grab java message from each java_*_*_.out file
              temp_strings = fname.split("/")
  
              start_url = g_jenkins_url
  
              for windex in range(6, len(temp_strings)):
                  start_url = os.path.join(
                      start_url, temp_strings[windex]
                  )
              try:  # first java file path is different.  Can ignore it.
                  get_console_out(
                      start_url
                  )  # get java text and save it in local directory for processing
                  grab_java_message()  # actually process the java text output and see if we found offensive stuff
              except:
                  pass
  
      # build up the dict structure that we are storing our data in
      if len(g_failed_jobs) > 0:
          g_failed_test_info_dict["failed_tests_info *********"] = [
              g_failed_jobs,
              g_failed_job_java_messages,
              g_failed_job_java_message_types,
          ]
      if len(g_success_jobs) > 0:
          g_failed_test_info_dict["passed_tests_info *********"] = [
              g_success_jobs,
              g_success_job_java_messages,
              g_success_job_java_message_types,
          ]
  
      if len(g_java_general_bad_messages) > 0:
          g_failed_test_info_dict["9.general_bad_java_messages"] = [
              g_java_general_bad_messages,
              g_java_general_bad_message_types,
          ]
  
imports: import sys
  import os
  import json
  import pickle
  import copy
  import subprocess
label_desc: Use image node_id 17 for calling a global function with example usage: extract_java_messages() without return types