code: def validate_job_exists(a_node, job_name, jobs=None):
      """
      Validate that a given job key is found in the jobs list.
      """
      if jobs is None:
          result = a_node.jobs()
          jobs = result["jobs"]
  
      jobs_dict = list_to_dict(jobs, "key/name")
      assert job_name in jobs_dict, (
          "FAIL: Failed to find "
          + job_name
          + " in jobs list: "
          + repr(jobs_dict.keys())
      )
      return jobs_dict[job_name]
  
imports: import sys, os, time, json, datetime, errno, stat, getpass, requests, pprint
  import h2o
label_desc: Use image node_id 23 for calling a global function with example usage: validate_job_exists(a_node, job_name, jobs) and returns: jobs_dict