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