code: def validate_validation_messages(result, expected_error_fields):
      """
      Check that we got the expected ERROR validation messages for a model build or validation check with bad parameters.
      """
      assert (
          "error_count" in result
      ), "FAIL: Failed to find error_count in bad-parameters model build result."
      assert (
          0 < result["error_count"]
      ), "FAIL: 0 != error_count in bad-parameters model build validation result."
  
      error_fields = []
      for validation_message in result["messages"]:
          if validation_message["message_type"] == "ERRR":
              error_fields.append(validation_message["field_name"])
  
      not_found = [
          item
          for item in expected_error_fields
          if item not in error_fields
      ]
      assert len(not_found) == 0, (
          "FAIL: Failed to find all expected ERROR validation messages.  Missing: "
          + repr(not_found)
          + " from result: "
          + repr(error_fields)
      )
      assert len(not_found) == 0, (
          "FAIL: Failed to find all expected ERROR validation messages.  Missing: "
          + repr(not_found)
          + " from result: "
          + repr(result["messages"])
      )
  
imports: import sys, os, time, json, datetime, errno, stat, getpass, requests, pprint
  import h2o
label_desc: Use image node_id 20 for calling a global function with example usage: validate_validation_messages(result, expected_error_fields) without return types