code: def write_hash_data(self, valueType, idType, data):
      new_data = {}
      for item in data:
          if item[0] not in new_data:
              new_data[item[0]] = ([], [])
          new_data[item[0]][0].append(item[1])
          new_data[item[0]][1].append(item[2])
  
      s = ""
      for key in new_data:
          s += write_correct_data(valueType, key)
          # ids vector
          s += struct.pack("I", len(new_data[key][0]))
          for i in new_data[key][0]:
              s += write_correct_data(idType, i)
          # weights vector
          s += struct.pack("I", len(new_data[key][1]))
          for i in new_data[key][1]:
              s += write_correct_data("float", i)
      return s
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import json
  import sys
  import struct
  from euler.tools import json2meta
  from euler.tools.util import *
  import os
label_desc: Use image node_id 8 for calling the Converter obj's underlying member method code with example usage: obj.write_hash_data(valueType, idType, data) and returns: s