code: def to_first_match_dict(kv_list):
      """
      Construct dict from kv_list
      """
      d = {}
      for item in kv_list:
          if item.key not in d:
              d[item.key] = item.value
      return d
  
imports: from caffe2.python import core, scope
label_desc: Use image node_id 4 for calling a global function with example usage: to_first_match_dict(kv_list) and returns: d