code: def grab_java_results(dirName, java_file, run_result):
      global g_direct_name_start
      global g_log_base_dir
      global g_initialXY
      global g_reguarlize_Y
      global g_regularize_X_objective
      global g_updateX
      global g_updateY
      global g_objective
      global g_stepsize
      global g_history
  
      if not (g_direct_name_start in dirName):
          print("Cannot find your java log file.  Nothing is done.\n")
          return run_result
  
      logText = os.path.join(
          os.path.join(g_log_base_dir, dirName), java_file
      )
      total_run_time = -1
      val = 0.0
  
      with open(
          logText, "r"
      ) as thefile:  # go into tempfile and grab test run info
          for each_line in thefile:
              temp_string = each_line.split()
  
              if len(temp_string) > 0:
                  val = temp_string[-1].replace("\\", "")
  
              if g_initialXY in each_line:  # start of a new file
                  if total_run_time > 0:  # update total run time
                      run_result["total time (ms)"].append(
                          total_run_time
                      )
                      total_run_time = 0.0
                  else:
                      total_run_time = 0.0
  
                  run_result["initialXY (ms)"].append(float(val))
                  total_run_time = total_run_time + float(val)
  
              if g_reguarlize_Y in each_line:
                  run_result["regularize Y (ms)"].append(float(val))
                  total_run_time = total_run_time + float(val)
  
              if g_regularize_X_objective in each_line:
                  run_result["regularize X and objective (ms)"].append(
                      float(val)
                  )
                  total_run_time = total_run_time + float(val)
  
              if g_updateX in each_line:
                  run_result["update X (ms)"].append(float(val))
                  total_run_time = total_run_time + float(val)
  
              if g_updateY in each_line:
                  run_result["update Y (ms)"].append(float(val))
                  total_run_time = total_run_time + float(val)
  
              if g_objective in each_line:
                  run_result["objective (ms)"].append(float(val))
                  total_run_time = total_run_time + float(val)
  
              if g_stepsize in each_line:
                  run_result["step size (ms)"].append(float(val))
                  total_run_time = total_run_time + float(val)
  
              if g_history in each_line:
                  run_result["update history (ms)"].append(float(val))
                  total_run_time = total_run_time + float(val)
  
          run_result["total time (ms)"].append(
              total_run_time
          )  # save the last one
  
      return run_result
  
file_path: h2o-3/scripts/grabGLRMJenkinRunResults.py
imports: import sys
  import os
  import json
label_desc: Use image node_id 5 for calling a global function with example usage: grab_java_results(dirName, java_file, run_result) and returns: run_result, run_result