code: def list_to_dict(l, key):
      """
      Given a List and a key to look for in each element return a Dict which maps the value of that key to the element.
      Also handles nesting for the key, so you can use this for things like a list of elements which contain H2O Keys and
      return a Dict indexed by the 'name" element within the key.
      list_to_dict([{'key': {'name': 'joe', 'baz': 17}}, {'key': {'name': 'bobby', 'baz': 42}}], 'key/name') =>
      {'joe': {'key': {'name': 'joe', 'baz': 17}}, 'bobby': {'key': {'name': 'bobby', 'baz': 42}}}
      """
      result = {}
      for entry in l:
          # print 'In list_to_dict, entry: ', repr(entry)
  
          part = entry
          k = None
          for keypart in key.split("/"):
              part = part[keypart]
              k = keypart
  
              # print 'for keypart: ', keypart, ' part: ', repr(part)
  
          result[part] = entry
      # print 'result: ', repr(result)
      return result
  
imports: import sys, os, time, json, datetime, errno, stat, getpass, requests, pprint
  import h2o
label_desc: Use image node_id 16 for calling a global function with example usage: list_to_dict(l, key) and returns: result