code: def validate_predictions(
      a_node,
      result,
      model_name,
      frame_key,
      expected_rows,
      predictions_frame=None,
  ):
      """
      Validate a /Predictions result.
      """
      assert result is not None, (
          "FAIL: Got a null result for scoring: "
          + model_name
          + " on: "
          + frame_key
      )
      assert "model_metrics" in result, (
          "FAIL: Predictions for scoring: "
          + model_name
          + " on: "
          + frame_key
          + " does not contain a model_metrics object."
      )
      mm = result["model_metrics"][0]
      h2o.H2O.verboseprint("mm: ", repr(mm))
      # assert 'auc' in mm, "FAIL: Predictions for scoring: " + model_name + " on: " + frame_key + " does not contain an AUC."
      # assert 'cm' in mm, "FAIL: Predictions for scoring: " + model_name + " on: " + frame_key + " does not contain a CM."
      assert "predictions" in mm, (
          "FAIL: Predictions for scoring: "
          + model_name
          + " on: "
          + frame_key
          + " does not contain an predictions section."
      )
      assert "frame_id" in mm["predictions"], (
          "FAIL: Predictions for scoring: "
          + model_name
          + " on: "
          + frame_key
          + " does not contain a key."
      )
      assert "name" in mm["predictions"]["frame_id"], (
          "FAIL: Predictions for scoring: "
          + model_name
          + " on: "
          + frame_key
          + " does not contain a key name."
      )
  
      predictions_key = mm["predictions"]["frame_id"]["name"]
      f = a_node.frames(
          key=predictions_key, find_compatible_models=True, row_count=5
      )
      frames = f["frames"]
      frames_dict = list_to_dict(frames, "frame_id/name")
      assert predictions_key in frames_dict, (
          "FAIL: Failed to find predictions key"
          + predictions_key
          + " in Frames list."
      )
  
      predictions = mm["predictions"]
      h2o.H2O.verboseprint("prediction result: ", repr(result))
      assert "columns" in predictions, (
          "FAIL: Predictions for scoring: "
          + model_name
          + " on: "
          + frame_key
          + " does not contain an columns section."
      )
      assert len(predictions["columns"]) > 0, (
          "FAIL: Predictions for scoring: "
          + model_name
          + " on: "
          + frame_key
          + " does not contain any columns."
      )
      assert "label" in predictions["columns"][0], (
          "FAIL: Predictions for scoring: "
          + model_name
          + " on: "
          + frame_key
          + " column 0 has no label element."
      )
      assert "predict" == predictions["columns"][0]["label"], (
          "FAIL: Predictions for scoring: "
          + model_name
          + " on: "
          + frame_key
          + " column 0 is not 'predict'."
      )
      assert expected_rows == predictions["rows"], (
          "FAIL: Predictions for scoring: "
          + model_name
          + " on: "
          + frame_key
          + " has an unexpected number of rows."
      )
  
      assert "predictions_frame" in result, (
          "FAIL: failed to find 'predictions_frame' in predict result:"
          + h2o_test_utils.dump_json(result)
      )
      assert "name" in result["predictions_frame"], (
          "FAIL: failed to find name in 'predictions_frame' in predict result:"
          + h2o_test_utils.dump_json(result)
      )
  
      if predictions_frame is not None:
          assert (
              predictions_frame == result["predictions_frame"]["name"]
          ), (
              "FAIL: bad value for 'predictions_frame' in predict result; expected: "
              + predictions_frame
              + ", got: "
              + result["predictions_frame"]["name"]
          )
  
imports: import sys, os, time, json, datetime, errno, stat, getpass, requests, pprint
  import h2o
label_desc: Use image node_id 27 for calling a global function with example usage: validate_predictions(a_node, result, model_name, frame_key, expected_rows, predictions_frame) without return types