code: def write_java_message(key, val, text_file):
      """
      Loop through all java messages that are not associated with a unit test and
      write them into a log file.
  
      Parameters
      ----------
      key :  str
          9.general_bad_java_messages
      val : list of list of str
          contains the bad java messages and the message types.
  
  
      :return: none
      """
  
      text_file.write(key)
      text_file.write("\n")
  
      if (len(val[0]) > 0) and (len(val) >= 3):
          for index in range(len(val[0])):
              text_file.write("Java Message Type: ")
              text_file.write(val[1][index])
              text_file.write("\n")
  
              text_file.write("Java Message: ")
  
              for jmess in val[2][index]:
                  text_file.write(jmess)
                  text_file.write("\n")
  
          text_file.write("\n \n")
  
imports: import sys
  import os
  import json
  import pickle
  import copy
  import subprocess
label_desc: Use image node_id 23 for calling a global function with example usage: write_java_message(key, val, text_file) without return types