code: def init_update_each_failed_test_dict(
      one_test_info, failed_test_path, testName, newTest
  ):
      """
      For each test, a dictionary structure will be built to record the various info about that test's failure
      information.  In particular, for each failed tests, there will be a dictionary associated with that test
      stored in the field "TestInfo" of g_faiiled_tests_info_dict.  The following fields are included:
          "JenkinsJobName": job name
          "BuildID"
          "Timestamp": in seconds
          "GitHash"
          "TestCategory": JUnit, PyUnit, RUnit or HadoopPyUnit, HadoopRUnit
          "NodeName": name of machine that the job was run on
          "FailureCount": integer counting number of times this particular test has failed.  An intermittent can be
            determined as any test with FailureCount >= 2.
          "FailureMessages": contains failure messages for the test
      :return: a new dict for that test
      """
      if newTest:
          one_test_info = dict()
          one_test_info["JenkinsJobName"] = []
          one_test_info["BuildID"] = []
          one_test_info["Timestamp"] = []
          one_test_info["GitHash"] = []
          one_test_info[
              "TestCategory"
          ] = (
              []
          )  # would be JUnit, PyUnit, RUnit or HadoopPyUnit, HadoopRUnit
          one_test_info["NodeName"] = []
          one_test_info[
              "FailureMessages"
          ] = []  # contains failure messages for the test
          one_test_info["FailureCount"] = 0
          one_test_info["TestName"] = testName
  
      #    if g_timestamp not in one_test_info["Timestamp"]:
      one_test_info["JenkinsJobName"].append(g_job_name)
      one_test_info["BuildID"].append(g_build_id)
      one_test_info["Timestamp"].append(g_timestamp)
      one_test_info["GitHash"].append(g_git_hash)
      one_test_info["TestCategory"].append(
          g_unit_test_type
      )  # would be JUnit, PyUnit, RUnit or HadoopPyUnit, HadoopRUnit
      one_test_info["NodeName"].append(g_node_name)
      one_test_info["FailureCount"] += 1
  
      error_url = "/".join(
          [g_resource_url, "testReport", failed_test_path]
      )
      get_console_out(error_url)  # store failure message in temp file
  
      if os.path.isfile(g_temp_filename):
          with open(g_temp_filename, "r") as error_file:
              one_test_info["FailureMessages"].append(error_file.read())
      else:
          one_test_info["FailureMessages"].append(
              ""
          )  # append empty error message if file not found
      return one_test_info
  
file_path: h2o-3/scripts/scrapeForIntermittents.py
imports: import sys
  import os
  import json
  import subprocess
  import time
  import datetime
  from pytz import timezone
  from dateutil import parser
label_desc: Use image node_id 2 for calling a global function with example usage: init_update_each_failed_test_dict(one_test_info, failed_test_path, testName, newTest) and returns: one_test_info