code: def validate_model_exists(a_node, model_name):
      """
      Validate that a given model key is found in the models list.
      """
      models = a_node.models()["models"]
  
      models_dict = list_to_dict(models, "model_id/name")
      assert model_name in models_dict, (
          "FAIL: Failed to find "
          + model_name
          + " in models list: "
          + repr(models_dict.keys())
      )
      return a_node.models(key=model_name)["models"][0]
  
imports: import sys, os, time, json, datetime, errno, stat, getpass, requests, pprint
  import h2o
label_desc: Use image node_id 21 for calling a global function with example usage: validate_model_exists(a_node, model_name) and returns: a_node