code: def write_range_data(self, valueType, idType, data):
      data.sort(key=lambda x: x[0])
      values = []
      ids = []
      weights = []
      for item in data:
          values.append(item[0])
          ids.append(item[1])
          weights.append(item[2])
  
      s = struct.pack("I", len(ids))
      for i in ids:
          s += write_correct_data(idType, i)
  
      s += struct.pack("I", len(values))
      for i in values:
          s += write_correct_data(valueType, i)
  
      total = 0
      s += struct.pack("I", len(weights))
      for i in weights:
          total += i
          s += write_correct_data("float", total)
  
      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 9 for calling the Converter obj's underlying member method code with example usage: obj.write_range_data(valueType, idType, data) and returns: s